Skip to content

Commit 38a6ead

Browse files
committed
fix: polish remaining vitevp branding in local CLI output
- Rename usage line from `vite` to `vp` in help output - Rename pack CLI name from `vite pack` to `vp pack` - Rename migration message from `vite install` to `vp install` - Show branded help on `vp` with no arguments (same as `vp -h`) - Rename `Vite+ Commands` to `Core Commands` - Align command order and descriptions with global vp binary - Update RFC with Phase 3.3 documenting these changes
1 parent ba04257 commit 38a6ead

7 files changed

Lines changed: 35 additions & 28 deletions

File tree

packages/cli/binding/src/cli.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -843,10 +843,7 @@ fn normalize_help_args(args: Vec<String>) -> Vec<String> {
843843
}
844844

845845
fn should_print_help(args: &[String]) -> bool {
846-
matches!(
847-
args,
848-
[arg] if arg == "-h" || arg == "--help"
849-
)
846+
args.is_empty() || matches!(args, [arg] if arg == "-h" || arg == "--help")
850847
}
851848

852849
fn print_help() {
@@ -857,21 +854,21 @@ fn print_help() {
857854
println!(
858855
"Vite+/{version}
859856
860-
{bold_underline}Usage:{reset} {bold}vite{reset} <COMMAND>
857+
{bold_underline}Usage:{reset} {bold}vp{reset} <COMMAND>
861858
862-
{bold_underline}Vite+ Commands:{reset}
859+
{bold_underline}Core Commands:{reset}
863860
{bold}dev{reset} Run the development server
864861
{bold}build{reset} Build for production
865-
{bold}preview{reset} Preview production build
866-
{bold}lint{reset} Lint code
867862
{bold}test{reset} Run tests
863+
{bold}lint{reset} Lint code
868864
{bold}fmt{reset} Format code
869865
{bold}pack{reset} Build library
870866
{bold}run{reset} Run tasks
867+
{bold}preview{reset} Preview production build
871868
{bold}cache{reset} Manage the task cache
872869
873870
{bold_underline}Package Manager Commands:{reset}
874-
{bold}install{reset} Install all dependencies
871+
{bold}install{reset} Install all dependencies, or add packages if package names are provided
875872
876873
Options:
877874
-h, --help Print help"

packages/cli/snap-tests/command-helper/snap.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
> vp -h # help message
22
Vite+/<semver>
33

4-
Usage: vite <COMMAND>
4+
Usage: vp <COMMAND>
55

6-
Vite+ Commands:
6+
Core Commands:
77
dev Run the development server
88
build Build for production
9-
preview Preview production build
10-
lint Lint code
119
test Run tests
10+
lint Lint code
1211
fmt Format code
1312
pack Build library
1413
run Run tasks
14+
preview Preview production build
1515
cache Manage the task cache
1616

1717
Package Manager Commands:
18-
install Install all dependencies
18+
install Install all dependencies, or add packages if package names are provided
1919

2020
Options:
2121
-h, --help Print help
2222

2323
> vp pack -h # pack help message
24-
vite pack
24+
vp pack
2525

2626
Usage:
27-
$ vite pack [...files]
27+
$ vp pack [...files]
2828

2929
Commands:
3030
[...files] Bundle files
3131

3232
For more info, run any command with the `--help` flag:
33-
$ vite pack --help
33+
$ vp pack --help
3434

3535
Options:
3636
--config-loader <loader> Config loader to use: auto, native, unrun (default: auto)

packages/cli/snap-tests/command-pack/snap.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
> vp pack -h # should print the help message
2-
vite pack
2+
vp pack
33

44
Usage:
5-
$ vite pack [...files]
5+
$ vp pack [...files]
66

77
Commands:
88
[...files] Bundle files
99

1010
For more info, run any command with the `--help` flag:
11-
$ vite pack --help
11+
$ vp pack --help
1212

1313
Options:
1414
--config-loader <loader> Config loader to use: auto, native, unrun (default: auto)

packages/cli/snap-tests/command-vp-alias/snap.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
> vp -h # vp should show help same as vite
22
Vite+/<semver>
33

4-
Usage: vite <COMMAND>
4+
Usage: vp <COMMAND>
55

6-
Vite+ Commands:
6+
Core Commands:
77
dev Run the development server
88
build Build for production
9-
preview Preview production build
10-
lint Lint code
119
test Run tests
10+
lint Lint code
1211
fmt Format code
1312
pack Build library
1413
run Run tasks
14+
preview Preview production build
1515
cache Manage the task cache
1616

1717
Package Manager Commands:
18-
install Install all dependencies
18+
install Install all dependencies, or add packages if package names are provided
1919

2020
Options:
2121
-h, --help Print help

packages/cli/src/migration/bin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async function main() {
123123
[
124124
styleText('bold', 'Migration plan:'),
125125
'- Inspect workspace and package manager',
126-
`- Run ${accent('vite install')} to prepare dependencies`,
126+
`- Run ${accent('vp install')} to prepare dependencies`,
127127
'- Rewrite configs and dependencies for Vite+',
128128
].join('\n'),
129129
);

packages/cli/src/pack-bin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '@voidzero-dev/vite-plus-core/pack';
1313
import { cac } from 'cac';
1414

15-
const cli = cac('vite pack');
15+
const cli = cac('vp pack');
1616
cli.help();
1717

1818
// support `TSDOWN_` for migration compatibility

rfcs/cli-output-polish.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,17 @@ After `bundleVitest()` copies vitest files to `dist/`, a `brandVitest()` step pa
311311

312312
The Rust NAPI binding injects `VITE_PLUS_VERSION` env var (same mechanism used for rolldown-vite build/dev/preview commands), so `vp test -h` shows `vp test/<vite-plus-version>`.
313313

314-
#### 3.2 Future: oxlint, oxfmt
314+
#### 3.3 Remaining `vite``vp` branding in CLI output
315+
316+
Several user-visible strings still show `vite` instead of `vp`:
317+
318+
1. **Local CLI help usage line** (`packages/cli/binding/src/cli.rs`): `Usage: vite <COMMAND>``Usage: vp <COMMAND>`
319+
2. **Pack CLI cac name** (`packages/cli/src/pack-bin.ts`): `cac('vite pack')``cac('vp pack')`
320+
3. **Migration message** (`packages/cli/src/migration/bin.ts`): `vite install``vp install`
321+
322+
These are straightforward string replacements in the source, verified by snap test updates.
323+
324+
#### 3.4 Future: oxlint, oxfmt
315325

316326
For oxlint and oxfmt, pre-spawn banners or build-time patching can follow the same pattern once their source/dist is bundled.
317327

0 commit comments

Comments
 (0)