fix(cli): delegate command help to local cli#2184
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
b7435e4 to
327d23a
Compare
Move delegated command help into the local CLI, preserve help annotations, and stabilize dev-server snapshot synchronization.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d31e3c6d5
ℹ️ 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".
| } | ||
| print_runtime_header(render_options.show_header); | ||
| maybe_print_runtime_header("dev", &args, render_options.show_header); | ||
| commands::delegate::execute(cwd, "dev", &args).await |
There was a problem hiding this comment.
Avoid resolving project Node just to show help
For global vp dev --help/vp build --help and the other delegated help paths, this now falls through to commands::delegate::execute, whose delegate_to_local_cli path resolves and may download the project runtime before the JS help can print. In a project pinned to a Node version that is unavailable or not yet downloaded, a help request can now fail or perform network/runtime setup even though the previous Rust help returned immediately; route help through a side-effect-free CLI-runtime path instead.
Useful? React with 👍 / 👎.
| rows: [ | ||
| { | ||
| label: '-f, --format <FORMAT>', | ||
| description: 'Bundle format: esm, cjs, iife, umd (default: esm)', |
There was a problem hiding this comment.
Include pack config-loader flags in help
vp pack --help now renders this static list instead of the real pack-bin.ts CLI help, but the list starts at -f, --format and omits the supported --config-loader <loader> and --no-config options defined immediately before it in packages/cli/src/pack-bin.ts. Users who need to change or disable pack config loading will no longer discover these valid flags from help output.
Useful? React with 👍 / 👎.
Close #1995
The global CLI currently renders help for commands implemented by the local CLI, so its documentation can drift from the installed local toolchain.
This PR moves prepared help for delegated commands into the local CLI and routes global, local, and task-script help through the same themed renderer. It also refreshes the documented options to match the current tools while omitting config-file flags that Vite+ does not expose in this workflow.
🤖 Generated with Codex