diff --git a/CHANGELOG.md b/CHANGELOG.md index 90fa2668..c65bda3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +- **Added** `--concurrency-limit` flag to limit the number of tasks running at the same time (defaults to 4) ([#288](https://github.com/voidzero-dev/vite-task/pull/288), [#309](https://github.com/voidzero-dev/vite-task/pull/309)) +- **Added** `--parallel` flag to ignore task dependencies and run all tasks at once with unlimited concurrency (unless `--concurrency-limit` is also specified) ([#309](https://github.com/voidzero-dev/vite-task/pull/309)) - **Added** object form for `input` entries: `{ "pattern": "...", "base": "workspace" | "package" }` to resolve glob patterns relative to the workspace root instead of the package directory ([#295](https://github.com/voidzero-dev/vite-task/pull/295)) - **Fixed** arguments after the task name being consumed by `vp` instead of passed through to the task ([#286](https://github.com/voidzero-dev/vite-task/pull/286), [#290](https://github.com/voidzero-dev/vite-task/pull/290)) - **Changed** default untracked env patterns to align with Turborepo, covering more CI and platform-specific variables ([#262](https://github.com/voidzero-dev/vite-task/pull/262)) diff --git a/crates/vite_task/src/cli/mod.rs b/crates/vite_task/src/cli/mod.rs index 65cf6122..84a420d6 100644 --- a/crates/vite_task/src/cli/mod.rs +++ b/crates/vite_task/src/cli/mod.rs @@ -51,6 +51,15 @@ pub struct RunFlags { /// How task output is displayed. #[clap(long, default_value = "interleaved")] pub log: LogMode, + + /// Maximum number of tasks to run concurrently. Defaults to 4. + #[clap(long)] + pub concurrency_limit: Option, + + /// Run tasks without dependency ordering. Sets concurrency to unlimited + /// unless `--concurrency-limit` is also specified. + #[clap(long, default_value = "false")] + pub parallel: bool, } impl RunFlags { @@ -206,6 +215,8 @@ impl ResolvedRunCommand { let cache_override = self.flags.cache_override(); let include_explicit_deps = !self.flags.ignore_depends_on; + let concurrency_limit = self.flags.concurrency_limit.map(|n| n.max(1)); + let parallel = self.flags.parallel; let (package_query, is_cwd_only) = self.flags.package_query.into_package_query(task_specifier.package_name, cwd)?; @@ -220,6 +231,8 @@ impl ResolvedRunCommand { plan_options: PlanOptions { extra_args: self.additional_args.into(), cache_override, + concurrency_limit, + parallel, }, }, is_cwd_only, diff --git a/crates/vite_task/src/session/execute/mod.rs b/crates/vite_task/src/session/execute/mod.rs index 9fec69b1..9f5877ed 100644 --- a/crates/vite_task/src/session/execute/mod.rs +++ b/crates/vite_task/src/session/execute/mod.rs @@ -50,10 +50,6 @@ pub enum SpawnOutcome { Failed, } -/// Maximum number of tasks that can execute concurrently within a single -/// execution graph level. -const CONCURRENCY_LIMIT: usize = 10; - /// Holds shared references needed during graph execution. /// /// The `reporter` field is wrapped in `RefCell` because concurrent futures @@ -80,7 +76,7 @@ impl ExecutionContext<'_> { /// /// Uses a DAG scheduler: tasks whose dependencies have all completed are scheduled /// onto a `FuturesUnordered`, bounded by a per-graph `Semaphore` with - /// [`CONCURRENCY_LIMIT`] permits. Each recursive `Expanded` graph creates its own + /// `concurrency_limit` permits. Each recursive `Expanded` graph creates its own /// semaphore, so nested graphs have independent concurrency limits. /// /// Fast-fail: if any task fails, `execute_leaf` cancels the `CancellationToken` @@ -88,17 +84,18 @@ impl ExecutionContext<'_> { /// closes the semaphore, drains remaining futures, and returns. #[tracing::instrument(level = "debug", skip_all)] async fn execute_expanded_graph(&self, graph: &ExecutionGraph) { - if graph.node_count() == 0 { + if graph.graph.node_count() == 0 { return; } - let semaphore = Arc::new(Semaphore::new(CONCURRENCY_LIMIT)); + let semaphore = + Arc::new(Semaphore::new(graph.concurrency_limit.min(Semaphore::MAX_PERMITS))); // Compute dependency count for each node. // Edge A→B means "A depends on B", so A's dependency count = outgoing edge count. let mut dep_count: FxHashMap = FxHashMap::default(); - for node_ix in graph.node_indices() { - dep_count.insert(node_ix, graph.neighbors(node_ix).count()); + for node_ix in graph.graph.node_indices() { + dep_count.insert(node_ix, graph.graph.neighbors(node_ix).count()); } let mut futures = FuturesUnordered::new(); @@ -123,7 +120,7 @@ impl ExecutionContext<'_> { // Find dependents of the completed node (nodes that depend on it). // Edge X→completed means "X depends on completed", so X is a predecessor // in graph direction = neighbor in Incoming direction. - for dependent in graph.neighbors_directed(completed_ix, Direction::Incoming) { + for dependent in graph.graph.neighbors_directed(completed_ix, Direction::Incoming) { let count = dep_count.get_mut(&dependent).expect("all nodes are in dep_count"); *count -= 1; if *count == 0 { @@ -162,7 +159,7 @@ impl ExecutionContext<'_> { /// in order; if any item fails, `execute_leaf` cancels the `CancellationToken` /// and remaining items are skipped (preserving `&&` semantics). async fn execute_node(&self, graph: &ExecutionGraph, node_ix: ExecutionNodeIndex) { - let task_execution = &graph[node_ix]; + let task_execution = &graph.graph[node_ix]; for item in &task_execution.items { if self.cancellation_token.is_cancelled() { diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index add1633a..e7b5fb10 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -273,10 +273,14 @@ impl<'a> Session<'a> { let (graph, is_cwd_only) = self.plan_from_cli_run_resolved(cwd, run_command.clone()).await?; - if graph.node_count() == 0 { - // No tasks matched. With is_cwd_only (no scope flags) the - // task name is a typo — show the selector. Otherwise error. - if is_cwd_only { + if graph.graph.node_count() == 0 { + // No tasks matched. Show the interactive selector only when + // the command has no scope flags and no execution flags + // (concurrency-limit, parallel) — otherwise the user intended + // a specific execution mode and a typo should be an error. + let has_execution_flags = run_command.flags.concurrency_limit.is_some() + || run_command.flags.parallel; + if is_cwd_only && !has_execution_flags { let qpr = self.handle_no_task(is_interactive, &run_command).await?; self.plan_from_query(qpr).await? } else { @@ -508,6 +512,8 @@ impl<'a> Session<'a> { plan_options: PlanOptions { extra_args: run_command.additional_args.clone().into(), cache_override: run_command.flags.cache_override(), + concurrency_limit: None, + parallel: false, }, }) } @@ -589,6 +595,11 @@ impl<'a> Session<'a> { &self.envs } + /// Mutably access the environment map, cloning the `Arc` if shared. + pub fn envs_mut(&mut self) -> &mut FxHashMap, Arc> { + Arc::make_mut(&mut self.envs) + } + pub const fn cwd(&self) -> &Arc { &self.cwd } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/package.json new file mode 100644 index 00000000..9bb9eec6 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/package.json @@ -0,0 +1,4 @@ +{ + "name": "parallel-execution-test", + "private": true +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/packages/a/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/packages/a/package.json new file mode 100644 index 00000000..094c896c --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/packages/a/package.json @@ -0,0 +1,6 @@ +{ + "name": "@parallel/a", + "scripts": { + "build": "vtt barrier ../../.barrier sync 2" + } +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/packages/b/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/packages/b/package.json new file mode 100644 index 00000000..84cf6429 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/packages/b/package.json @@ -0,0 +1,9 @@ +{ + "name": "@parallel/b", + "scripts": { + "build": "vtt barrier ../../.barrier sync 2" + }, + "dependencies": { + "@parallel/a": "workspace:*" + } +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/pnpm-workspace.yaml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/pnpm-workspace.yaml new file mode 100644 index 00000000..924b55f4 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/snapshots.toml new file mode 100644 index 00000000..de1cbd21 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/snapshots.toml @@ -0,0 +1,8 @@ +# Package b depends on a, so without --parallel they run sequentially. +# Both use a barrier requiring 2 participants — if run sequentially the +# first would wait forever and the test would timeout. +# --parallel discards dependency edges, allowing both to run at once. + +[[e2e]] +name = "parallel flag runs dependent tasks concurrently" +steps = [["vt", "run", "-r", "--parallel", "build"]] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/snapshots/parallel flag runs dependent tasks concurrently.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/snapshots/parallel flag runs dependent tasks concurrently.snap new file mode 100644 index 00000000..a06f33e0 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/snapshots/parallel flag runs dependent tasks concurrently.snap @@ -0,0 +1,11 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vt run -r --parallel build +~/packages/a$ vtt barrier ../../.barrier sync 2 ⊘ cache disabled +~/packages/b$ vtt barrier ../../.barrier sync 2 ⊘ cache disabled + + +--- +vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/vite-task.json new file mode 100644 index 00000000..b39113d0 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/parallel-execution/vite-task.json @@ -0,0 +1,3 @@ +{ + "cache": false +} diff --git a/crates/vite_task_plan/src/error.rs b/crates/vite_task_plan/src/error.rs index 66db2783..7a255b8d 100644 --- a/crates/vite_task_plan/src/error.rs +++ b/crates/vite_task_plan/src/error.rs @@ -154,6 +154,9 @@ pub enum Error { #[error("Task \"{0}\" not found")] NoTasksMatched(Str), + #[error("Invalid value for VP_RUN_CONCURRENCY_LIMIT: {0:?}")] + InvalidConcurrencyLimitEnv(Arc), + /// A cycle was detected in the task dependency graph during planning. /// /// This is caught by `AcyclicGraph::try_from_graph`, which validates that the diff --git a/crates/vite_task_plan/src/execution_graph.rs b/crates/vite_task_plan/src/execution_graph.rs index 5a884296..4e8b94d9 100644 --- a/crates/vite_task_plan/src/execution_graph.rs +++ b/crates/vite_task_plan/src/execution_graph.rs @@ -155,15 +155,44 @@ impl Index> for AcyclicGraph { } } -/// The execution graph type alias, specialized for task execution. -pub type ExecutionGraph = AcyclicGraph; - impl Serialize for AcyclicGraph { fn serialize(&self, serializer: S) -> Result { vite_graph_ser::serialize_by_key(&self.graph, serializer) } } +/// The default concurrency limit for task execution within a single graph level. +pub const DEFAULT_CONCURRENCY_LIMIT: usize = 4; + +/// An execution graph with a per-level concurrency limit. +/// +/// Wraps an [`AcyclicGraph`] of task executions together with the maximum number +/// of tasks that may run concurrently within this graph level. Nested `Expanded` +/// graphs carry their own concurrency limit, enabling per-level control. +#[derive(Debug, Serialize)] +pub struct ExecutionGraph { + /// The underlying acyclic task execution graph. + pub graph: AcyclicGraph, + + /// Maximum number of tasks that can execute concurrently within this graph level. + pub concurrency_limit: usize, +} + +impl ExecutionGraph { + /// Validate that `graph` is acyclic and wrap it in an `ExecutionGraph` with + /// the given concurrency limit. + /// + /// # Errors + /// + /// Returns [`CycleError`] if the graph contains a cycle. + pub fn try_from_graph( + graph: InnerExecutionGraph, + concurrency_limit: usize, + ) -> Result> { + Ok(Self { graph: AcyclicGraph::try_from_graph(graph)?, concurrency_limit }) + } +} + /// Find a cycle in the directed graph, returning the cycle path if one exists. /// /// Uses a DFS with predecessor tracking. When a back edge `u → v` is detected diff --git a/crates/vite_task_plan/src/lib.rs b/crates/vite_task_plan/src/lib.rs index 1420cb75..c749ef29 100644 --- a/crates/vite_task_plan/src/lib.rs +++ b/crates/vite_task_plan/src/lib.rs @@ -12,7 +12,7 @@ use std::{collections::BTreeMap, ffi::OsStr, fmt::Debug, sync::Arc}; use context::PlanContext; pub use error::Error; -pub use execution_graph::ExecutionGraph; +pub use execution_graph::{DEFAULT_CONCURRENCY_LIMIT, ExecutionGraph}; pub use in_process::InProcessExecution; pub use path_env::{get_path_env, prepend_path_env}; use plan::{ParentCacheConfig, plan_query_request, plan_synthetic_request}; @@ -138,10 +138,6 @@ pub enum LeafExecutionKind { InProcess(InProcessExecution), } -/// Serialize an `ExecutionGraph` using `serialize_by_key`. -/// -/// `vite_graph_ser::serialize_by_key` expects `&DiGraph`, so we call `.inner()` -/// to get the underlying `DiGraph` reference. /// An execution item, from a split subcommand in a task's command (`item1 && item2 && ...`). #[derive(Debug, Serialize)] #[expect( diff --git a/crates/vite_task_plan/src/plan.rs b/crates/vite_task_plan/src/plan.rs index b39bc32f..e9436680 100644 --- a/crates/vite_task_plan/src/plan.rs +++ b/crates/vite_task_plan/src/plan.rs @@ -255,7 +255,7 @@ async fn plan_task_as_execution_node( // An empty execution graph means no tasks matched the query. // At the top level the session shows the task selector UI, // but in a nested context there is no UI — propagate as an error. - if execution_graph.node_count() == 0 { + if execution_graph.graph.node_count() == 0 { return Err(Error::NestPlan { task_display: task_node.task_display.clone(), command: Str::from(&command_str[add_item_span]), @@ -675,6 +675,27 @@ pub async fn plan_query_request( ); context.set_resolved_global_cache(final_cache); } + // Resolve effective concurrency for this level. + // + // Priority (highest to lowest): + // 1. `--concurrency-limit N` CLI flag + // 2. `--parallel` (without the above) → unlimited + // 3. `VP_RUN_CONCURRENCY_LIMIT` env var + // 4. `DEFAULT_CONCURRENCY_LIMIT` (4) + let effective_concurrency = match plan_options.concurrency_limit { + Some(n) => n, + None => { + if plan_options.parallel { + usize::MAX + } else { + concurrency_limit_from_env(context.envs())? + .unwrap_or(crate::DEFAULT_CONCURRENCY_LIMIT) + } + } + }; + + let parallel = plan_options.parallel; + context.set_extra_args(plan_options.extra_args); context.set_parent_query(Arc::clone(&query)); @@ -751,10 +772,15 @@ pub async fn plan_query_request( } } + // If --parallel, discard all edges so tasks run independently. + if parallel { + inner_graph.clear_edges(); + } + // Validate the graph is acyclic. // `try_from_graph` performs a DFS; if a cycle is found, it returns // `CycleError` containing the full cycle path as node indices. - ExecutionGraph::try_from_graph(inner_graph).map_err(|cycle| { + ExecutionGraph::try_from_graph(inner_graph, effective_concurrency).map_err(|cycle| { // Map each execution node index in the cycle path to its human-readable TaskDisplay. // Every node in the cycle was added via `inner_graph.add_node()` above, // with a corresponding entry in `execution_node_indices_by_task_index`. @@ -778,6 +804,22 @@ pub async fn plan_query_request( }) } +/// Parse `VP_RUN_CONCURRENCY_LIMIT` from the environment variables. +/// +/// Returns `Ok(None)` if the variable is not set. +/// Returns `Err` if the variable is set but cannot be parsed as a positive integer. +#[expect(clippy::result_large_err, reason = "Error type is shared across all plan functions")] +fn concurrency_limit_from_env( + envs: &FxHashMap, Arc>, +) -> Result, Error> { + let Some(value) = envs.get(OsStr::new("VP_RUN_CONCURRENCY_LIMIT")) else { + return Ok(None); + }; + let s = value.to_str().ok_or_else(|| Error::InvalidConcurrencyLimitEnv(Arc::clone(value)))?; + let n: usize = s.parse().map_err(|_| Error::InvalidConcurrencyLimitEnv(Arc::clone(value)))?; + Ok(Some(n.max(1))) +} + #[cfg(test)] mod tests { use std::collections::BTreeSet; diff --git a/crates/vite_task_plan/src/plan_request.rs b/crates/vite_task_plan/src/plan_request.rs index eb5716f5..b7addc8e 100644 --- a/crates/vite_task_plan/src/plan_request.rs +++ b/crates/vite_task_plan/src/plan_request.rs @@ -49,6 +49,13 @@ pub enum CacheOverride { pub struct PlanOptions { pub extra_args: Arc<[Str]>, pub cache_override: CacheOverride, + /// Per-level concurrency limit. `None` means inherit from the parent level + /// (or default to [`crate::DEFAULT_CONCURRENCY_LIMIT`] at the root). + pub concurrency_limit: Option, + /// When `true`, discard dependency edges between tasks at this level, + /// running all tasks as independent. If `concurrency` is also `None`, + /// this sets the effective concurrency to `usize::MAX`. + pub parallel: bool, } #[derive(Debug)] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - tool synthetic task in user task.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - tool synthetic task in user task.snap index e998b35c..ab370951 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - tool synthetic task in user task.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - tool synthetic task in user task.snap @@ -7,87 +7,90 @@ info: - env-test input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "TEST_VAR=hello_world vt tool print-env TEST_VAR", + "and_item_index": null, + "cwd": "/" }, - "command": "TEST_VAR=hello_world vt tool print-env TEST_VAR", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-env", + "TEST_VAR" + ], + "env_fingerprints": { + "fingerprinted_envs": { + "TEST_VAR": "hello_world" + }, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "env-test", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print-env", "TEST_VAR" ], - "env_fingerprints": { - "fingerprinted_envs": { - "TEST_VAR": "hello_world" - }, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "env-test", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:", + "TEST_VAR": "hello_world" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-env", - "TEST_VAR" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:", - "TEST_VAR": "hello_world" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap index 96229013..a4a3a4a3 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap @@ -8,52 +8,55 @@ info: - deploy input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override --- -[ - { - "key": [ - "/", - "deploy" - ], - "node": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "deploy", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "deploy", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "deploy" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "deploy", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "deploy", + "package_path": "/" + }, + "command": "vtt print-file vite-task.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file vite-task.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "vite-task.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "vite-task.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap index a86068f2..1fec2e4c 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap @@ -8,84 +8,87 @@ info: - test input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override --- -[ - { - "key": [ - "/", - "test" - ], - "node": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "test", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "test", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "test", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "test", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print-file", "package.json" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "test", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap index 43d87f5d..474a1ab4 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap @@ -8,84 +8,87 @@ info: - build input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override --- -[ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "build", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "build", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print-file", "package.json" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "build", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap index c468954c..ea5b94f3 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap @@ -8,84 +8,87 @@ info: - check input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override --- -[ - { - "key": [ - "/", - "check" - ], - "node": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "check", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "check", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "check" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "check", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "check", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "check", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print-file", "package.json" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "check", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap index 54847471..7bb3c028 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap @@ -8,52 +8,55 @@ info: - build input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override --- -[ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "build", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "build", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap index 80e8a5d3..609a8abc 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap @@ -8,52 +8,55 @@ info: - check input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override --- -[ - { - "key": [ - "/", - "check" - ], - "node": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "check", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "check", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "check" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "check", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "check", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap index aeeb3a97..94f369ca 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap @@ -7,52 +7,55 @@ info: - build input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override --- -[ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "build", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-cli-override", - "task_name": "build", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 369af88a..6e75db7d 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 @@ -8,114 +8,117 @@ info: - "--fix" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "/" }, - "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": "/" - }, - "command": "vt tool print lint --fix", - "and_item_index": 1, - "cwd": "/" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "echo-and-lint", + "package_path": "/" + }, + "command": "vt tool print lint --fix", + "and_item_index": 1, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint", + "--fix" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] } }, + "execution_cache_key": { + "UserTask": { + "task_name": "echo-and-lint", + "and_item_index": 1, + "extra_args": [ + "--fix" + ], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print", "lint", "--fix" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "echo-and-lint", - "and_item_index": 1, - "extra_args": [ - "--fix" - ], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint", - "--fix" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 47c93c91..63e165ba 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 @@ -8,110 +8,113 @@ info: - Linting complete input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt tool print lint", + "and_item_index": 0, + "cwd": "/" }, - "command": "vt tool print lint", - "and_item_index": 0, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint-and-echo", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print", "lint" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint-and-echo", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } - } - }, - { - "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 + { + "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 + } } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 32b9abdd..2b8b8c95 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 @@ -8,86 +8,89 @@ info: - a.txt input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vtt print-file a.txt", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file a.txt", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "a.txt" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "hello", + "and_item_index": 0, + "extra_args": [ + "a.txt" + ], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print-file", "a.txt" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "hello", - "and_item_index": 0, - "extra_args": [ - "a.txt" - ], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "a.txt" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 0f6f310b..f33b18c9 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 @@ -8,84 +8,87 @@ info: cwd: subdir input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt tool print lint", + "and_item_index": null, + "cwd": "/" }, - "command": "vt tool print lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print", "lint" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 13da929a..b5b496c5 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 @@ -7,84 +7,87 @@ info: - lint input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt tool print lint", + "and_item_index": null, + "cwd": "/" }, - "command": "vt tool print lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print", "lint" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 1ad6b8d8..1437733f 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 @@ -8,88 +8,91 @@ info: - "--fix" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt tool print lint --fix", + "and_item_index": null, + "cwd": "/" }, - "command": "vt tool print lint --fix", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint", + "--fix" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint", + "and_item_index": 0, + "extra_args": [ + "--fix" + ], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print", "lint", "--fix" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint", - "and_item_index": 0, - "extra_args": [ - "--fix" - ], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint", - "--fix" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap index 91936614..fab6d952 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap @@ -7,52 +7,55 @@ info: - build input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default --- -[ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/cache-scripts-default", - "task_name": "build", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-scripts-default", - "task_name": "build", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-scripts-default", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-scripts-default", + "task_name": "build", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - another task cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - another task cached by default.snap index 63557fe5..1cae81f1 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - another task cached by default.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - another task cached by default.snap @@ -7,84 +7,87 @@ info: - deploy input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override --- -[ - { - "key": [ - "/", - "deploy" - ], - "node": { - "task_display": { - "package_name": "@test/cache-scripts-task-override", - "task_name": "deploy", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-scripts-task-override", - "task_name": "deploy", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "deploy" + ], + "node": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "deploy", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "deploy", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "deploy", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print-file", "package.json" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "deploy", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap index bb7aaffb..d4a0b5ff 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap @@ -7,52 +7,55 @@ info: - test input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override --- -[ - { - "key": [ - "/", - "test" - ], - "node": { - "task_display": { - "package_name": "@test/cache-scripts-task-override", - "task_name": "test", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-scripts-task-override", - "task_name": "test", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "test", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap index 54467767..869906ce 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap @@ -7,84 +7,87 @@ info: - build input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override --- -[ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/cache-scripts-task-override", - "task_name": "build", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-scripts-task-override", - "task_name": "build", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "build", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print-file", "package.json" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "build", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 7594b7d3..5275a8f5 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 @@ -7,52 +7,55 @@ info: - clean-cache input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt cache clean", + "and_item_index": null, + "cwd": "/" }, - "command": "vt cache clean", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/node_modules/.bin/vt", - "args": [ - "cache", - "clean" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/vt", + "args": [ + "cache", + "clean" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap index 6a53eb9f..bb0b66cc 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap @@ -7,52 +7,55 @@ info: - deploy input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled --- -[ - { - "key": [ - "/", - "deploy" - ], - "node": { - "task_display": { - "package_name": "@test/cache-tasks-disabled", - "task_name": "deploy", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-tasks-disabled", - "task_name": "deploy", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "deploy" + ], + "node": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "deploy", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "deploy", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap index 796d0c9e..9594a9d9 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap @@ -7,52 +7,55 @@ info: - test input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled --- -[ - { - "key": [ - "/", - "test" - ], - "node": { - "task_display": { - "package_name": "@test/cache-tasks-disabled", - "task_name": "test", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-tasks-disabled", - "task_name": "test", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "test", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap index 99ede03b..e72d2099 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap @@ -7,52 +7,55 @@ info: - build input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled --- -[ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/cache-tasks-disabled", - "task_name": "build", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-tasks-disabled", - "task_name": "build", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "build", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap index 33282150..fcfb2ef0 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap @@ -7,84 +7,87 @@ info: - test input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable --- -[ - { - "key": [ - "/", - "test" - ], - "node": { - "task_display": { - "package_name": "@test/cache-true-no-force-enable", - "task_name": "test", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-true-no-force-enable", - "task_name": "test", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "test", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "test", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print-file", "package.json" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "test", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap index feb7b2ee..26fe7993 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap @@ -7,84 +7,87 @@ info: - deploy input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable --- -[ - { - "key": [ - "/", - "deploy" - ], - "node": { - "task_display": { - "package_name": "@test/cache-true-no-force-enable", - "task_name": "deploy", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-true-no-force-enable", - "task_name": "deploy", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "deploy" + ], + "node": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "deploy", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "deploy", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "deploy", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print-file", "package.json" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "deploy", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap index d87eb446..700ad40e 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap @@ -7,52 +7,55 @@ info: - build input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable --- -[ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/cache-true-no-force-enable", - "task_name": "build", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/cache-true-no-force-enable", - "task_name": "build", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "build", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt lint should put synthetic task under cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt lint should put synthetic task under cwd.snap index 10b37328..d675dd9a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt lint should put synthetic task under cwd.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt lint should put synthetic task under cwd.snap @@ -7,84 +7,87 @@ info: - cd-lint input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt tool print lint", + "and_item_index": 1, + "cwd": "/src" }, - "command": "vt tool print lint", - "and_item_index": 1, - "cwd": "/src" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "src", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "src", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "cd-lint", + "and_item_index": 1, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print", "lint" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "cd-lint", - "and_item_index": 1, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/src" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/src" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt run should not affect expanded task cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt run should not affect expanded task cwd.snap index 90a78acb..fea71c5a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt run should not affect expanded task cwd.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt run should not affect expanded task cwd.snap @@ -7,116 +7,122 @@ info: - cd-build input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt run build", + "and_item_index": 1, + "cwd": "/src" }, - "command": "vt run build", - "and_item_index": 1, - "cwd": "/src" - }, - "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": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "build", + "package_path": "/" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "build", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] } }, - "args": [ - "print-file", - "package.json" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "build", - "and_item_index": 0, - "extra_args": [], - "package_path": "" + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] + } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap index 6009b4ad..541fc3df 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap @@ -7,116 +7,122 @@ info: - outer-cache input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override --- -[ - { - "key": [ - "/", - "outer-cache" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-cache", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-cache", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "outer-cache" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-cache", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-cache", + "package_path": "/" + }, + "command": "vt run --cache inner", + "and_item_index": null, + "cwd": "/" }, - "command": "vt run --cache inner", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "inner" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "inner", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] } }, - "args": [ - "print-file", - "package.json" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "inner", - "and_item_index": 0, - "extra_args": [], - "package_path": "" + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] + } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap index 7c79d052..aed12a13 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap @@ -7,84 +7,90 @@ info: - outer-no-cache input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override --- -[ - { - "key": [ - "/", - "outer-no-cache" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-no-cache", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-no-cache", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "outer-no-cache" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-no-cache", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-no-cache", + "package_path": "/" + }, + "command": "vt run --no-cache inner", + "and_item_index": null, + "cwd": "/" }, - "command": "vt run --no-cache inner", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "inner" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] + } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap index e645edb2..626ebf28 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap @@ -7,84 +7,90 @@ info: - outer-inherit input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override --- -[ - { - "key": [ - "/", - "outer-inherit" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-inherit", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-inherit", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "outer-inherit" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "command": "vt run inner", + "and_item_index": null, + "cwd": "/" }, - "command": "vt run inner", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "inner" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] + } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap index f16cc13a..987a8c07 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap @@ -8,116 +8,122 @@ info: - outer-inherit input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override --- -[ - { - "key": [ - "/", - "outer-inherit" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-inherit", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-inherit", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "outer-inherit" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "command": "vt run inner", + "and_item_index": null, + "cwd": "/" }, - "command": "vt run inner", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "inner" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "inner", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] } }, - "args": [ - "print-file", - "package.json" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "inner", - "and_item_index": 0, - "extra_args": [], - "package_path": "" + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] + } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap index fb6b11cd..156ff02f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap @@ -8,116 +8,122 @@ info: - outer-cache input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override --- -[ - { - "key": [ - "/", - "outer-cache" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-cache", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-cache", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "outer-cache" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-cache", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-cache", + "package_path": "/" + }, + "command": "vt run --cache inner", + "and_item_index": null, + "cwd": "/" }, - "command": "vt run --cache inner", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "inner" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "inner", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] } }, - "args": [ - "print-file", - "package.json" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "inner", - "and_item_index": 0, - "extra_args": [], - "package_path": "" + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] + } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap index 5e754c41..c29e017d 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap @@ -8,84 +8,90 @@ info: - outer-inherit input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override --- -[ - { - "key": [ - "/", - "outer-inherit" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-inherit", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "outer-inherit", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "outer-inherit" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "command": "vt run inner", + "and_item_index": null, + "cwd": "/" }, - "command": "vt run inner", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "inner" - ], - "node": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/nested-cache-override", - "task_name": "inner", - "package_path": "/" - }, - "command": "vtt print-file package.json", - "and_item_index": null, - "cwd": "/" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print-file", - "package.json" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] + } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/package.json new file mode 100644 index 00000000..c2e0d471 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/package.json @@ -0,0 +1,8 @@ +{ + "name": "test-workspace", + "private": true, + "scripts": { + "build": "vt run -r build", + "build-with-concurrency": "vt run -r --concurrency-limit 5 build" + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/packages/a/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/packages/a/package.json new file mode 100644 index 00000000..e429c6e0 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/packages/a/package.json @@ -0,0 +1,10 @@ +{ + "name": "@test/a", + "version": "1.0.0", + "scripts": { + "build": "echo building a" + }, + "dependencies": { + "@test/b": "workspace:*" + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/packages/b/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/packages/b/package.json new file mode 100644 index 00000000..47183f5a --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/packages/b/package.json @@ -0,0 +1,10 @@ +{ + "name": "@test/b", + "version": "1.0.0", + "scripts": { + "build": "echo building b" + }, + "dependencies": { + "@test/c": "workspace:*" + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/packages/c/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/packages/c/package.json new file mode 100644 index 00000000..fb2d4b42 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/packages/c/package.json @@ -0,0 +1,7 @@ +{ + "name": "@test/c", + "version": "1.0.0", + "scripts": { + "build": "echo building c" + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/pnpm-workspace.yaml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/pnpm-workspace.yaml new file mode 100644 index 00000000..18ec407e --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - 'packages/*' diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots.toml new file mode 100644 index 00000000..d3b72979 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots.toml @@ -0,0 +1,49 @@ +# Baseline: normal recursive build preserves topo edges +[[plan]] +name = "baseline recursive build" +args = ["run", "-r", "build"] +compact = true + +# --parallel discards all edges at this level +[[plan]] +name = "parallel discards edges" +args = ["run", "-r", "--parallel", "build"] +compact = true + +# --parallel only affects the current level; nested Expanded graph preserves edges +[[plan]] +name = "parallel only affects current level" +args = ["run", "--parallel", "build"] +compact = true + +# --concurrency-limit with explicit value +[[plan]] +name = "concurrency-limit with explicit value" +args = ["run", "-r", "--concurrency-limit", "5", "build"] + +# --parallel without --concurrency-limit sets concurrency to max +[[plan]] +name = "parallel without concurrency-limit" +args = ["run", "-r", "--parallel", "build"] + +# --parallel with --concurrency-limit uses explicit concurrency, not max +[[plan]] +name = "parallel with concurrency-limit" +args = ["run", "-r", "--parallel", "--concurrency-limit", "3", "build"] + +# Nested vt run with explicit --concurrency-limit +[[plan]] +name = "nested with explicit concurrency-limit" +args = ["run", "build-with-concurrency"] + +# VP_RUN_CONCURRENCY_LIMIT env var sets concurrency +[[plan]] +name = "env var sets concurrency" +args = ["run", "-r", "build"] +env = { VP_RUN_CONCURRENCY_LIMIT = "7" } + +# --concurrency-limit flag takes priority over VP_RUN_CONCURRENCY_LIMIT env +[[plan]] +name = "cli flag overrides env var" +args = ["run", "-r", "--concurrency-limit", "3", "build"] +env = { VP_RUN_CONCURRENCY_LIMIT = "7" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - baseline recursive build.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - baseline recursive build.snap new file mode 100644 index 00000000..70c370c3 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - baseline recursive build.snap @@ -0,0 +1,20 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&compact_plan" +info: + args: + - run + - "-r" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency +--- +{ + "#build": [], + "packages/a#build": [ + "packages/b#build" + ], + "packages/b#build": [ + "packages/c#build" + ], + "packages/c#build": [] +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - cli flag overrides env var.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - cli flag overrides env var.snap new file mode 100644 index 00000000..052cc154 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - cli flag overrides env var.snap @@ -0,0 +1,171 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "-r" + - "--concurrency-limit" + - "3" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency +--- +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "test-workspace", + "task_name": "build", + "package_path": "/" + }, + "items": [] + }, + "neighbors": [] + }, + { + "key": [ + "/packages/a", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "command": "echo building a", + "and_item_index": null, + "cwd": "/packages/a" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "a" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [ + [ + "/packages/b", + "build" + ] + ] + }, + { + "key": [ + "/packages/b", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "command": "echo building b", + "and_item_index": null, + "cwd": "/packages/b" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "b" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [ + [ + "/packages/c", + "build" + ] + ] + }, + { + "key": [ + "/packages/c", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "command": "echo building c", + "and_item_index": null, + "cwd": "/packages/c" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "c" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 3 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - concurrency-limit with explicit value.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - concurrency-limit with explicit value.snap new file mode 100644 index 00000000..a33bbd36 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - concurrency-limit with explicit value.snap @@ -0,0 +1,171 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "-r" + - "--concurrency-limit" + - "5" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency +--- +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "test-workspace", + "task_name": "build", + "package_path": "/" + }, + "items": [] + }, + "neighbors": [] + }, + { + "key": [ + "/packages/a", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "command": "echo building a", + "and_item_index": null, + "cwd": "/packages/a" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "a" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [ + [ + "/packages/b", + "build" + ] + ] + }, + { + "key": [ + "/packages/b", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "command": "echo building b", + "and_item_index": null, + "cwd": "/packages/b" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "b" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [ + [ + "/packages/c", + "build" + ] + ] + }, + { + "key": [ + "/packages/c", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "command": "echo building c", + "and_item_index": null, + "cwd": "/packages/c" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "c" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 5 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - env var sets concurrency.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - env var sets concurrency.snap new file mode 100644 index 00000000..db02c515 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - env var sets concurrency.snap @@ -0,0 +1,169 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "-r" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency +--- +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "test-workspace", + "task_name": "build", + "package_path": "/" + }, + "items": [] + }, + "neighbors": [] + }, + { + "key": [ + "/packages/a", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "command": "echo building a", + "and_item_index": null, + "cwd": "/packages/a" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "a" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [ + [ + "/packages/b", + "build" + ] + ] + }, + { + "key": [ + "/packages/b", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "command": "echo building b", + "and_item_index": null, + "cwd": "/packages/b" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "b" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [ + [ + "/packages/c", + "build" + ] + ] + }, + { + "key": [ + "/packages/c", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "command": "echo building c", + "and_item_index": null, + "cwd": "/packages/c" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "c" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 7 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - nested with explicit concurrency-limit.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - nested with explicit concurrency-limit.snap new file mode 100644 index 00000000..a786312f --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - nested with explicit concurrency-limit.snap @@ -0,0 +1,203 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - build-with-concurrency +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency +--- +{ + "graph": [ + { + "key": [ + "/", + "build-with-concurrency" + ], + "node": { + "task_display": { + "package_name": "test-workspace", + "task_name": "build-with-concurrency", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "test-workspace", + "task_name": "build-with-concurrency", + "package_path": "/" + }, + "command": "vt run -r --concurrency-limit 5 build", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "test-workspace", + "task_name": "build", + "package_path": "/" + }, + "items": [] + }, + "neighbors": [] + }, + { + "key": [ + "/packages/a", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "command": "echo building a", + "and_item_index": null, + "cwd": "/packages/a" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "a" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [ + [ + "/packages/b", + "build" + ] + ] + }, + { + "key": [ + "/packages/b", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "command": "echo building b", + "and_item_index": null, + "cwd": "/packages/b" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "b" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [ + [ + "/packages/c", + "build" + ] + ] + }, + { + "key": [ + "/packages/c", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "command": "echo building c", + "and_item_index": null, + "cwd": "/packages/c" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "c" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 5 + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel discards edges.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel discards edges.snap new file mode 100644 index 00000000..71abf02d --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel discards edges.snap @@ -0,0 +1,17 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&compact_plan" +info: + args: + - run + - "-r" + - "--parallel" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency +--- +{ + "#build": [], + "packages/a#build": [], + "packages/b#build": [], + "packages/c#build": [] +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel only affects current level.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel only affects current level.snap new file mode 100644 index 00000000..bb9d06db --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel only affects current level.snap @@ -0,0 +1,26 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&compact_plan" +info: + args: + - run + - "--parallel" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency +--- +{ + "#build": { + "items": [ + { + "packages/a#build": [ + "packages/b#build" + ], + "packages/b#build": [ + "packages/c#build" + ], + "packages/c#build": [] + } + ], + "neighbors": [] + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel with concurrency-limit.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel with concurrency-limit.snap new file mode 100644 index 00000000..7d856058 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel with concurrency-limit.snap @@ -0,0 +1,162 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "-r" + - "--parallel" + - "--concurrency-limit" + - "3" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency +--- +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "test-workspace", + "task_name": "build", + "package_path": "/" + }, + "items": [] + }, + "neighbors": [] + }, + { + "key": [ + "/packages/a", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "command": "echo building a", + "and_item_index": null, + "cwd": "/packages/a" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "a" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [] + }, + { + "key": [ + "/packages/b", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "command": "echo building b", + "and_item_index": null, + "cwd": "/packages/b" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "b" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [] + }, + { + "key": [ + "/packages/c", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "command": "echo building c", + "and_item_index": null, + "cwd": "/packages/c" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "c" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 3 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel without concurrency-limit.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel without concurrency-limit.snap new file mode 100644 index 00000000..55c94875 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/query - parallel without concurrency-limit.snap @@ -0,0 +1,160 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "-r" + - "--parallel" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency +--- +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "test-workspace", + "task_name": "build", + "package_path": "/" + }, + "items": [] + }, + "neighbors": [] + }, + { + "key": [ + "/packages/a", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "command": "echo building a", + "and_item_index": null, + "cwd": "/packages/a" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "a" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [] + }, + { + "key": [ + "/packages/b", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "command": "echo building b", + "and_item_index": null, + "cwd": "/packages/b" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "b" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [] + }, + { + "key": [ + "/packages/c", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "command": "echo building c", + "and_item_index": null, + "cwd": "/packages/c" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "building", + "c" + ], + "trailing_newline": true + } + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 18446744073709551615 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/task graph.snap new file mode 100644 index 00000000..768246a6 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/snapshots/task graph.snap @@ -0,0 +1,177 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: task_graph_json +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency +--- +[ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "test-workspace", + "task_name": "build", + "package_path": "/" + }, + "resolved_config": { + "command": "vt run -r build", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "build-with-concurrency" + ], + "node": { + "task_display": { + "package_name": "test-workspace", + "task_name": "build-with-concurrency", + "package_path": "/" + }, + "resolved_config": { + "command": "vt run -r --concurrency-limit 5 build", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + }, + { + "key": [ + "/packages/a", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/a", + "task_name": "build", + "package_path": "/packages/a" + }, + "resolved_config": { + "command": "echo building a", + "resolved_options": { + "cwd": "/packages/a", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + }, + { + "key": [ + "/packages/b", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/b", + "task_name": "build", + "package_path": "/packages/b" + }, + "resolved_config": { + "command": "echo building b", + "resolved_options": { + "cwd": "/packages/b", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + }, + { + "key": [ + "/packages/c", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/c", + "task_name": "build", + "package_path": "/packages/c" + }, + "resolved_config": { + "command": "echo building c", + "resolved_options": { + "cwd": "/packages/c", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/vite-task.json new file mode 100644 index 00000000..d548edfa --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel-and-concurrency/vite-task.json @@ -0,0 +1,3 @@ +{ + "cache": true +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-disabled/snapshots/query - test runs without hooks when disabled.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-disabled/snapshots/query - test runs without hooks when disabled.snap index ee7d6ecd..173cfbf0 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-disabled/snapshots/query - test runs without hooks when disabled.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-disabled/snapshots/query - test runs without hooks when disabled.snap @@ -7,47 +7,50 @@ info: - test input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-disabled --- -[ - { - "key": [ - "/", - "test" - ], - "node": { - "task_display": { - "package_name": "@test/script-hooks-disabled", - "task_name": "test", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks-disabled", - "task_name": "test", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/script-hooks-disabled", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks-disabled", + "task_name": "test", + "package_path": "/" + }, + "command": "echo test", + "and_item_index": null, + "cwd": "/" }, - "command": "echo test", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "test" - ], - "trailing_newline": true + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "test" + ], + "trailing_newline": true + } } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-nested-run/snapshots/query - prescriptInHook runs when scriptInHook is called from a hook.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-nested-run/snapshots/query - prescriptInHook runs when scriptInHook is called from a hook.snap index 148cbdfd..3627717f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-nested-run/snapshots/query - prescriptInHook runs when scriptInHook is called from a hook.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-nested-run/snapshots/query - prescriptInHook runs when scriptInHook is called from a hook.snap @@ -7,131 +7,137 @@ info: - test input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-nested-run --- -[ - { - "key": [ - "/", - "test" - ], - "node": { - "task_display": { - "package_name": "@test/script-hooks-nested-run", - "task_name": "test", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks-nested-run", - "task_name": "pretest", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/script-hooks-nested-run", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks-nested-run", + "task_name": "pretest", + "package_path": "/" + }, + "command": "vt run scriptInHook", + "and_item_index": null, + "cwd": "/" }, - "command": "vt run scriptInHook", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Expanded": [ - { - "key": [ - "/", - "scriptInHook" - ], - "node": { - "task_display": { - "package_name": "@test/script-hooks-nested-run", - "task_name": "scriptInHook", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks-nested-run", - "task_name": "prescriptInHook", - "package_path": "/" - }, - "command": "echo prescriptInHook", - "and_item_index": null, - "cwd": "/" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "scriptInHook" + ], + "node": { + "task_display": { + "package_name": "@test/script-hooks-nested-run", + "task_name": "scriptInHook", + "package_path": "/" }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "prescriptInHook" - ], - "trailing_newline": true + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks-nested-run", + "task_name": "prescriptInHook", + "package_path": "/" + }, + "command": "echo prescriptInHook", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "prescriptInHook" + ], + "trailing_newline": true + } + } } } } - } - } - }, - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks-nested-run", - "task_name": "scriptInHook", - "package_path": "/" }, - "command": "echo scriptInHook", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "scriptInHook" - ], - "trailing_newline": true + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks-nested-run", + "task_name": "scriptInHook", + "package_path": "/" + }, + "command": "echo scriptInHook", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "scriptInHook" + ], + "trailing_newline": true + } + } } } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] - } - }, - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks-nested-run", - "task_name": "test", - "package_path": "/" - }, - "command": "echo test", - "and_item_index": null, - "cwd": "/" + } }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "test" - ], - "trailing_newline": true + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks-nested-run", + "task_name": "test", + "package_path": "/" + }, + "command": "echo test", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "test" + ], + "trailing_newline": true + } } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-task-no-hook/snapshots/query - task config test does not expand pretest hook.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-task-no-hook/snapshots/query - task config test does not expand pretest hook.snap index 5e738dfb..8c4c1322 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-task-no-hook/snapshots/query - task config test does not expand pretest hook.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-task-no-hook/snapshots/query - task config test does not expand pretest hook.snap @@ -7,47 +7,50 @@ info: - test input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks-task-no-hook --- -[ - { - "key": [ - "/", - "test" - ], - "node": { - "task_display": { - "package_name": "@test/script-hooks-task-no-hook", - "task_name": "test", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks-task-no-hook", - "task_name": "test", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/script-hooks-task-no-hook", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks-task-no-hook", + "task_name": "test", + "package_path": "/" + }, + "command": "echo test-task", + "and_item_index": null, + "cwd": "/" }, - "command": "echo test-task", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "test-task" - ], - "trailing_newline": true + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "test-task" + ], + "trailing_newline": true + } } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - build runs with pre hook only.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - build runs with pre hook only.snap index 566371b4..b3e378f8 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - build runs with pre hook only.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - build runs with pre hook only.snap @@ -7,73 +7,76 @@ info: - build input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks --- -[ - { - "key": [ - "/", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "build", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "prebuild", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "prebuild", + "package_path": "/" + }, + "command": "echo prebuild", + "and_item_index": null, + "cwd": "/" }, - "command": "echo prebuild", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "prebuild" - ], - "trailing_newline": true + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "prebuild" + ], + "trailing_newline": true + } } } } } - } - }, - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "build", - "package_path": "/" - }, - "command": "echo build", - "and_item_index": null, - "cwd": "/" }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "build" - ], - "trailing_newline": true + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "build", + "package_path": "/" + }, + "command": "echo build", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "build" + ], + "trailing_newline": true + } } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - extra args not passed to hooks.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - extra args not passed to hooks.snap index d37b03f2..b3592131 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - extra args not passed to hooks.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - extra args not passed to hooks.snap @@ -8,100 +8,103 @@ info: - "--coverage" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks --- -[ - { - "key": [ - "/", - "test" - ], - "node": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "test", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "pretest", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "pretest", + "package_path": "/" + }, + "command": "echo pretest", + "and_item_index": null, + "cwd": "/" }, - "command": "echo pretest", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "pretest" - ], - "trailing_newline": true + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "pretest" + ], + "trailing_newline": true + } } } } } - } - }, - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "test", - "package_path": "/" - }, - "command": "echo test --coverage", - "and_item_index": null, - "cwd": "/" }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "test", - "--coverage" - ], - "trailing_newline": true + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "test", + "package_path": "/" + }, + "command": "echo test --coverage", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "test", + "--coverage" + ], + "trailing_newline": true + } } } } } - } - }, - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "posttest", - "package_path": "/" - }, - "command": "echo posttest", - "and_item_index": null, - "cwd": "/" }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "posttest" - ], - "trailing_newline": true + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "posttest", + "package_path": "/" + }, + "command": "echo posttest", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "posttest" + ], + "trailing_newline": true + } } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - pretest directly expands prepretest but not when called as hook.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - pretest directly expands prepretest but not when called as hook.snap index 56765b7c..d6caa487 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - pretest directly expands prepretest but not when called as hook.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - pretest directly expands prepretest but not when called as hook.snap @@ -7,73 +7,76 @@ info: - pretest input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks --- -[ - { - "key": [ - "/", - "pretest" - ], - "node": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "pretest", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "prepretest", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "pretest" + ], + "node": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "pretest", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "prepretest", + "package_path": "/" + }, + "command": "echo prepretest", + "and_item_index": null, + "cwd": "/" }, - "command": "echo prepretest", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "prepretest" - ], - "trailing_newline": true + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "prepretest" + ], + "trailing_newline": true + } } } } } - } - }, - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "pretest", - "package_path": "/" - }, - "command": "echo pretest", - "and_item_index": null, - "cwd": "/" }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "pretest" - ], - "trailing_newline": true + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "pretest", + "package_path": "/" + }, + "command": "echo pretest", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "pretest" + ], + "trailing_newline": true + } } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - test runs with pre and post hooks.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - test runs with pre and post hooks.snap index fdf34168..8c59d369 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - test runs with pre and post hooks.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks/snapshots/query - test runs with pre and post hooks.snap @@ -7,99 +7,102 @@ info: - test input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/script-hooks --- -[ - { - "key": [ - "/", - "test" - ], - "node": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "test", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "pretest", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "pretest", + "package_path": "/" + }, + "command": "echo pretest", + "and_item_index": null, + "cwd": "/" }, - "command": "echo pretest", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "pretest" - ], - "trailing_newline": true + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "pretest" + ], + "trailing_newline": true + } } } } } - } - }, - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "test", - "package_path": "/" - }, - "command": "echo test", - "and_item_index": null, - "cwd": "/" }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "test" - ], - "trailing_newline": true + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "test", + "package_path": "/" + }, + "command": "echo test", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "test" + ], + "trailing_newline": true + } } } } } - } - }, - { - "execution_item_display": { - "task_display": { - "package_name": "@test/script-hooks", - "task_name": "posttest", - "package_path": "/" - }, - "command": "echo posttest", - "and_item_index": null, - "cwd": "/" }, - "kind": { - "Leaf": { - "InProcess": { - "kind": { - "Echo": { - "strings": [ - "posttest" - ], - "trailing_newline": true + { + "execution_item_display": { + "task_display": { + "package_name": "@test/script-hooks", + "task_name": "posttest", + "package_path": "/" + }, + "command": "echo posttest", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "InProcess": { + "kind": { + "Echo": { + "strings": [ + "posttest" + ], + "trailing_newline": true + } } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 db9b1c85..b0496247 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 @@ -7,84 +7,87 @@ info: - pipe-test input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "/" }, - "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": "" + "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": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "pipe-test", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "", "args": [ "", "echo hello | node -e \"process.stdin.pipe(process.stdout)\"" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "pipe-test", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "", - "args": [ - "", - "echo hello | node -e \"process.stdin.pipe(process.stdout)\"" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 ddf0f97e..7dc94216 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 @@ -7,116 +7,122 @@ info: - run-build-no-cache input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt run build", + "and_item_index": null, + "cwd": "/" }, - "command": "vt 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": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "build", - "package_path": "/" - }, - "command": "vt tool print lint", - "and_item_index": null, - "cwd": "/" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "build", + "package_path": "/" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "build", + "package_path": "/" + }, + "command": "vt tool print lint", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] } }, - "args": [ - "print", - "lint" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "build", - "and_item_index": 0, - "extra_args": [], - "package_path": "" + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] + } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 a917af98..5b5acfec 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 @@ -7,116 +7,122 @@ info: - run-build-cache-false input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt run build", + "and_item_index": null, + "cwd": "/" }, - "command": "vt 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": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "build", - "package_path": "/" - }, - "command": "vt tool print lint", - "and_item_index": null, - "cwd": "/" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "build", + "package_path": "/" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "build", + "package_path": "/" + }, + "command": "vt tool print lint", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] } }, - "args": [ - "print", - "lint" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "build", - "and_item_index": 0, - "extra_args": [], - "package_path": "" + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] + } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cache.scripts defaults to no cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cache.scripts defaults to no cache.snap index 10b9d818..13285719 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cache.scripts defaults to no cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cache.scripts defaults to no cache.snap @@ -7,52 +7,55 @@ info: - lint input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt tool print lint", + "and_item_index": null, + "cwd": "/" }, - "command": "vt tool print lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task untrackedEnv inherited by synthetic.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task untrackedEnv inherited by synthetic.snap index 155fb3a9..cea7eaa8 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task untrackedEnv inherited by synthetic.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task untrackedEnv inherited by synthetic.snap @@ -7,85 +7,88 @@ info: - lint-with-untracked-env input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -[ - { - "key": [ - "/", - "lint-with-untracked-env" - ], - "node": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "lint-with-untracked-env", - "package_path": "/" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "@test/synthetic-cache-disabled", - "task_name": "lint-with-untracked-env", - "package_path": "/" +{ + "graph": [ + { + "key": [ + "/", + "lint-with-untracked-env" + ], + "node": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "lint-with-untracked-env", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/synthetic-cache-disabled", + "task_name": "lint-with-untracked-env", + "package_path": "/" + }, + "command": "vt tool print lint", + "and_item_index": null, + "cwd": "/" }, - "command": "vt tool print lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "CUSTOM_VAR", + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint-with-untracked-env", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print", "lint" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "CUSTOM_VAR", - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint-with-untracked-env", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 04079568..1b9647c6 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 @@ -7,52 +7,55 @@ info: - lint-no-cache input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt tool print lint", + "and_item_index": null, + "cwd": "/" }, - "command": "vt tool print lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": null, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 3b7ce025..0aabadb4 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 @@ -7,84 +7,87 @@ info: - lint-with-cache input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt tool print lint", + "and_item_index": null, + "cwd": "/" }, - "command": "vt tool print lint", - "and_item_index": null, - "cwd": "/" - }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint-with-cache", + "and_item_index": 0, + "extra_args": [], + "package_path": "" } }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", "args": [ "print", "lint" ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint-with-cache", - "and_item_index": 0, - "extra_args": [], - "package_path": "" - } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/node_modules/.bin:" - }, - "cwd": "/" } } } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} 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 655d1c5b..f387431f 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 @@ -7,116 +7,122 @@ info: - lint input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage --- -[ - { - "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": "/" +{ + "graph": [ + { + "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": "vt run a#lint", + "and_item_index": null, + "cwd": "/" }, - "command": "vt 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" - }, - "items": [ - { - "execution_item_display": { - "task_display": { - "package_name": "a", - "task_name": "lint", - "package_path": "/packages/a" - }, - "command": "vt tool print lint", - "and_item_index": null, - "cwd": "/packages/a" + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/packages/a", + "lint" + ], + "node": { + "task_display": { + "package_name": "a", + "task_name": "lint", + "package_path": "/packages/a" }, - "kind": { - "Leaf": { - "Spawn": { - "cache_metadata": { - "spawn_fingerprint": { - "cwd": "packages/a", - "program_fingerprint": { - "OutsideWorkspace": { - "program_name": "vtt" + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "a", + "task_name": "lint", + "package_path": "/packages/a" + }, + "command": "vt tool print lint", + "and_item_index": null, + "cwd": "/packages/a" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "packages/a", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print", + "lint" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "lint", + "and_item_index": 0, + "extra_args": [], + "package_path": "packages/a" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] } }, - "args": [ - "print", - "lint" - ], - "env_fingerprints": { - "fingerprinted_envs": {}, - "untracked_env_config": [ - "" - ] - } - }, - "execution_cache_key": { - "UserTask": { - "task_name": "lint", - "and_item_index": 0, - "extra_args": [], - "package_path": "packages/a" + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/packages/a/node_modules/.bin:/node_modules/.bin:" + }, + "cwd": "/packages/a" } - }, - "input_config": { - "includes_auto": true, - "positive_globs": [], - "negative_globs": [] } - }, - "spawn_command": { - "program_path": "/vtt", - "args": [ - "print", - "lint" - ], - "all_envs": { - "NO_COLOR": "1", - "PATH": "/packages/a/node_modules/.bin:/node_modules/.bin:" - }, - "cwd": "/packages/a" } } } - } - } - ] - }, - "neighbors": [] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 } - ] + } } - } - ] - }, - "neighbors": [] - } -] + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/main.rs b/crates/vite_task_plan/tests/plan_snapshots/main.rs index 08ec2859..4da61062 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/main.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/main.rs @@ -36,6 +36,8 @@ struct Plan { pub cwd: RelativePathBuf, #[serde(default)] pub compact: bool, + #[serde(default)] + pub env: BTreeMap, } #[derive(serde::Deserialize, Default)] @@ -65,13 +67,16 @@ impl CompactPlan { fn from_execution_graph(graph: &ExecutionGraph, workspace_root: &AbsolutePath) -> Self { use petgraph::visit::EdgeRef as _; let mut map = BTreeMap::::new(); - for node_idx in graph.node_indices() { - let node = &graph[node_idx]; + for node_idx in graph.graph.node_indices() { + let node = &graph.graph[node_idx]; let key = Self::task_key(&node.task_display, workspace_root); let neighbors: BTreeSet = graph + .graph .edges(node_idx) - .map(|edge| Self::task_key(&graph[edge.target()].task_display, workspace_root)) + .map(|edge| { + Self::task_key(&graph.graph[edge.target()].task_display, workspace_root) + }) .collect(); let expanded_items: Vec = node @@ -245,6 +250,17 @@ fn run_case_inner( panic!("only `run` commands supported in plan tests") }; + // Inject per-case environment variables, removing them after the plan call. + let env_keys: Vec> = plan + .env + .iter() + .map(|(k, v)| { + let key = Arc::::from(OsStr::new(k.as_str())); + session.envs_mut().insert(Arc::clone(&key), Arc::from(OsStr::new(v.as_str()))); + key + }) + .collect(); + let plan_result = session .plan_from_cli_run(workspace_root.path.join(plan.cwd).into(), run_command) .await; @@ -281,6 +297,11 @@ fn run_case_inner( let plan_json = redact_snapshot(&plan, workspace_root_str); insta::assert_json_snapshot!(snapshot_name.as_str(), &plan_json); } + + // Clean up per-case environment variables. + for key in env_keys { + session.envs_mut().remove(&key); + } } }); } diff --git a/docs/concurrency.md b/docs/concurrency.md new file mode 100644 index 00000000..57b021cd --- /dev/null +++ b/docs/concurrency.md @@ -0,0 +1,59 @@ +# Concurrency + +`vp run` runs up to 4 tasks at once by default, respecting dependency order. + +## `--concurrency-limit`/`VP_RUN_CONCURRENCY_LIMIT` + +```sh +vp run -t --concurrency-limit 1 build # sequential +vp run -t --concurrency-limit 16 build # up to 16 at once +``` + +Also settable via the `VP_RUN_CONCURRENCY_LIMIT` env var. The CLI flag wins when both are present. + +**Default is 4** (same as pnpm) — enough to keep the machine busy while leaving room for tasks that already use all cores (bundlers, `tsc`, etc.). + +**Why the name `--concurrency-limit`**: The name makes clear this is an upper bound, not a target. We plan to add per-task concurrency control in `vite.config.*` (e.g. marking a build task as CPU-heavy), so the actual concurrency may end up lower than the limit. + +**Why not support CPU percentage** (like Turborepo's `--concurrency 50%`): This setting is meant to be a simple upper bound. CPU-core-aware concurrency control belongs at the per-task level, which we plan to add in the future. + +**Why support `VP_RUN_CONCURRENCY_LIMIT` env**: To allow people to apply it to every `vp run` without repeating the flag, especially in CI. + +**Why not support `concurrencyLimit` in `vite.config.*`**: The right limit usually depends on the machine, not the project. We reserve config-file concurrency settings for per-task hints (see above). + +Equivalent flags in other tools: + +| pnpm | Turborepo | Nx | +| ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | +| [`--workspace-concurrency`](https://pnpm.io/cli/recursive#--workspace-concurrency) | [`--concurrency`](https://turborepo.dev/docs/reference/run#--concurrency-number--percentage) | [`--parallel`](https://nx.dev/nx-api/nx/documents/run-many#parallel) | + +## `--parallel` + +Ignores dependency order and removes the concurrency limit: + +```sh +vp run -r --parallel dev +``` + +Useful for starting dev servers that all need to run at the same time. Same behavior as `--parallel` in pnpm. + +To ignore dependency order but still cap concurrency, combine both flags: + +```sh +vp run -r --parallel --concurrency-limit 8 lint +``` + +Equivalent flags in other tools: + +| pnpm | Turborepo | Nx | +| -------------------------------------------------- | ------------------------------------------------------------------- | --- | +| [`--parallel`](https://pnpm.io/cli/run#--parallel) | [`--parallel`](https://turborepo.dev/docs/reference/run#--parallel) | n/a | + +## Resolution order of concurrency limit + +The concurrency limit is resolved in this order (first match wins): + +1. `--concurrency-limit` CLI flag +2. `--parallel` without the above → unlimited +3. `VP_RUN_CONCURRENCY_LIMIT` env var +4. Default: 4