Skip to content

Commit ebc1d9d

Browse files
committed
1 parent 8579518 commit ebc1d9d

5 files changed

Lines changed: 230 additions & 136 deletions

File tree

Cargo.lock

Lines changed: 78 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ dunce = "1.0.5"
8585
fast-glob = "1.0.0"
8686
flate2 = { version = "=1.1.9", features = ["zlib-rs"] }
8787
form_urlencoded = "1.2.1"
88-
fspy = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "26c18922e8f3de1cf8a18597e5640f1c85662e45" }
88+
fspy = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "1ef4e2f6bd783472ffdaa1cae874d142e2f56322" }
8989
futures = "0.3.31"
9090
futures-util = "0.3.31"
9191
glob = "0.3.2"
@@ -186,15 +186,15 @@ vfs = "0.13.0"
186186
vite_command = { path = "crates/vite_command" }
187187
vite_error = { path = "crates/vite_error" }
188188
vite_js_runtime = { path = "crates/vite_js_runtime" }
189-
vite_glob = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "26c18922e8f3de1cf8a18597e5640f1c85662e45" }
189+
vite_glob = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "1ef4e2f6bd783472ffdaa1cae874d142e2f56322" }
190190
vite_install = { path = "crates/vite_install" }
191191
vite_migration = { path = "crates/vite_migration" }
192192
vite_shared = { path = "crates/vite_shared" }
193193
vite_static_config = { path = "crates/vite_static_config" }
194-
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "26c18922e8f3de1cf8a18597e5640f1c85662e45" }
195-
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "26c18922e8f3de1cf8a18597e5640f1c85662e45" }
196-
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "26c18922e8f3de1cf8a18597e5640f1c85662e45" }
197-
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "26c18922e8f3de1cf8a18597e5640f1c85662e45" }
194+
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "1ef4e2f6bd783472ffdaa1cae874d142e2f56322" }
195+
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "1ef4e2f6bd783472ffdaa1cae874d142e2f56322" }
196+
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "1ef4e2f6bd783472ffdaa1cae874d142e2f56322" }
197+
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "1ef4e2f6bd783472ffdaa1cae874d142e2f56322" }
198198
walkdir = "2.5.0"
199199
wax = "0.6.0"
200200
which = "8.0.0"

docs/config/run.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ A set of common environment variables are automatically passed through to all ta
171171

172172
### `input`
173173

174-
- **Type:** `Array<string | { auto: boolean }>`
174+
- **Type:** `Array<string | { auto: boolean } | { pattern: string, base: "workspace" | "package" }>`
175175
- **Default:** `[{ auto: true }]` (auto-inferred)
176176

177177
Vite Task automatically detects which files are used by a command (see [Automatic File Tracking](/guide/cache#automatic-file-tracking)). The `input` option can be used to explicitly include or exclude certain files.
@@ -199,6 +199,24 @@ tasks: {
199199
}
200200
```
201201

202+
**Resolve patterns relative to the workspace root** using the object form:
203+
204+
```ts
205+
tasks: {
206+
build: {
207+
command: 'vp build',
208+
input: [
209+
{ auto: true },
210+
{ pattern: 'shared-config/**', base: 'workspace' },
211+
],
212+
},
213+
}
214+
```
215+
216+
The `base` field controls how the glob pattern is resolved:
217+
- `"package"` (default): relative to the package directory
218+
- `"workspace"`: relative to the workspace root
219+
202220
**Disable file tracking** entirely and cache only on command/env changes:
203221

204222
```ts
@@ -211,7 +229,7 @@ tasks: {
211229
```
212230

213231
::: tip
214-
Glob patterns are resolved relative to the package directory, not the task's `cwd`.
232+
String glob patterns are resolved relative to the package directory by default. Use the object form with `base: "workspace"` to resolve relative to the workspace root.
215233
:::
216234

217235
### `cwd`

docs/guide/run.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,34 @@ Use `--last-details` to show the summary from the last run without running tasks
287287
vp run --last-details
288288
```
289289

290+
## Concurrency
291+
292+
By default, up to 4 tasks run at the same time. Use `--concurrency-limit` to change this:
293+
294+
```bash
295+
# Run up to 8 tasks at once
296+
vp run -r --concurrency-limit 8 build
297+
298+
# Run tasks one at a time
299+
vp run -r --concurrency-limit 1 build
300+
```
301+
302+
The limit can also be set via the `VP_RUN_CONCURRENCY_LIMIT` environment variable. The `--concurrency-limit` flag takes priority over the environment variable.
303+
304+
### Parallel Mode
305+
306+
Use `--parallel` to ignore task dependencies and run all tasks at once with unlimited concurrency:
307+
308+
```bash
309+
vp run -r --parallel lint
310+
```
311+
312+
This is useful when tasks are independent and you want maximum throughput. You can combine `--parallel` with `--concurrency-limit` to run tasks without dependency ordering but still cap the number of concurrent tasks:
313+
314+
```bash
315+
vp run -r --parallel --concurrency-limit 4 lint
316+
```
317+
290318
## Additional Arguments
291319

292320
Arguments after the task name are passed through to the task command:

0 commit comments

Comments
 (0)