背景:本地 PG/Redis 已按要求复用 docker-postgres-1 / docker-redis-1; S3 容器按用户要求删除,后续接入公网自建 RustFS。 改动: - 删除 infra/docker-compose.dev.yaml、infra/compose.dev.yaml - 移除 compose:up / compose:down 脚本,改用 check:dev 预检本机 PG/Redis - 新增 scripts/check-dev-deps.mjs;.env.example 的 S3_* 改为待填 - README / AGENTS / A0 报告同步本地依赖与对象存储说明 影响面:本地开发依赖与 CI 本地脚本、环境变量样例、文档。 回滚方式:恢复被删除的两个 compose 文件与 package.json 脚本即可。 验证:format:check、lint、pnpm ci:local(含 e2e 4/4)全部通过,用时 106.3s。
This commit is contained in:
1 parent
620cb93a46
commit
5628e158c0
9 files changed
+85
-57
No files matched your search
@@ -9,7 +9,7 @@
|
||||
| WBS | 状态 | 落地内容 |
|
||||
| --- | --- | --- |
|
||||
| A0-INF-01 Monorepo / 工具链 | 完成 | pnpm workspace + Turborepo;TS strict、ESLint 9 flat + Prettier + commitlint + lint-staged + husky;`.nvmrc` / `engines` / `packageManager` / preinstall 仅允许 pnpm;目录与 AGENTS.md §5 一致 |
|
||||
| A0-INF-02 本地依赖与迁移种子 | 完成(种子范围受限,见 §4.4) | 复用本机 `docker-postgres-1`(PostgreSQL 18,5432)与 `docker-redis-1`(6379);`infra/docker-compose.dev.yaml` 仅管理 S3 兼容服务;`.env.example`;Prisma 初始化与首版迁移;`system_configs` 幂等种子 |
|
||||
| A0-INF-02 本地依赖与迁移种子 | 完成(种子范围受限,见 §4.4) | 复用本机 `docker-postgres-1`(PostgreSQL 18,5432)与 `docker-redis-1`(6379);`pnpm check:dev` 预检;`.env.example`;Prisma 初始化与首版迁移;`system_configs` 幂等种子 |
|
||||
| A0-INF-03 CI 与质量门禁 | 完成 | `.gitea/workflows/ci.yml`:install → format → lint → typecheck → test → build → migrate → test:int → openapi:export/diff → e2e;新增 `pnpm ci:local` 在无 runner 时本地执行同一门禁;失败阻断 |
|
||||
| A0-BE-01 API 骨架 | 完成 | NestJS 11 + Fastify;Pino + `trace_id`;统一错误体 `{code,message,details,trace_id}`;`GET /health`;`/api/docs` 与 OpenAPI JSON;Zod 管道;CORS / Helmet |
|
||||
| A0-BE-02 Prisma 基线 | 完成 | `PrismaService` 封装;`outbox_events` / `idempotency_keys` / `system_configs`;ULID `char(26)`、软删/时间字段约定;首版迁移可重复执行 |
|
||||
@@ -26,7 +26,7 @@
|
||||
- API:`apps/api/src/`(`bootstrap.ts`、`common/filters`、`common/pipes`、`modules/platform/health/`、`openapi/document.ts`、`scripts/export-openapi.ts`)
|
||||
- 数据:`prisma/schema.prisma`、`prisma/migrations/20261102083445_init_platform_baseline/`、`prisma/seed.ts`、`prisma/SEED.md`
|
||||
- Web:`apps/web/src/`(`layout/`、`navigation/nav-config.ts`、`api/client.ts`、`pages/`、`stores/auth-store.ts`、`styles/`)
|
||||
- 基础设施:`infra/docker-compose.dev.yaml`、`infra/compose.dev.yaml`、`.env.example`
|
||||
- 本地依赖:`scripts/check-dev-deps.mjs`、`.env.example`
|
||||
- 契约快照:`openapi/lingxi.openapi.json`、`apps/web/src/api/generated/openapi.d.ts`
|
||||
|
||||
## 3. 本地门禁实测
|
||||
@@ -41,7 +41,7 @@
|
||||
| `pnpm test:int` | 通过(真实 PostgreSQL + Redis,`/health` 200) |
|
||||
| `pnpm test:e2e` | 通过(4/4,Playwright/Chrome) |
|
||||
| `pnpm openapi:export` + `pnpm openapi:diff` | 通过;快照含 20 个错误码,OpenAPI `3.1.0` |
|
||||
| `pnpm compose:up` | 通过;`lingxi-s3` healthy;PG / Redis 使用本机已运行容器,`/health` 与 `test:int` 验证连通 |
|
||||
| `pnpm check:dev` | 通过;PostgreSQL `5432/lingxi` 与 Redis `6379` 均可连接,`/health` 与 `test:int` 验证连通 |
|
||||
| API 启动 | `/health` 200、`/api/docs` 200、`/api/openapi.json` 200 |
|
||||
| Worker 启动 | 连接 Redis 成功,收到 SIGTERM 后正常退出 |
|
||||
| 种子幂等 | 连续执行两次,`system_configs` 保持 7 条 |
|
||||
@@ -50,11 +50,11 @@
|
||||
|
||||
### 4.1 本地依赖来源(环境适配)
|
||||
|
||||
本地 PostgreSQL 与 Redis **复用本机已有 Docker 服务**,不另起容器:`docker-postgres-1`(PostgreSQL 18,`127.0.0.1:5432`,库 `lingxi`、用户 `postgres`、密码 `postgres`)与 `docker-redis-1`(`127.0.0.1:6379`)。`infra/docker-compose.dev.yaml` 仅保留 S3 兼容服务(宿主 `19000/19001`)。CI services 使用标准 5432/6379,凭据同为 `postgres/postgres`。
|
||||
本地 PostgreSQL 与 Redis **复用本机已有 Docker 服务**,不另起容器:`docker-postgres-1`(PostgreSQL 18,`127.0.0.1:5432`,库 `lingxi`、用户 `postgres`、密码 `postgres`)与 `docker-redis-1`(`127.0.0.1:6379`)。仓库不包含任何数据库/缓存容器编排。CI services 使用标准 5432/6379,凭据同为 `postgres/postgres`。
|
||||
|
||||
### 4.2 对象存储镜像不可得(环境适配)
|
||||
### 4.2 对象存储待接入公网 RustFS
|
||||
|
||||
当前 Docker 环境无法拉取 `minio/minio` 与 `minio/mc`(registry denied),`dl.min.io` 二进制返回 410。A0 使用 **`adobe/s3mock`** 并在启动时创建 `assets / renders / temp / archive` 四个桶,仅用于本地开发;CI / 生产接入真实 MinIO 时替换 compose 中 `s3` 服务即可,应用侧仍只依赖 S3 协议与环境变量。
|
||||
本地 Docker 不提供 S3 服务,`minio/minio` 镜像在当前网络也不可拉取。A0 代码不依赖对象存储(`/health` 只检查 DB 与 Redis),`.env.example` 保留 `S3_*` 占位;后续由项目方提供公网自建 RustFS 的 endpoint 与凭据后填写,应用侧继续只依赖 S3 协议。
|
||||
|
||||
### 4.3 演示登录(A0 临时)
|
||||
|
||||
@@ -80,7 +80,7 @@ npm 上 `oasdiff` 为占位包(0.0.1-security),A0 暂用自研 `scripts/op
|
||||
|
||||
当前离线 Gitea 未部署 Actions runner,推送后远程 CI 会停留在 `queued`。A0 增加 `pnpm ci:local`:按 `.gitea/workflows/ci.yml` 的顺序在本地执行 compose、格式、Lint、类型、单测、构建、迁移与种子、集成、OpenAPI 契约与 e2e,全部通过才退出 0;runner 就绪后远程工作流可直接接管。
|
||||
|
||||
本地开发库为 `lingxi` / `postgres` / `postgres`,直接连接本机已有 PostgreSQL 容器;`.env.example` 与 CI services 保持一致。
|
||||
本地开发库为 `lingxi` / `postgres` / `postgres`,直接连接本机已有 PostgreSQL 容器;`.env.example` 与 CI services 保持一致;S3 待 RustFS 信息后配置。
|
||||
|
||||
### 4.8 前端视觉方向
|
||||
|
||||
@@ -98,7 +98,7 @@ npm 上 `oasdiff` 为占位包(0.0.1-security),A0 暂用自研 `scripts/op
|
||||
|
||||
1. **A1 必须移除演示登录**并接入真实 JWT / 刷新令牌 / 权限守卫。
|
||||
2. 种子业务数据待 A1 / A3 / A4 / B0 表就绪后补齐(Q-A0-01)。
|
||||
3. MinIO 本地替代方案需在具备镜像的环境回归;生产 compose 与 CI 镜像另行处理。
|
||||
3. 对象存储待接入公网 RustFS;接入前不使用本地 S3 容器。
|
||||
4. Web 主包约 599 kB(Semi 全量 CSS 689 kB),A0 接受;M1 前做路由级拆分与 Semi 按需样式。
|
||||
5. 远程 CI 待 Gitea Actions runner 就绪后验证 services 与 Playwright 浏览器安装;当前以 `pnpm ci:local` 为准(已实测通过)。
|
||||
|
||||
|
||||
Reference in new issue
Block a user