For Codex: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
Goal: 将 HIS 病案复印 Demo 的平铺源码整理为页面、路由桥、模型、工具、样式和测试分层,保持菜单与路由行为不变。
Architecture: 路由仍由 StaticRouterData.js 统一声明;仅将其 JSX 组件地址调整到 mrcDemo/page/ 和 mrcDemo/route/。页面继续从 model/、utils/、style/ 导入模块私有能力;测试移动至 __tests__/ 并改用相对引用。无接口、无持久化、无业务交互变更。
Tech Stack: React、react-router-dom、Ant Design、Node.js assert、Git。
Files:
04-新项目源码_source/项目源码/cloudhis-pr/src/pages/mrcDemo/__tests__/structure.test.js04-新项目源码_source/项目源码/cloudhis-pr/src/pages/mrcDemo/__tests__/structure.test.jsStep 1: Write the failing test
断言迁移后的 4 个 JSX 文件、模型、工具和样式文件都位于目标目录;断言 StaticRouterData.js 的 4 个组件路径使用新目录。
Step 2: Run test to verify it fails
Run: node 04-新项目源码_source/项目源码/cloudhis-pr/src/pages/mrcDemo/__tests__/structure.test.js
Expected: FAIL,因为迁移前目标目录不存在。
Step 3: Move files and update imports
使用 git mv 迁移文件;调整页面、路由桥、测试的相对导入;更新静态路由组件路径。
Step 4: Run test to verify it passes
Run: node 04-新项目源码_source/项目源码/cloudhis-pr/src/pages/mrcDemo/__tests__/structure.test.js
Expected: mrcDemo structure tests passed。
Step 5: Commit
git add docs/plans 04-新项目源码_source/项目源码/cloudhis-pr/src
git commit -m "refactor(mrc): organize demo source structure"
Files:
01-项目文档_docs/03-功能模块/整改中(Demo)_MRC-PC-ORDER-001_订单管理工作台/13-Demo正式复审记录.md04-新项目源码_source/项目源码/cloudhis-pr/src/pages/mrcDemo/__tests__/*.test.jsStep 1: Add the menu-routing evidence
写入唯一菜单 /mrc-demo 与 page/MRCDemoEntry.jsx 的对应关系,并标注其余三条路由为工作台或兼容桥接,不新增菜单。
Step 2: Run all offline tests
Run: for f in 04-新项目源码_source/项目源码/cloudhis-pr/src/pages/mrcDemo/__tests__/*.test.js; do node "$f"; done
Expected: 所有 9 组测试通过。
Step 3: Validate references and diff
Run: node 04-新项目源码_source/项目源码/pri-smart-hospital-miniprogram/scripts/validate-doc-links.js && git diff --check
Expected: 文档链接与差异格式均通过。