From 2089136c90506f738844a5ce9c57ee562686e38f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Mar 2026 14:27:32 +0000 Subject: [PATCH] Rename config fields `envs` to `env` and `inputs` to `input` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename the task configuration fields for consistency: - `envs` → `env`: environment variable names for fingerprinting - `inputs` → `input`: file patterns for cache fingerprinting Updated across source code, JSON fixtures, test snapshots, fixture directory names, test names, documentation, and comments. https://claude.ai/code/session_01565Vu5goEjTJjXVVpvaQnb --- CLAUDE.md | 8 +-- crates/vite_task/docs/task-cache.md | 24 +++---- .../vite_task/docs/wildcard-env-patterns.md | 14 ++--- crates/vite_task/src/session/cache/display.rs | 2 +- crates/vite_task/src/session/cache/mod.rs | 2 +- .../vite_task/src/session/reporter/summary.rs | 2 +- crates/vite_task_bin/src/lib.rs | 8 +-- crates/vite_task_bin/src/main.rs | 4 +- .../cache-miss-reasons/snapshots.toml | 4 +- ...changed.snap => input config changed.snap} | 4 +- .../cache-miss-reasons/vite-task.json | 4 +- .../packages/sub-pkg/vite-task.json | 4 +- .../fixtures/glob-base-test/vite-task.json | 4 +- .../package.json | 0 .../snapshots.toml | 2 +- .../snapshots/individual cache for env.snap} | 0 .../vite-task.json | 2 +- .../dist/output.js | 0 .../package.json | 0 .../snapshots.toml | 30 ++++----- ...nly - hit on non-inferred file change.snap | 0 ...o only - miss on inferred file change.snap | 0 ...ative - hit on excluded inferred file.snap | 0 ... - miss on non-excluded inferred file.snap | 0 ...pty input - hit despite file changes.snap} | 0 ...empty input - miss on command change.snap} | 0 ...pite file changes and folder deletion.snap | 0 ...input - hit on file outside directory.snap | 0 ...iss on direct and nested file changes.snap | 0 ... not set when auto inference disabled.snap | 0 ...env - set when auto inference enabled.snap | 0 ... auto negative - hit on excluded file.snap | 0 ...negative - miss on explicit glob file.snap | 0 ...auto negative - miss on inferred file.snap | 0 ...lobs - hit on read but unmatched file.snap | 0 ... globs only - cache hit on second run.snap | 0 ...s only - hit on unmatched file change.snap | 0 ...bs only - miss on matched file change.snap | 0 ...negative globs - hit on excluded file.snap | 0 ...ive globs - miss on non-excluded file.snap | 0 .../src/main.test.ts | 0 .../src/main.ts | 0 .../src/sub/nested.ts | 0 .../src/utils.ts | 0 .../test/main.test.ts | 0 .../vite-task.json | 22 +++---- .../package.json | 0 .../packages/[lib]/package.json | 0 .../packages/[lib]/src/main.ts | 0 .../packages/[lib]/vite-task.json | 2 +- .../pnpm-workspace.yaml | 0 .../snapshots.toml | 0 .../cache hit then miss on file change.snap | 0 .../package.json | 0 .../packages/shared/dist/output.js | 0 .../packages/shared/package.json | 0 .../packages/shared/src/utils.ts | 0 .../packages/sub-pkg/dist/output.js | 0 .../packages/sub-pkg/package.json | 0 .../packages/sub-pkg/src/main.ts | 0 .../packages/sub-pkg/vite-task.json | 8 +-- .../pnpm-workspace.yaml | 0 .../snapshots.toml | 12 ++-- ...hit on excluded sibling inferred file.snap | 0 ...on non-excluded sibling inferred file.snap | 0 ...e glob - hit on unmatched file change.snap | 0 ...ve glob - miss on sibling file change.snap | 0 ...gative - hit on excluded sibling file.snap | 0 ...e - miss on non-excluded sibling file.snap | 0 ...ative - hit on excluded inferred file.snap | 0 ... - miss on non-excluded inferred file.snap | 0 .../foo.txt | 0 .../package.json | 0 .../snapshots.toml | 2 +- .../snapshots/shared caching input.snap} | 0 .../vite-task.json | 0 crates/vite_task_graph/run-config.ts | 4 +- crates/vite_task_graph/src/config/mod.rs | 4 +- crates/vite_task_graph/src/config/user.rs | 62 +++++++++---------- crates/vite_task_plan/src/cache_metadata.rs | 4 +- crates/vite_task_plan/src/plan.rs | 2 +- crates/vite_task_plan/src/plan_request.rs | 2 +- .../package.json | 0 .../snapshots.toml | 0 ... env-test synthetic task in user task.snap | 2 +- .../snapshots/task graph.snap | 2 +- .../vite-task.json | 0 .../package.json | 0 .../snapshots.toml | 0 .../snapshots/task graph.snap | 2 +- .../vite-task.json | 2 +- 91 files changed, 125 insertions(+), 125 deletions(-) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/{inputs config changed.snap => input config changed.snap} (57%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{individual-cache-for-envs => individual-cache-for-env}/package.json (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{individual-cache-for-envs => individual-cache-for-env}/snapshots.toml (87%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{individual-cache-for-envs/snapshots/individual cache for envs.snap => individual-cache-for-env/snapshots/individual cache for env.snap} (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{individual-cache-for-envs => individual-cache-for-env}/vite-task.json (83%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/dist/output.js (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/package.json (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots.toml (90%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/auto only - hit on non-inferred file change.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/auto only - miss on inferred file change.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/auto with negative - hit on excluded inferred file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/auto with negative - miss on non-excluded inferred file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test/snapshots/empty inputs - hit despite file changes.snap => input-cache-test/snapshots/empty input - hit despite file changes.snap} (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test/snapshots/empty inputs - miss on command change.snap => input-cache-test/snapshots/empty input - miss on command change.snap} (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/folder input - hit despite file changes and folder deletion.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/folder slash input - hit on file outside directory.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/folder slash input - miss on direct and nested file changes.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/fspy env - not set when auto inference disabled.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/fspy env - set when auto inference enabled.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/positive auto negative - hit on excluded file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/positive auto negative - miss on explicit glob file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/positive auto negative - miss on inferred file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/positive globs - hit on read but unmatched file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/positive globs only - cache hit on second run.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/positive globs only - hit on unmatched file change.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/positive globs only - miss on matched file change.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/positive negative globs - hit on excluded file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/snapshots/positive negative globs - miss on non-excluded file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/src/main.test.ts (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/src/main.ts (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/src/sub/nested.ts (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/src/utils.ts (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/test/main.test.ts (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-cache-test => input-cache-test}/vite-task.json (73%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-glob-meta-in-path => input-glob-meta-in-path}/package.json (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-glob-meta-in-path => input-glob-meta-in-path}/packages/[lib]/package.json (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-glob-meta-in-path => input-glob-meta-in-path}/packages/[lib]/src/main.ts (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-glob-meta-in-path => input-glob-meta-in-path}/packages/[lib]/vite-task.json (76%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-glob-meta-in-path => input-glob-meta-in-path}/pnpm-workspace.yaml (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-glob-meta-in-path => input-glob-meta-in-path}/snapshots.toml (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-glob-meta-in-path => input-glob-meta-in-path}/snapshots/cache hit then miss on file change.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/package.json (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/packages/shared/dist/output.js (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/packages/shared/package.json (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/packages/shared/src/utils.ts (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/packages/sub-pkg/dist/output.js (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/packages/sub-pkg/package.json (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/packages/sub-pkg/src/main.ts (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/packages/sub-pkg/vite-task.json (72%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/pnpm-workspace.yaml (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/snapshots.toml (89%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/snapshots/dotdot auto negative - hit on excluded sibling inferred file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/snapshots/dotdot positive glob - hit on unmatched file change.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/snapshots/dotdot positive glob - miss on sibling file change.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/snapshots/dotdot positive negative - hit on excluded sibling file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/snapshots/dotdot positive negative - miss on non-excluded sibling file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/snapshots/subpackage auto with negative - hit on excluded inferred file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{inputs-negative-glob-subpackage => input-negative-glob-subpackage}/snapshots/subpackage auto with negative - miss on non-excluded inferred file.snap (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{shared-caching-inputs => shared-caching-input}/foo.txt (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{shared-caching-inputs => shared-caching-input}/package.json (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{shared-caching-inputs => shared-caching-input}/snapshots.toml (92%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{shared-caching-inputs/snapshots/shared caching inputs.snap => shared-caching-input/snapshots/shared caching input.snap} (100%) rename crates/vite_task_bin/tests/e2e_snapshots/fixtures/{shared-caching-inputs => shared-caching-input}/vite-task.json (100%) rename crates/vite_task_plan/tests/plan_snapshots/fixtures/{additional-envs => additional-env}/package.json (100%) rename crates/vite_task_plan/tests/plan_snapshots/fixtures/{additional-envs => additional-env}/snapshots.toml (100%) rename crates/vite_task_plan/tests/plan_snapshots/fixtures/{additional-envs => additional-env}/snapshots/query - env-test synthetic task in user task.snap (99%) rename crates/vite_task_plan/tests/plan_snapshots/fixtures/{additional-envs => additional-env}/snapshots/task graph.snap (99%) rename crates/vite_task_plan/tests/plan_snapshots/fixtures/{additional-envs => additional-env}/vite-task.json (100%) rename crates/vite_task_plan/tests/plan_snapshots/fixtures/{inputs-trailing-slash => input-trailing-slash}/package.json (100%) rename crates/vite_task_plan/tests/plan_snapshots/fixtures/{inputs-trailing-slash => input-trailing-slash}/snapshots.toml (100%) rename crates/vite_task_plan/tests/plan_snapshots/fixtures/{inputs-trailing-slash => input-trailing-slash}/snapshots/task graph.snap (97%) rename crates/vite_task_plan/tests/plan_snapshots/fixtures/{inputs-trailing-slash => input-trailing-slash}/vite-task.json (72%) diff --git a/CLAUDE.md b/CLAUDE.md index 17b4bd30..e71d5118 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -132,9 +132,9 @@ Tasks are defined in `vite-task.json`: "cwd": "relative/path", "dependsOn": ["build", "package#task"], "cache": true, - "envs": ["NODE_ENV"], + "env": ["NODE_ENV"], "passThroughEnvs": ["CI"], - "inputs": ["src/**", "!dist/**", { "auto": true }] + "input": ["src/**", "!dist/**", { "auto": true }] } } } @@ -145,9 +145,9 @@ Tasks are defined in `vite-task.json`: - `cwd`: working directory relative to the package root - `dependsOn`: explicit task dependencies (`taskName` or `package#task`) - `cache` (task): enable/disable caching for this task (default: `true`) -- `envs`: env var names to fingerprint and pass to the task +- `env`: env var names to fingerprint and pass to the task - `passThroughEnvs`: env var names to pass without fingerprinting -- `inputs`: files for cache fingerprinting (globs, `{ "auto": true }`, negation patterns) +- `input`: files for cache fingerprinting (globs, `{ "auto": true }`, negation patterns) ## Task Dependencies diff --git a/crates/vite_task/docs/task-cache.md b/crates/vite_task/docs/task-cache.md index e378e8bb..d48826ca 100644 --- a/crates/vite_task/docs/task-cache.md +++ b/crates/vite_task/docs/task-cache.md @@ -11,7 +11,7 @@ The task cache system enables: - **Content-based hashing**: Cache keys based on actual content, not timestamps - **Output replay**: Cached stdout/stderr are replayed exactly as originally produced - **Two-tier caching**: Cache entries shared across tasks, with task-run associations -- **Configurable inputs**: Control which files are tracked for cache invalidation +- **Configurable input**: Control which files are tracked for cache invalidation ### Shared caching @@ -56,7 +56,7 @@ the task cache system is able to hit the same cache for the `test` task and for │ ▼ │ │ 2. Cache Key Generation │ │ ────────────────────── │ -│ • Spawn fingerprint (cwd, program, args, envs) │ +│ • Spawn fingerprint (cwd, program, args, env) │ │ • Input configuration │ │ │ │ │ ▼ │ @@ -131,15 +131,15 @@ This ensures cache invalidation when: The `fingerprinted_envs` field is crucial for cache correctness: -- Only includes envs explicitly declared in the task's `envs` array +- Only includes env vars explicitly declared in the task's `env` array - Does NOT include pass-through envs (PATH, CI, etc.) -- These envs become part of the cache key +- These env vars become part of the cache key When a task runs: -1. All envs (including pass-through) are available to the process -2. Only declared envs affect the cache key -3. If a declared env changes value, cache will miss +1. All env vars (including pass-through) are available to the process +2. Only declared env vars affect the cache key +3. If a declared env var changes value, cache will miss 4. If a pass-through env changes, cache will still hit The `pass_through_envs` field stores env names (not values) — if the set of pass-through env names changes, the cache invalidates, but value changes don't. @@ -220,13 +220,13 @@ Vite Task uses `fspy` to monitor file system access during task execution: ### 7. Inputs Configuration -The `inputs` field in `vite-task.json` controls which files are tracked for cache fingerprinting: +The `input` field in `vite-task.json` controls which files are tracked for cache fingerprinting: ```json { "tasks": { "build": { - "inputs": ["src/**", "!dist/**", { "auto": true }] + "input": ["src/**", "!dist/**", { "auto": true }] } } } @@ -382,7 +382,7 @@ Cache entries are automatically invalidated when: 4. **Pass-through config changes**: Pass-through environment names added/removed from configuration 5. **Input files change**: Content hash differs (detected via xxHash3) 6. **File structure changes**: Files added, removed, or type changed -7. **Input config changes**: The `inputs` configuration itself changes +7. **Input config changes**: The `input` configuration itself changes ## Configuration @@ -535,13 +535,13 @@ Ensure commands produce identical outputs for identical inputs: } ``` -### 3. Use `inputs` for Precise Cache Control +### 3. Use `input` for Precise Cache Control ```json { "tasks": { "build": { - "inputs": ["src/**", "tsconfig.json", "!src/**/*.test.ts"] + "input": ["src/**", "tsconfig.json", "!src/**/*.test.ts"] } } } diff --git a/crates/vite_task/docs/wildcard-env-patterns.md b/crates/vite_task/docs/wildcard-env-patterns.md index 23e1504a..5acf6065 100644 --- a/crates/vite_task/docs/wildcard-env-patterns.md +++ b/crates/vite_task/docs/wildcard-env-patterns.md @@ -1,4 +1,4 @@ -# Common Wildcard Pattern for Task Envs +# Common Wildcard Pattern for Task Env ## Executive Summary @@ -13,7 +13,7 @@ Currently, vite-plus requires explicit listing of environment variables in task "tasks": { "build": { "command": "vite build", - "envs": ["NODE_ENV", "NODE_OPTIONS", "VITE_API_URL", "VITE_APP_TITLE", "MY_APP_PORT"] + "env": ["NODE_ENV", "NODE_OPTIONS", "VITE_API_URL", "VITE_APP_TITLE", "MY_APP_PORT"] } } } @@ -23,7 +23,7 @@ This approach becomes cumbersome when dealing with multiple environment variable ## Goals -1. **Simplify Configuration**: Allow wildcard patterns in the `envs` array to match multiple environment variables +1. **Simplify Configuration**: Allow wildcard patterns in the `env` array to match multiple environment variables 2. **Maintain Cache Correctness**: Ensure wildcard-matched variables are properly included in cache fingerprints 3. **Backward Compatibility**: Support both explicit variable names and wildcard patterns 4. **Performance**: Minimal overhead when resolving environment variables @@ -32,7 +32,7 @@ This approach becomes cumbersome when dealing with multiple environment variable ## Non-Goals 1. Full regex support (only glob-style wildcards) -2. Wildcard patterns in `pass_through_envs` (same as `envs`) +2. Wildcard patterns in `passThroughEnvs` (same as `env`) 3. Complex glob patterns like `{VITE,NODE}_*` (supported by wax crate) ## Proposed Solution @@ -63,7 +63,7 @@ We don't support `!` for negated patterns. If match the negated pattern, will ig ``` ┌─────────────────┐ │ Task Config │ -│ envs: [ │ +│ env: [ │ │ "NODE_*", │ │ "VITE_*", │ │ "CI" │ @@ -164,7 +164,7 @@ pub struct CommandFingerprint { "tasks": { "build": { "command": "vite build", - "envs": [ + "env": [ "NODE_ENV", "NODE_OPTIONS", "VITE_API_URL", @@ -184,7 +184,7 @@ pub struct CommandFingerprint { "tasks": { "build": { "command": "vite build", - "envs": ["NODE_*", "VITE_*"] + "env": ["NODE_*", "VITE_*"] } } } diff --git a/crates/vite_task/src/session/cache/display.rs b/crates/vite_task/src/session/cache/display.rs index 07ba184b..2d6cda3d 100644 --- a/crates/vite_task/src/session/cache/display.rs +++ b/crates/vite_task/src/session/cache/display.rs @@ -173,7 +173,7 @@ pub fn format_cache_status_inline(cache_status: &CacheStatus) -> Option { None => "configuration changed", } } - FingerprintMismatch::InputConfig => "inputs configuration changed", + FingerprintMismatch::InputConfig => "input configuration changed", FingerprintMismatch::InputChanged { kind, path } => { let desc = format_input_change_str(*kind, path.as_str()); return Some(vite_str::format!("✗ cache miss: {desc}, executing")); diff --git a/crates/vite_task/src/session/cache/mod.rs b/crates/vite_task/src/session/cache/mod.rs index 1bb5f802..c2cc4f18 100644 --- a/crates/vite_task/src/session/cache/mod.rs +++ b/crates/vite_task/src/session/cache/mod.rs @@ -119,7 +119,7 @@ impl Display for FingerprintMismatch { write!(f, "Spawn fingerprint changed: old={old:?}, new={new:?}") } Self::InputConfig => { - write!(f, "inputs configuration changed") + write!(f, "input configuration changed") } Self::InputChanged { kind, path } => { write!(f, "{}", display::format_input_change_str(*kind, path.as_str())) diff --git a/crates/vite_task/src/session/reporter/summary.rs b/crates/vite_task/src/session/reporter/summary.rs index 76c6930c..855ddb3a 100644 --- a/crates/vite_task/src/session/reporter/summary.rs +++ b/crates/vite_task/src/session/reporter/summary.rs @@ -439,7 +439,7 @@ impl TaskResult { } } SavedCacheMissReason::ConfigChanged => { - Str::from("→ Cache miss: inputs configuration changed") + Str::from("→ Cache miss: input configuration changed") } SavedCacheMissReason::InputChanged { kind, path } => { let desc = format_input_change_str(*kind, path.as_str()); diff --git a/crates/vite_task_bin/src/lib.rs b/crates/vite_task_bin/src/lib.rs index 5b6c3adc..7c756af6 100644 --- a/crates/vite_task_bin/src/lib.rs +++ b/crates/vite_task_bin/src/lib.rs @@ -62,9 +62,9 @@ fn synthesize_node_modules_bin_task( program: find_executable(get_path_env(envs), cwd, executable_name)?, args: args.into(), cache_config: UserCacheConfig::with_config(EnabledCacheConfig { - envs: None, + env: None, pass_through_envs: None, - inputs: None, + input: None, }), envs: Arc::clone(envs), }) @@ -127,9 +127,9 @@ impl vite_task::CommandHandler for CommandHandler { args: [name.clone()].into(), cache_config: UserCacheConfig::with_config({ EnabledCacheConfig { - envs: None, + env: None, pass_through_envs: Some(vec![name]), - inputs: None, + input: None, } }), envs: Arc::new(envs), diff --git a/crates/vite_task_bin/src/main.rs b/crates/vite_task_bin/src/main.rs index 2dfdd252..9ff49623 100644 --- a/crates/vite_task_bin/src/main.rs +++ b/crates/vite_task_bin/src/main.rs @@ -33,9 +33,9 @@ async fn run() -> anyhow::Result { args: [Str::from("FOO")].into(), cache_config: UserCacheConfig::with_config({ EnabledCacheConfig { - envs: Some(Box::from([Str::from("FOO")])), + env: Some(Box::from([Str::from("FOO")])), pass_through_envs: None, - inputs: None, + input: None, } }), envs: Arc::clone(envs), diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml index 0e56468e..013ec18b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml @@ -61,10 +61,10 @@ steps = [ ] [[e2e]] -name = "inputs config changed" +name = "input config changed" steps = [ "vp run test # cache miss", - "json-edit vite-task.json \"_.tasks.test.inputs = ['test.txt']\" # change inputs config", + "json-edit vite-task.json \"_.tasks.test.input = ['test.txt']\" # change input config", "vp run test # cache miss: configuration changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inputs config changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input config changed.snap similarity index 57% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inputs config changed.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input config changed.snap index fe83d450..0d56195b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inputs config changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input config changed.snap @@ -5,8 +5,8 @@ expression: e2e_outputs > vp run test # cache miss $ print-file test.txt initial content -> json-edit vite-task.json "_.tasks.test.inputs = ['test.txt']" # change inputs config +> json-edit vite-task.json "_.tasks.test.input = ['test.txt']" # change input config > vp run test # cache miss: configuration changed -$ print-file test.txt ✗ cache miss: inputs configuration changed, executing +$ print-file test.txt ✗ cache miss: input configuration changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/vite-task.json index e9cb1a3a..1a9f83b0 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/vite-task.json @@ -3,12 +3,12 @@ "tasks": { "test": { "command": "print-file test.txt", - "envs": ["MY_ENV"], + "env": ["MY_ENV"], "cache": true }, "glob-test": { "command": "print glob-test", - "inputs": ["*.txt"], + "input": ["*.txt"], "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/packages/sub-pkg/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/packages/sub-pkg/vite-task.json index 2343b213..e8d4cf67 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/packages/sub-pkg/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/packages/sub-pkg/vite-task.json @@ -2,13 +2,13 @@ "tasks": { "sub-glob-test": { "command": "print-file src/sub.ts", - "inputs": ["src/**/*.ts"], + "input": ["src/**/*.ts"], "cache": true }, "sub-glob-with-cwd": { "command": "print-file sub.ts", "cwd": "src", - "inputs": ["src/**/*.ts"], + "input": ["src/**/*.ts"], "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/vite-task.json index be9583e2..474decce 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/vite-task.json @@ -2,13 +2,13 @@ "tasks": { "root-glob-test": { "command": "print-file src/root.ts", - "inputs": ["src/**/*.ts"], + "input": ["src/**/*.ts"], "cache": true }, "root-glob-with-cwd": { "command": "print-file root.ts", "cwd": "src", - "inputs": ["src/**/*.ts"], + "input": ["src/**/*.ts"], "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/package.json similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/package.json diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots.toml similarity index 87% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots.toml index 77193ea2..e837db72 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots.toml @@ -1,7 +1,7 @@ # Tests that different env values get separate cache entries [[e2e]] -name = "individual cache for envs" +name = "individual cache for env" steps = [ "FOO=1 vp run hello # cache miss", "FOO=2 vp run hello # cache miss, different env", diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots/individual cache for env.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots/individual cache for env.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/vite-task.json similarity index 83% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/vite-task.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/vite-task.json index 32c2885c..95c16136 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/vite-task.json @@ -3,7 +3,7 @@ "tasks": { "hello": { "command": "print-env FOO", - "envs": ["FOO"], + "env": ["FOO"], "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/dist/output.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/dist/output.js similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/dist/output.js rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/dist/output.js diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/package.json similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/package.json diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml similarity index 90% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots.toml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml index 36a7ffbd..a1da9d92 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml @@ -1,6 +1,6 @@ # Test all input configuration combinations for cache behavior -# 1. Positive globs only: inputs: ["src/**/*.ts"] +# 1. Positive globs only: input: ["src/**/*.ts"] # - Files matching the glob trigger cache invalidation # - Files outside the glob do NOT trigger cache invalidation [[e2e]] @@ -30,11 +30,11 @@ steps = [ "vp run positive-globs-only", # Modify a file that does NOT match the glob (test/ is outside src/) "replace-file-content test/main.test.ts outside modified", - # Cache hit: file not in inputs + # Cache hit: file not in input "vp run positive-globs-only", ] -# 1b. Positive globs reads unmatched file: inputs: ["src/main.ts"], command reads src/utils.ts too +# 1b. Positive globs reads unmatched file: input: ["src/main.ts"], command reads src/utils.ts too # - File read by command but NOT matched by glob should NOT be fingerprinted # - This tests that inference is truly disabled when only explicit globs are used [[e2e]] @@ -48,7 +48,7 @@ steps = [ "vp run positive-globs-reads-unmatched", ] -# 2. Positive + negative globs: inputs: ["src/**", "!src/**/*.test.ts"] +# 2. Positive + negative globs: input: ["src/**", "!src/**/*.test.ts"] # - Files matching positive but NOT negative trigger invalidation # - Files matching negative glob are excluded [[e2e]] @@ -73,7 +73,7 @@ steps = [ "vp run positive-negative-globs", ] -# 3. Auto only: inputs: [{ "auto": true }] +# 3. Auto only: input: [{ "auto": true }] # - Files read by the command trigger invalidation (fspy inference) # - Files NOT read by the command do NOT trigger invalidation [[e2e]] @@ -94,11 +94,11 @@ steps = [ "vp run auto-only", # Modify a file that was NOT read by the command "replace-file-content src/utils.ts initial modified", - # Cache hit: file not in inferred inputs + # Cache hit: file not in inferred input "vp run auto-only", ] -# 4. Auto + negative: inputs: [{ "auto": true }, "!dist/**"] +# 4. Auto + negative: input: [{ "auto": true }, "!dist/**"] # - Inferred files are tracked, but negative globs filter them out # - Files in excluded directories don't trigger invalidation even if read [[e2e]] @@ -123,9 +123,9 @@ steps = [ "vp run auto-with-negative", ] -# 5. Positive + auto + negative: inputs: ["package.json", { "auto": true }, "!src/**/*.test.ts"] +# 5. Positive + auto + negative: input: ["package.json", { "auto": true }, "!src/**/*.test.ts"] # - Explicit globs AND inferred files are both tracked -# - Negative globs apply to both explicit and inferred inputs +# - Negative globs apply to both explicit and inferred input [[e2e]] name = "positive auto negative - miss on explicit glob file" steps = [ @@ -159,22 +159,22 @@ steps = [ "vp run positive-auto-negative", ] -# 6. Empty inputs: inputs: [] +# 6. Empty input: input: [] # - No file changes affect the cache # - Only command/env changes trigger cache invalidation [[e2e]] -name = "empty inputs - hit despite file changes" +name = "empty input - hit despite file changes" steps = [ # Initial run "vp run empty-inputs", # Modify any file - should NOT affect cache "replace-file-content src/main.ts initial modified", - # Cache hit: no inputs configured + # Cache hit: no input configured "vp run empty-inputs", ] [[e2e]] -name = "empty inputs - miss on command change" +name = "empty input - miss on command change" steps = [ # Initial run "vp run empty-inputs", @@ -201,7 +201,7 @@ steps = [ "vp run check-fspy-env-without-auto", ] -# 8. Trailing slash input: inputs: ["src/"] +# 8. Trailing slash input: input: ["src/"] # - Trailing `/` is expanded to `/**`, matching all files under that directory # - Direct and nested file changes trigger cache invalidation # - Files outside the directory do NOT trigger cache invalidation @@ -232,7 +232,7 @@ steps = [ "vp run folder-slash-input", ] -# 9. Folder path as input: inputs: ["src"] +# 9. Folder path as input: input: ["src"] # - A bare directory name matches nothing (directories are not files) # - File changes inside the folder should NOT trigger cache invalidation [[e2e]] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/auto only - hit on non-inferred file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - hit on non-inferred file change.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/auto only - hit on non-inferred file change.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - hit on non-inferred file change.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/auto only - miss on inferred file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - miss on inferred file change.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/auto only - miss on inferred file change.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - miss on inferred file change.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/auto with negative - hit on excluded inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - hit on excluded inferred file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/auto with negative - hit on excluded inferred file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - hit on excluded inferred file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/auto with negative - miss on non-excluded inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - miss on non-excluded inferred file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/auto with negative - miss on non-excluded inferred file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - miss on non-excluded inferred file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/empty inputs - hit despite file changes.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - hit despite file changes.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/empty inputs - hit despite file changes.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - hit despite file changes.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/empty inputs - miss on command change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - miss on command change.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/empty inputs - miss on command change.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - miss on command change.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/folder slash input - hit on file outside directory.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - hit on file outside directory.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/folder slash input - hit on file outside directory.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - hit on file outside directory.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/folder slash input - miss on direct and nested file changes.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - miss on direct and nested file changes.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/folder slash input - miss on direct and nested file changes.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - miss on direct and nested file changes.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/fspy env - not set when auto inference disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - not set when auto inference disabled.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/fspy env - not set when auto inference disabled.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - not set when auto inference disabled.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/fspy env - set when auto inference enabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - set when auto inference enabled.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/fspy env - set when auto inference enabled.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - set when auto inference enabled.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive auto negative - hit on excluded file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - hit on excluded file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive auto negative - hit on excluded file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - hit on excluded file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive auto negative - miss on explicit glob file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on explicit glob file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive auto negative - miss on explicit glob file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on explicit glob file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive auto negative - miss on inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on inferred file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive auto negative - miss on inferred file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on inferred file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive globs - hit on read but unmatched file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs - hit on read but unmatched file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive globs - hit on read but unmatched file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs - hit on read but unmatched file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive globs only - cache hit on second run.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - cache hit on second run.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive globs only - cache hit on second run.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - cache hit on second run.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive globs only - hit on unmatched file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - hit on unmatched file change.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive globs only - hit on unmatched file change.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - hit on unmatched file change.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive globs only - miss on matched file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - miss on matched file change.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive globs only - miss on matched file change.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - miss on matched file change.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive negative globs - hit on excluded file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - hit on excluded file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive negative globs - hit on excluded file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - hit on excluded file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive negative globs - miss on non-excluded file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - miss on non-excluded file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots/positive negative globs - miss on non-excluded file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - miss on non-excluded file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/src/main.test.ts b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/src/main.test.ts similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/src/main.test.ts rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/src/main.test.ts diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/src/main.ts b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/src/main.ts similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/src/main.ts rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/src/main.ts diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/src/sub/nested.ts b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/src/sub/nested.ts similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/src/sub/nested.ts rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/src/sub/nested.ts diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/src/utils.ts b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/src/utils.ts similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/src/utils.ts rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/src/utils.ts diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/test/main.test.ts b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/test/main.test.ts similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/test/main.test.ts rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/test/main.test.ts diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/vite-task.json similarity index 73% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/vite-task.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/vite-task.json index d608ac41..bdd9882c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/vite-task.json @@ -2,57 +2,57 @@ "tasks": { "positive-globs-only": { "command": "print-file src/main.ts", - "inputs": ["src/**/*.ts"], + "input": ["src/**/*.ts"], "cache": true }, "positive-globs-reads-unmatched": { "command": "print-file src/main.ts src/utils.ts", - "inputs": ["src/main.ts"], + "input": ["src/main.ts"], "cache": true }, "positive-negative-globs": { "command": "print-file src/main.ts", - "inputs": ["src/**", "!src/**/*.test.ts"], + "input": ["src/**", "!src/**/*.test.ts"], "cache": true }, "auto-only": { "command": "print-file src/main.ts", - "inputs": [{ "auto": true }], + "input": [{ "auto": true }], "cache": true }, "auto-with-negative": { "command": "print-file src/main.ts dist/output.js", - "inputs": [{ "auto": true }, "!dist/**"], + "input": [{ "auto": true }, "!dist/**"], "cache": true }, "positive-auto-negative": { "command": "print-file src/main.ts", - "inputs": ["package.json", { "auto": true }, "!src/**/*.test.ts"], + "input": ["package.json", { "auto": true }, "!src/**/*.test.ts"], "cache": true }, "empty-inputs": { "command": "print-file src/main.ts", - "inputs": [], + "input": [], "cache": true }, "check-fspy-env-with-auto": { "command": "print-env FSPY", - "inputs": [{ "auto": true }], + "input": [{ "auto": true }], "cache": true }, "check-fspy-env-without-auto": { "command": "print-env FSPY", - "inputs": ["src/**/*.ts"], + "input": ["src/**/*.ts"], "cache": true }, "folder-input": { "command": "print-file src/main.ts", - "inputs": ["src"], + "input": ["src"], "cache": true }, "folder-slash-input": { "command": "print-file src/main.ts", - "inputs": ["src/"], + "input": ["src/"], "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/package.json similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/package.json diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/packages/[lib]/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/package.json similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/packages/[lib]/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/package.json diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/packages/[lib]/src/main.ts b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/src/main.ts similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/packages/[lib]/src/main.ts rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/src/main.ts diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/packages/[lib]/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/vite-task.json similarity index 76% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/packages/[lib]/vite-task.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/vite-task.json index 2a31e9ce..e09c87a3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/packages/[lib]/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/vite-task.json @@ -2,7 +2,7 @@ "tasks": { "build": { "command": "print-file src/main.ts", - "inputs": ["src/**/*.ts"], + "input": ["src/**/*.ts"], "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/pnpm-workspace.yaml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/pnpm-workspace.yaml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots.toml similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/snapshots.toml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots.toml diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/snapshots/cache hit then miss on file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots/cache hit then miss on file change.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-glob-meta-in-path/snapshots/cache hit then miss on file change.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots/cache hit then miss on file change.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/package.json similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/package.json diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/shared/dist/output.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/shared/dist/output.js similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/shared/dist/output.js rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/shared/dist/output.js diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/shared/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/shared/package.json similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/shared/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/shared/package.json diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/shared/src/utils.ts b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/shared/src/utils.ts similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/shared/src/utils.ts rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/shared/src/utils.ts diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/sub-pkg/dist/output.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/dist/output.js similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/sub-pkg/dist/output.js rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/dist/output.js diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/sub-pkg/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/package.json similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/sub-pkg/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/package.json diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/sub-pkg/src/main.ts b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/src/main.ts similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/sub-pkg/src/main.ts rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/src/main.ts diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/sub-pkg/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/vite-task.json similarity index 72% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/sub-pkg/vite-task.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/vite-task.json index 91096c33..e3842a24 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/packages/sub-pkg/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/vite-task.json @@ -2,22 +2,22 @@ "tasks": { "auto-with-negative": { "command": "print-file src/main.ts dist/output.js", - "inputs": [{ "auto": true }, "!dist/**"], + "input": [{ "auto": true }, "!dist/**"], "cache": true }, "dotdot-positive": { "command": "print-file ../shared/src/utils.ts", - "inputs": ["../shared/src/**"], + "input": ["../shared/src/**"], "cache": true }, "dotdot-positive-negative": { "command": "print-file ../shared/src/utils.ts ../shared/dist/output.js", - "inputs": ["../shared/**", "!../shared/dist/**"], + "input": ["../shared/**", "!../shared/dist/**"], "cache": true }, "dotdot-auto-negative": { "command": "print-file ../shared/src/utils.ts ../shared/dist/output.js", - "inputs": [{ "auto": true }, "!../shared/dist/**"], + "input": [{ "auto": true }, "!../shared/dist/**"], "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/pnpm-workspace.yaml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/pnpm-workspace.yaml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml similarity index 89% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots.toml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml index 51bac65f..f5a95fa2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml @@ -3,7 +3,7 @@ # instead of package-relative paths, so exclusions like !dist/** # failed for subpackages. -# Auto + negative in subpackage: inputs: [{ "auto": true }, "!dist/**"] +# Auto + negative in subpackage: input: [{ "auto": true }, "!dist/**"] # - dist/ should be excluded even though the package is a subpackage # - Modifying dist/output.js should be a cache hit [[e2e]] @@ -28,7 +28,7 @@ steps = [ "vp run sub-pkg#auto-with-negative", ] -# .. prefix positive globs: inputs: ["../shared/src/**"] +# .. prefix positive globs: input: ["../shared/src/**"] # - Should find files in sibling package via .. # - Cache miss when sibling file changes, hit when unrelated file changes [[e2e]] @@ -47,11 +47,11 @@ steps = [ "vp run sub-pkg#dotdot-positive", # Modify a file NOT matched by ../shared/src/** "replace-file-content packages/shared/dist/output.js initial modified", - # Cache hit: file not in inputs + # Cache hit: file not in input "vp run sub-pkg#dotdot-positive", ] -# .. prefix positive + negative globs: inputs: ["../shared/**", "!../shared/dist/**"] +# .. prefix positive + negative globs: input: ["../shared/**", "!../shared/dist/**"] # - Positive glob matches sibling package files via .. # - Negative glob excludes sibling dist/ via .. [[e2e]] @@ -74,9 +74,9 @@ steps = [ "vp run sub-pkg#dotdot-positive-negative", ] -# .. prefix auto + negative: inputs: [{ "auto": true }, "!../shared/dist/**"] +# .. prefix auto + negative: input: [{ "auto": true }, "!../shared/dist/**"] # - Auto-inferred files from sibling package are tracked -# - Negative glob excludes sibling dist/ from inferred inputs +# - Negative glob excludes sibling dist/ from inferred input [[e2e]] name = "dotdot auto negative - hit on excluded sibling inferred file" steps = [ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot auto negative - hit on excluded sibling inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - hit on excluded sibling inferred file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot auto negative - hit on excluded sibling inferred file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - hit on excluded sibling inferred file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot positive glob - hit on unmatched file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - hit on unmatched file change.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot positive glob - hit on unmatched file change.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - hit on unmatched file change.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot positive glob - miss on sibling file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - miss on sibling file change.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot positive glob - miss on sibling file change.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - miss on sibling file change.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot positive negative - hit on excluded sibling file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - hit on excluded sibling file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot positive negative - hit on excluded sibling file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - hit on excluded sibling file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot positive negative - miss on non-excluded sibling file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - miss on non-excluded sibling file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot positive negative - miss on non-excluded sibling file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - miss on non-excluded sibling file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/subpackage auto with negative - hit on excluded inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - hit on excluded inferred file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/subpackage auto with negative - hit on excluded inferred file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - hit on excluded inferred file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/subpackage auto with negative - miss on non-excluded inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - miss on non-excluded inferred file.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/subpackage auto with negative - miss on non-excluded inferred file.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - miss on non-excluded inferred file.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/foo.txt b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/foo.txt similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/foo.txt rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/foo.txt diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/package.json similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/package.json diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml similarity index 92% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml index 73abab94..9b7fccb6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml @@ -1,7 +1,7 @@ # Tests that tasks with identical commands share cache entries [[e2e]] -name = "shared caching inputs" +name = "shared caching input" steps = [ "vp run script1 # cache miss", "vp run script2 # cache hit, same command as script1", diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots/shared caching input.snap similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots/shared caching input.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/vite-task.json similarity index 100% rename from crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/vite-task.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/vite-task.json diff --git a/crates/vite_task_graph/run-config.ts b/crates/vite_task_graph/run-config.ts index b79190c9..a6d9f51a 100644 --- a/crates/vite_task_graph/run-config.ts +++ b/crates/vite_task_graph/run-config.ts @@ -24,7 +24,7 @@ export type Task = { /** * Environment variable names to be fingerprinted and passed to the task. */ - envs?: Array; + env?: Array; /** * Environment variable names to be passed to the task without fingerprinting. */ @@ -40,7 +40,7 @@ export type Task = { * * Patterns are relative to the package directory. */ - inputs?: Array< + input?: Array< | string | { /** diff --git a/crates/vite_task_graph/src/config/mod.rs b/crates/vite_task_graph/src/config/mod.rs index 5a8fc11f..f94fc157 100644 --- a/crates/vite_task_graph/src/config/mod.rs +++ b/crates/vite_task_graph/src/config/mod.rs @@ -72,7 +72,7 @@ impl ResolvedTaskOptions { pass_through_envs.extend(DEFAULT_PASSTHROUGH_ENVS.iter().copied().map(Str::from)); let input_config = ResolvedInputConfig::from_user_config( - enabled_cache_config.inputs.as_ref(), + enabled_cache_config.input.as_ref(), dir, workspace_root, )?; @@ -80,7 +80,7 @@ impl ResolvedTaskOptions { Some(CacheConfig { env_config: EnvConfig { fingerprinted_envs: enabled_cache_config - .envs + .env .map(|e| e.into_vec().into_iter().collect()) .unwrap_or_default(), pass_through_envs, diff --git a/crates/vite_task_graph/src/config/user.rs b/crates/vite_task_graph/src/config/user.rs index 6210fadf..a89e8de7 100644 --- a/crates/vite_task_graph/src/config/user.rs +++ b/crates/vite_task_graph/src/config/user.rs @@ -10,7 +10,7 @@ use ts_rs::TS; use vite_path::RelativePathBuf; use vite_str::Str; -/// A single input entry in the `inputs` array. +/// A single input entry in the `input` array. /// /// Inputs can be either glob patterns (strings) or auto-inference directives (`{auto: true}`). #[derive(Debug, Deserialize, PartialEq, Eq, Clone)] @@ -76,7 +76,7 @@ impl UserCacheConfig { #[serde(rename_all = "camelCase")] pub struct EnabledCacheConfig { /// Environment variable names to be fingerprinted and passed to the task. - pub envs: Option>, + pub env: Option>, /// Environment variable names to be passed to the task without fingerprinting. pub pass_through_envs: Option>, @@ -92,7 +92,7 @@ pub struct EnabledCacheConfig { /// Patterns are relative to the package directory. #[serde(default)] #[cfg_attr(all(test, not(clippy)), ts(inline))] - pub inputs: Option, + pub input: Option, } /// Options for user-defined tasks in `vite.config.*`, excluding the command. @@ -121,13 +121,13 @@ impl Default for UserTaskOptions { cwd_relative_to_package: None, // No dependencies depends_on: None, - // Caching enabled with no fingerprinted envs + // Caching enabled with no fingerprinted env cache_config: UserCacheConfig::Enabled { cache: None, enabled_cache_config: EnabledCacheConfig { - envs: None, + env: None, pass_through_envs: None, - inputs: None, + input: None, }, }, } @@ -403,7 +403,7 @@ mod tests { fn test_cache_explicitly_enabled() { let user_config_json = json!({ "cache": true, - "envs": ["NODE_ENV"], + "env": ["NODE_ENV"], "passThroughEnvs": ["FOO"], }); assert_eq!( @@ -411,49 +411,49 @@ mod tests { UserCacheConfig::Enabled { cache: Some(MustBe!(true)), enabled_cache_config: EnabledCacheConfig { - envs: Some(std::iter::once("NODE_ENV".into()).collect()), + env: Some(std::iter::once("NODE_ENV".into()).collect()), pass_through_envs: Some(std::iter::once("FOO".into()).collect()), - inputs: None, + input: None, } }, ); } #[test] - fn test_inputs_empty_array() { + fn test_input_empty_array() { let user_config_json = json!({ - "inputs": [] + "input": [] }); let config: EnabledCacheConfig = serde_json::from_value(user_config_json).unwrap(); - assert_eq!(config.inputs, Some(vec![])); + assert_eq!(config.input, Some(vec![])); } #[test] - fn test_inputs_auto_true() { + fn test_input_auto_true() { let user_config_json = json!({ - "inputs": [{ "auto": true }] + "input": [{ "auto": true }] }); let config: EnabledCacheConfig = serde_json::from_value(user_config_json).unwrap(); - assert_eq!(config.inputs, Some(vec![UserInputEntry::Auto { auto: true }])); + assert_eq!(config.input, Some(vec![UserInputEntry::Auto { auto: true }])); } #[test] - fn test_inputs_auto_false() { + fn test_input_auto_false() { let user_config_json = json!({ - "inputs": [{ "auto": false }] + "input": [{ "auto": false }] }); let config: EnabledCacheConfig = serde_json::from_value(user_config_json).unwrap(); - assert_eq!(config.inputs, Some(vec![UserInputEntry::Auto { auto: false }])); + assert_eq!(config.input, Some(vec![UserInputEntry::Auto { auto: false }])); } #[test] - fn test_inputs_globs() { + fn test_input_globs() { let user_config_json = json!({ - "inputs": ["src/**/*.ts", "package.json"] + "input": ["src/**/*.ts", "package.json"] }); let config: EnabledCacheConfig = serde_json::from_value(user_config_json).unwrap(); assert_eq!( - config.inputs, + config.input, Some(vec![ UserInputEntry::Glob("src/**/*.ts".into()), UserInputEntry::Glob("package.json".into()), @@ -462,13 +462,13 @@ mod tests { } #[test] - fn test_inputs_negative_globs() { + fn test_input_negative_globs() { let user_config_json = json!({ - "inputs": ["src/**", "!src/**/*.test.ts"] + "input": ["src/**", "!src/**/*.test.ts"] }); let config: EnabledCacheConfig = serde_json::from_value(user_config_json).unwrap(); assert_eq!( - config.inputs, + config.input, Some(vec![ UserInputEntry::Glob("src/**".into()), UserInputEntry::Glob("!src/**/*.test.ts".into()), @@ -477,13 +477,13 @@ mod tests { } #[test] - fn test_inputs_mixed() { + fn test_input_mixed() { let user_config_json = json!({ - "inputs": ["package.json", { "auto": true }, "!node_modules/**"] + "input": ["package.json", { "auto": true }, "!node_modules/**"] }); let config: EnabledCacheConfig = serde_json::from_value(user_config_json).unwrap(); assert_eq!( - config.inputs, + config.input, Some(vec![ UserInputEntry::Glob("package.json".into()), UserInputEntry::Auto { auto: true }, @@ -493,11 +493,11 @@ mod tests { } #[test] - fn test_inputs_with_cache_false_error() { - // inputs with cache: false should produce a serde error due to deny_unknown_fields + fn test_input_with_cache_false_error() { + // input with cache: false should produce a serde error due to deny_unknown_fields let user_config_json = json!({ "cache": false, - "inputs": ["src/**"] + "input": ["src/**"] }); assert!(serde_json::from_value::(user_config_json).is_err()); } @@ -506,7 +506,7 @@ mod tests { fn test_cache_disabled_but_with_fields() { let user_config_json = json!({ "cache": false, - "envs": ["NODE_ENV"], + "env": ["NODE_ENV"], }); assert!(serde_json::from_value::(user_config_json).is_err()); } diff --git a/crates/vite_task_plan/src/cache_metadata.rs b/crates/vite_task_plan/src/cache_metadata.rs index 15a0b85b..6a055bed 100644 --- a/crates/vite_task_plan/src/cache_metadata.rs +++ b/crates/vite_task_plan/src/cache_metadata.rs @@ -53,9 +53,9 @@ pub struct CacheMetadata { /// # Environment Variable Impact on Cache /// /// The `envs_without_pass_through` field is crucial for cache correctness: -/// - Only includes envs explicitly declared in the task's `envs` array +/// - Only includes env vars explicitly declared in the task's `env` array /// - Does NOT include pass-through envs (PATH, CI, etc.) -/// - These envs become part of the cache key +/// - These env vars become part of the cache key /// /// When a task runs: /// 1. All envs (including pass-through) are available to the process diff --git a/crates/vite_task_plan/src/plan.rs b/crates/vite_task_plan/src/plan.rs index 76efc362..3b5d6e07 100644 --- a/crates/vite_task_plan/src/plan.rs +++ b/crates/vite_task_plan/src/plan.rs @@ -420,7 +420,7 @@ fn resolve_synthetic_cache_config( Ok(match synthetic_cache_config { UserCacheConfig::Disabled { .. } => Option::None, UserCacheConfig::Enabled { enabled_cache_config, .. } => { - if let Some(extra_envs) = enabled_cache_config.envs { + if let Some(extra_envs) = enabled_cache_config.env { parent_config.env_config.fingerprinted_envs.extend(extra_envs.into_vec()); } if let Some(extra_pts) = enabled_cache_config.pass_through_envs { diff --git a/crates/vite_task_plan/src/plan_request.rs b/crates/vite_task_plan/src/plan_request.rs index 71474f77..df681893 100644 --- a/crates/vite_task_plan/src/plan_request.rs +++ b/crates/vite_task_plan/src/plan_request.rs @@ -81,7 +81,7 @@ pub struct SyntheticPlanRequest { /// Therefore, these envs are subject to env configurations in `UserTaskOptions`. /// /// - To set envs that are not subject to caching but still passed to the spawned child, use `task_options` to configure `pass_through_envs`. - /// - To set envs that should be fingerprinted, use `task_options` to configure `envs`. + /// - To set envs that should be fingerprinted, use `task_options` to configure `env`. /// - If neither is set, and caching is enabled, these envs will have not effect. pub envs: Arc, Arc>>, } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/package.json similarity index 100% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/package.json diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots.toml similarity index 100% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots.toml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots.toml diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/query - env-test synthetic task in user task.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - env-test synthetic task in user task.snap similarity index 99% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/query - env-test synthetic task in user task.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - env-test synthetic task in user task.snap index ab8ef29f..761dbd0c 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/query - env-test synthetic task in user task.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - env-test synthetic task in user task.snap @@ -5,7 +5,7 @@ info: args: - run - env-test -input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env --- [ { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/task graph.snap similarity index 99% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/task graph.snap index d98da2ef..f6ab4f05 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/task graph.snap @@ -1,7 +1,7 @@ --- source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: task_graph_json -input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env --- [ { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/vite-task.json similarity index 100% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/vite-task.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/vite-task.json diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash/package.json similarity index 100% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash/package.json diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash/snapshots.toml similarity index 100% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash/snapshots.toml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash/snapshots.toml diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash/snapshots/task graph.snap similarity index 97% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash/snapshots/task graph.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash/snapshots/task graph.snap index 071c92e6..5ca47de3 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash/snapshots/task graph.snap @@ -1,7 +1,7 @@ --- source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: task_graph_json -input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash --- [ { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash/vite-task.json similarity index 72% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash/vite-task.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash/vite-task.json index 563fc807..14f8abfd 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/inputs-trailing-slash/vite-task.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/input-trailing-slash/vite-task.json @@ -2,7 +2,7 @@ "tasks": { "build": { "command": "echo build", - "inputs": ["src/", "!dist/"], + "input": ["src/", "!dist/"], "cache": true } }