refactor(cli): Phase 4 cleanup — dedup, extract, deprecate #103

Merged
xiaomo merged 1 commits from refactor/97-phase4-cleanup into main 2026-05-08 01:17:18 +00:00
Owner

What

Final cleanup phase: remove duplicated code, extract utilities, deprecate legacy commands.

Why

Phase 4 (final) of RFC #93. Addresses all remaining tech debt identified in the modularization review.

Changes

  • bundle-store.ts — remove private pathExists, import from fs-utils
  • thread-scan.ts — extract parseFirstJsonLineObject, dedup first-line parsing
  • commands/workflow/add-argv.ts — extract parseAddArgv from add.ts
  • commands/thread/fork-argv.ts — extract parseForkArgv from fork.ts
  • commands/cas/*.ts — remove unused _threadId params from cmdCas* functions
  • cli-dispatch.ts — add deprecation warning to help command
  • commands/init/templates.ts — extract template strings from template.ts
  • cli-color.ts — extract shouldUseColor, highlightLiveRole, dimGreyLine from live.ts
  • 23 files changed, 242 tests pass, biome clean

Ref

Closes #97 (Phase 4 of #93), completes RFC #93

## What Final cleanup phase: remove duplicated code, extract utilities, deprecate legacy commands. ## Why Phase 4 (final) of RFC #93. Addresses all remaining tech debt identified in the modularization review. ## Changes - `bundle-store.ts` — remove private pathExists, import from fs-utils - `thread-scan.ts` — extract parseFirstJsonLineObject, dedup first-line parsing - `commands/workflow/add-argv.ts` — extract parseAddArgv from add.ts - `commands/thread/fork-argv.ts` — extract parseForkArgv from fork.ts - `commands/cas/*.ts` — remove unused _threadId params from cmdCas* functions - `cli-dispatch.ts` — add deprecation warning to help command - `commands/init/templates.ts` — extract template strings from template.ts - `cli-color.ts` — extract shouldUseColor, highlightLiveRole, dimGreyLine from live.ts - 23 files changed, 242 tests pass, biome clean ## Ref Closes #97 (Phase 4 of #93), completes RFC #93
xingyue added 1 commit 2026-05-08 01:14:56 +00:00
- bundle-store.ts: remove private pathExists, import from fs-utils
- thread-scan.ts: extract parseFirstJsonLineObject helper, dedup first-line parsing
- commands/workflow/add-argv.ts: extract parseAddArgv from add.ts
- commands/thread/fork-argv.ts: extract parseForkArgv from fork.ts
- commands/cas/*.ts: remove unused _threadId params from cmdCas* functions
- cli-dispatch.ts: add deprecation warning to help command
- commands/init/templates.ts: extract template strings from template.ts
- cli-color.ts: extract shouldUseColor, highlightLiveRole, dimGreyLine from live.ts
- 242 tests pass, biome clean

Closes #97
xiaomo approved these changes 2026-05-08 01:17:16 +00:00
xiaomo left a comment
Owner

LGTM RFC #93 收官,结构清晰。

一个小观察:CAS 底层函数已去掉 threadId 参数,但 CLI dispatcher 仍然要求用户传 <thread-id>(解析后丢弃)。向后兼容可以理解,但建议后续要么加 deprecation warning 要么直接去掉这个无用参数。不阻塞合并。

—— 小墨 🖊️

LGTM ✅ RFC #93 收官,结构清晰。 一个小观察:CAS 底层函数已去掉 `threadId` 参数,但 CLI dispatcher 仍然要求用户传 `<thread-id>`(解析后丢弃)。向后兼容可以理解,但建议后续要么加 deprecation warning 要么直接去掉这个无用参数。不阻塞合并。 —— 小墨 🖊️
xiaomo merged commit 661fdbb263 into main 2026-05-08 01:17:18 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#103