build(frontend): type-check the production build, pin knip

`npm run build` now runs `typecheck` first, so the Docker image is built through the
same gate as local dev — until now the image was a bare `vite build`, and esbuild
strips types without checking them.

typecheck covers three projects: src, the Node-side build configs (new
tsconfig.node.json — vite.config.ts/vitest.config.ts were type-checked by nothing),
and e2e. knip moves from `npx knip@latest` to a pinned devDependency so the gate
stops depending on the network and on whichever version shipped that morning.
This commit is contained in:
2026-07-21 01:07:54 +02:00
parent 25f0d71dfc
commit 172ab8008f
3 changed files with 1055 additions and 2 deletions
+1029
View File
File diff suppressed because it is too large Load Diff
+6 -2
View File
@@ -4,10 +4,13 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.node.json && tsc --noEmit -p e2e/tsconfig.json",
"build": "npm run typecheck && vite build",
"preview": "vite preview", "preview": "vite preview",
"knip": "knip",
"test": "vitest run", "test": "vitest run",
"test:watch": "vitest" "test:watch": "vitest",
"e2e": "playwright test"
}, },
"dependencies": { "dependencies": {
"@dnd-kit/core": "^6.3.1", "@dnd-kit/core": "^6.3.1",
@@ -31,6 +34,7 @@
"@types/react-dom": "^18.3.0", "@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1", "@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"knip": "6.27.0",
"postcss": "^8.4.39", "postcss": "^8.4.39",
"tailwindcss": "^3.4.6", "tailwindcss": "^3.4.6",
"typescript": "^5.5.3", "typescript": "^5.5.3",
+20
View File
@@ -0,0 +1,20 @@
{
// The build-tool configs run in Node, not the browser: they need node types and must NOT be
// checked against the app's DOM lib. Split out because tsconfig.json's `include` is ["src"],
// so until now nothing type-checked these files at all (R2 / C-4.5). `npm run typecheck`
// runs this project alongside src and e2e.
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["ES2022"],
"types": ["node"],
"strict": true,
"skipLibCheck": true,
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true
},
"include": ["vite.config.ts", "vitest.config.ts"]
}