Skip to content

Commit e812aa6

Browse files
committed
fix!: update vp run argument order for flags-before-task breaking change
vite-task PR voidzero-dev/vite-task#286 and voidzero-dev/vite-task#290 changed trailing_var_arg to the command level, meaning flags like `-r` must now appear before the task name. Tokens after the task name are passed through verbatim to the task process. - `vp run -r test` (correct) — `-r` is the recursive flag - `vp run test -r` (broken) — `-r` is passed through to the task Add snap test `command-run-argument-order` verifying both behaviors. Update monorepo template, docs, and RFCs to use the new syntax.
1 parent 066fe5f commit e812aa6

File tree

11 files changed

+57
-12
lines changed

11 files changed

+57
-12
lines changed

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ vp test # Run Vitest (dedicated command)
1313
vp lint # Run oxlint (dedicated command)
1414

1515
# Run tasks across packages (explicit mode)
16-
vp run build -r # recursive with topological ordering
16+
vp run -r build # recursive with topological ordering
1717
vp run app#build web#build # specific packages
18-
vp run build -r --no-topological # recursive without implicit deps
18+
vp run -r --no-topological build # recursive without implicit deps
1919

2020
# Run task in current package (implicit mode - for non-built-in tasks)
2121
vp run dev # runs dev script from package.json

packages/cli/snap-tests-global/new-vite-monorepo/snap.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ vite.config.ts
1616
"private": true,
1717
"type": "module",
1818
"scripts": {
19-
"ready": "vp fmt && vp lint && vp run test -r && vp run build -r",
19+
"ready": "vp fmt && vp lint && vp run -r test && vp run -r build",
2020
"dev": "vp run website#dev",
2121
"prepare": "vp config"
2222
},
@@ -126,7 +126,7 @@ vite.config.ts
126126
"private": true,
127127
"type": "module",
128128
"scripts": {
129-
"ready": "vp fmt && vp lint && vp run test -r && vp run build -r",
129+
"ready": "vp fmt && vp lint && vp run -r test && vp run -r build",
130130
"dev": "vp run website#dev",
131131
"prepare": "vp config"
132132
},
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "run-argument-order",
3+
"workspaces": [
4+
"packages/*"
5+
]
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "app-a",
3+
"scripts": {
4+
"hello": "echo hello from app-a"
5+
},
6+
"dependencies": {
7+
"lib-b": "workspace:*"
8+
}
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "lib-b",
3+
"scripts": {
4+
"hello": "echo hello from lib-b"
5+
}
6+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
> vp run -r hello # new syntax: -r before task, runs recursively
2+
~/packages/lib-b$ echo hello from lib-b ⊘ cache disabled
3+
hello from lib-b
4+
5+
~/packages/app-a$ echo hello from app-a ⊘ cache disabled
6+
hello from app-a
7+
8+
---
9+
vp run: 0/2 cache hit (0%). (Run `vp run --last-details` for full details)
10+
11+
[1]> vp run hello -r # old syntax: -r after task, passed through as arg
12+
Task "hello" not found. Did you mean:
13+
app-a#hello: echo hello from app-a
14+
lib-b#hello: echo hello from lib-b
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"ignoredPlatforms": ["win32"],
3+
"env": {
4+
"VITE_DISABLE_AUTO_INSTALL": "1"
5+
},
6+
"commands": [
7+
"vp run -r hello # new syntax: -r before task, runs recursively",
8+
"vp run hello -r # old syntax: -r after task, passed through as arg"
9+
]
10+
}

packages/cli/templates/monorepo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ vp run ready
1313
- Run the tests:
1414

1515
```bash
16-
vp run test -r
16+
vp run -r test
1717
```
1818

1919
- Build the monorepo:
2020

2121
```bash
22-
vp run build -r
22+
vp run -r build
2323
```
2424

2525
- Run the development server:

packages/cli/templates/monorepo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010
"type": "module",
1111
"scripts": {
12-
"ready": "vp fmt && vp lint && vp run test -r && vp run build -r",
12+
"ready": "vp fmt && vp lint && vp run -r test && vp run -r build",
1313
"dev": "vp run website#dev"
1414
},
1515
"engines": {

rfcs/check-command.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Currently, running a full code quality check requires chaining multiple commands
1010

1111
```bash
1212
# From the monorepo template's "ready" script:
13-
vp fmt && vp lint --type-aware && vp run test -r && vp run build -r
13+
vp fmt && vp lint --type-aware && vp run -r test && vp run -r build
1414
```
1515

1616
Pain points:
@@ -221,7 +221,7 @@ Options:
221221
With `vp check`, the monorepo template's "ready" script simplifies to:
222222

223223
```json
224-
"ready": "vp check && vp run test -r && vp run build -r"
224+
"ready": "vp check && vp run -r test && vp run -r build"
225225
```
226226

227227
## Comparison with Other Tools

0 commit comments

Comments
 (0)