fix(frontend): include frontend/dist in npm package and support static file serving

- Add ccw/frontend/dist/ to package.json files field
- Modify react-frontend.ts to detect and use production build
- Add static file serving to server.ts with MIME type support
- Update prepublishOnly to build frontend before publishing
- Fix unused import in TerminalDashboardPage.tsx

This fixes the 'Could not find React frontend directory' error when users install from npm.
This commit is contained in:
catlog22
2026-02-28 08:39:07 +08:00
parent 54f15b6bda
commit 902ee8528a
5 changed files with 129 additions and 538 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "claude-code-workflow",
"version": "7.0.0",
"version": "7.0.1",
"description": "JSON-driven multi-agent development framework with intelligent CLI orchestration (Gemini/Qwen/Codex), context-first architecture, and automated workflow execution",
"type": "module",
"main": "ccw/dist/index.js",
@@ -19,7 +19,7 @@
"test": "node --experimental-strip-types --test ccw/tests/*.test.js",
"test:visual": "node --experimental-strip-types --test ccw/tests/visual/**/*.visual.test.ts",
"test:e2e": "node --experimental-strip-types --test ccw/tests/e2e/*.e2e.test.ts",
"prepublishOnly": "npm run build && node ccw/scripts/prepublish-clean.mjs && echo 'Ready to publish @dyw/claude-code-workflow'",
"prepublishOnly": "npm run build && npm run frontend:build && node ccw/scripts/prepublish-clean.mjs && echo 'Ready to publish @dyw/claude-code-workflow'",
"frontend": "npm run dev --workspace=ccw/frontend",
"frontend:build": "npm run build --workspace=ccw/frontend",
"ws:install": "npm install",
@@ -65,6 +65,7 @@
"ccw/bin/",
"ccw/dist/",
"ccw/scripts/",
"ccw/frontend/dist/",
".claude/agents/",
".claude/commands/",
".claude/scripts/",