Skip to content

refactor(cli): extract subcommand handlers into separate modules#441

Merged
jafreck merged 2 commits intomainfrom
refactor/cli-commands
Mar 28, 2026
Merged

refactor(cli): extract subcommand handlers into separate modules#441
jafreck merged 2 commits intomainfrom
refactor/cli-commands

Conversation

@jafreck
Copy link
Copy Markdown
Owner

@jafreck jafreck commented Mar 28, 2026

Summary

Extracts the 727-line monolithic cli.ts into a thin dispatcher + 6 command modules + shared args utility.

Motivation

cli.ts housed argument parsing, 6+ subcommand implementations, config resolution, process lifecycle, and logging setup in one procedural file. Adding a new command meant editing a 700-line file.

Changes

  • src/cli.ts → 68 lines (thin dispatcher with signal handlers)
  • src/cli/args.ts — shared argument utilities
  • 6 command modules in src/cli/commands/:
    • index-cmd.ts (162 lines)
    • serve-cmd.ts (123 lines)
    • refresh-cmd.ts (159 lines)
    • analyze-cmd.ts (72 lines)
    • install-scip-cmd.ts (39 lines)
    • hooks-cmd.ts (89 lines)

Testing

All existing tests pass. Zero new failures introduced.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 28, 2026

Codecov Report

❌ Patch coverage is 82.60870% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.36%. Comparing base (9cd4039) to head (205c344).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/cli/commands/serve-cmd.ts 37.28% 37 Missing ⚠️
src/cli/commands/refresh-cmd.ts 84.81% 12 Missing ⚠️
src/cli/commands/hooks-cmd.ts 88.23% 4 Missing ⚠️
src/cli/commands/index-cmd.ts 95.40% 4 Missing ⚠️
src/cli/commands/install-scip-cmd.ts 84.21% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #441   +/-   ##
=======================================
  Coverage   89.35%   89.36%           
=======================================
  Files          93      100    +7     
  Lines        9670     9683   +13     
  Branches     3013     3013           
=======================================
+ Hits         8641     8653   +12     
- Misses       1029     1030    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jafreck jafreck merged commit 049d36c into main Mar 28, 2026
3 checks passed
@jafreck jafreck mentioned this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant