Commit 18f9f50
committed
refactor: split cli.rs into focused submodules (#1351)
Break the 1,314-line cli.rs into a cli/ directory with 6 files:
- types.rs: all structs, enums, and type aliases
- resolver.rs: SubcommandResolver and cache/env helpers
- handler.rs: VitePlusCommandHandler and VitePlusConfigLoader
- execution.rs: resolve_and_execute command variants
- help.rs: CLI help, error formatting, vitest arg helpers, and tests
- mod.rs: module declarations, re-exports, and entry points
Tightens visibility where possible (pub(super), pub(crate)) following
the patterns established in the check/ and exec/ modules.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Primarily a code-organization refactor of the CLI with minimal behavior change; risk is limited to potential regressions from moved code/visibility tweaks and the new unified stdout/stderr filtering helper.
>
> **Overview**
> Replaces the monolithic `packages/cli/binding/src/cli.rs` with a `packages/cli/binding/src/cli/` module (`types`, `resolver`, `handler`, `execution`, `help`, `mod`) while keeping the same CLI entrypoints and behavior.
>
> As part of the split, tightens visibility (`pub(super)`, `pub(crate)`) and consolidates stdout/stderr capture+rewrite into `execution::resolve_and_execute_with_filter` (used for suppressing init output and rewriting `oxfmt --init` hints). Tests for help/arg-parsing behavior move into `help.rs` and the run-config sync test remains in `mod.rs`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 54a20cb. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 6ebba00 commit 18f9f50
File tree
7 files changed
+1344
-1314
lines changed- packages/cli/binding/src
- cli
7 files changed
+1344
-1314
lines changed
0 commit comments