From 010c29279103027f0f336208eeffeb850ddf7da3 Mon Sep 17 00:00:00 2001 From: branchseer Date: Sun, 15 Feb 2026 13:14:12 +0800 Subject: [PATCH 1/2] refactor: remove ExecutionPlan wrapper struct ExecutionPlan was a trivial single-field wrapper around ExecutionItemKind that added no value. Its methods either delegated trivially or were associated functions that didn't even return Self. - Promote plan_query() and plan_synthetic() to pub free functions - plan_synthetic() now returns SpawnExecution directly instead of wrapping/unwrapping through ExecutionPlan - Move Serialize impl to ExecutionGraph directly, removing the serialize_with indirection on ExecutionItemKind::Expanded - Remove unused methods: plan(), is_empty(), root_node(), into_root_node(), from_execution_graph() --- crates/vite_task/src/session/mod.rs | 12 +- crates/vite_task_plan/src/execution_graph.rs | 7 + crates/vite_task_plan/src/lib.rs | 179 +++++----------- ... env-test synthetic task in user task.snap | 140 ++++++------- ...query - echo and lint with extra args.snap | 180 ++++++++-------- ...query - lint and echo with extra args.snap | 172 ++++++++------- .../query - normal task with extra args.snap | 136 ++++++------ ... synthetic task in user task with cwd.snap | 128 ++++++------ .../query - synthetic task in user task.snap | 128 ++++++------ ...tic task with extra args in user task.snap | 136 ++++++------ .../query - cache clean in script.snap | 92 ++++---- ...t should put synthetic task under cwd.snap | 128 ++++++------ ...n should not affect expanded task cwd.snap | 196 +++++++++--------- .../snapshots/query - nested vp run.snap | 140 ++++++------- ...in pnpm-workspace.yaml to be optional.snap | 80 ++++--- ...ery - shell fallback for pipe command.snap | 140 ++++++------- ... does not affect expanded query tasks.snap | 188 ++++++++--------- ...s not affect expanded synthetic cache.snap | 188 ++++++++--------- ...out cacheScripts defaults to no cache.snap | 86 ++++---- ...assThroughEnvs inherited by synthetic.snap | 130 ++++++------ ... cache false disables synthetic cache.snap | 86 ++++---- ...th cache true enables synthetic cache.snap | 128 ++++++------ .../query - synthetic-in-subpackage.snap | 188 ++++++++--------- .../query - vpr expands to vp run.snap | 140 ++++++------- .../tests/plan_snapshots/main.rs | 3 +- 25 files changed, 1483 insertions(+), 1648 deletions(-) diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index b6a7fd9d..feb0c684 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -20,7 +20,7 @@ use vite_task_graph::{ loader::UserConfigLoader, }; use vite_task_plan::{ - ExecutionGraph, ExecutionPlan, TaskGraphLoader, + ExecutionGraph, TaskGraphLoader, plan_request::{PlanRequest, ScriptCommand, SyntheticPlanRequest}, prepend_path_env, }; @@ -457,18 +457,12 @@ impl<'a> Session<'a> { ) -> anyhow::Result { // Plan the synthetic execution — returns a SpawnExecution directly // (synthetic plans are always a single spawned process) - let execution_plan = ExecutionPlan::plan_synthetic( + let spawn_execution = vite_task_plan::plan_synthetic( &self.workspace_path, &self.cwd, synthetic_plan_request, cache_key, )?; - let vite_task_plan::ExecutionItemKind::Leaf(vite_task_plan::LeafExecutionKind::Spawn( - spawn_execution, - )) = execution_plan.into_root_node() - else { - unreachable!("plan_synthetic always produces a Leaf(Spawn(..)) node") - }; // Initialize cache (needed for cache-aware execution) let cache = self.cache()?; @@ -531,7 +525,7 @@ impl<'a> Session<'a> { }); } }; - ExecutionPlan::plan_query( + vite_task_plan::plan_query( query_plan_request, &self.workspace_path, &cwd, diff --git a/crates/vite_task_plan/src/execution_graph.rs b/crates/vite_task_plan/src/execution_graph.rs index 214b0e46..3c731016 100644 --- a/crates/vite_task_plan/src/execution_graph.rs +++ b/crates/vite_task_plan/src/execution_graph.rs @@ -1,6 +1,7 @@ use std::ops::Deref; use petgraph::graph::{DefaultIx, DiGraph, EdgeIndex, IndexType, NodeIndex}; +use serde::{Serialize, Serializer}; use crate::TaskExecution; @@ -135,3 +136,9 @@ impl Deref for ExecutionGraph { &self.graph } } + +impl Serialize for ExecutionGraph { + fn serialize(&self, serializer: S) -> Result { + vite_graph_ser::serialize_by_key(&self.graph, serializer) + } +} diff --git a/crates/vite_task_plan/src/lib.rs b/crates/vite_task_plan/src/lib.rs index c4f1cd25..366395c5 100644 --- a/crates/vite_task_plan/src/lib.rs +++ b/crates/vite_task_plan/src/lib.rs @@ -18,7 +18,7 @@ pub use path_env::{get_path_env, prepend_path_env}; use plan::{ParentCacheConfig, plan_query_request, plan_synthetic_request}; use plan_request::{PlanRequest, QueryPlanRequest, SyntheticPlanRequest}; use rustc_hash::FxHashMap; -use serde::{Serialize, Serializer, ser::SerializeMap as _}; +use serde::{Serialize, ser::SerializeMap as _}; use vite_path::AbsolutePath; use vite_str::Str; use vite_task_graph::{TaskGraphLoadError, display::TaskDisplay}; @@ -142,18 +142,11 @@ pub enum LeafExecutionKind { /// /// `vite_graph_ser::serialize_by_key` expects `&DiGraph`, so we call `.inner()` /// to get the underlying `DiGraph` reference. -fn serialize_execution_graph_by_key( - graph: &ExecutionGraph, - serializer: S, -) -> Result { - vite_graph_ser::serialize_by_key(graph.inner(), serializer) -} - /// An execution item, from a split subcommand in a task's command (`item1 && item2 && ...`). #[derive(Debug, Serialize)] pub enum ExecutionItemKind { /// Expanded from a known vp subcommand, like `vp run ...` or a synthesized task. - Expanded(#[serde(serialize_with = "serialize_execution_graph_by_key")] ExecutionGraph), + Expanded(ExecutionGraph), /// A normal execution that spawns a child process, like `tsc --noEmit`. Leaf(LeafExecutionKind), } @@ -186,127 +179,53 @@ pub trait TaskGraphLoader { ) -> Result<&vite_task_graph::IndexedTaskGraph, TaskGraphLoadError>; } -#[derive(Debug, Serialize)] -pub struct ExecutionPlan { - root_node: ExecutionItemKind, +/// Plan a query execution: load the task graph, query it, and build the execution graph. +/// +/// # Errors +/// Returns an error if task graph loading, query, or execution planning fails. +#[expect(clippy::future_not_send, reason = "PlanRequestParser and TaskGraphLoader are !Send")] +pub async fn plan_query( + query_plan_request: QueryPlanRequest, + workspace_path: &Arc, + cwd: &Arc, + envs: &FxHashMap, Arc>, + plan_request_parser: &mut (dyn PlanRequestParser + '_), + task_graph_loader: &mut (dyn TaskGraphLoader + '_), +) -> Result { + let indexed_task_graph = task_graph_loader.load_task_graph().await?; + + let context = PlanContext::new( + workspace_path, + Arc::clone(cwd), + envs.clone(), + plan_request_parser, + indexed_task_graph, + ); + plan_query_request(query_plan_request, context).await } -impl ExecutionPlan { - #[must_use] - pub const fn root_node(&self) -> &ExecutionItemKind { - &self.root_node - } - - #[must_use] - pub fn into_root_node(self) -> ExecutionItemKind { - self.root_node - } - - /// Returns `true` if the plan contains no tasks to execute. - #[must_use] - pub fn is_empty(&self) -> bool { - match &self.root_node { - ExecutionItemKind::Expanded(graph) => graph.node_count() == 0, - ExecutionItemKind::Leaf(_) => false, - } - } - - /// Create an execution plan from an execution graph. - #[must_use] - pub const fn from_execution_graph(execution_graph: ExecutionGraph) -> Self { - Self { root_node: ExecutionItemKind::Expanded(execution_graph) } - } - - /// Plan a query execution: load the task graph, query it, and build the execution graph. - /// - /// # Errors - /// Returns an error if task graph loading, query, or execution planning fails. - #[expect(clippy::future_not_send, reason = "PlanRequestParser and TaskGraphLoader are !Send")] - pub async fn plan_query( - query_plan_request: QueryPlanRequest, - workspace_path: &Arc, - cwd: &Arc, - envs: &FxHashMap, Arc>, - plan_request_parser: &mut (dyn PlanRequestParser + '_), - task_graph_loader: &mut (dyn TaskGraphLoader + '_), - ) -> Result { - let indexed_task_graph = task_graph_loader.load_task_graph().await?; - - let context = PlanContext::new( - workspace_path, - Arc::clone(cwd), - envs.clone(), - plan_request_parser, - indexed_task_graph, - ); - plan_query_request(query_plan_request, context).await - } - - /// Plan an execution from a plan request. - /// - /// # Errors - /// Returns an error if task graph loading, query, or execution planning fails. - #[expect(clippy::future_not_send, reason = "PlanRequestParser and TaskGraphLoader are !Send")] - pub async fn plan( - plan_request: PlanRequest, - workspace_path: &Arc, - cwd: &Arc, - envs: &FxHashMap, Arc>, - plan_request_parser: &mut (dyn PlanRequestParser + '_), - task_graph_loader: &mut (dyn TaskGraphLoader + '_), - ) -> Result { - let root_node = match plan_request { - PlanRequest::Query(query_plan_request) => { - let execution_graph = Self::plan_query( - query_plan_request, - workspace_path, - cwd, - envs, - plan_request_parser, - task_graph_loader, - ) - .await?; - ExecutionItemKind::Expanded(execution_graph) - } - PlanRequest::Synthetic(synthetic_plan_request) => { - let execution = plan_synthetic_request( - workspace_path, - &BTreeMap::default(), - synthetic_plan_request, - None, - cwd, - ParentCacheConfig::None, - )?; - ExecutionItemKind::Leaf(LeafExecutionKind::Spawn(execution)) - } - }; - Ok(Self { root_node }) - } - - /// Plan a synthetic task execution, returning the resolved [`SpawnExecution`] directly. - /// - /// Unlike `plan_query` which returns a full execution graph, synthetic executions - /// are always a single spawned process. The caller can execute it directly using - /// `execute_spawn`. - /// - /// # Errors - /// Returns an error if the program is not found or path fingerprinting fails. - #[expect(clippy::result_large_err, reason = "Error is large for diagnostics")] - pub fn plan_synthetic( - workspace_path: &Arc, - cwd: &Arc, - synthetic_plan_request: SyntheticPlanRequest, - cache_key: Arc<[Str]>, - ) -> Result { - let execution_cache_key = cache_metadata::ExecutionCacheKey::ExecAPI(cache_key); - let execution = plan_synthetic_request( - workspace_path, - &BTreeMap::default(), - synthetic_plan_request, - Some(execution_cache_key), - cwd, - ParentCacheConfig::None, - )?; - Ok(Self { root_node: ExecutionItemKind::Leaf(LeafExecutionKind::Spawn(execution)) }) - } +/// Plan a synthetic task execution, returning the resolved [`SpawnExecution`] directly. +/// +/// Unlike [`plan_query`] which returns a full execution graph, synthetic executions +/// are always a single spawned process. The caller can execute it directly using +/// `execute_spawn`. +/// +/// # Errors +/// Returns an error if the program is not found or path fingerprinting fails. +#[expect(clippy::result_large_err, reason = "Error is large for diagnostics")] +pub fn plan_synthetic( + workspace_path: &Arc, + cwd: &Arc, + synthetic_plan_request: SyntheticPlanRequest, + cache_key: Arc<[Str]>, +) -> Result { + let execution_cache_key = cache_metadata::ExecutionCacheKey::ExecAPI(cache_key); + plan_synthetic_request( + workspace_path, + &BTreeMap::default(), + synthetic_plan_request, + Some(execution_cache_key), + cwd, + ParentCacheConfig::None, + ) } 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-envs/snapshots/query - env-test synthetic task in user task.snap index 763a1c1b..fb26571a 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-envs/snapshots/query - env-test synthetic task in user task.snap @@ -3,84 +3,80 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "env-test" - ], - "node": { - "task_display": { - "package_name": "additional-envs", - "task_name": "env-test", - "package_path": "/" +[ + { + "key": [ + "/", + "env-test" + ], + "node": { + "task_display": { + "package_name": "additional-envs", + "task_name": "env-test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "additional-envs", + "task_name": "env-test", + "package_path": "/" + }, + "command": "vp env-test TEST_VAR hello_world", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "additional-envs", - "task_name": "env-test", - "package_path": "/" - }, - "command": "vp env-test TEST_VAR hello_world", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "print-env" - } - }, - "args": [ - "TEST_VAR" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "TEST_VAR", - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "env-test", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-env" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/print-env", - "args": [ - "TEST_VAR" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin", - "TEST_VAR": "hello_world" - }, - "cwd": "/" + "args": [ + "TEST_VAR" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "TEST_VAR", + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "env-test", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-env", + "args": [ + "TEST_VAR" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin", + "TEST_VAR": "hello_world" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap index 8c407f5b..01aaa4ca 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap @@ -3,110 +3,106 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "echo-and-lint" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "echo-and-lint", - "package_path": "/" +[ + { + "key": [ + "/", + "echo-and-lint" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "echo-and-lint", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "echo-and-lint", + "package_path": "/" + }, + "command": "echo Linting", + "and_item_index": 0, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "echo-and-lint", - "package_path": "/" - }, - "command": "echo Linting", - "and_item_index": 0, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "Linting" - ], - "trailing_newline": true - } - } + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "Linting" + ], + "trailing_newline": true } } } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "echo-and-lint", + "package_path": "/" }, - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "echo-and-lint", - "package_path": "/" - }, - "command": "vp lint --fix", - "and_item_index": 1, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [ - "--fix" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "echo-and-lint", - "and_item_index": 1, - "extra_args": [ - "--fix" - ], - "package_path": "" - } + "command": "vp lint --fix", + "and_item_index": 1, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [ + "args": [ + "--fix" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "echo-and-lint", + "and_item_index": 1, + "extra_args": [ "--fix" ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [ + "--fix" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap index 96ef73af..ad51649f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap @@ -3,104 +3,100 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "lint-and-echo" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "lint-and-echo", - "package_path": "/" +[ + { + "key": [ + "/", + "lint-and-echo" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "lint-and-echo", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "lint-and-echo", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": 0, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "lint-and-echo", - "package_path": "/" - }, - "command": "vp lint", - "and_item_index": 0, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint-and-echo", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "args": [], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint-and-echo", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "lint-and-echo", + "package_path": "/" }, - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "lint-and-echo", - "package_path": "/" - }, - "command": "echo 'Linting complete'", - "and_item_index": 1, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "Linting complete" - ], - "trailing_newline": true - } - } + "command": "echo 'Linting complete'", + "and_item_index": 1, + "cwd": "/" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "Linting complete" + ], + "trailing_newline": true } } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap index 440abfa4..61490dad 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap @@ -3,84 +3,80 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "hello" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "hello", - "package_path": "/" +[ + { + "key": [ + "/", + "hello" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "hello", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "hello", + "package_path": "/" + }, + "command": "print-file a.txt", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "hello", - "package_path": "/" - }, - "command": "print-file a.txt", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "print-file" - } - }, - "args": [ - "a.txt" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "hello", - "and_item_index": 0, - "extra_args": [ - "a.txt" - ], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/print-file", - "args": [ + "args": [ + "a.txt" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "hello", + "and_item_index": 0, + "extra_args": [ "a.txt" ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "a.txt" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap index 157b5d59..5f2e0320 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap @@ -3,78 +3,74 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "lint" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "lint", - "package_path": "/" +[ + { + "key": [ + "/", + "lint" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "lint", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "lint", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "lint", - "package_path": "/" - }, - "command": "vp lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "args": [], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap index 157b5d59..5f2e0320 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap @@ -3,78 +3,74 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "lint" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "lint", - "package_path": "/" +[ + { + "key": [ + "/", + "lint" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "lint", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "lint", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "lint", - "package_path": "/" - }, - "command": "vp lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "args": [], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap index 75011659..7aaa1216 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap @@ -3,84 +3,80 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "lint" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "lint", - "package_path": "/" +[ + { + "key": [ + "/", + "lint" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "lint", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "lint", + "package_path": "/" + }, + "command": "vp lint --fix", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "lint", - "package_path": "/" - }, - "command": "vp lint --fix", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [ - "--fix" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint", - "and_item_index": 0, - "extra_args": [ - "--fix" - ], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [ + "args": [ + "--fix" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint", + "and_item_index": 0, + "extra_args": [ "--fix" ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [ + "--fix" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap index 916c5e05..1aa3598b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap @@ -3,56 +3,52 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "clean-cache" - ], - "node": { - "task_display": { - "package_name": "@test/cache-subcommand", - "task_name": "clean-cache", - "package_path": "/" +[ + { + "key": [ + "/", + "clean-cache" + ], + "node": { + "task_display": { + "package_name": "@test/cache-subcommand", + "task_name": "clean-cache", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-subcommand", + "task_name": "clean-cache", + "package_path": "/" + }, + "command": "vp cache clean", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-subcommand", - "task_name": "clean-cache", - "package_path": "/" - }, - "command": "vp cache clean", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/node_modules/.bin/vp", - "args": [ - "cache", - "clean" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" - } - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/vp", + "args": [ + "cache", + "clean" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp lint should put synthetic task under cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp lint should put synthetic task under cwd.snap index ee106cdb..957f0afa 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp lint should put synthetic task under cwd.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp lint should put synthetic task under cwd.snap @@ -3,78 +3,74 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "cd-lint" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "cd-lint", - "package_path": "/" +[ + { + "key": [ + "/", + "cd-lint" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "cd-lint", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "cd-lint", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": 1, + "cwd": "/src" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "cd-lint", - "package_path": "/" - }, - "command": "vp lint", - "and_item_index": 1, - "cwd": "/src" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "src", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "cd-lint", - "and_item_index": 1, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "src", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/src" + "args": [], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "cd-lint", + "and_item_index": 1, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/src" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp run should not affect expanded task cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp run should not affect expanded task cwd.snap index 16713272..220135ea 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp run should not affect expanded task cwd.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp run should not affect expanded task cwd.snap @@ -3,114 +3,110 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "cd-build" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "cd-build", - "package_path": "/" +[ + { + "key": [ + "/", + "cd-build" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "cd-build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "cd-build", + "package_path": "/" + }, + "command": "vp run build", + "and_item_index": 1, + "cwd": "/src" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "cd-build", - "package_path": "/" - }, - "command": "vp run build", - "and_item_index": 1, - "cwd": "/src" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "build", - "package_path": "/" + "kind": { + "Expanded": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "build", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "build", - "package_path": "/" - }, - "command": "print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "print-file" - } - }, - "args": [ - "package.json" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "build", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/print-file", - "args": [ - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } - } - ] - }, - "neighbors": [] - } - ] + ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/query - nested vp run.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/query - nested vp run.snap index d892aaaa..5a40c0d8 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/query - nested vp run.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/query - nested vp run.snap @@ -3,83 +3,79 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "script2" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "script2", - "package_path": "/" +[ + { + "key": [ + "/", + "script2" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "script2", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "script2", + "package_path": "/" + }, + "command": "vp run script1", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "script2", - "package_path": "/" - }, - "command": "vp run script1", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "script1" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "script1", - "package_path": "/" + "kind": { + "Expanded": [ + { + "key": [ + "/", + "script1" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "script1", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "script1", + "package_path": "/" + }, + "command": "echo hello", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "script1", - "package_path": "/" - }, - "command": "echo hello", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "hello" - ], - "trailing_newline": true - } - } + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "hello" + ], + "trailing_newline": true } } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } - } - ] - }, - "neighbors": [] - } - ] + ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-packages-optional/snapshots/query - allow `packages` in pnpm-workspace.yaml to be optional.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-packages-optional/snapshots/query - allow `packages` in pnpm-workspace.yaml to be optional.snap index 07834655..e903be3c 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-packages-optional/snapshots/query - allow `packages` in pnpm-workspace.yaml to be optional.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-packages-optional/snapshots/query - allow `packages` in pnpm-workspace.yaml to be optional.snap @@ -3,51 +3,47 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-packages-optional --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "hello" - ], - "node": { - "task_display": { - "package_name": "additional-envs", - "task_name": "hello", - "package_path": "/" +[ + { + "key": [ + "/", + "hello" + ], + "node": { + "task_display": { + "package_name": "additional-envs", + "task_name": "hello", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "additional-envs", + "task_name": "hello", + "package_path": "/" + }, + "command": "echo hello", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "additional-envs", - "task_name": "hello", - "package_path": "/" - }, - "command": "echo hello", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "hello" - ], - "trailing_newline": true - } - } + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "hello" + ], + "trailing_newline": true } } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/query - shell fallback for pipe command.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/query - shell fallback for pipe command.snap index 0e230877..a71c1be7 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/query - shell fallback for pipe command.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/query - shell fallback for pipe command.snap @@ -3,84 +3,80 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "pipe-test" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "pipe-test", - "package_path": "/" +[ + { + "key": [ + "/", + "pipe-test" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "pipe-test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "pipe-test", + "package_path": "/" + }, + "command": "echo hello | node -e \"process.stdin.pipe(process.stdout)\"", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "pipe-test", - "package_path": "/" - }, - "command": "echo hello | node -e \"process.stdin.pipe(process.stdout)\"", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "" - } - }, - "args": [ - "", - "echo hello | node -e \"process.stdin.pipe(process.stdout)\"" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "pipe-test", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "" } }, - "spawn_command": { - "program_path": "", - "args": [ - "", - "echo hello | node -e \"process.stdin.pipe(process.stdout)\"" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "args": [ + "", + "echo hello | node -e \"process.stdin.pipe(process.stdout)\"" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "pipe-test", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "", + "args": [ + "", + "echo hello | node -e \"process.stdin.pipe(process.stdout)\"" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - parent cache false does not affect expanded query tasks.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - parent cache false does not affect expanded query tasks.snap index 60326ff8..7d9735f0 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - parent cache false does not affect expanded query tasks.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - parent cache false does not affect expanded query tasks.snap @@ -3,110 +3,106 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "run-build-no-cache" - ], - "node": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "run-build-no-cache", - "package_path": "/" +[ + { + "key": [ + "/", + "run-build-no-cache" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "run-build-no-cache", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "run-build-no-cache", + "package_path": "/" + }, + "command": "vp run build", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "run-build-no-cache", - "package_path": "/" - }, - "command": "vp run build", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "build", - "package_path": "/" + "kind": { + "Expanded": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "build", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "build", - "package_path": "/" - }, - "command": "vp lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "build", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "args": [], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } - } - ] - }, - "neighbors": [] - } - ] + ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script cache false does not affect expanded synthetic cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script cache false does not affect expanded synthetic cache.snap index 5fca264a..aa9178c1 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script cache false does not affect expanded synthetic cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script cache false does not affect expanded synthetic cache.snap @@ -3,110 +3,106 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "run-build-cache-false" - ], - "node": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "run-build-cache-false", - "package_path": "/" +[ + { + "key": [ + "/", + "run-build-cache-false" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "run-build-cache-false", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "run-build-cache-false", + "package_path": "/" + }, + "command": "vp run build", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "run-build-cache-false", - "package_path": "/" - }, - "command": "vp run build", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "build", - "package_path": "/" + "kind": { + "Expanded": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "build", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "build", - "package_path": "/" - }, - "command": "vp lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "build", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "args": [], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } - } - ] - }, - "neighbors": [] - } - ] + ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cacheScripts defaults to no cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cacheScripts defaults to no cache.snap index 714efb30..d0939ed4 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cacheScripts defaults to no cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cacheScripts defaults to no cache.snap @@ -3,53 +3,49 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "lint" - ], - "node": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "lint", - "package_path": "/" +[ + { + "key": [ + "/", + "lint" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "lint", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "lint", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "lint", - "package_path": "/" - }, - "command": "vp lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" - } - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task passThroughEnvs inherited by synthetic.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task passThroughEnvs inherited by synthetic.snap index c8ba0b5e..4ec65e1d 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task passThroughEnvs inherited by synthetic.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task passThroughEnvs inherited by synthetic.snap @@ -3,79 +3,75 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "lint-with-pass-through-envs" - ], - "node": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "lint-with-pass-through-envs", - "package_path": "/" +[ + { + "key": [ + "/", + "lint-with-pass-through-envs" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "lint-with-pass-through-envs", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "lint-with-pass-through-envs", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "lint-with-pass-through-envs", - "package_path": "/" - }, - "command": "vp lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "CUSTOM_VAR", - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint-with-pass-through-envs", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "args": [], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "CUSTOM_VAR", + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint-with-pass-through-envs", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache false disables synthetic cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache false disables synthetic cache.snap index 967bf632..d4dae7cd 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache false disables synthetic cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache false disables synthetic cache.snap @@ -3,53 +3,49 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "lint-no-cache" - ], - "node": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "lint-no-cache", - "package_path": "/" +[ + { + "key": [ + "/", + "lint-no-cache" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "lint-no-cache", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "lint-no-cache", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "lint-no-cache", - "package_path": "/" - }, - "command": "vp lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" - } - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache true enables synthetic cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache true enables synthetic cache.snap index 106590da..24822be5 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache true enables synthetic cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache true enables synthetic cache.snap @@ -3,78 +3,74 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "lint-with-cache" - ], - "node": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "lint-with-cache", - "package_path": "/" +[ + { + "key": [ + "/", + "lint-with-cache" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "lint-with-cache", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "lint-with-cache", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "lint-with-cache", - "package_path": "/" - }, - "command": "vp lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint-with-cache", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/" + "args": [], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint-with-cache", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap index b714f2c5..4e2faf07 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap @@ -3,110 +3,106 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "lint" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "lint", - "package_path": "/" +[ + { + "key": [ + "/", + "lint" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "lint", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "lint", + "package_path": "/" + }, + "command": "vp run a#lint", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "lint", - "package_path": "/" - }, - "command": "vp run a#lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/packages/a", - "lint" - ], - "node": { - "task_display": { - "package_name": "a", - "task_name": "lint", - "package_path": "/packages/a" + "kind": { + "Expanded": [ + { + "key": [ + "/packages/a", + "lint" + ], + "node": { + "task_display": { + "package_name": "a", + "task_name": "lint", + "package_path": "/packages/a" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "a", + "task_name": "lint", + "package_path": "/packages/a" + }, + "command": "vp lint", + "and_item_index": null, + "cwd": "/packages/a" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "a", - "task_name": "lint", - "package_path": "/packages/a" - }, - "command": "vp lint", - "and_item_index": null, - "cwd": "/packages/a" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "packages/a", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "oxlint" - } - }, - "args": [], - "env_fingerprints": { - "fingerprinted_envs": {}, - "pass_through_env_config": [ - "" - ] - }, - "fingerprint_ignores": null - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint", - "and_item_index": 0, - "extra_args": [], - "package_path": "packages/a" - } + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "packages/a", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" } }, - "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/packages/a/node_modules/.bin:/node_modules/.bin:/node_modules/.bin" - }, - "cwd": "/packages/a" + "args": [], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint", + "and_item_index": 0, + "extra_args": [], + "package_path": "packages/a" } } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/packages/a/node_modules/.bin:/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/packages/a" } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } - } - ] - }, - "neighbors": [] - } - ] + ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/query - vpr expands to vp run.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/query - vpr expands to vp run.snap index 5d31eed5..693bf502 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/query - vpr expands to vp run.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/query - vpr expands to vp run.snap @@ -3,83 +3,79 @@ source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand --- -{ - "root_node": { - "Expanded": [ - { - "key": [ - "/", - "all" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "all", - "package_path": "/" +[ + { + "key": [ + "/", + "all" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "all", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "all", + "package_path": "/" + }, + "command": "vpr build", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "all", - "package_path": "/" - }, - "command": "vpr build", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "", - "task_name": "build", - "package_path": "/" + "kind": { + "Expanded": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "build", + "package_path": "/" + }, + "command": "echo building", + "and_item_index": null, + "cwd": "/" }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "", - "task_name": "build", - "package_path": "/" - }, - "command": "echo building", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "building" - ], - "trailing_newline": true - } - } + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building" + ], + "trailing_newline": true } } } } - ] - }, - "neighbors": [] - } - ] + } + } + ] + }, + "neighbors": [] } - } - ] - }, - "neighbors": [] - } - ] + ] + } + } + ] + }, + "neighbors": [] } -} +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/main.rs b/crates/vite_task_plan/tests/plan_snapshots/main.rs index 11b7bab1..294a74ad 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/main.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/main.rs @@ -11,7 +11,6 @@ use tokio::runtime::Runtime; use vite_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf}; use vite_str::Str; use vite_task::{Command, Session}; -use vite_task_plan::ExecutionPlan; use vite_workspace::find_workspace_root; /// Local parser wrapper for `BuiltInCommand` @@ -185,7 +184,7 @@ fn run_case_inner( .await; let plan = match plan_result { - Ok(graph) => ExecutionPlan::from_execution_graph(graph), + Ok(graph) => graph, Err(err) => { // Format the full error chain using anyhow's `{:#}` formatter // and redact workspace paths for snapshot stability. From 21ab5a662300766dd4577e7309da90f1d2381916 Mon Sep 17 00:00:00 2001 From: branchseer Date: Sun, 15 Feb 2026 13:21:40 +0800 Subject: [PATCH 2/2] fix: suppress clippy::implicit_hasher on free function plan_query --- crates/vite_task_plan/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/vite_task_plan/src/lib.rs b/crates/vite_task_plan/src/lib.rs index 366395c5..79968548 100644 --- a/crates/vite_task_plan/src/lib.rs +++ b/crates/vite_task_plan/src/lib.rs @@ -184,6 +184,7 @@ pub trait TaskGraphLoader { /// # Errors /// Returns an error if task graph loading, query, or execution planning fails. #[expect(clippy::future_not_send, reason = "PlanRequestParser and TaskGraphLoader are !Send")] +#[expect(clippy::implicit_hasher, reason = "FxHashMap is the only hasher used in this codebase")] pub async fn plan_query( query_plan_request: QueryPlanRequest, workspace_path: &Arc,