diff --git a/CHANGELOG.md b/CHANGELOG.md index 90fa2668..f2aac7ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +- **Fixed** Ctrl-C now prevents future tasks from being scheduled and prevents caching of in-flight task results ([#309](https://github.com/voidzero-dev/vite-task/pull/309)) +- **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/CONTRIBUTING.md b/CONTRIBUTING.md index b847cb9d..db3ceab3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,9 @@ just lint # Clippy linting just doc # Generate documentation ``` -### Running Specific Tests +## Testing + +### Running Tests ```bash cargo test # All tests @@ -55,6 +57,17 @@ Integration tests (e2e, plan, fspy) require `pnpm install` in `packages/tools` f See individual crate READMEs for crate-specific testing details. +### Playground + +The `playground/` directory is a small workspace for manually testing the task runner. It has three packages (`app → lib → utils`) with cached tasks (`build`, `test`, `lint`, `typecheck`) and an uncached `dev` script. + +```bash +cargo run --bin vt -- run -r build # run build across all packages +cargo run --bin vt -- run -r --parallel dev # start all dev scripts in parallel +``` + +See `playground/README.md` for the full task list and dependency structure. + ## Cross-Platform Development This project must work on macOS, Linux, and Windows. Skipping tests on any platform is not acceptable. 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/event.rs b/crates/vite_task/src/session/event.rs index a0ff4a3b..57aec779 100644 --- a/crates/vite_task/src/session/event.rs +++ b/crates/vite_task/src/session/event.rs @@ -59,6 +59,13 @@ pub enum CacheNotUpdatedReason { CacheDisabled, /// Execution exited with non-zero status NonZeroExitStatus, + /// Execution was cancelled before the result could be trusted. + /// Two possible causes: + /// - Ctrl-C: the user interrupted execution; the task may have + /// exited successfully but without completing its intended work. + /// - Fast-fail: a sibling task failed, triggering cancellation + /// while this task was still running. + Cancelled, /// Task modified files it read during execution (read-write overlap detected by fspy). /// Caching such tasks is unsound because the prerun input hashes become stale. InputModified { diff --git a/crates/vite_task/src/session/execute/mod.rs b/crates/vite_task/src/session/execute/mod.rs index 9fec69b1..9d5bf8e4 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 @@ -71,34 +67,48 @@ struct ExecutionContext<'a> { /// Base path for resolving relative paths in cache entries. /// Typically the workspace root. cache_base_path: &'a Arc, - /// Token for cancelling in-flight child processes. - cancellation_token: CancellationToken, + /// Token cancelled when a task fails. Kills in-flight child processes + /// (via `start_kill` in spawn.rs), prevents scheduling new tasks, and + /// prevents caching results of concurrently-running tasks. + fast_fail_token: CancellationToken, + /// Token cancelled by Ctrl-C. Unlike `fast_fail_token` (which kills + /// children), this only prevents scheduling new tasks and caching + /// results — running processes are left to handle SIGINT naturally. + interrupt_token: CancellationToken, } impl ExecutionContext<'_> { + /// Returns true if execution has been cancelled, either by a task + /// failure (fast-fail) or by Ctrl-C (interrupt). + fn cancelled(&self) -> bool { + self.fast_fail_token.is_cancelled() || self.interrupt_token.is_cancelled() + } + /// Execute all tasks in an execution graph concurrently, respecting dependencies. /// /// 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` - /// (killing in-flight child processes). This method detects the cancellation, - /// closes the semaphore, drains remaining futures, and returns. + /// Fast-fail: if any task fails, `execute_leaf` cancels the `fast_fail_token` + /// (killing in-flight child processes). Ctrl-C cancels the `interrupt_token`. + /// Either cancellation causes this method to close the semaphore, drain + /// remaining futures, and return. #[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(); @@ -114,7 +124,7 @@ impl ExecutionContext<'_> { // On failure, `execute_leaf` cancels the token — we detect it here, close // the semaphore (so pending acquires fail immediately), and drain. while let Some(completed_ix) = futures.next().await { - if self.cancellation_token.is_cancelled() { + if self.cancelled() { semaphore.close(); while futures.next().await.is_some() {} return; @@ -123,7 +133,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 { @@ -135,7 +145,7 @@ impl ExecutionContext<'_> { /// Create a future that acquires a semaphore permit, then executes a graph node. /// - /// On failure, `execute_node` cancels the `CancellationToken` — the caller + /// On failure, `execute_node` cancels the `fast_fail_token` — the caller /// detects this after the future completes. On semaphore closure or prior /// cancellation, the node is skipped. fn spawn_node<'a>( @@ -147,7 +157,7 @@ impl ExecutionContext<'_> { let sem = semaphore.clone(); async move { if let Ok(_permit) = sem.acquire_owned().await - && !self.cancellation_token.is_cancelled() + && !self.cancelled() { self.execute_node(graph, node_ix).await; } @@ -159,13 +169,13 @@ impl ExecutionContext<'_> { /// Execute a single node's items sequentially. /// /// A node may have multiple items (from `&&`-split commands). Items are executed - /// in order; if any item fails, `execute_leaf` cancels the `CancellationToken` + /// in order; if any item fails, `execute_leaf` cancels the `fast_fail_token` /// 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() { + if self.cancelled() { return; } match &item.kind { @@ -183,7 +193,7 @@ impl ExecutionContext<'_> { /// /// Creates a [`LeafExecutionReporter`] from the graph reporter and delegates /// to the appropriate execution method. On failure (non-zero exit or - /// infrastructure error), cancels the `CancellationToken`. + /// infrastructure error), cancels the `fast_fail_token`. #[tracing::instrument(level = "debug", skip_all)] async fn execute_leaf(&self, display: &ExecutionItemDisplay, leaf_kind: &LeafExecutionKind) { // Borrow the reporter briefly to create the leaf reporter, then drop @@ -218,7 +228,8 @@ impl ExecutionContext<'_> { spawn_execution, self.cache, self.cache_base_path, - self.cancellation_token.clone(), + self.fast_fail_token.clone(), + self.interrupt_token.clone(), ) .await; match outcome { @@ -229,7 +240,7 @@ impl ExecutionContext<'_> { } }; if failed { - self.cancellation_token.cancel(); + self.fast_fail_token.cancel(); } } } @@ -258,7 +269,8 @@ pub async fn execute_spawn( spawn_execution: &SpawnExecution, cache: &ExecutionCache, cache_base_path: &Arc, - cancellation_token: CancellationToken, + fast_fail_token: CancellationToken, + interrupt_token: CancellationToken, ) -> SpawnOutcome { let cache_metadata = spawn_execution.cache_metadata.as_ref(); @@ -351,7 +363,7 @@ pub async fn execute_spawn( // while the child also writes to the same FD. drop(stdio_config); - match spawn_inherited(&spawn_execution.spawn_command, cancellation_token).await { + match spawn_inherited(&spawn_execution.spawn_command, fast_fail_token).await { Ok(result) => { leaf_reporter.finish( Some(result.exit_status), @@ -422,7 +434,7 @@ pub async fn execute_spawn( std_outputs.as_mut(), path_accesses.as_mut(), &resolved_negatives, - cancellation_token, + fast_fail_token.clone(), ) .await { @@ -442,7 +454,11 @@ pub async fn execute_spawn( let (cache_update_status, cache_error) = if let Some((cache_metadata, globbed_inputs)) = cache_metadata_and_inputs { - if result.exit_status.success() { + let cancelled = fast_fail_token.is_cancelled() || interrupt_token.is_cancelled(); + if cancelled { + // Cancelled (Ctrl-C or sibling failure) — result is untrustworthy + (CacheUpdateStatus::NotUpdated(CacheNotUpdatedReason::Cancelled), None) + } else if result.exit_status.success() { // Check for read-write overlap: if the task wrote to any file it also // read, the inputs were modified during execution — don't cache. // Note: this only checks fspy-inferred reads, not globbed_inputs keys. @@ -522,7 +538,7 @@ pub async fn execute_spawn( #[tracing::instrument(level = "debug", skip_all)] async fn spawn_inherited( spawn_command: &SpawnCommand, - cancellation_token: CancellationToken, + fast_fail_token: CancellationToken, ) -> anyhow::Result { let mut cmd = fspy::Command::new(spawn_command.program_path.as_path()); cmd.args(spawn_command.args.iter().map(vite_str::Str::as_str)); @@ -582,7 +598,7 @@ async fn spawn_inherited( let exit_status = tokio::select! { status = child.wait() => status?, - () = cancellation_token.cancelled() => { + () = fast_fail_token.cancelled() => { child.start_kill()?; child.wait().await? } @@ -697,6 +713,7 @@ impl Session<'_> { &self, execution_graph: ExecutionGraph, builder: Box, + interrupt_token: CancellationToken, ) -> Result<(), ExitStatus> { // Initialize cache before building the reporter. Cache errors are reported // directly to stderr and cause an early exit, keeping the reporter flow clean @@ -716,7 +733,8 @@ impl Session<'_> { reporter: &reporter, cache, cache_base_path: &self.workspace_path, - cancellation_token: CancellationToken::new(), + fast_fail_token: CancellationToken::new(), + interrupt_token, }; // Execute the graph with fast-fail: if any task fails, remaining tasks diff --git a/crates/vite_task/src/session/execute/spawn.rs b/crates/vite_task/src/session/execute/spawn.rs index 03a055bb..6a3b7842 100644 --- a/crates/vite_task/src/session/execute/spawn.rs +++ b/crates/vite_task/src/session/execute/spawn.rs @@ -92,7 +92,7 @@ pub async fn spawn_with_tracking( std_outputs: Option<&mut Vec>, path_accesses: Option<&mut TrackedPathAccesses>, resolved_negatives: &[wax::Glob<'static>], - cancellation_token: CancellationToken, + fast_fail_token: CancellationToken, ) -> anyhow::Result { let mut cmd = fspy::Command::new(spawn_command.program_path.as_path()); cmd.args(spawn_command.args.iter().map(vite_str::Str::as_str)); @@ -108,7 +108,7 @@ pub async fn spawn_with_tracking( let (mut child_stdout, mut child_stderr, mut child_wait) = if path_accesses.is_some() { // fspy tracking enabled — fspy manages cancellation internally via a clone // of the token. We keep the original for the pipe read loop. - let mut tracked_child = cmd.spawn(cancellation_token.clone()).await?; + let mut tracked_child = cmd.spawn(fast_fail_token.clone()).await?; let stdout = tracked_child.stdout.take().unwrap(); let stderr = tracked_child.stderr.take().unwrap(); #[cfg(windows)] @@ -193,7 +193,7 @@ pub async fn spawn_with_tracking( } } } - () = cancellation_token.cancelled() => { + () = fast_fail_token.cancelled() => { // Kill the direct child (no-op for fspy which handles it internally). if let ChildWait::Tokio(ref mut child) = child_wait { let _ = child.start_kill(); @@ -291,7 +291,7 @@ pub async fn spawn_with_tracking( ChildWait::Tokio(mut child) => { let exit_status = tokio::select! { status = child.wait() => status?, - () = cancellation_token.cancelled() => { + () = fast_fail_token.cancelled() => { child.start_kill()?; child.wait().await? } diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index add1633a..4a2002ab 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 { @@ -327,14 +331,38 @@ impl<'a> Session<'a> { Some(self.make_summary_writer()), self.program_name.clone(), )); - // Ignore SIGINT/CTRL_C before executing tasks. Child tasks - // receive the signal directly from the terminal driver and handle - // it themselves. This lets the runner wait for tasks to exit and - // report their actual exit status rather than being killed - // mid-flight. - let _ = ctrlc::set_handler(|| {}); - - self.execute_graph(graph, builder).await.map_err(SessionError::EarlyExit) + // Don't let SIGINT/CTRL_C kill the runner. Child tasks receive + // the signal directly from the terminal driver and handle it + // themselves. Cancelling the interrupt token prevents scheduling + // new tasks and caching results of in-flight tasks. + // + // On Windows, an ancestor process (e.g. cargo) may have been + // created with CREATE_NEW_PROCESS_GROUP, which sets a per-process + // flag that silently drops CTRL_C_EVENT before it reaches + // registered handlers. Clear it so our handler fires. + #[cfg(windows)] + { + // SAFETY: Passing (None, FALSE) clears the inherited + // CTRL_C ignore flag. + unsafe extern "system" { + fn SetConsoleCtrlHandler( + handler: Option i32>, + add: i32, + ) -> i32; + } + unsafe { + SetConsoleCtrlHandler(None, 0); + } + } + let interrupt_token = tokio_util::sync::CancellationToken::new(); + let ct = interrupt_token.clone(); + ctrlc::set_handler(move || { + ct.cancel(); + })?; + + self.execute_graph(graph, builder, interrupt_token) + .await + .map_err(SessionError::EarlyExit) } } } @@ -508,6 +536,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, }, }) } @@ -642,6 +672,7 @@ impl<'a> Session<'a> { cache, &self.workspace_path, tokio_util::sync::CancellationToken::new(), + tokio_util::sync::CancellationToken::new(), ) .await; match outcome { diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/package.json index f444dee5..a9a08d6f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/package.json @@ -1,3 +1,4 @@ { - "name": "ctrl-c-test" + "name": "ctrl-c-test", + "private": true } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/packages/a/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/packages/a/package.json new file mode 100644 index 00000000..afec67f2 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/packages/a/package.json @@ -0,0 +1,6 @@ +{ + "name": "@ctrl-c/a", + "scripts": { + "dev": "vtt exit-on-ctrlc" + } +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/packages/b/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/packages/b/package.json new file mode 100644 index 00000000..3d0a9d82 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/packages/b/package.json @@ -0,0 +1,9 @@ +{ + "name": "@ctrl-c/b", + "scripts": { + "dev": "vtt print b-ran" + }, + "dependencies": { + "@ctrl-c/a": "workspace:*" + } +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/pnpm-workspace.yaml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/pnpm-workspace.yaml new file mode 100644 index 00000000..924b55f4 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots.toml index ec1817db..7c41735c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots.toml @@ -6,7 +6,8 @@ steps = [ { argv = [ "vt", "run", - "dev", + "--no-cache", + "@ctrl-c/a#dev", ], interactions = [ { "expect-milestone" = "ready" }, { "write-key" = "ctrl-c" }, @@ -19,9 +20,49 @@ steps = [ { argv = [ "vt", "run", - "dev-cached", + "@ctrl-c/a#dev", ], interactions = [ { "expect-milestone" = "ready" }, { "write-key" = "ctrl-c" }, ] }, ] + +# Package b depends on a, so without --parallel they run sequentially. +# After Ctrl-C terminates a, b should not be scheduled. +[[e2e]] +name = "ctrl-c prevents future tasks" +steps = [ + { argv = [ + "vt", + "run", + "-r", + "--no-cache", + "dev", + ], interactions = [ + { "expect-milestone" = "ready" }, + { "write-key" = "ctrl-c" }, + ] }, +] + +# dev exits 0 after Ctrl-C but the result should not be cached. +# The second run should be a cache miss, not a hit. +[[e2e]] +name = "ctrl-c prevents caching" +steps = [ + { argv = [ + "vt", + "run", + "@ctrl-c/a#dev", + ], interactions = [ + { "expect-milestone" = "ready" }, + { "write-key" = "ctrl-c" }, + ], comment = "exits 0 but should not be cached" }, + { argv = [ + "vt", + "run", + "@ctrl-c/a#dev", + ], interactions = [ + { "expect-milestone" = "ready" }, + { "write-key" = "ctrl-c" }, + ], comment = "should be cache miss, not hit" }, +] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c prevents caching.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c prevents caching.snap new file mode 100644 index 00000000..9f201464 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c prevents caching.snap @@ -0,0 +1,16 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vt run @ctrl-c/a#dev # exits 0 but should not be cached +@ expect-milestone: ready +~/packages/a$ vtt exit-on-ctrlc +@ write-key: ctrl-c +~/packages/a$ vtt exit-on-ctrlc +ctrl-c received +> vt run @ctrl-c/a#dev # should be cache miss, not hit +@ expect-milestone: ready +~/packages/a$ vtt exit-on-ctrlc +@ write-key: ctrl-c +~/packages/a$ vtt exit-on-ctrlc +ctrl-c received diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c prevents future tasks.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c prevents future tasks.snap new file mode 100644 index 00000000..d3ba5c9a --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c prevents future tasks.snap @@ -0,0 +1,10 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +expression: e2e_outputs +--- +> vt run -r --no-cache dev +@ expect-milestone: ready +~/packages/a$ vtt exit-on-ctrlc ⊘ cache disabled +@ write-key: ctrl-c +~/packages/a$ vtt exit-on-ctrlc ⊘ cache disabled +ctrl-c received diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c terminates running tasks (cached).snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c terminates running tasks (cached).snap index 8673a01f..6f0bca35 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c terminates running tasks (cached).snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c terminates running tasks (cached).snap @@ -2,9 +2,9 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vt run dev-cached +> vt run @ctrl-c/a#dev @ expect-milestone: ready -$ vtt exit-on-ctrlc +~/packages/a$ vtt exit-on-ctrlc @ write-key: ctrl-c -$ vtt exit-on-ctrlc +~/packages/a$ vtt exit-on-ctrlc ctrl-c received diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c terminates running tasks.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c terminates running tasks.snap index b19a6308..a29e7572 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c terminates running tasks.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/snapshots/ctrl-c terminates running tasks.snap @@ -2,9 +2,9 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vt run dev +> vt run --no-cache @ctrl-c/a#dev @ expect-milestone: ready -$ vtt exit-on-ctrlc ⊘ cache disabled +~/packages/a$ vtt exit-on-ctrlc ⊘ cache disabled @ write-key: ctrl-c -$ vtt exit-on-ctrlc ⊘ cache disabled +~/packages/a$ vtt exit-on-ctrlc ⊘ cache disabled ctrl-c received diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/vite-task.json index ed631d53..d548edfa 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/ctrl-c/vite-task.json @@ -1,13 +1,3 @@ { - "cache": true, - "tasks": { - "dev": { - "command": "vtt exit-on-ctrlc", - "cache": false - }, - "dev-cached": { - "command": "vtt exit-on-ctrlc", - "cache": true - } - } + "cache": true } 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..2fafc67a 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 @@ -182,7 +187,7 @@ fn run_case_inner( let workspace_root_str = workspace_root.path.as_path().to_str().unwrap(); let mut owned_config = vite_task_bin::OwnedSessionConfig::default(); let mut session = Session::init_with( - plan_envs, + plan_envs.clone(), Arc::clone(&workspace_root.path), owned_config.as_config(), ) @@ -245,9 +250,20 @@ fn run_case_inner( panic!("only `run` commands supported in plan tests") }; - let plan_result = session - .plan_from_cli_run(workspace_root.path.join(plan.cwd).into(), run_command) - .await; + // Create a fresh session per plan case with case-specific env vars and cwd. + let mut case_envs = plan_envs.clone(); + for (k, v) in &plan.env { + case_envs + .insert(Arc::from(OsStr::new(k.as_str())), Arc::from(OsStr::new(v.as_str()))); + } + let case_cwd: Arc = workspace_root.path.join(plan.cwd).into(); + let mut case_owned_config = vite_task_bin::OwnedSessionConfig::default(); + let mut case_session = + Session::init_with(case_envs, Arc::clone(&case_cwd), case_owned_config.as_config()) + .unwrap(); + case_session.ensure_task_graph_loaded().await.unwrap(); + + let plan_result = case_session.plan_from_cli_run(case_cwd, run_command).await; let plan = match plan_result { Ok(graph) => graph, diff --git a/docs/cancellation.md b/docs/cancellation.md new file mode 100644 index 00000000..30d4b104 --- /dev/null +++ b/docs/cancellation.md @@ -0,0 +1,23 @@ +# Cancellation + +`vp run` handles two kinds of cancellation: **Ctrl-C** (user interrupt) and **fast-fail** (a task exits with non-zero status). Both prevent new tasks from being scheduled and prevent caching of in-flight results, but they differ in how they treat running processes. + +## Ctrl-C + +When the user presses Ctrl-C: + +1. The OS delivers SIGINT (Unix) or CTRL_C_EVENT (Windows) directly to all processes in the terminal's foreground process group — both the runner and child tasks. This is standard OS behavior, not something `vp run` implements. +2. No new tasks are scheduled after the signal. +3. Results of in-flight tasks are **not cached**, even if a task handles the signal gracefully and exits 0. The output may be incomplete, so caching it would risk false cache hits on subsequent runs. + +## Fast-fail + +When any task exits with non-zero status: + +1. All other running child processes are killed immediately (`SIGKILL` on Unix, `TerminateJobObject` on Windows). +2. No new tasks are scheduled. +3. Results of other in-flight tasks are **not cached** (they were killed mid-execution). + +## Why interrupted tasks are not cached + +A task that receives Ctrl-C might exit 0 after partial work (e.g., a build tool that flushes what it has so far). Caching this result would mean the next `vp run` replays incomplete output and skips the real execution. By never caching interrupted results, `vp run` guarantees that the next run starts fresh. 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 diff --git a/playground/README.md b/playground/README.md new file mode 100644 index 00000000..863dce49 --- /dev/null +++ b/playground/README.md @@ -0,0 +1,28 @@ +# Playground + +A workspace for manually testing `cargo run --bin vt run ...`. + +## Structure + +``` +playground/ +├── packages/ +│ ├── app/ → depends on @playground/lib +│ ├── lib/ → depends on @playground/utils +│ └── utils/ → no dependencies +└── vite-task.json → workspace-level task config +``` + +Dependency chain: `app → lib → utils` + +## Scripts & Tasks + +Tasks are defined in each package's `vite-task.json` with caching enabled. `dev` is a package.json script (not cached). + +| Name | Type | Packages | Cached | Description | +| ----------- | ------ | --------------- | ------ | ---------------------------------------------- | +| `build` | task | app, lib, utils | yes | Prints a build message | +| `test` | task | app, lib, utils | yes | Prints a test message | +| `lint` | task | app, lib, utils | yes | Prints a lint message | +| `typecheck` | task | app, lib | yes | Prints a typecheck message | +| `dev` | script | app, lib | no | Long-running process (prints every 2s, ctrl-c) | diff --git a/playground/package.json b/playground/package.json new file mode 100644 index 00000000..51466b17 --- /dev/null +++ b/playground/package.json @@ -0,0 +1,4 @@ +{ + "name": "playground", + "private": true +} diff --git a/playground/packages/app/build.mjs b/playground/packages/app/build.mjs new file mode 100644 index 00000000..9b3bc870 --- /dev/null +++ b/playground/packages/app/build.mjs @@ -0,0 +1 @@ +console.log('Building app'); diff --git a/playground/packages/app/dev.mjs b/playground/packages/app/dev.mjs new file mode 100644 index 00000000..c6e4ab0e --- /dev/null +++ b/playground/packages/app/dev.mjs @@ -0,0 +1,6 @@ +process.on('SIGINT', () => { + console.log('app: dev server stopped'); + process.exit(0); +}); + +setInterval(() => console.log('app: waiting for changes...'), 2000); diff --git a/playground/packages/app/lint.mjs b/playground/packages/app/lint.mjs new file mode 100644 index 00000000..7f54bd9b --- /dev/null +++ b/playground/packages/app/lint.mjs @@ -0,0 +1 @@ +console.log('Linting app'); diff --git a/playground/packages/app/package.json b/playground/packages/app/package.json new file mode 100644 index 00000000..055ace37 --- /dev/null +++ b/playground/packages/app/package.json @@ -0,0 +1,11 @@ +{ + "name": "@playground/app", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "node dev.mjs" + }, + "dependencies": { + "@playground/lib": "workspace:*" + } +} diff --git a/playground/packages/app/src/index.ts b/playground/packages/app/src/index.ts new file mode 100644 index 00000000..7db55b49 --- /dev/null +++ b/playground/packages/app/src/index.ts @@ -0,0 +1,3 @@ +import { sum } from '@playground/lib'; + +console.log(sum(1, 2, 3)); diff --git a/playground/packages/app/test.mjs b/playground/packages/app/test.mjs new file mode 100644 index 00000000..7ffabb41 --- /dev/null +++ b/playground/packages/app/test.mjs @@ -0,0 +1 @@ +console.log('Testing app'); diff --git a/playground/packages/app/typecheck.mjs b/playground/packages/app/typecheck.mjs new file mode 100644 index 00000000..2980e420 --- /dev/null +++ b/playground/packages/app/typecheck.mjs @@ -0,0 +1 @@ +console.log('Typechecking app'); diff --git a/playground/packages/app/vite-task.json b/playground/packages/app/vite-task.json new file mode 100644 index 00000000..58a9b2b4 --- /dev/null +++ b/playground/packages/app/vite-task.json @@ -0,0 +1,16 @@ +{ + "tasks": { + "build": { + "command": "node build.mjs" + }, + "test": { + "command": "node test.mjs" + }, + "typecheck": { + "command": "node typecheck.mjs" + }, + "lint": { + "command": "node lint.mjs" + } + } +} diff --git a/playground/packages/lib/build.mjs b/playground/packages/lib/build.mjs new file mode 100644 index 00000000..9af60efc --- /dev/null +++ b/playground/packages/lib/build.mjs @@ -0,0 +1 @@ +console.log('Building lib'); diff --git a/playground/packages/lib/dev.mjs b/playground/packages/lib/dev.mjs new file mode 100644 index 00000000..8836ae3a --- /dev/null +++ b/playground/packages/lib/dev.mjs @@ -0,0 +1,6 @@ +process.on('SIGINT', () => { + console.log('lib: dev server stopped'); + process.exit(0); +}); + +setInterval(() => console.log('lib: waiting for changes...'), 2000); diff --git a/playground/packages/lib/lint.mjs b/playground/packages/lib/lint.mjs new file mode 100644 index 00000000..85e0d9d8 --- /dev/null +++ b/playground/packages/lib/lint.mjs @@ -0,0 +1 @@ +console.log('Linting lib'); diff --git a/playground/packages/lib/package.json b/playground/packages/lib/package.json new file mode 100644 index 00000000..fddb3aab --- /dev/null +++ b/playground/packages/lib/package.json @@ -0,0 +1,11 @@ +{ + "name": "@playground/lib", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "node dev.mjs" + }, + "dependencies": { + "@playground/utils": "workspace:*" + } +} diff --git a/playground/packages/lib/src/index.ts b/playground/packages/lib/src/index.ts new file mode 100644 index 00000000..f7fa1e13 --- /dev/null +++ b/playground/packages/lib/src/index.ts @@ -0,0 +1,5 @@ +import { add } from '@playground/utils'; + +export function sum(...nums: number[]): number { + return nums.reduce((acc, n) => add(acc, n), 0); +} diff --git a/playground/packages/lib/test.mjs b/playground/packages/lib/test.mjs new file mode 100644 index 00000000..6309a203 --- /dev/null +++ b/playground/packages/lib/test.mjs @@ -0,0 +1 @@ +console.log('Testing lib'); diff --git a/playground/packages/lib/typecheck.mjs b/playground/packages/lib/typecheck.mjs new file mode 100644 index 00000000..5f7e4b7d --- /dev/null +++ b/playground/packages/lib/typecheck.mjs @@ -0,0 +1 @@ +console.log('Typechecking lib'); diff --git a/playground/packages/lib/vite-task.json b/playground/packages/lib/vite-task.json new file mode 100644 index 00000000..58a9b2b4 --- /dev/null +++ b/playground/packages/lib/vite-task.json @@ -0,0 +1,16 @@ +{ + "tasks": { + "build": { + "command": "node build.mjs" + }, + "test": { + "command": "node test.mjs" + }, + "typecheck": { + "command": "node typecheck.mjs" + }, + "lint": { + "command": "node lint.mjs" + } + } +} diff --git a/playground/packages/utils/build.mjs b/playground/packages/utils/build.mjs new file mode 100644 index 00000000..f0cc45c7 --- /dev/null +++ b/playground/packages/utils/build.mjs @@ -0,0 +1 @@ +console.log('Building utils'); diff --git a/playground/packages/utils/lint.mjs b/playground/packages/utils/lint.mjs new file mode 100644 index 00000000..64299d21 --- /dev/null +++ b/playground/packages/utils/lint.mjs @@ -0,0 +1 @@ +console.log('Linting utils'); diff --git a/playground/packages/utils/package.json b/playground/packages/utils/package.json new file mode 100644 index 00000000..8036670a --- /dev/null +++ b/playground/packages/utils/package.json @@ -0,0 +1,5 @@ +{ + "name": "@playground/utils", + "version": "0.0.0", + "private": true +} diff --git a/playground/packages/utils/src/index.ts b/playground/packages/utils/src/index.ts new file mode 100644 index 00000000..8d9b8a22 --- /dev/null +++ b/playground/packages/utils/src/index.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number): number { + return a + b; +} diff --git a/playground/packages/utils/test.mjs b/playground/packages/utils/test.mjs new file mode 100644 index 00000000..2c833107 --- /dev/null +++ b/playground/packages/utils/test.mjs @@ -0,0 +1 @@ +console.log('Testing utils'); diff --git a/playground/packages/utils/vite-task.json b/playground/packages/utils/vite-task.json new file mode 100644 index 00000000..b86327b6 --- /dev/null +++ b/playground/packages/utils/vite-task.json @@ -0,0 +1,13 @@ +{ + "tasks": { + "build": { + "command": "node build.mjs" + }, + "test": { + "command": "node test.mjs" + }, + "lint": { + "command": "node lint.mjs" + } + } +} diff --git a/playground/pnpm-lock.yaml b/playground/pnpm-lock.yaml new file mode 100644 index 00000000..ef78a0a0 --- /dev/null +++ b/playground/pnpm-lock.yaml @@ -0,0 +1,23 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: {} + + packages/app: + dependencies: + '@playground/lib': + specifier: workspace:* + version: link:../lib + + packages/lib: + dependencies: + '@playground/utils': + specifier: workspace:* + version: link:../utils + + packages/utils: {} diff --git a/playground/pnpm-workspace.yaml b/playground/pnpm-workspace.yaml new file mode 100644 index 00000000..924b55f4 --- /dev/null +++ b/playground/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/playground/vite-task.json b/playground/vite-task.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/playground/vite-task.json @@ -0,0 +1 @@ +{}