Phase 3 Testing: 拆分 cli-dispatch.ts #96

Closed
opened 2026-05-07 16:23:03 +00:00 by xingyue · 0 comments
Owner

验证目标

cli-dispatch.ts 从 777 行瘦身到 < 150 行。Usage 格式化、子命令表分别迁出。

测试步骤

  • Step 1: cli-dispatch.ts 行数 < 150

    wc -l packages/cli-workflow/src/cli-dispatch.ts
    

    预期: < 150 行

  • Step 2: cli-usage.ts 存在

    ls packages/cli-workflow/src/cli-usage.ts
    

    预期: 文件存在,包含 formatCliUsage 等

  • Step 3: 各组 index.ts 包含子命令表

    grep 'SUBCOMMAND_TABLE\|commandTable\|subcommands' packages/cli-workflow/src/commands/*/index.ts
    

    预期: 每个组的 index.ts 定义了自己的子命令表

  • Step 4: dispatch wrapper 工厂化

    grep -c 'dispatchAdd\|dispatchShow\|dispatchRemove\|dispatchKill\|dispatchPause' packages/cli-workflow/src/cli-dispatch.ts
    

    预期: 大量单独 dispatch 函数已被工厂替代,计数明显减少

  • Step 5: 全量验证

    cd packages/cli-workflow && bun run check && bun run build && bun test
    

    预期: 全部 pass

  • Step 6: usage 输出不变

    bun run packages/cli-workflow/src/cli.ts 2>&1
    

    预期: 输出与重构前一致

验证完成标准

所有 checkbox 打勾
dispatch 文件大幅瘦身

Ref

RFC #93, Phase 3

## 验证目标 cli-dispatch.ts 从 777 行瘦身到 < 150 行。Usage 格式化、子命令表分别迁出。 ## 测试步骤 - [ ] **Step 1: cli-dispatch.ts 行数 < 150** ```bash wc -l packages/cli-workflow/src/cli-dispatch.ts ``` **预期:** < 150 行 - [ ] **Step 2: cli-usage.ts 存在** ```bash ls packages/cli-workflow/src/cli-usage.ts ``` **预期:** 文件存在,包含 formatCliUsage 等 - [ ] **Step 3: 各组 index.ts 包含子命令表** ```bash grep 'SUBCOMMAND_TABLE\|commandTable\|subcommands' packages/cli-workflow/src/commands/*/index.ts ``` **预期:** 每个组的 index.ts 定义了自己的子命令表 - [ ] **Step 4: dispatch wrapper 工厂化** ```bash grep -c 'dispatchAdd\|dispatchShow\|dispatchRemove\|dispatchKill\|dispatchPause' packages/cli-workflow/src/cli-dispatch.ts ``` **预期:** 大量单独 dispatch 函数已被工厂替代,计数明显减少 - [ ] **Step 5: 全量验证** ```bash cd packages/cli-workflow && bun run check && bun run build && bun test ``` **预期:** 全部 pass - [ ] **Step 6: usage 输出不变** ```bash bun run packages/cli-workflow/src/cli.ts 2>&1 ``` **预期:** 输出与重构前一致 ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ dispatch 文件大幅瘦身 ## Ref RFC #93, Phase 3
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#96