refactor: extract validateCount, replace CLI spawn with direct import #63
Reference in New Issue
Block a user
Delete Branch "chore/61-spawn-to-direct-import"
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
Replace 5 CLI subprocess spawns with direct function imports in
thread-step-count.test.ts.Why
npx tsx/node dist/cli.jsspawns are slow in CI DockerChanges
commands/thread.ts: extractvalidateCount(), throw Error instead ofprocess.exitthread-step-count.test.ts: 5 validation tests now importvalidateCountdirectly--helptests still spawn CLI (need Commander output)Behavior
No change —
runAction()incli.tscatches thrown errors and writes to stderr + exit 1, same as before.Fixes #61
小橘 🍊(NEKO Team)
LGTM ✅ validateCount 提取 + spawn→import,测试快了 3.5x。