From 7d9d18ae44cda2c5c445f14e90a7b4cb684b76e5 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Mar 2026 15:29:54 +0000 Subject: [PATCH 1/2] fix: regenerate TypeScript type definitions after cache config refactor The cache configuration refactor in #191 added UserGlobalCacheConfig but didn't regenerate run-config.ts, causing the typescript_generation test to fail in CI. https://claude.ai/code/session_014eMPQ1Mw6EQpPkjkk1onsQ --- crates/vite_task_graph/run-config.ts | 48 ++++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/crates/vite_task_graph/run-config.ts b/crates/vite_task_graph/run-config.ts index 7944ae70..4b0c4c48 100644 --- a/crates/vite_task_graph/run-config.ts +++ b/crates/vite_task_graph/run-config.ts @@ -1,27 +1,3 @@ -export type UserGlobalCacheConfig = - | boolean - | { - /** - * Enable caching for package.json scripts not defined in the `tasks` map. - * - * When `false`, package.json scripts will not be cached. - * When `true`, package.json scripts will be cached with default settings. - * - * Default: `false` - */ - scripts?: boolean; - /** - * Global cache kill switch for task entries. - * - * When `false`, overrides all tasks to disable caching, even tasks with `cache: true`. - * When `true`, respects each task's individual `cache` setting - * (each task's `cache` defaults to `true` if omitted). - * - * Default: `true` - */ - tasks?: boolean; - }; - export type Task = { /** * The command to run for the task. @@ -60,6 +36,30 @@ export type Task = { } ); +export type UserGlobalCacheConfig = + | boolean + | { + /** + * Enable caching for package.json scripts not defined in the `tasks` map. + * + * When `false`, package.json scripts will not be cached. + * When `true`, package.json scripts will be cached with default settings. + * + * Default: `false` + */ + scripts?: boolean; + /** + * Global cache kill switch for task entries. + * + * When `false`, overrides all tasks to disable caching, even tasks with `cache: true`. + * When `true`, respects each task's individual `cache` setting + * (each task's `cache` defaults to `true` if omitted). + * + * Default: `true` + */ + tasks?: boolean; + }; + export type RunConfig = { /** * Root-level cache configuration. From afcceecdee3d7212e0def1007f6ae8812c9df2ca Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Mar 2026 15:36:40 +0000 Subject: [PATCH 2/2] fix: sort TypeScript type declarations for deterministic generation The ts_rs visit_dependencies traversal order is non-deterministic due to HashMap iteration order, causing run-config.ts to randomly reorder type declarations between regenerations. Sort the collected declarations before emitting them. https://claude.ai/code/session_014eMPQ1Mw6EQpPkjkk1onsQ --- crates/vite_task_graph/src/config/user.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/vite_task_graph/src/config/user.rs b/crates/vite_task_graph/src/config/user.rs index bf55eaec..d8d784d6 100644 --- a/crates/vite_task_graph/src/config/user.rs +++ b/crates/vite_task_graph/src/config/user.rs @@ -225,6 +225,9 @@ impl UserRunConfig { let mut collector = DeclCollector(Vec::new()); Self::visit_dependencies(&mut collector); + // Sort declarations for deterministic output order + collector.0.sort(); + // Export all types let mut types: String = collector .0