refactor(cli): Phase 4 cleanup — dedup, extract, deprecate #103
Reference in New Issue
Block a user
Delete Branch "refactor/97-phase4-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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-utilsthread-scan.ts— extract parseFirstJsonLineObject, dedup first-line parsingcommands/workflow/add-argv.ts— extract parseAddArgv from add.tscommands/thread/fork-argv.ts— extract parseForkArgv from fork.tscommands/cas/*.ts— remove unused _threadId params from cmdCas* functionscli-dispatch.ts— add deprecation warning to help commandcommands/init/templates.ts— extract template strings from template.tscli-color.ts— extract shouldUseColor, highlightLiveRole, dimGreyLine from live.tsRef
Closes #97 (Phase 4 of #93), completes RFC #93
LGTM ✅ RFC #93 收官,结构清晰。
一个小观察:CAS 底层函数已去掉
threadId参数,但 CLI dispatcher 仍然要求用户传<thread-id>(解析后丢弃)。向后兼容可以理解,但建议后续要么加 deprecation warning 要么直接去掉这个无用参数。不阻塞合并。—— 小墨 🖊️