The two Worker-rendered admin pages (admin-ui.ts, edit-ui.ts: 1,400 lines of HTML and script inside template literals) are replaced by a Svelte 5 app in web/admin/. It is built on its own and embedded in the Worker as the gitignored worker/generated/admin-bundle.ts, so no admin code ever reaches dist/, the service worker's precache or the packaged apps. worker/routes/admin-spa.ts serves the shell with a per-response nonce CSP after the existing Access checks, serves hashed assets immutably, and 404s any other path under /admin. Queue - Rows that are decided (approved, committed, rejected) or whose game is already published have no checkbox, show a lock and are skipped by select-all. The rules come from shared/queue-rules.ts, the same module the Worker enforces. - Decisions confirm every row first and report skipped rows with their reasons. - Tabs with counts, cross-status search, sort, page size, all kept in the URL. - Keyboard: j/k, x, a, r, d, e, /, Esc, ?. Ignored while typing or composing. - Details dialog: payload, durable decision, other rows for the game, Reopen for a rejected row with the reason when it cannot be reopened. - Phone layout as cards. Edit - One game: every change reviewed in a diff dialog before the commit; retire; delete a settled override file; unsaved-change guard. - Several games: any field, set or retire, selection kept across pages and genres (up to 10), each game shown in the review. Jobs, Audit and Health get their own paged, filterable pages. Health draws its table on a 503 too, and Test write proves the write path. An expired Access session reloads the page once; a refusal that survives the reload is reported instead of looping. A non-JSON response is a server error, never "session expired". Local development: npm run dev:admin runs the real handlers against an in-memory D1 with demo data, and npm run preview:admin serves the built bundle through the real serveAdmin with the production CSP. Nothing in worker/ or admin/src imports the mock, and the Worker has no authentication switch. Also: design tokens move to src/styles/theme.css, shared by both builds; verify-dist fails if admin code reaches dist/; vite-plugin-pwa is declared, as src/app.d.ts references its types; docs/ADMIN.md, DEPLOYMENT.md and CLAUDE.md describe the new admin. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
20 lines
572 B
JSON
20 lines
572 B
JSON
{
|
|
// The admin's Node-side code: its Vite config, the bundle emitter and the
|
|
// local mock backend.
|
|
"compilerOptions": {
|
|
"target": "ES2022",
|
|
"lib": ["ES2022"],
|
|
"module": "ESNext",
|
|
"moduleResolution": "Bundler",
|
|
"types": ["node"],
|
|
"noEmit": true,
|
|
"isolatedModules": true,
|
|
"strict": true,
|
|
"noUnusedLocals": true,
|
|
"noUnusedParameters": true,
|
|
"skipLibCheck": true
|
|
},
|
|
"include": ["vite.config.ts", "build/**/*.ts", "mock/**/*.ts", "../worker-configuration.d.ts", "../worker/env.d.ts"],
|
|
"exclude": ["mock/**/*.test.ts"]
|
|
}
|