Skip to content

docs(rfcs): align command routing with the current global CLI - #2528

Merged
fengmk2 merged 10 commits into
voidzero-dev:mainfrom
jong-kyung:docs/rfc-command-routing
Aug 22, 2026
Merged

docs(rfcs): align command routing with the current global CLI#2528
fengmk2 merged 10 commits into
voidzero-dev:mainfrom
jong-kyung:docs/rfc-command-routing

Conversation

@jong-kyung

Copy link
Copy Markdown
Collaborator

The Command Routing section of rfcs/merge-global-and-local-cli.md still described the two-path model from the original merge: Category A for package-manager commands and Category B for "everything else". crates/vp_global_cli/src/cli.rs has since grown into three labelled blocks plus a handful of Rust-native commands, so the RFC no longer matched the code it documents.

This rewrites the section to mirror cli.rs as it is today:

  • Category A (package manager), B (JS script commands: create, migrate, config, hooks, staged, --version), and C (local CLI delegation: dev through cache), matching the comment blocks in the Commands enum.
  • A separate "Rust-native global commands" group for the variants outside those blocks: toolchain as a hybrid that delegates locally or renders the global toolchain.json depending on --global, env, and the self-management pair upgrade and implode.
  • The --global interception for package-manager commands now points at PackageManagerCommand::managed_global_command and commands::global; the RFC still referenced the removed commands::env::global_install.
  • The ASCII diagram is replaced with a mermaid flowchart, which the repo already uses in docs/ and rfcs/core-binding-resolution.md, so the B and C convergence on oxc_resolver and the --global branches are visible.

Docs only, no code changes. Follows up on the routing gaps surfaced while reviewing #2525.

Rewrite the Command Routing section of merge-global-and-local-cli.md to
mirror crates/vp_global_cli/src/cli.rs: Categories A, B, and C as the code
labels them, plus the Rust-native global commands (toolchain, env, upgrade,
implode) that sit outside those blocks. Replace the two-path ASCII diagram
with a mermaid flowchart and point the --global interception at
commands::global instead of the removed commands::env::global_install.
@netlify

netlify Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit df778e9
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a8881a6340c1800084345e7

@jong-kyung
jong-kyung marked this pull request as ready for review August 21, 2026 15:38
@jong-kyung jong-kyung self-assigned this Aug 21, 2026
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44a34daea0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread rfcs/merge-global-and-local-cli.md Outdated
Comment thread rfcs/merge-global-and-local-cli.md Outdated
Comment thread rfcs/merge-global-and-local-cli.md Outdated
Comment thread rfcs/merge-global-and-local-cli.md Outdated
Comment thread rfcs/merge-global-and-local-cli.md Outdated
run_command_with_options handles args.version in commands::version before
any JS resolution, so it does not belong in Category B.
commands::toolchain only delegates when a local vite-plus resolves; with
--global or no local install it renders the global manifest in Rust.
… CLI

JsExecutor::delegate_migrate bypasses an older local vite-plus, so migrate
does not follow the plain local-first path of the other Category B commands.
packages/cli builds its CLI entries with tsdown via buildWithTsdown(); the
CLI package has no rolldown config.
…g diagram

Package-manager commands entering through the global vp binary are handled
by run_package_manager_command and never reach bin.ts; the NAPI route only
exists for direct local invocations, which the prose now states.
@jong-kyung
jong-kyung force-pushed the docs/rfc-command-routing branch from 0e40a9d to 61b8c5f Compare August 21, 2026 15:52
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61b8c5fb03

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread rfcs/merge-global-and-local-cli.md Outdated
… implode

--version and toolchain are also implemented in the local CLI and are
reached there on direct invocation of the JavaScript entry point.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 2981f444d6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@jong-kyung
jong-kyung requested a review from fengmk2 August 21, 2026 16:15
@fengmk2
fengmk2 merged commit b2679c5 into voidzero-dev:main Aug 22, 2026
41 checks passed
@jong-kyung
jong-kyung deleted the docs/rfc-command-routing branch August 22, 2026 04:21
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.

2 participants