chore: 一键检查、发布脚本与开发环境约定

- deno task test:all(scripts/test-all.sh):逐包跑完再汇总,连不上测试库直接失败,
  web 用 Node 跑 vitest;deno task ci 改用它
- deno task release(scripts/release.sh):工作区不干净、CHANGELOG 无本版条目即拒绝;
  打 tag、构建、只替换 app、核对健康接口版本
- deno task dev:up:起开发库并迁移到最新;开发 API 端口改 4390(4380 留给本机部署版)
- CLAUDE.md:命令、提交与发布约定、文档放哪

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-10-02 16:08:09 +08:00
1 parent ceb66f8c77
commit 11ca2f01ff
200 files changed
+191 -23061

No files matched your search

+7 -8
View File
@@ -3,16 +3,15 @@
## 前置
- Deno 2.9.7(锁定;`curl -fsSL https://deno.land/install.sh | sh -s v2.9.7`)、Docker。不需要 Node.js / pnpm。
- 端口:web 5180、API 4380、PG 55433。本机 3000/5175/5176/55432 已被其他项目占用,不要改用。
- 端口:web 5180、API 4390、PG 55433。4380 留给本机部署版(Caddy),本机 3000/5175/5176/55432 已被其他项目占用,不要改用。
## 首次启动
```sh
cp .env.example .env # 按需修改;server 与 db 脚本都读仓库根 .env
deno task db:up # 起 postgres:16-alpine(docker-compose.dev.yml,数据卷 umt-pg-data)
deno install # 按 deno.lock 装依赖到 node_modules(成员包软链到 node_modules/@umt/*)
deno task db:migrate # 执行 packages/db/migrations 下全部迁移
deno task dev # 同时起 server(4380)与 web(5180)
deno task dev:up # 起开发库 postgres:18.6(docker-compose.dev.yml)并迁移到最新;拉代码后也跑一次
deno task dev # 同时起 server(4390)与 web(5180)
```
单独起:`deno task dev:server`(`deno run --watch`,默认 `--role all`,API + worker 同进程)、`deno task dev:web`。
@@ -20,13 +19,13 @@ deno task dev # 同时起 server(4380)与 web(5180)
## 验证
```sh
curl localhost:4380/api/v1/health
curl localhost:4390/api/v1/health
# 开发模式可用 .env 的 DEV_ADMIN_KEY 作 admin
curl -N -H "Authorization: Bearer umt-dev-admin-key" "localhost:4380/api/v1/events?after=0" # SSE 流(控制台用)
curl -H "Authorization: Bearer umt-dev-admin-key" "localhost:4380/api/v1/events?after=0&limit=50" # JSON 补读页(API Key 调用者用)
curl -N -H "Authorization: Bearer umt-dev-admin-key" "localhost:4390/api/v1/events?after=0" # SSE 流(控制台用)
curl -H "Authorization: Bearer umt-dev-admin-key" "localhost:4390/api/v1/events?after=0&limit=50" # JSON 补读页(API Key 调用者用)
```
- OpenAPI:http://localhost:4380/api/openapi.json,文档页 http://localhost:4380/api/docs
- OpenAPI:http://localhost:4390/api/openapi.json,文档页 http://localhost:4390/api/docs
- 控制台:http://localhost:5180,右上角钥匙按钮设置 API Key(存 localStorage `umt-api-key`)
## 常用命令