diff --git a/AGENTS.md b/AGENTS.md index b2a406f..31d8fc9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -46,6 +46,9 @@ npm test # 纯逻辑单测(node --test) ``` > 前端改动优先改 `frontend/src/*.ts`,再 `npm run build`;`?v=__ASSET_VER__` 依据文件 mtime 自动破缓存。 +> +> **每次改动 `frontend/` 后必须运行 `npm run verify`(typecheck → test → build)**,确保入库产物 `src/genesis/server/static/chat.js` 与源码一致;提交时一并包含重建后的 `chat.js`。 +> 开发期可用 `npm run watch` + `npm run typecheck:watch` 实现保存即重建/检查。 ## 开发范式 diff --git a/frontend/package.json b/frontend/package.json index bf9a7bb..a2fa373 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,7 +7,10 @@ "build": "node esbuild.config.mjs", "watch": "node esbuild.config.mjs --watch", "typecheck": "tsc --noEmit", - "test": "node --test tests/state.test.ts tests/ws.test.ts" + "typecheck:watch": "tsc --noEmit --watch", + "test": "node --test tests/state.test.ts tests/ws.test.ts", + "test:watch": "node --test --watch tests/state.test.ts tests/ws.test.ts", + "verify": "npm run typecheck && npm test && npm run build" }, "devDependencies": { "@types/node": "^22.20.2",