Commit 09f1343
authored
feat(cache): add explicit inputs config for cache fingerprinting (#104)
## Summary
- Add `inputs` field to task configuration for explicit cache fingerprinting
- Support glob patterns, auto-inference from fspy, negative patterns, and mixed mode
- Expand trailing `/` in globs to `/**` (e.g., `"src/"` → `"src/**"`)
- Bare directory names (e.g., `"src"` without `/`) match nothing — only files are fingerprinted
- Remove `fstat` interception in fspy (fd was already tracked via `open`)
- Skip duplicate files across overlapping glob patterns via entry API
### Input modes
- Explicit globs: `inputs: ["src/**/*.ts"]`
- Auto-inference: `inputs: [{ "auto": true }]`
- Negative patterns: `inputs: ["src/**", "!**/*.test.ts"]`
- Directory shorthand: `inputs: ["src/"]` (expands to `"src/**"`)
- Mixed: `inputs: ["package.json", { "auto": true }, "!dist/**"]`
- Empty (no file tracking): `inputs: []`
## Test plan
- [x] Plan snapshot: `inputs-trailing-slash` verifies `src/` → `src/**` and `!dist/` → `dist/**`
- [x] E2E: all input combinations (positive, negative, auto, mixed, empty)
- [x] E2E: `folder-slash-input` — cache miss on direct and nested file changes, hit on outside
- [x] E2E: `folder-input` — bare directory name fingerprints nothing
- [x] E2E: glob meta chars in package paths (`packages/[lib]`)
- [x] E2E: cross-package `..` globs in subpackages
- [x] Unit tests: overlapping globs deduplicate, negative exclusions, sibling packages
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent 389ca7a commit 09f1343
171 files changed
Lines changed: 3686 additions & 320 deletions
File tree
- crates
- fspy_preload_unix/src/interceptions
- fspy/src
- unix
- windows
- vite_glob
- src
- vite_path
- src
- absolute
- vite_task_bin
- src
- tests/e2e_snapshots
- fixtures
- cache-miss-reasons
- snapshots
- glob-base-test
- other
- packages/sub-pkg
- other
- src
- snapshots
- src
- inputs-cache-test
- dist
- snapshots
- src
- sub
- test
- inputs-glob-meta-in-path
- packages/[lib]
- src
- snapshots
- inputs-negative-glob-subpackage
- packages
- sub-pkg
- dist
- src
- snapshots
- vite_task_graph
- src
- config
- vite_task_plan
- src
- tests/plan_snapshots
- fixtures
- additional-envs/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
- filter-workspace/snapshots
- fingerprint-ignore-test/snapshots
- inputs-trailing-slash
- snapshots
- nested-cache-override/snapshots
- nested-tasks/snapshots
- pnpm-workspace-packages-optional/snapshots
- recursive-topological-workspace/snapshots
- shell-fallback/snapshots
- synthetic-cache-disabled/snapshots
- synthetic-in-subpackage/snapshots
- transitive-skip-intermediate/snapshots
- vpr-shorthand/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
- vite_workspace
- src
- docs
- packages/tools/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
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 | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
| |||
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 30 | | |
44 | 31 | | |
45 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
203 | 221 | | |
204 | 222 | | |
205 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
65 | 87 | | |
66 | 88 | | |
67 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
0 commit comments