You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/depends-on.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Two equivalent styles are proposed.
33
33
34
34
### Style 1: CLI string syntax
35
35
36
-
Each `dependsOn` element is a string (or array of strings) written exactly as you would type CLI arguments to `vp run`:
36
+
Each `dependsOn` element is a string (existing syntax) or a string array written exactly as you would type CLI arguments to `vp run`:
37
37
38
38
```jsonc
39
39
{
@@ -45,25 +45,21 @@ Each `dependsOn` element is a string (or array of strings) written exactly as yo
45
45
"utils#build",
46
46
47
47
// Run `build` across all workspace packages
48
-
"--recursivebuild",
48
+
["--recursive", "build"],
49
49
50
50
// Run `build` in current package and its transitive dependencies
51
-
"--transitivebuild",
51
+
["--transitive", "build"],
52
52
53
53
// Run `build` in packages matching a filter
54
-
"--filter @myorg/core build",
55
-
"--filter @myorg/core... build", // @myorg/core and its deps
56
-
57
-
// Array form — each element is one CLI token
58
54
["--filter", "@myorg/core", "build"],
59
-
["--transitive", "build"],
55
+
["--filter", "@myorg/core...", "build"],// @myorg/core and its deps
60
56
],
61
57
},
62
58
},
63
59
}
64
60
```
65
61
66
-
The parser splits a string element on whitespace (like a shell would) and interprets the tokens as `vp run` arguments. The array form avoids splitting entirely — useful when a filter value contains whitespace or for explicitness.
62
+
Each element in the array is one CLI token, exactly as you would pass to `vp run`.
67
63
68
64
**Supported flags:**
69
65
@@ -128,3 +124,11 @@ The same validation rules from the CLI apply:
128
124
## Context: "Current Package"
129
125
130
126
When `--transitive` or a filter with traversal suffixes (e.g. `@myorg/core...`) resolves packages, "current package" means the package that owns the task containing this `dependsOn` entry — the same package that would be inferred from an unqualified `"build"` dependency today.
| Learning curve | None if you already know `vp run` — identical syntax | Minimal — same flag names, written as JSON keys |
133
+
| IDE autocompletion | Yes — TypeScript tuple types can constrain each array position | Yes — TypeScript object types can validate keys and suggest fields |
134
+
| Config consistency | Unusual — CLI syntax embedded in config arrays | Consistent — matches the object style used elsewhere in the config |
0 commit comments