feat(cli): add format alias for vp fmt#1727
Merged
Merged
Conversation
`vp format` previously failed to parse and suggested an unrelated command. Add `visible_alias = "format"` to the `Fmt` subcommand in both the global CLI parser and the local NAPI binding so `format` resolves to `fmt`. Also normalize `format` to `fmt` in init-config handling so `vp format --init` / `vp format --migrate` get the same vite.config.ts wiring as `vp fmt`, not just the underlying oxfmt run. Closes voidzero-dev#1721
✅ Deploy Preview for viteplus-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
jong-kyung
approved these changes
Jun 1, 2026
Collaborator
jong-kyung
left a comment
There was a problem hiding this comment.
LGTM. Since top-level help is custom-rendered, could we also show the alias there, e.g. fmt, format?
Top-level `vp --help` is custom-rendered, so the clap visible_alias does not surface there. List it as `fmt, format` to match the existing alias style (e.g. `info, view, show`), per review feedback.
Contributor
Author
|
@jong-kyung |
Collaborator
|
@semimikoh Thanks! Could we also update |
The local NAPI binding renders its own `vp --help`, so the alias must be added there too. Show it as `fmt, format` to match the top-level help and the existing alias style, per review feedback. Regenerated the local snapshots accordingly.
Contributor
Author
|
@jong-kyung |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1721.
Running
vp format(a common slip forvp fmt) previously failed to parse and clap suggested an unrelated command. This addsformatas a visible alias offmt.Changes
visible_alias = "format"to theFmtsubcommand in:crates/vite_global_cli/src/cli.rs(globalvpbinary parser)packages/cli/binding/src/cli/types.rs(local NAPI binding parser)format→fmtininit-config.tsso thatvp format --initandvp format --migrateapply the samevite.config.tsintegration asvp fmt(without it, only the underlying oxfmt run happened and the config wiring was silently skipped).formatas an init alias.Validation
vp format --help→ resolves tovp fmt(no more "did you mean" suggestion), verified on both the global binary and the local CLI afterpnpm bootstrap-cli.vp test run init-config→ 9 passed (incl. the newformatalias case).snap-test-global/snap-test-localforcli-helper-messageandcommand-vp-alias: no snapshot diffs (help output is custom-rendered, so the alias doesn't alter--helptext).