refactor: split cli.rs into focused submodules#1351
refactor: split cli.rs into focused submodules#1351fengmk2 wants to merge 2 commits intorefactor-cli.rsfrom
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label auto-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
74678d6 to
69654e0
Compare
|
@codex review |
cpojer
left a comment
There was a problem hiding this comment.
Approving assuming that you or codex will find any issues from splitting this up and that there is no new code.
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
69654e0 to
cb441d1
Compare
cb441d1 to
87a4ff7
Compare
5ad7900 to
e9cf38e
Compare
87a4ff7 to
54a20cb
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 54a20cb. Configure here.
e9cf38e to
7b8da63
Compare
54a20cb to
08a95ab
Compare
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.
…unctions Extract repeated `self.cli_options.as_ref().ok_or_else(...)` pattern (9 occurrences) into a `cli_options()` helper method on SubcommandResolver. Merge `resolve_and_execute_with_stdout_filter` and `resolve_and_execute_with_stderr_filter` into a single `resolve_and_execute_with_filter` that takes a `FilterStream` enum.
7b8da63 to
fd25de3
Compare
08a95ab to
8e4d260
Compare

Break the 1,314-line cli.rs into a cli/ directory with 6 files:
Tightens visibility where possible (pub(super), pub(crate)) following
the patterns established in the check/ and exec/ modules.
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.rswith apackages/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 intoexecution::resolve_and_execute_with_filter(used for suppressing init output and rewritingoxfmt --inithints). Tests for help/arg-parsing behavior move intohelp.rsand the run-config sync test remains inmod.rs.Reviewed by Cursor Bugbot for commit 54a20cb. Configure here.