This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- **Added** `dependsOn` can now run the specified task in each direct workspace package listed in `dependencies`, `devDependencies`, or `peerDependencies`; for example, `{ "task": "build", "from": ["dependencies", "devDependencies"] }` runs `build` in each direct dependency and dev dependency ([#467](https://github.com/voidzero-dev/vite-task/pull/467), [#469](https://github.com/voidzero-dev/vite-task/pull/469)).
- **Added** First-party support for caching `vite build` with zero cache config, giving Vite projects correct cache hits out of the box ([vitejs/vite#22453](https://github.com/vitejs/vite/pull/22453)).
- **Added** [`@voidzero-dev/vite-task-client`](https://npmx.dev/package/@voidzero-dev/vite-task-client), allowing tools to report cache information to Vite Task at runtime so users do not need to configure it manually ([#441](https://github.com/voidzero-dev/vite-task/pull/441), [#454](https://github.com/voidzero-dev/vite-task/pull/454), [#449](https://github.com/voidzero-dev/vite-task/pull/449), [#450](https://github.com/voidzero-dev/vite-task/pull/450), [#458](https://github.com/voidzero-dev/vite-task/pull/458), [#431](https://github.com/voidzero-dev/vite-task/pull/431), [#459](https://github.com/voidzero-dev/vite-task/pull/459), [#472](https://github.com/voidzero-dev/vite-task/pull/472)).
- **Changed** Cached tasks now restore automatically tracked output files by default; use `output: []` to disable restoration ([#460](https://github.com/voidzero-dev/vite-task/pull/460), [#461](https://github.com/voidzero-dev/vite-task/pull/461)).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -7,14 +7,13 @@ How `vp run` decides which tasks to run and in what order.
When `vp` starts, it builds two data structures from the workspace:
1. **Package graph** — which packages depend on which. Built from `package.json` dependency fields.
2. **Task graph** — which tasks exist and their string-form `dependsOn` relationships. Built from `vite.config.*` and `package.json` scripts.
2. **Task graph** — which tasks exist and their explicit `dependsOn` relationships. Built from `vite.config.*` and `package.json` scripts.
Both are built once and reused for every query, including nested `vp run` calls inside task scripts.
### What goes into the task graph
The task graph contains a node for every task in every package. String-form
`dependsOn` declarations become edges in this graph:
The task graph contains a node for every task in every package, and edges only for explicit `dependsOn` declarations:
```jsonc
// packages/app/vite.config.*
Expand All
@@ -38,8 +37,6 @@ Task graph:
```
Package dependency ordering (app depends on lib) is NOT stored as edges in the task graph. Why not is explained below.
Object-form `dependsOn` entries are also not stored as global task graph edges;
they are kept on the declaring task and expanded for each query.
## What happens when you run a query
Expand Down
Expand Up
@@ -77,7 +74,7 @@ Given the package subgraph and a task name, we build the execution plan:
1. Find which selected packages have the requested task.
2. For packages that don't have it, reconnect their predecessors to their successors (skip-intermediate, explained below).
3. Map the remaining package nodes to task nodes — this gives us topological ordering.
4. Expand `dependsOn` from these tasks (may pull in tasks from outside the selected packages).
4. Follow explicit `dependsOn` edges outward from these tasks (may pull in tasks from outside the selected packages).
The result is the execution plan: which tasks to run and in what order.
Expand Down
Expand Up
@@ -172,11 +169,9 @@ The package subgraph is already a lightweight `DiGraphMap<PackageNodeIndex, ()>`
So we clone the `DiGraphMap` once and mutate the clone. We iterate the original (stable node order) while modifying the clone.
## `dependsOn` expansion
## Explicit dependency expansion
After mapping the package subgraph to tasks, we expand `dependsOn` entries.
String-form entries follow task graph edges and can pull in tasks from packages
outside the selected set.
After mapping the package subgraph to tasks, we follow explicit `dependsOn` edges from the task graph. This can pull in tasks from packages outside the selected set.
```jsonc
// packages/app/vite.config.*
Expand All
@@ -193,31 +188,7 @@ If you run `vp run --filter app build`, the package subgraph contains only `app`
This is intentional — `dependsOn` is an explicit declaration that a task can't run without its dependency. Ignoring it would break the build. (Users can skip this with `--ignore-depends-on`.)
Object-form entries select direct package dependencies from the declaring task:
For `app#test`, this runs `build` in direct workspace dependency packages selected
by the listed package.json fields. Packages without `build` are skipped. Supported
fields are `dependencies`, `devDependencies`, and `peerDependencies`.
Recursive expansion comes from dependency tasks declaring their own `dependsOn`
entries. For example, if `ui#build` also has `{ "task": "build", "from": "dependencies" }`,
then `tokens#build` is selected while expanding `ui#build`.
The expansion follows `dependsOn` entries, not every topological edge.
Topological ordering comes from the package subgraph — it's already baked into
the task execution graph by Stage 2.
The expansion only follows explicit edges, not topological ones. Topological ordering comes from the package subgraph — it's already baked into the task execution graph by Stage 2.
## Nested `vp run`
Expand All
@@ -242,7 +213,7 @@ The nested query produces its own execution subgraph, which gets embedded inside
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
revert: object-form dependsOn package selection (#467, #469) #478
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
revert: object-form dependsOn package selection (#467, #469) #478
Filter by extension
Only manifest files
Deleted files Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.