Skip to content

Commit b95ec46

Browse files
branchseerclaude
andauthored
chore: rename CLI command from vite to vp (#145)
Rename the user-facing CLI binary and all command references from `vite` to `vp`. Internal crate names, `vite-task.json` config, `VITE_*` env vars, and `vpr` shorthand are unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6e3aa68 commit b95ec46

File tree

112 files changed

+620
-338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+620
-338
lines changed

CLAUDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ Test fixtures and snapshots:
4040

4141
```bash
4242
# Run a task defined in vite-task.json
43-
vite run <task> # run task in current package
44-
vite run <package>#<task> # run task in specific package
45-
vite run <task> -r # run task in all packages (recursive)
46-
vite run <task> -t # run task in current package + transitive deps
47-
vite run <task> --extra --args # pass extra args to the task command
43+
vp run <task> # run task in current package
44+
vp run <package>#<task> # run task in specific package
45+
vp run <task> -r # run task in all packages (recursive)
46+
vp run <task> -t # run task in current package + transitive deps
47+
vp run <task> --extra --args # pass extra args to the task command
4848

4949
# Built-in commands (run tools from node_modules/.bin)
50-
vite test [args...] # run vitest
51-
vite lint [args...] # run oxlint
50+
vp test [args...] # run vitest
51+
vp lint [args...] # run oxlint
5252

5353
# Flags
5454
-r, --recursive # run across all packages
@@ -59,7 +59,7 @@ vite lint [args...] # run oxlint
5959
## Key Architecture
6060

6161
- **vite_task** - Main task runner with caching and session management
62-
- **vite_task_bin** - CLI binary (`vite` command) and task synthesizer
62+
- **vite_task_bin** - CLI binary (`vp` command) and task synthesizer
6363
- **vite_task_graph** - Task dependency graph construction and config loading
6464
- **vite_task_plan** - Execution planning (resolves env vars, working dirs, commands)
6565
- **vite_workspace** - Workspace detection and package dependency graph

crates/vite_task/docs/boolean-flags.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The positive and negative forms of a flag are mutually exclusive. You cannot use
3535

3636
```bash
3737
# This will result in an error
38-
vite run --recursive --no-recursive build
38+
vp run --recursive --no-recursive build
3939
```
4040

4141
### Precedence
@@ -44,7 +44,7 @@ When only the negative form is used, it takes precedence and explicitly sets the
4444

4545
```bash
4646
# Explicitly disable topological ordering
47-
vite run build -r --no-topological
47+
vp run build -r --no-topological
4848
```
4949

5050
### Default Values
@@ -54,23 +54,23 @@ The negative flags are particularly useful for overriding default behaviors:
5454
- `--recursive` with `--no-topological`: By default, recursive runs enable topological ordering. Use `--no-topological` to disable it:
5555
```bash
5656
# Recursive run WITHOUT topological ordering
57-
vite run build -r --no-topological
57+
vp run build -r --no-topological
5858
```
5959

6060
## Examples
6161

6262
```bash
6363
# Run with debugging disabled (useful if debug is enabled by default in config)
64-
vite --no-debug build
64+
vp --no-debug build
6565

6666
# Recursive build without topological ordering
67-
vite run build --recursive --no-topological
67+
vp run build --recursive --no-topological
6868

6969
# Explicitly disable parallel execution
70-
vite run build --no-parallel
70+
vp run build --no-parallel
7171

7272
# Run tests sequentially, not in parallel
73-
vite run test --no-parallel
73+
vp run test --no-parallel
7474
```
7575

7676
## Implementation Details

crates/vite_task/docs/task-cache.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ For tasks defined as below:
2929

3030
the task cache system is able to hit the same cache for `test` task and for the first subcommand in `build` task:
3131

32-
1. user runs `vite run build` -> no cache hit. run `echo $foo` and create cache
33-
2. user runs `vite run test`
32+
1. user runs `vp run build` -> no cache hit. run `echo $foo` and create cache
33+
2. user runs `vp run test`
3434
1. `echo $foo` -> **hit cache created in step 1 and replay**
3535
2. `echo $bar` -> no cache hit. run `echo test` and create cache
3636
3. user changes env `$foo`
37-
4. user runs `vite run test`
37+
4. user runs `vp run test`
3838
1. `echo $foo`
3939
1. the cache system should be able to **locate the cache that was created in step 1 and hit in step 2.1**
4040
2. compare the command fingerprint and report cache miss because `$foo` is changed.
4141
3. re-run and replace the cache with a new one.
4242
2. `echo $bar` -> hit cache created in step 2.2 and replay
43-
5. user runs `vite run build`: **hit the cache created in step 4.1.3 and replay**.
43+
5. user runs `vp run build`: **hit the cache created in step 4.1.3 and replay**.
4444

4545
## Architecture
4646

@@ -498,10 +498,10 @@ The cache location can be configured via environment variable:
498498

499499
```bash
500500
# Custom cache location
501-
VITE_CACHE_PATH=/tmp/vite-cache vite run build
501+
VITE_CACHE_PATH=/tmp/vite-cache vp run build
502502

503503
# Default: node_modules/.vite/task-cache in workspace root
504-
vite run build
504+
vp run build
505505
```
506506

507507
### Task-Level Cache Control
@@ -614,7 +614,7 @@ CommandFingerprint {
614614
### Example: Synthetic Task Cache Key
615615

616616
```rust
617-
// Synthetic task (e.g., "vite lint" in a task script)
617+
// Synthetic task (e.g., "vp lint" in a task script)
618618
TaskRunKey {
619619
task_id: TaskId {
620620
task_group_id: TaskGroupId {
@@ -645,10 +645,10 @@ CommandFingerprint {
645645

646646
```bash
647647
# Enable debug logging
648-
VITE_LOG=debug vite run build
648+
VITE_LOG=debug vp run build
649649

650650
# Show cache operations
651-
VITE_LOG=trace vite run build
651+
VITE_LOG=trace vp run build
652652
```
653653

654654
### Debug Output Examples
@@ -718,8 +718,8 @@ Tasks with identical commands automatically share cache entries:
718718

719719
Behavior:
720720

721-
1. `vite run script1` creates command cache for `cat foo.txt`
722-
2. `vite run script2` hits the same command cache (shared)
721+
1. `vp run script1` creates command cache for `cat foo.txt`
722+
2. `vp run script2` hits the same command cache (shared)
723723
3. If `foo.txt` changes, both tasks will see cache miss on next run
724724
4. Cache update from either task benefits the other
725725

@@ -729,8 +729,8 @@ Tasks with different arguments get separate cache entries:
729729

730730
```bash
731731
# These create separate caches
732-
vite run echo -- a # TaskRunKey with args: ["a"]
733-
vite run echo -- b # TaskRunKey with args: ["b"]
732+
vp run echo -- a # TaskRunKey with args: ["a"]
733+
vp run echo -- b # TaskRunKey with args: ["b"]
734734
```
735735

736736
### 4. Compound Commands for Granular Caching
@@ -787,23 +787,23 @@ No need to manually specify inputs - fspy captures actual dependencies.
787787

788788
```bash
789789
# Initial run creates command cache
790-
> vite run script1
790+
> vp run script1
791791
Cache not found
792792
bar
793793

794794
# Different task, same command - hits shared cache
795-
> vite run script2
795+
> vp run script2
796796
Cache hit, replaying
797797
bar
798798

799799
# File change invalidates shared cache
800800
> echo baz > foo.txt
801-
> vite run script2
801+
> vp run script2
802802
Cache miss: foo.txt content changed
803803
baz
804804

805805
# Original task benefits from updated cache
806-
> vite run script1
806+
> vp run script1
807807
Cache hit, replaying
808808
baz
809809
```
@@ -812,20 +812,20 @@ baz
812812

813813
```bash
814814
# Different args create separate caches
815-
> vite run echo -- a
815+
> vp run echo -- a
816816
Cache not found
817817
a
818818

819-
> vite run echo -- b
819+
> vp run echo -- b
820820
Cache not found
821821
b
822822

823823
# Each argument combination has its own cache
824-
> vite run echo -- a
824+
> vp run echo -- a
825825
Cache hit, replaying
826826
a
827827

828-
> vite run echo -- b
828+
> vp run echo -- b
829829
Cache hit, replaying
830830
b
831831
```
@@ -834,16 +834,16 @@ b
834834

835835
```bash
836836
# Different directories create separate caches for tasks
837-
> cd folder1 && vite run lint
837+
> cd folder1 && vp run lint
838838
Cache not found
839839
Found 0 warnings and 0 errors.
840840

841-
> cd folder2 && vite run lint
841+
> cd folder2 && vp run lint
842842
Cache not found # Different cwd = different cache
843843
Found 0 warnings and 0 errors.
844844

845845
# Each directory maintains its own cache
846-
> cd folder1 && vite run lint
846+
> cd folder1 && vp run lint
847847
Cache hit, replaying
848848
Found 0 warnings and 0 errors.
849849
```

crates/vite_task/docs/terminologies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ The two task groups generates 3 tasks:
3131

3232
These are **task names**. They are for displaying and filtering.
3333

34-
The user could execute `vite run build` under the `app` package, or execute `vite run app#build` from anywhere. The parameter `build` and `app#build` after `vite run` are **task requests**. They are used to match against task names to determine what tasks to run.
34+
The user could execute `vp run build` under the `app` package, or execute `vp run app#build` from anywhere. The parameter `build` and `app#build` after `vp run` are **task requests**. They are used to match against task names to determine what tasks to run.

crates/vite_task/docs/vite-run.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# `vite-plus run`
1+
# `vp run`
22

33
Vite-plus run has two modes:
44

5-
1. Implicit mode is running `vite-plus` without `run` command, it will run the task in the current package, it supposed to replace the `pnpm/yarn run` command.
6-
2. Explicit mode is running `vite-plus run` with run command, like `vite-plus run vite-plus#build`.
5+
1. Implicit mode is running `vp` without `run` command, it will run the task in the current package, it supposed to replace the `pnpm/yarn run` command.
6+
2. Explicit mode is running `vp run` with run command, like `vp run vite-plus#build`.
77

88
## Implicit mode
99

@@ -15,7 +15,7 @@ Vite-plus run has two modes:
1515
>
1616
> This documentation describes the current behavior and should be updated when the Implicit Mode RFC is done.
1717
18-
With implicit mode, `vite` will run the task in the current package. It can't accept more than on task. The first argument will be treated as the task name; the args following the command will be treated as the task args and bypass to the task.
18+
With implicit mode, `vp` will run the task in the current package. It can't accept more than on task. The first argument will be treated as the task name; the args following the command will be treated as the task args and bypass to the task.
1919

2020
Given the following `package.json` file:
2121

@@ -31,54 +31,54 @@ Given the following `package.json` file:
3131
This command equivalent to `vite build`:
3232

3333
```bash
34-
vite-plus build
34+
vp build
3535
```
3636

3737
This command equivalent to `vite build --mode production`:
3838

3939
```bash
40-
vite-plus build --mode production
40+
vp build --mode production
4141
```
4242

4343
This command equivalent to `oxlint packages/cli/binding/index.js`:
4444

4545
```bash
46-
vite-plus lint packages/cli/binding/index.js
46+
vp lint packages/cli/binding/index.js
4747
```
4848

4949
If the command contains `#`, the command will be treated as a task in the workspace subpackage.
5050

51-
This command equivalent to `vite-plus run cli#build`:
51+
This command equivalent to `vp run cli#build`:
5252

5353
```bash
54-
vite-plus cli#build
54+
vp cli#build
5555
```
5656

5757
## Explicit mode
5858

59-
With explicit mode, `vite-plus run` will run the task in the workspace subpackage. It can accept more than one task. The arguments will be treated as the task names; the args following the `--` will be treated as the task args and bypass to the task.
59+
With explicit mode, `vp run` will run the task in the workspace subpackage. It can accept more than one task. The arguments will be treated as the task names; the args following the `--` will be treated as the task args and bypass to the task.
6060

6161
### Default behavior
6262

63-
The `vite-plus run` command will run the scoped tasks in dependency order.
63+
The `vp run` command will run the scoped tasks in dependency order.
6464

6565
Task names without `#` will be resolved in the current package (the package containing the nearest package.json file from the current working directory). For example:
6666

67-
- `vite-plus run build` - runs the build task in the current package
68-
- `vite-plus run test lint` - Throw `OnlyOneTaskRequest` error
69-
- `vite-plus run @other/package#build` - runs the build task in @other/package
67+
- `vp run build` - runs the build task in the current package
68+
- `vp run test lint` - Throw `OnlyOneTaskRequest` error
69+
- `vp run @other/package#build` - runs the build task in @other/package
7070

7171
Behaviors when the package root and/or the workspace root is not found:
7272

73-
| package root | workspace root | behaviour |
74-
| ------------ | -------------- | --------------------------------------------------------------------------------------------------------------------------- |
75-
| found | not found | No possible: workspace root always fallbacks to package root. |
76-
| not found | found | `vite-plus run build` should throw an `CurrentPackageNotFound` error. `vite-plus run @other/package#build` is still allowed |
77-
| not found | not found | Throw an error on any `vite run`. The workspace root must always exist as it's where we store the cache. |
73+
| package root | workspace root | behaviour |
74+
| ------------ | -------------- | ------------------------------------------------------------------------------------------------------------- |
75+
| found | not found | No possible: workspace root always fallbacks to package root. |
76+
| not found | found | `vp run build` should throw an `CurrentPackageNotFound` error. `vp run @other/package#build` is still allowed |
77+
| not found | not found | Throw an error on any `vp run`. The workspace root must always exist as it's where we store the cache. |
7878

7979
### `--recursive,-r`
8080

81-
With the `--recursive,-r` flag, the `vite-plus run` command will run the tasks in all monorepo packages.
81+
With the `--recursive,-r` flag, the `vp run` command will run the tasks in all monorepo packages.
8282

8383
The task name should't contain `#` with the `--recursive,-r` flag. If any task name contains `#`, it would cause an `RecursiveRunWithScope` error.
8484

@@ -98,16 +98,16 @@ Examples:
9898

9999
```bash
100100
# Recursive build with topological ordering (default)
101-
vite-plus run build -r
101+
vp run build -r
102102

103103
# Recursive build WITHOUT topological ordering
104-
vite-plus run build -r --no-topological
104+
vp run build -r --no-topological
105105

106106
# Single package with topological ordering enabled
107-
vite-plus run app#build -t
107+
vp run app#build -t
108108

109109
# Multiple packages without topological ordering (default)
110-
vite-plus run app#build web#build
110+
vp run app#build web#build
111111
```
112112

113113
Note: `--topological` and `--no-topological` are mutually exclusive and cannot be used together. See [boolean-flags.md](./boolean-flags.md) for more information about boolean flag patterns.
@@ -172,7 +172,7 @@ Task Dependencies (explicit):
172172
utils#build → utils#test
173173
```
174174

175-
The execution flow for `vite-plus run build -r --topological`:
175+
The execution flow for `vp run build -r --topological`:
176176

177177
```
178178
┌─────────────────────────────────────────────────────────────┐
@@ -342,12 +342,12 @@ The final step creates an execution plan:
342342

343343
Task requests are in form of `task_name` or `pkg#task_name`. They occur in two places:
344344

345-
- one or multiple parameters following after `vite run`.
345+
- one or multiple parameters following after `vp run`.
346346
- items in `dependsOn`.
347347

348348
How task requests work:
349349

350-
- `build` in `vite run build` matches task `build` in the current package determined by cwd.
350+
- `build` in `vp run build` matches task `build` in the current package determined by cwd.
351351
- `build` in `dependsOn: ["build"]` matches task `build` in the package where the config file is.
352352
- `app#build` matches task `build` in package `app`.
353353
- `app#build` raises an error if there are multiple packages named `app`.
@@ -357,4 +357,4 @@ How task requests work:
357357
- `#build` raises an error if there are multiple nameless packages.
358358
- `build` does not match task `build` in the nameless package.
359359

360-
While task requests with multiple `#` are invalid, packages with `#` in their names are valid. For example, a package named `pkg#special` can have a task named `build`. It can be referenced by executing `vite run build` under the folder of package `pkg#special`.
360+
While task requests with multiple `#` are invalid, packages with `#` in their names are valid. For example, a package named `pkg#special` can have a task named `build`. It can be referenced by executing `vp run build` under the folder of package `pkg#special`.

0 commit comments

Comments
 (0)