Skip to content

feat(cli): add top-level rebuild alias#1383

Open
Han5991 wants to merge 6 commits intovoidzero-dev:mainfrom
Han5991:issue-1057-top-level-rebuild
Open

feat(cli): add top-level rebuild alias#1383
Han5991 wants to merge 6 commits intovoidzero-dev:mainfrom
Han5991:issue-1057-top-level-rebuild

Conversation

@Han5991
Copy link
Copy Markdown

@Han5991 Han5991 commented Apr 14, 2026

Summary

  • add a top-level vp rebuild alias that normalizes to vp pm rebuild
  • add normalization tests for bare and passthrough rebuild invocations

Why

  • issue feat: support rebuild command #1057 asks for a top-level rebuild command
  • the underlying package-manager implementation already exists under vp pm rebuild, so this change exposes it without duplicating logic

Closes #1057

Validation

  • cargo test -p vite_global_cli

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit f295193
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69dfa56fd494030008e07337

@Han5991 Han5991 marked this pull request as ready for review April 14, 2026 15:49
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 15, 2026

@Han5991 Thank you very much for your contribution. Could you please add the corresponding user documentation?

Han5991 and others added 2 commits April 15, 2026 11:59
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Han5991
Copy link
Copy Markdown
Author

Han5991 commented Apr 15, 2026

@Han5991 Thank you very much for your contribution. Could you please add the corresponding user documentation?

Thank you for leaving a comment! Could you please review it again?

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 15, 2026

@codex review

Copy link
Copy Markdown

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

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: f8a102930b

ℹ️ 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 on lines +55 to +59
Some("rebuild") => {
let mut normalized = Vec::with_capacity(args.len() + 1);
normalized.push(args[0].clone());
normalized.push("pm".to_string());
normalized.push("rebuild".to_string());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize help rebuild through pm alias

Adding a direct rebuild rewrite here makes vp rebuild --help work, but vp help rebuild still fails because help normalization (vp [command] --help) happens in a separate branch and normalization is only applied once. In that flow, the args become vp rebuild --help and then go straight to clap parsing, where rebuild is not a real top-level subcommand, so users get an unknown-command error instead of help for the newly added alias.

Useful? React with 👍 / 👎.

- Refactor `normalize_args` to run in a loop, allowing multiple normalizations to be applied sequentially.
- This fixes issues where commands like `vp help rebuild` or `vp help node` were not fully normalized to their target commands.
- Update global CLI snapshot tests to reflect the new `rebuild` top-level command in help output.
@Han5991
Copy link
Copy Markdown
Author

Han5991 commented Apr 15, 2026

@fengmk2 I have finished fixing the broken CI. Could you please review it one more time and return the CI?

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 15, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

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

@Han5991
Copy link
Copy Markdown
Author

Han5991 commented Apr 15, 2026

@fengmk2 Requesting a CI re-run. The snapshot diff was hard to catch locally — it's now been committed.

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.

feat: support rebuild command

2 participants