mirror of
https://github.com/motajs/template.git
synced 2026-10-14 17:10:20 +08:00
fix(09): revise plans based on checker feedback
This commit is contained in:
parent
337d28c1d7
commit
e2b44441c7
@ -254,7 +254,7 @@ Phase 9 · 任务 3 · 第 6 个计划 —— **book 怪物手册(列表 `book
|
||||
</action>
|
||||
<reversibility rating="reversible">纯新增文件;删除 / `git revert` 可整体回退。</reversibility>
|
||||
<verify>
|
||||
<automated>node -e "const fs=require('fs');const bad=[];const p='packages-user/client-modules/src/ui/book.tsx';if(!fs.existsSync(p)){bad.push('book.tsx missing')}else{const t=fs.readFileSync(p,'utf8').replace(/\r\n/g,'\n');const need=[['interface BookProps','props interface'],['props.state.enemyContext','bind enemyContext'],['iterateEnemy(','enumerate'],['getBaseEnemy(','base enemy'],['.code','dedup key code'],['calculateEnemyCritical(','base critical API'],['calculateViewCritical(','computed critical API'],['baseInfo','damage baseInfo'],['with(','scoped hero'],['<icon','icon'],['<Scroll','scroll list'],['new GameUI(','GameUI export'],['BookDetailUI','detail import'],['controller.open(','open detail'],['controller.close(','close/exit'],['props: [','props array']];for(const [s,label] of need){if(t.indexOf(s)<0)bad.push('missing '+label+': '+s)}if(/import type/.test(t))bad.push('has import type');if(/\?\.[a-zA-Z]/.test(t))bad.push('has optional chaining');if(/import\s*\{[^}]*\bclient\b/.test(t)&&/from\s*'\.\.\/\.\.\/core'/.test(t))bad.push('client singleton import');if(!/BookUI\s*=\s*new GameUI\(/.test(t))bad.push('BookUI not exported');if(!/props\.state\.enemyContext/.test(t))bad.push('not bound to props.state.enemyContext');}if(bad.length>0){console.error('BOOK GATE FAILED :: '+bad.join(' ; '));process.exit(1)}console.log('OK book: list UI present and bound to enemyContext')"</automated>
|
||||
<automated>node -e "const fs=require('fs');const bad=[];const p='packages-user/client-modules/src/ui/book.tsx';if(!fs.existsSync(p)){bad.push('book.tsx missing')}else{const t=fs.readFileSync(p,'utf8').replace(/\r\n/g,'\n');const need=[['interface BookProps','props interface'],['props.state.enemyContext','bind enemyContext'],['iterateEnemy(','enumerate'],['getBaseEnemy(','base enemy'],['.code','dedup key code'],['calculateEnemyCritical(','base critical API'],['baseInfo','damage baseInfo'],['with(','scoped hero'],['<icon','icon'],['<Scroll','scroll list'],['new GameUI(','GameUI export'],['BookDetailUI','detail import'],['controller.open(','open detail'],['controller.close(','close/exit'],['props: [','props array']];for(const [s,label] of need){if(t.indexOf(s)<0)bad.push('missing '+label+': '+s)}if(/import type/.test(t))bad.push('has import type');if(/\?\.[a-zA-Z]/.test(t))bad.push('has optional chaining');if(/import\s*\{[^}]*\bclient\b/.test(t)&&/from\s*'\.\.\/\.\.\/core'/.test(t))bad.push('client singleton import');if(!/BookUI\s*=\s*new GameUI\(/.test(t))bad.push('BookUI not exported');if(!/props\.state\.enemyContext/.test(t))bad.push('not bound to props.state.enemyContext');}if(bad.length>0){console.error('BOOK GATE FAILED :: '+bad.join(' ; '));process.exit(1)}console.log('OK book: list UI present and bound to enemyContext')"</automated>
|
||||
<fails_when>non-zero exit, 或 stderr 含 "BOOK GATE FAILED"(文件缺失 / 未绑定 `enemyContext` / 关键符号缺失 / 引入 `client` 单例 / `import type` / `?.`)</fails_when>
|
||||
<automated>node -e "const fs=require('fs');const files=['packages-user/client-modules/src/ui/book.tsx','packages-user/client-modules/src/ui/bookDetail.tsx'];const bad=[];for(const f of files){if(!fs.existsSync(f)){bad.push('missing '+f);continue}const raw=fs.readFileSync(f,'utf8');if(/(?<!\r)\n/.test(raw))bad.push(f+': LF without CR');if(raw.includes('\r')&&!/\r\n/.test(raw))bad.push(f+': stray CR')}if(bad.length){console.error('CRLF FAILED :: '+bad.join(' ; '));process.exit(1)}console.log('OK CRLF: book.tsx + bookDetail.tsx')"</automated>
|
||||
<fails_when>non-zero exit, 或 stderr 含 "CRLF FAILED"(换行非 CRLF)</fails_when>
|
||||
|
||||
@ -119,7 +119,7 @@ Phase 9 · 任务 3 · 第 7 个计划 —— **equipbox 装备界面**。
|
||||
- 新增组件:`EquipBox`。
|
||||
- 新增 `GameUI` 名称字符串:`'equipbox'`。
|
||||
- 新增 props 接口:`EquipBoxProps`(含 `heroState: IHeroState<IHeroAttr>`、`attributes: readonly IHeroAttrItem[]`,及 `IUIPropsBase` 的 `controller/instance/state`)。
|
||||
- 新增属性项类型:`IHeroAttrItem`(默认名,`{ readonly id: keyof IHeroAttr; readonly name: string }`;与 09-06 的同名提案如用户希望统一,可后续合并)。
|
||||
- 新增属性项类型:`IHeroAttrItem`(默认名,`{ readonly id: keyof IHeroAttr; readonly name: string }`;**本计划独有的新命名**,与其它计划无同名提案)。
|
||||
- 新增导出:`EquipBoxUI`(`new GameUI(...)`)。
|
||||
- **不修改**任何既有命名 / 单例;不向 `src/ui/index.ts` 添加导出(保持与同 wave 计划互不冲突)。
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user