chore: scaffold Vite + Vitest PWA project

This commit is contained in:
2026-07-20 13:36:38 +01:00
parent 415f8c61bf
commit e4aafe5147
5 changed files with 53 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>The Director</title>
</head>
<body>
<gm-shell></gm-shell>
<script type="module" src="/src/main.js"></script>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
{
"name": "gm-director",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"test": "vitest run",
"test:watch": "vitest"
},
"devDependencies": {
"jsdom": "^24.0.0",
"vite": "^5.2.0",
"vitest": "^1.6.0"
}
}
+2
View File
@@ -0,0 +1,2 @@
// Boot entry. Component registration is added in later tasks.
export const APP = 'the-director';
+13
View File
@@ -0,0 +1,13 @@
// tests/smoke.test.js
import { describe, it, expect } from 'vitest';
import { APP } from '../src/main.js';
describe('scaffold', () => {
it('boots and exposes the app id', () => {
expect(APP).toBe('the-director');
});
it('has a working DOM environment', () => {
document.body.innerHTML = '<div id="x">hi</div>';
expect(document.getElementById('x').textContent).toBe('hi');
});
});
+8
View File
@@ -0,0 +1,8 @@
import { defineConfig } from 'vite';
export default defineConfig({
test: {
environment: 'jsdom',
include: ['tests/**/*.test.js'],
},
});