Skip to content

Commit b0f2f4b

Browse files
committed
revert: remove CacheOutputs test type, keep only DeclCollector fix
Remove the CacheOutputs indirect type that was added to demonstrate the bug. The recursive DeclCollector fix is retained. https://claude.ai/code/session_01VQvSgXNnYL8tNWydvtbCvg
1 parent f545d01 commit b0f2f4b

File tree

5 files changed

+3
-49
lines changed

5 files changed

+3
-49
lines changed

crates/vite_task_bin/src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ fn synthesize_node_modules_bin_task(
6464
cache_config: UserCacheConfig::with_config(EnabledCacheConfig {
6565
envs: None,
6666
pass_through_envs: None,
67-
outputs: None,
6867
}),
6968
envs: Arc::clone(envs),
7069
})
@@ -126,11 +125,7 @@ impl vite_task::CommandHandler for CommandHandler {
126125
program: find_executable(get_path_env(&envs), &command.cwd, "print-env")?,
127126
args: [name.clone()].into(),
128127
cache_config: UserCacheConfig::with_config({
129-
EnabledCacheConfig {
130-
envs: None,
131-
pass_through_envs: Some(vec![name]),
132-
outputs: None,
133-
}
128+
EnabledCacheConfig { envs: None, pass_through_envs: Some(vec![name]) }
134129
}),
135130
envs: Arc::new(envs),
136131
}))

crates/vite_task_bin/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ async fn run() -> anyhow::Result<ExitStatus> {
3535
EnabledCacheConfig {
3636
envs: Some(Box::from([Str::from("FOO")])),
3737
pass_through_envs: None,
38-
outputs: None,
3938
}
4039
}),
4140
envs: Arc::clone(envs),

crates/vite_task_graph/run-config.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
export type CacheOutputs = {
2-
/**
3-
* Directories to cache (relative to the package root).
4-
*/
5-
include?: Array<string>;
6-
/**
7-
* Directories to exclude from the cache.
8-
*/
9-
exclude?: Array<string>;
10-
};
11-
121
export type Task = {
132
/**
143
* The command to run for the task.
@@ -38,10 +27,6 @@ export type Task = {
3827
* Environment variable names to be passed to the task without fingerprinting.
3928
*/
4029
passThroughEnvs?: Array<string>;
41-
/**
42-
* Output artifacts to cache.
43-
*/
44-
outputs?: CacheOutputs;
4530
}
4631
| {
4732
/**

crates/vite_task_graph/src/config/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,7 @@ impl ResolvedTaskConfig {
114114
let cache_config = if cache_scripts {
115115
UserCacheConfig::Enabled {
116116
cache: None,
117-
enabled_cache_config: EnabledCacheConfig {
118-
envs: None,
119-
pass_through_envs: None,
120-
outputs: None,
121-
},
117+
enabled_cache_config: EnabledCacheConfig { envs: None, pass_through_envs: None },
122118
}
123119
} else {
124120
UserCacheConfig::Disabled { cache: MustBe!(false) }

crates/vite_task_graph/src/config/user.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,6 @@ impl UserCacheConfig {
4747
}
4848
}
4949

50-
/// Configuration for cache output artifacts
51-
#[derive(Debug, Deserialize, PartialEq, Eq)]
52-
// TS derive macro generates code using std types that clippy disallows; skip derive during linting
53-
#[cfg_attr(all(test, not(clippy)), derive(TS), ts(optional_fields, rename = "CacheOutputs"))]
54-
#[serde(rename_all = "camelCase")]
55-
pub struct CacheOutputs {
56-
/// Directories to cache (relative to the package root).
57-
pub include: Option<Vec<Str>>,
58-
59-
/// Directories to exclude from the cache.
60-
pub exclude: Option<Vec<Str>>,
61-
}
62-
6350
/// Cache configuration fields when caching is enabled
6451
#[derive(Debug, Deserialize, PartialEq, Eq)]
6552
// TS derive macro generates code using std types that clippy disallows; skip derive during linting
@@ -71,9 +58,6 @@ pub struct EnabledCacheConfig {
7158

7259
/// Environment variable names to be passed to the task without fingerprinting.
7360
pub pass_through_envs: Option<Vec<Str>>,
74-
75-
/// Output artifacts to cache.
76-
pub outputs: Option<CacheOutputs>,
7761
}
7862

7963
/// Options for user-defined tasks in `vite.config.*`, excluding the command.
@@ -105,11 +89,7 @@ impl Default for UserTaskOptions {
10589
// Caching enabled with no fingerprinted envs
10690
cache_config: UserCacheConfig::Enabled {
10791
cache: None,
108-
enabled_cache_config: EnabledCacheConfig {
109-
envs: None,
110-
pass_through_envs: None,
111-
outputs: None,
112-
},
92+
enabled_cache_config: EnabledCacheConfig { envs: None, pass_through_envs: None },
11393
},
11494
}
11595
}
@@ -388,7 +368,6 @@ mod tests {
388368
enabled_cache_config: EnabledCacheConfig {
389369
envs: Some(std::iter::once("NODE_ENV".into()).collect()),
390370
pass_through_envs: Some(std::iter::once("FOO".into()).collect()),
391-
outputs: None,
392371
}
393372
},
394373
);

0 commit comments

Comments
 (0)