Commit 630722f
authored
feat(cache): add output globs for cache restoration (#375)
## Summary
Adds an `output` field to cached tasks: archives files matching the configured globs after a successful run and restores them on cache hit.
- Omitted or `[]`: no output archiving (matches existing behavior)
- `["dist/**"]`: archive matching files; restore on cache hit
- `[{"pattern": "...", "base": "workspace" | "package"}]`: explicit base directory
- `["!dist/cache/**"]`: negative patterns exclude files
- This PR does **not** support `{auto: true}` — that comes in the follow-up #321
Schema bumped to v12 (`CacheEntryKey` carries `output_config`, `CacheEntryValue` carries `output_archive`). Old caches reset on upgrade.
## Test plan
- [ ] CI green
- [ ] New e2e fixture `output_cache_test/` covers archive+restore and negative-pattern exclusion
- [ ] All 87 plan snapshots updated to include the new `output_config` field (default empty)
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent 868fdb1 commit 630722f
100 files changed
Lines changed: 1859 additions & 131 deletions
File tree
- crates
- vite_task_bin
- src
- vtt
- tests/e2e_snapshots
- fixtures/output_cache_test
- snapshots
- src
- vite_task_graph
- src/config
- vite_task_plan
- src
- tests/plan_snapshots/fixtures
- additional_env/snapshots
- cache_cli_override/snapshots
- cache_keys/snapshots
- cache_scripts_default/snapshots
- cache_scripts_enabled/snapshots
- cache_scripts_task_override/snapshots
- cache_sharing/snapshots
- cache_subcommand/snapshots
- cache_tasks_disabled/snapshots
- cache_true_no_force_enable/snapshots
- cd_in_scripts/snapshots
- comprehensive_task_graph/snapshots
- conflict_test/snapshots
- cycle_dependency/snapshots
- dependency_both_topo_and_explicit/snapshots
- duplicate_package_names/snapshots
- empty_package_test/snapshots
- explicit_deps_workspace/snapshots
- extra_args_not_forwarded_to_depends_on/snapshots
- filter_workspace/snapshots
- input_trailing_slash/snapshots
- input_workspace_base/snapshots
- nested_cache_override/snapshots
- nested_tasks/snapshots
- package_self_dependency/snapshots
- parallel_and_concurrency/snapshots
- pnpm_workspace_packages_optional/snapshots
- recursive_topological_workspace/snapshots
- script_hooks_disabled/snapshots
- script_hooks_nested_run/snapshots
- script_hooks_task_no_hook/snapshots
- script_hooks/snapshots
- shell_fallback/snapshots
- synthetic_cache_disabled/snapshots
- synthetic_in_subpackage/snapshots
- transitive_skip_intermediate/snapshots
- vpr_shorthand/snapshots
- windows_cmd_shim_rewrite/snapshots
- workspace_root_cd_no_skip/snapshots
- workspace_root_depends_on_passthrough/snapshots
- workspace_root_multi_command/snapshots
- workspace_root_mutual_recursion/snapshots
- workspace_root_no_package_json/snapshots
- workspace_root_self_reference/snapshots
- vite_task
- src/session
- cache
- execute
- reporter
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
| |||
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
106 | 115 | | |
107 | 116 | | |
108 | 117 | | |
| |||
142 | 151 | | |
143 | 152 | | |
144 | 153 | | |
| 154 | + | |
| 155 | + | |
145 | 156 | | |
146 | 157 | | |
147 | 158 | | |
| |||
158 | 169 | | |
159 | 170 | | |
160 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
161 | 175 | | |
162 | 176 | | |
163 | 177 | | |
| |||
201 | 215 | | |
202 | 216 | | |
203 | 217 | | |
204 | | - | |
| 218 | + | |
205 | 219 | | |
206 | | - | |
| 220 | + | |
207 | 221 | | |
208 | 222 | | |
209 | 223 | | |
210 | 224 | | |
211 | 225 | | |
212 | | - | |
213 | | - | |
| 226 | + | |
| 227 | + | |
214 | 228 | | |
215 | 229 | | |
216 | 230 | | |
| |||
269 | 283 | | |
270 | 284 | | |
271 | 285 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
279 | 296 | | |
280 | 297 | | |
281 | 298 | | |
282 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
283 | 305 | | |
284 | 306 | | |
285 | 307 | | |
| |||
288 | 310 | | |
289 | 311 | | |
290 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
291 | 317 | | |
292 | 318 | | |
293 | 319 | | |
294 | 320 | | |
295 | 321 | | |
| 322 | + | |
296 | 323 | | |
297 | 324 | | |
298 | 325 | | |
299 | 326 | | |
300 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
301 | 340 | | |
302 | 341 | | |
303 | 342 | | |
| |||
0 commit comments