Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/cli/bin/vpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env node

import module from 'node:module';
if (module.enableCompileCache) {
module.enableCompileCache();
}

process.argv.splice(2, 0, 'run');
await import('../dist/bin.js');
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"bin": {
"oxfmt": "./bin/oxfmt",
"oxlint": "./bin/oxlint",
"vp": "./bin/vp"
"vp": "./bin/vp",
"vpr": "./bin/vpr"
},
"files": [
"AGENTS.md",
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/snap-tests/command-vpr/args.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Print arguments passed to this script, one per line
for (const arg of process.argv.slice(2)) {
console.log(arg);
}
9 changes: 9 additions & 0 deletions packages/cli/snap-tests/command-vpr/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "command-vpr",
"version": "1.0.0",
"scripts": {
"hello": "node args.mjs hello from script",
"greet": "node args.mjs greet"
},
"packageManager": "pnpm@10.19.0"
}
57 changes: 57 additions & 0 deletions packages/cli/snap-tests/command-vpr/snap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
> vpr -h # should show vp run help
Run tasks

Usage: vp run [OPTIONS] [TASK_SPECIFIER] [ADDITIONAL_ARGS]...

Arguments:
[TASK_SPECIFIER] [ADDITIONAL_ARGS]...
Task to run, as `packageName#taskName` or just `taskName`.
Any arguments after the task name are forwarded to the task process.
Running `vp run` without a task name shows an interactive task selector.

Options:
-r, --recursive
Select all packages in the workspace
-t, --transitive
Select the current package and its transitive dependencies
-w, --workspace-root
Select the workspace root package
-F, --filter <FILTERS>
Match packages by name, directory, or glob pattern
--fail-if-no-match
Exit with a non-zero status if a `--filter` expression matches no packages
--ignore-depends-on
Do not run dependencies specified in `dependsOn` fields
-v, --verbose
Show full detailed summary after execution
--cache
Force caching on for all tasks and scripts
--no-cache
Force caching off for all tasks and scripts
--log <LOG>
How task output is displayed [default: interleaved] [possible values: interleaved, labeled, grouped]
--concurrency-limit <CONCURRENCY_LIMIT>
Maximum number of tasks to run concurrently. Defaults to 4
--parallel
Run tasks without dependency ordering. Sets concurrency to unlimited unless `--concurrency-limit` is also specified
--last-details
Display the detailed summary of the last run
-h, --help
Print help (see more with '--help')

> vpr hello # should run script via vpr shorthand
$ node args.mjs hello from script ⊘ cache disabled
hello
from
script


> vpr greet --arg1 value1 # should pass through additional args
$ node args.mjs greet --arg1 value1 ⊘ cache disabled
greet
--arg1
value1


[1]> vpr nonexistent # should show pnpm missing script error
Task "nonexistent" not found.
9 changes: 9 additions & 0 deletions packages/cli/snap-tests/command-vpr/steps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
Comment thread
fengmk2 marked this conversation as resolved.
"ignoredPlatforms": ["win32"],
"commands": [
"vpr -h # should show vp run help",
"vpr hello # should run script via vpr shorthand",
"vpr greet --arg1 value1 # should pass through additional args",
"vpr nonexistent # should show pnpm missing script error"
]
}
Loading