feat: remove old vanilla JS/CSS frontend, make React SPA the sole entry for ccw view

Remove the entire old template-based frontend (~106K lines) and make the React
SPA the only way to access the ccw dashboard via `ccw view`.

Key changes:
- Delete all old frontend files: dashboard-css/ (37 CSS), dashboard-js/ (59 JS),
  assets/, dashboard.html, and legacy HTML templates
- Delete dashboard-generator.ts and dashboard-generator-patch.ts
- Simplify server.ts: remove ~234 lines of old frontend code (template constants,
  MODULE_CSS_FILES/MODULE_FILES arrays, generateServerDashboard(), /assets/* serving)
- Rebase React frontend from /react/ to root / (vite.config.ts, react-frontend.ts)
- Add /react/* -> /* 301 redirect for backward compatibility
- Remove --frontend and --new CLI flags from view and serve commands
- Remove generateDashboard export from public API (index.ts)
- Simplify serve.ts and view.ts to always use React without conditional branching
- Update all affected tests (unit, e2e) for React-only architecture

BREAKING CHANGE: --frontend and --new CLI flags removed; generateDashboard export
removed from ccw package; /react/ base path changed to /
This commit is contained in:
catlog22
2026-02-13 17:26:03 +08:00
parent 31f37751fc
commit bcb736709f
136 changed files with 204 additions and 115952 deletions

View File

@@ -46,11 +46,19 @@ describe('view command module', async () => {
mock.method(globalThis as any, 'fetch', async (url: string) => {
if (url.includes('/api/health')) {
return { ok: true };
return { ok: true, status: 200 };
}
if (url.includes('/api/auth/token')) {
return {
ok: true,
status: 200,
json: async () => ({ token: 'test-token' }),
};
}
if (url.includes('/api/switch-path')) {
return {
ok: true,
status: 200,
json: async () => ({ success: true, path: 'C:\\test-workspace' }),
};
}
@@ -59,7 +67,7 @@ describe('view command module', async () => {
await viewModule.viewCommand({ port: 3456, browser: false });
assert.ok(logs.some((l) => l.includes('Server already running')));
assert.ok(logs.some((l) => l.includes('URL: http://localhost:3456/')));
assert.ok(logs.some((l) => l.includes('http://') && l.includes(':3456/')));
});
it('starts server when not running (browser disabled) and can be shut down via captured SIGINT handler', async () => {