部署 v0.7.3 后,/health 的 scenes.error 给出决定性线索: No metadata for "Scene" was found. src/entities/index.ts 的 ENTITIES 一直漏了 Scene: export const ENTITIES = [Asset, Song, Motion, CharacterModel, ReviewRecord]; TypeORM 只按 ENTITIES 注册 metadata,漏注册的后果极其隐蔽: - 启动完全正常(DI 可解析、/health 正常、migrationsPending 0); - 迁移也正常(AddScenes 已执行,表其实是建好的); - 但第一次查 Scene 就抛 No metadata,于是 /api/scenes、/api/catalog/export、 /api/catalog/version、/api/reviews?status=pending 全部 500 → 客户端拉不到任何目录、管理端待审列表打不开。 即:此前"数据库缺 scenes 表"的判断也是错的(v0.7.3 的降级与诊断脚本因此仍然值得保留 —— 它们把"场景坏了"限制成"场景不可用",而不是整站不可用)。 修复:ENTITIES 加入 Scene 并导出。 新增静态防线 test/entities-registry.spec.ts(4 项):扫描 src/entities/*.entity.ts 里的 @Entity() 类并逐一与 ENTITIES 对账(漏一个即失败)、检查无重复/无多余、核对 AddScenes 迁移文件存在。已做反向验证:把 Scene 从 ENTITIES 移除后该测试立刻失败。 这类缺陷既过得了 tsc、也过得了启动冒烟(应用能启动),只能靠静态核对兜住。 文档:README.md/.txt 增加 v0.7.4 修订说明;tasks/015-scene-management.md 增 「缺陷修复记录四」;开发文档 §4.12 补「新增实体必须加入 ENTITIES」的硬性要求。 验证:npm run verify 通过(23 文件 / 285 项测试 + 契约/路由/版本一致 + 启动冒烟); 发布产物 opendance-web-v0.7.4.tar.gz sha256 e680c23fc382b6c39498608ea0154f8f80e9e6b5c13518f0f88095644ce88fe1。
30 lines
725 B
JSON
30 lines
725 B
JSON
{
|
||
"name": "opendance-admin",
|
||
"private": true,
|
||
"version": "0.7.4",
|
||
"type": "module",
|
||
"description": "OpenDance Studio 管理端(React + TypeScript + Vite)",
|
||
"scripts": {
|
||
"dev": "vite",
|
||
"build": "tsc -b && vite build",
|
||
"preview": "vite preview",
|
||
"typecheck": "tsc --noEmit"
|
||
},
|
||
"dependencies": {
|
||
"@pixiv/three-vrm": "^3.5.5",
|
||
"react": "^18.3.1",
|
||
"react-dom": "^18.3.1",
|
||
"react-router-dom": "^6.30.6",
|
||
"three": "^0.186.0"
|
||
},
|
||
"devDependencies": {
|
||
"@types/node": "^24.10.1",
|
||
"@types/react": "^18.3.31",
|
||
"@types/react-dom": "^18.3.7",
|
||
"@types/three": "^0.186.0",
|
||
"@vitejs/plugin-react": "^6.1.1",
|
||
"typescript": "^5.9.3",
|
||
"vite": "^8.3.0"
|
||
}
|
||
}
|