From e04b727acfa8a247565cd4c165e6afbabf8d1eaa Mon Sep 17 00:00:00 2001 From: lhl Date: Sat, 12 Sep 2026 18:40:29 +0800 Subject: [PATCH] =?UTF-8?q?chore(frontend):=20=E6=96=B0=E5=A2=9E=20npm=20r?= =?UTF-8?q?un=20verify(typecheck+test+build)=20=E4=B8=8E=20watch=20?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=9BAGENTS.md=20=E8=A6=81=E6=B1=82?= =?UTF-8?q?=E6=94=B9=E5=89=8D=E7=AB=AF=E5=90=8E=E5=BF=85=E8=B7=91=20verify?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 3 +++ frontend/package.json | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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",