diff --git a/CHANGELOG.md b/CHANGELOG.md index add778222..0edabcde4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog +- **Added** task command shorthands for defining tasks as command strings or command string arrays ([#391](https://github.com/voidzero-dev/vite-task/pull/391)) - **Changed** Cached logs are stored with colors intact (`FORCE_COLOR=1` is auto-injected into spawned tasks). Colors are then stripped at display time when the terminal does not support them. Other color-related env vars (`NO_COLOR`, `COLORTERM`, `TERM`, `TERM_PROGRAM`) are no longer passed through by default. Opt in via a task's `env`/`untrackedEnv` ([#378](https://github.com/voidzero-dev/vite-task/pull/378)) - **Added** `output` field for cached tasks: archives matching files after a successful run and restores them on cache hit ([#375](https://github.com/voidzero-dev/vite-task/pull/375)) - **Fixed** Windows cached tasks can now run package shims rewritten through PowerShell; default env passthrough now preserves `PATHEXT` ([#366](https://github.com/voidzero-dev/vite-task/pull/366)) diff --git a/crates/vite_task/docs/task-cache.md b/crates/vite_task/docs/task-cache.md index 440901ccd..bd71db2f9 100644 --- a/crates/vite_task/docs/task-cache.md +++ b/crates/vite_task/docs/task-cache.md @@ -550,13 +550,13 @@ Ensure commands produce identical outputs for identical inputs: ```json { - "scripts": { - "build": "tsc && rollup -c && terser dist/bundle.js" + "tasks": { + "build": ["tsc", "rollup -c", "terser dist/bundle.js"] } } ``` -Each `&&` separated command is cached independently. If only terser config changes, TypeScript and rollup will hit cache. +Each `&&` separated command is cached independently. Task command arrays use the same granular caching semantics. If only terser config changes, TypeScript and rollup will hit cache. ## Implementation Reference diff --git a/crates/vite_task/docs/terminologies.md b/crates/vite_task/docs/terminologies.md index 6118fc52e..c949f300b 100644 --- a/crates/vite_task/docs/terminologies.md +++ b/crates/vite_task/docs/terminologies.md @@ -16,19 +16,24 @@ // vite-task.json { "tasks": { - "lint": { - "command": "echo lint" - } + "lint": "echo lint", + "check": ["eslint .", "tsc --noEmit", "prettier --check ."], + }, } ``` -In the example above, `build` and `lint` are **task group names**. A task group may define one task, or multiple tasks separated by `&&`. +In the example above, `build`, `lint`, and `check` are **task group names**. A task group may define one task, or multiple tasks separated by `&&`. + +In `tasks`, command-only task groups can be written as a string or as an array. Object form with `command` and options is also supported. -The two task groups generates 3 tasks: +The three task groups generate these tasks: - `app#build(subcommand 0)` (runs `echo build1`) - `app#build` (runs `echo build2`) - `app#lint` (runs `echo lint`) +- `app#check(subcommand 0)` (runs `eslint .`) +- `app#check(subcommand 1)` (runs `tsc --noEmit`) +- `app#check` (runs `prettier --check .`) These are **task names**. They are for displaying and filtering. diff --git a/crates/vite_task_graph/run-config.ts b/crates/vite_task_graph/run-config.ts index 1fa4ee868..cc28dc3e1 100644 --- a/crates/vite_task_graph/run-config.ts +++ b/crates/vite_task_graph/run-config.ts @@ -20,7 +20,7 @@ export type InputBase = "package" | "workspace"; export type Task = { /** - * The command to run for the task. + * Command string to run for the task. */ command: string, /** @@ -63,11 +63,61 @@ input?: Array, * - Negative patterns (e.g. `"!dist/cache/**"`) exclude matched files */ output?: Array, } | { +/** + * Whether to cache the task + */ +cache: false, }) | { +/** + * Command strings to run for the task. + */ +command: Array, +/** + * The working directory for the task, relative to the package root (not workspace root). + */ +cwd?: string, +/** + * Dependencies of this task. Use `package-name#task-name` to refer to tasks in other packages. + */ +dependsOn?: Array, } & ({ +/** + * Whether to cache the task + */ +cache?: true, +/** + * Environment variable names to be fingerprinted and passed to the task. + */ +env?: Array, +/** + * Environment variable names to be passed to the task without fingerprinting. + */ +untrackedEnv?: Array, +/** + * Files to include in the cache fingerprint. + * + * - Omitted: automatically tracks which files the task reads + * - `[]` (empty): disables file tracking entirely + * - Glob patterns (e.g. `"src/**"`) select specific files, relative to the package directory + * - `{pattern: "...", base: "workspace" | "package"}` specifies a glob with an explicit base directory + * - `{auto: true}` enables automatic file tracking + * - Negative patterns (e.g. `"!dist/**"`) exclude matched files + */ +input?: Array, +/** + * Output files to archive after a successful run and restore on cache hit. + * + * - Omitted or `[]` (empty): no output archiving (default) + * - Glob patterns (e.g. `"dist/**"`) select specific output files, relative to the package directory + * - `{pattern: "...", base: "workspace" | "package"}` specifies a glob with an explicit base directory + * - Negative patterns (e.g. `"!dist/cache/**"`) exclude matched files + */ +output?: Array, } | { /** * Whether to cache the task */ cache: false, }); +export type TaskDefinition = Task | string | Array; + export type UserGlobalCacheConfig = boolean | { /** * Enable caching for package.json scripts not defined in the `tasks` map. @@ -98,9 +148,9 @@ export type RunConfig = { */ cache?: UserGlobalCacheConfig, /** - * Task definitions + * Task definitions: full task objects, command strings, or command string arrays. */ -tasks?: { [key in string]: Task }, +tasks?: { [key in string]: TaskDefinition }, /** * Whether to automatically run `preX`/`postX` package.json scripts as * lifecycle hooks when script `X` is executed. diff --git a/crates/vite_task_graph/src/config/mod.rs b/crates/vite_task_graph/src/config/mod.rs index 38e1db736..679670547 100644 --- a/crates/vite_task_graph/src/config/mod.rs +++ b/crates/vite_task_graph/src/config/mod.rs @@ -8,7 +8,7 @@ use serde::Serialize; pub use user::{ AutoInput, EnabledCacheConfig, GlobWithBase, InputBase, ResolvedGlobalCacheConfig, UserCacheConfig, UserGlobalCacheConfig, UserInputEntry, UserInputsConfig, UserOutputEntry, - UserRunConfig, UserTaskConfig, + UserRunConfig, UserTaskConfig, UserTaskDefinition, }; use vite_path::AbsolutePath; use vite_str::Str; @@ -28,10 +28,10 @@ use crate::config::user::UserTaskOptions; /// `depends_on` is not included here because it's represented by the edges of the task graph. #[derive(Debug, Serialize)] pub struct ResolvedTaskConfig { - /// The command to run for this task, as a raw string. + /// The command or commands to run for this task. /// - /// The command may contain environment variables that need to be expanded later. - pub command: Str, + /// Commands may contain environment variables that need to be expanded later. + pub commands: Arc<[Str]>, pub resolved_options: ResolvedTaskOptions, } @@ -360,7 +360,7 @@ impl ResolvedTaskConfig { workspace_root: &AbsolutePath, ) -> Result { Ok(Self { - command: package_json_script.into(), + commands: vec![package_json_script.into()].into(), resolved_options: ResolvedTaskOptions::resolve( UserTaskOptions::default(), package_dir, @@ -379,13 +379,10 @@ impl ResolvedTaskConfig { package_dir: &Arc, workspace_root: &AbsolutePath, ) -> Result { + let (commands, options) = user_config.into_parts(); Ok(Self { - command: Str::from(user_config.command.as_ref()), - resolved_options: ResolvedTaskOptions::resolve( - user_config.options, - package_dir, - workspace_root, - )?, + commands, + resolved_options: ResolvedTaskOptions::resolve(options, package_dir, workspace_root)?, }) } } diff --git a/crates/vite_task_graph/src/config/user.rs b/crates/vite_task_graph/src/config/user.rs index aeee38608..c6e790adf 100644 --- a/crates/vite_task_graph/src/config/user.rs +++ b/crates/vite_task_graph/src/config/user.rs @@ -197,14 +197,57 @@ impl Default for UserTaskOptions { #[derive(Debug, Deserialize, PartialEq, Eq)] // TS derive macro generates code using std types that clippy disallows; skip derive during linting #[cfg_attr(all(test, not(clippy)), derive(TS), ts(optional_fields, rename = "Task"))] -#[serde(rename_all = "camelCase")] -pub struct UserTaskConfig { - /// The command to run for the task. - pub command: Box, +#[serde(untagged, rename_all = "camelCase")] +pub enum UserTaskConfig { + /// Task object form with a single command string. + String { + /// Command string to run for the task. + command: Str, + + /// Fields other than the command + #[serde(flatten)] + options: UserTaskOptions, + }, + /// Task object form with a sequence of command strings. + Array { + /// Command strings to run for the task. + command: Arc<[Str]>, - /// Fields other than the command - #[serde(flatten)] - pub options: UserTaskOptions, + /// Fields other than the command + #[serde(flatten)] + options: UserTaskOptions, + }, +} + +impl UserTaskConfig { + #[must_use] + pub const fn options(&self) -> &UserTaskOptions { + match self { + Self::String { options, .. } | Self::Array { options, .. } => options, + } + } + + #[must_use] + pub fn into_parts(self) -> (Arc<[Str]>, UserTaskOptions) { + match self { + Self::String { command, options } => (vec![command].into(), options), + Self::Array { command, options } => (command, options), + } + } +} + +/// User-defined task configuration or command-only shorthand in `vite.config.*`. +#[derive(Debug, Deserialize, PartialEq, Eq)] +// TS derive macro generates code using std types that clippy disallows; skip derive during linting +#[cfg_attr(all(test, not(clippy)), derive(TS), ts(rename = "TaskDefinition"))] +#[serde(untagged)] +pub enum UserTaskDefinition { + /// Full task object form. + Config(UserTaskConfig), + /// Command-only shorthand form using default task options. + CommandString(Str), + /// Command sequence shorthand form using default task options. + CommandArray(Arc<[Str]>), } /// Root-level cache configuration. @@ -281,8 +324,8 @@ pub struct UserRunConfig { /// Setting it in a package's config will result in an error. pub cache: Option, - /// Task definitions - pub tasks: Option>, + /// Task definitions: full task objects, command strings, or command string arrays. + pub tasks: Option>, /// Whether to automatically run `preX`/`postX` package.json scripts as /// lifecycle hooks when script `X` is executed. @@ -413,10 +456,92 @@ mod tests { let user_config: UserTaskConfig = serde_json::from_value(user_config_json).unwrap(); assert_eq!( user_config, - UserTaskConfig { command: "echo hello".into(), options: UserTaskOptions::default() } + UserTaskConfig::String { + command: "echo hello".into(), + options: UserTaskOptions::default() + } ); } + #[test] + fn test_command_array() { + let user_config_json = json!({ + "command": ["echo one", "echo two", "echo three"] + }); + let user_config: UserTaskConfig = serde_json::from_value(user_config_json).unwrap(); + let (commands, options) = user_config.into_parts(); + assert_eq!( + commands, + Arc::from(["echo one".into(), "echo two".into(), "echo three".into()]) + ); + assert_eq!(options, UserTaskOptions::default()); + } + + #[test] + fn test_task_string_shorthand() { + let user_config_json = json!({ + "tasks": { + "build": "echo build" + } + }); + let mut user_config: UserRunConfig = serde_json::from_value(user_config_json).unwrap(); + let task = user_config.tasks.as_mut().unwrap().remove("build").unwrap(); + assert_eq!(task, UserTaskDefinition::CommandString("echo build".into())); + } + + #[test] + fn test_task_array_shorthand() { + let user_config_json = json!({ + "tasks": { + "build": ["echo one", "echo two", "echo three"] + } + }); + let mut user_config: UserRunConfig = serde_json::from_value(user_config_json).unwrap(); + let task = user_config.tasks.as_mut().unwrap().remove("build").unwrap(); + assert_eq!( + task, + UserTaskDefinition::CommandArray(Arc::from([ + "echo one".into(), + "echo two".into(), + "echo three".into() + ])) + ); + } + + #[test] + fn test_command_array_with_options() { + let user_config_json = json!({ + "command": ["echo one", "echo two"], + "cwd": "src", + "dependsOn": ["build"], + "cache": false + }); + let user_config: UserTaskConfig = serde_json::from_value(user_config_json).unwrap(); + let (commands, options) = user_config.into_parts(); + assert_eq!(commands, Arc::from(["echo one".into(), "echo two".into()])); + assert_eq!(options.cwd_relative_to_package.as_ref().unwrap().as_str(), "src"); + assert_eq!(options.depends_on.as_ref().unwrap().as_ref(), [Str::from("build")]); + assert_eq!(options.cache_config, UserCacheConfig::Disabled { cache: MustBe!(false) }); + } + + #[test] + fn test_task_invalid_shorthand_error() { + let user_config_json = json!({ + "tasks": { + "build": 123 + } + }); + assert!(serde_json::from_value::(user_config_json).is_err()); + } + + #[test] + fn test_command_array_invalid_item_error() { + let user_config_json = json!({ + "command": ["echo one", 123] + }); + assert!(serde_json::from_value::(user_config_json).is_err()); + } + #[test] fn test_cwd_rename() { let user_config_json = json!({ @@ -424,7 +549,7 @@ mod tests { "cwd": "src" }); let user_config: UserTaskConfig = serde_json::from_value(user_config_json).unwrap(); - assert_eq!(user_config.options.cwd_relative_to_package.as_ref().unwrap().as_str(), "src"); + assert_eq!(user_config.options().cwd_relative_to_package.as_ref().unwrap().as_str(), "src"); } #[test] @@ -435,7 +560,7 @@ mod tests { }); let user_config: UserTaskConfig = serde_json::from_value(user_config_json).unwrap(); assert_eq!( - user_config.options.cache_config, + user_config.options().cache_config, UserCacheConfig::Disabled { cache: MustBe!(false) } ); } diff --git a/crates/vite_task_graph/src/display.rs b/crates/vite_task_graph/src/display.rs index fbc06dd29..2648aae95 100644 --- a/crates/vite_task_graph/src/display.rs +++ b/crates/vite_task_graph/src/display.rs @@ -50,9 +50,26 @@ impl IndexedTaskGraph { let node = &self.task_graph()[idx]; TaskListEntry { task_display: node.task_display.clone(), - command: node.resolved_config.command.clone(), + command: format_command_for_task_list(&node.resolved_config.commands), } }) .collect() } } + +// Display-only formatting for task list/selector descriptions. Execution planning keeps +// command arrays structured and must not depend on this joined string. +fn format_command_for_task_list(commands: &Arc<[Str]>) -> Str { + if commands.len() == 1 { + commands[0].clone() + } else { + let mut display = Str::default(); + for (index, command) in commands.iter().enumerate() { + if index > 0 { + display.push_str(" && "); + } + display.push_str(command.as_str()); + } + display + } +} diff --git a/crates/vite_task_graph/src/lib.rs b/crates/vite_task_graph/src/lib.rs index 98a7c3d62..943ebb4d5 100644 --- a/crates/vite_task_graph/src/lib.rs +++ b/crates/vite_task_graph/src/lib.rs @@ -6,7 +6,10 @@ mod specifier; use std::{convert::Infallible, sync::Arc}; -use config::{ResolvedGlobalCacheConfig, ResolvedTaskConfig, UserRunConfig}; +use config::{ + ResolvedGlobalCacheConfig, ResolvedTaskConfig, UserRunConfig, UserTaskConfig, + UserTaskDefinition, +}; use petgraph::graph::{DefaultIx, DiGraph, EdgeIndex, IndexType, NodeIndex}; use rustc_hash::{FxBuildHasher, FxHashMap}; use serde::Serialize; @@ -15,7 +18,7 @@ use vite_path::AbsolutePath; use vite_str::Str; use vite_workspace::{PackageNodeIndex, WorkspaceRoot, package_graph::IndexedPackageGraph}; -use crate::display::TaskDisplay; +use crate::{config::user::UserTaskOptions, display::TaskDisplay}; /// The type of a task dependency edge in the task graph. /// @@ -303,7 +306,16 @@ impl IndexedTaskGraph { let task_id = TaskId { task_name: task_name.clone(), package_index }; - let dependency_specifiers = task_user_config.options.depends_on.clone(); + let task_user_config = match task_user_config { + UserTaskDefinition::Config(config) => config, + UserTaskDefinition::CommandString(command) => { + UserTaskConfig::String { command, options: UserTaskOptions::default() } + } + UserTaskDefinition::CommandArray(command) => { + UserTaskConfig::Array { command, options: UserTaskOptions::default() } + } + }; + let dependency_specifiers = task_user_config.options().depends_on.clone(); // Resolve the task configuration from the user config let resolved_config = ResolvedTaskConfig::resolve( diff --git a/crates/vite_task_plan/src/cache_metadata.rs b/crates/vite_task_plan/src/cache_metadata.rs index 11a1d957e..5e951b59a 100644 --- a/crates/vite_task_plan/src/cache_metadata.rs +++ b/crates/vite_task_plan/src/cache_metadata.rs @@ -15,7 +15,9 @@ pub enum ExecutionCacheKey { UserTask { /// The name of the user-defined task. task_name: Str, - /// The index of the execution item in the task's command split by `&&`. + /// The index of the command item in the task's command array. + command_item_index: usize, + /// The index of the execution item within the command item split by `&&`. /// This is to distinguish multiple execution items from the same task. and_item_index: usize, /// Extra args provided when invoking the user-defined task (`vp [task_name] [extra_args...]`). diff --git a/crates/vite_task_plan/src/error.rs b/crates/vite_task_plan/src/error.rs index 7a255b8df..d7014697b 100644 --- a/crates/vite_task_plan/src/error.rs +++ b/crates/vite_task_plan/src/error.rs @@ -119,6 +119,9 @@ pub enum Error { #[error(transparent)] TaskRecursionDetected(#[from] TaskRecursionError), + #[error("Invalid task command: {0}")] + InvalidTaskCommand(Str), + #[error("Invalid vite task command: {program} with args {args:?} under cwd {cwd:?}")] ParsePlanRequest { program: Str, diff --git a/crates/vite_task_plan/src/plan.rs b/crates/vite_task_plan/src/plan.rs index c88846330..b8705f1db 100644 --- a/crates/vite_task_plan/src/plan.rs +++ b/crates/vite_task_plan/src/plan.rs @@ -8,6 +8,7 @@ use std::{ collections::BTreeMap, env::home_dir, ffi::OsStr, + ops::Range, sync::{Arc, LazyLock}, }; @@ -15,7 +16,7 @@ use futures_util::FutureExt; use petgraph::Direction; use rustc_hash::FxHashMap; use vite_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf, relative::InvalidPathDataError}; -use vite_shell::try_parse_as_and_list; +use vite_shell::{TaskParsedCommand, try_parse_as_and_list}; use vite_str::Str; use vite_task_graph::{ TaskNodeIndex, TaskSource, @@ -80,6 +81,50 @@ fn effective_cache_config( if enabled { task_cache_config.cloned() } else { None } } +enum PlannedCommand { + Parsed { + command_item_index: usize, + and_item_index: usize, + and_item: TaskParsedCommand, + display: Str, + stack_frame: Range, + }, + Shell { + command_item_index: usize, + script: Str, + }, +} + +#[expect(clippy::result_large_err, reason = "Error is large for diagnostics")] +fn planned_commands(commands: &Arc<[Str]>) -> Result, Error> { + if commands.is_empty() { + return Err(Error::InvalidTaskCommand("command array must not be empty".into())); + } + if commands.iter().any(|command| command.as_str().trim().is_empty()) { + return Err(Error::InvalidTaskCommand("command array entries must not be empty".into())); + } + + let mut planned = Vec::new(); + + for (command_item_index, command) in commands.iter().enumerate() { + if let Some(parsed) = try_parse_as_and_list(command.as_str()) { + planned.extend(parsed.into_iter().enumerate().map( + |(and_item_index, (and_item, range))| PlannedCommand::Parsed { + command_item_index, + and_item_index, + and_item, + display: Str::from(&command.as_str()[range.clone()]), + stack_frame: range, + }, + )); + } else { + planned.push(PlannedCommand::Shell { command_item_index, script: command.clone() }); + } + } + + Ok(planned) +} + /// - `with_hooks`: whether to look up `preX`/`postX` lifecycle hooks for this task. /// `false` when the task itself is being executed as a hook, so that hooks are /// never expanded more than one level deep (matching npm behavior). @@ -93,7 +138,6 @@ async fn plan_task_as_execution_node( context.check_recursion(task_node_index)?; let task_node = &context.indexed_task_graph().task_graph()[task_node_index]; - let command_str = task_node.resolved_config.command.as_str(); let package_path = context.indexed_task_graph().get_package_path_for_task(task_node_index); // Prepend {package_path}/node_modules/.bin to PATH @@ -128,262 +172,277 @@ async fn plan_task_as_execution_node( let mut cwd = Arc::clone(&task_node.resolved_config.resolved_options.cwd); // TODO: variable expansion (https://crates.io/crates/shellexpand) BEFORE parsing - // Try to parse the command string as a list of subcommands separated by `&&` - if let Some(parsed_subcommands) = try_parse_as_and_list(command_str) { - let and_item_count = parsed_subcommands.len(); - for (index, (and_item, add_item_span)) in parsed_subcommands.into_iter().enumerate() { - // Duplicate the context before modifying it for each and_item - let mut context = context.duplicate(); - context.push_stack_frame(task_node_index, add_item_span.clone()); - - let mut args = and_item.args; - let extra_args = if index == and_item_count - 1 { - // For the last and_item, append extra args from the plan context - Arc::clone(context.extra_args()) - } else { - Arc::new([]) - }; - args.extend(extra_args.iter().cloned()); + let planned_commands = planned_commands(&task_node.resolved_config.commands)?; + let and_item_count = planned_commands.len(); + for (index, planned_command) in planned_commands.into_iter().enumerate() { + match planned_command { + PlannedCommand::Parsed { + command_item_index, + and_item_index, + and_item, + display, + stack_frame, + } => { + // Duplicate the context before modifying it for each and_item + let mut context = context.duplicate(); + context.push_stack_frame(task_node_index, stack_frame); + + let mut args = and_item.args; + let extra_args = if index == and_item_count - 1 { + // For the last and_item, append extra args from the plan context + Arc::clone(context.extra_args()) + } else { + Arc::new([]) + }; + args.extend(extra_args.iter().cloned()); + + // Handle `cd` builtin command + if and_item.program == "cd" { + #[expect( + clippy::disallowed_types, + reason = "Path is needed for std::env::home_dir return type and AbsolutePath::join" + )] + let cd_target: Cow<'_, Path> = match args.as_slice() { + // No args, go to home directory + [] => home_dir() + .ok_or(Error::CdCommand(CdCommandError::NoHomeDirectory))? + .into(), + [dir] => Path::new(dir.as_str()).into(), + _ => { + return Err(Error::CdCommand(CdCommandError::TooManyArgs)); + } + }; + cwd = cwd.join(cd_target.as_ref()).into(); + continue; + } - // Handle `cd` builtin command - if and_item.program == "cd" { - #[expect( - clippy::disallowed_types, - reason = "Path is needed for std::env::home_dir return type and AbsolutePath::join" - )] - let cd_target: Cow<'_, Path> = match args.as_slice() { - // No args, go to home directory - [] => { - home_dir().ok_or(Error::CdCommand(CdCommandError::NoHomeDirectory))?.into() - } - [dir] => Path::new(dir.as_str()).into(), - _ => { - return Err(Error::CdCommand(CdCommandError::TooManyArgs)); - } + // Build execution display + let execution_item_display = ExecutionItemDisplay { + command: { + let mut command = display.clone(); + for arg in extra_args.iter() { + command.push(' '); + command.push_str(shell_escape::escape(arg.as_str().into()).as_ref()); + } + command + }, + cwd: Arc::clone(&cwd), + task_display: task_node.task_display.clone(), }; - cwd = cwd.join(cd_target.as_ref()).into(); - continue; - } - // Build execution display - let execution_item_display = ExecutionItemDisplay { - command: { - let mut command = Str::from(&command_str[add_item_span.clone()]); - for arg in extra_args.iter() { - command.push(' '); - command.push_str(shell_escape::escape(arg.as_str().into()).as_ref()); - } - command - }, - cwd: Arc::clone(&cwd), - task_display: task_node.task_display.clone(), - }; - - // Check for builtin commands like `echo ...` - if let Some(builtin_execution) = - InProcessExecution::get_builtin_execution(&and_item.program, args.iter(), &cwd) - { - items.push(ExecutionItem { - execution_item_display, - kind: ExecutionItemKind::Leaf(LeafExecutionKind::InProcess(builtin_execution)), - }); - continue; - } + // Check for builtin commands like `echo ...` + if let Some(builtin_execution) = + InProcessExecution::get_builtin_execution(&and_item.program, args.iter(), &cwd) + { + items.push(ExecutionItem { + execution_item_display, + kind: ExecutionItemKind::Leaf(LeafExecutionKind::InProcess( + builtin_execution, + )), + }); + continue; + } - // Create execution cache key for this and_item - let task_execution_cache_key = ExecutionCacheKey::UserTask { - task_name: task_node.task_display.task_name.clone(), - and_item_index: index, - extra_args: Arc::clone(&extra_args), - package_path: strip_prefix_for_cache(package_path, context.workspace_path()) - .map_err(|kind| PathFingerprintError { - kind, - path_type: PathType::PackagePath, - })?, - }; - - // Try to parse the args of an and_item to a plan request like `run -r build` - let envs: Arc, Arc>> = context.envs().clone().into(); - let mut script_command = ScriptCommand { - program: and_item.program.clone(), - args: args.into(), - envs, - cwd: Arc::clone(&cwd), - }; - let plan_request = - context.callbacks().get_plan_request(&mut script_command).await.map_err( - |error| Error::ParsePlanRequest { - program: script_command.program.clone(), - args: Arc::clone(&script_command.args), - cwd: Arc::clone(&script_command.cwd), - error, - }, - )?; + // Create execution cache key for this and_item + let task_execution_cache_key = ExecutionCacheKey::UserTask { + task_name: task_node.task_display.task_name.clone(), + command_item_index, + and_item_index, + extra_args: Arc::clone(&extra_args), + package_path: strip_prefix_for_cache(package_path, context.workspace_path()) + .map_err(|kind| PathFingerprintError { + kind, + path_type: PathType::PackagePath, + })?, + }; - let execution_item_kind: ExecutionItemKind = match plan_request { - // Expand task query like `vp run -r build` - Some(PlanRequest::Query(query_plan_request)) => { - // Skip rule: skip if this nested query is the same as the parent expansion. - // This handles workspace root tasks like `"build": "vp run -r build"` — - // re-entering the same query would just re-expand the same tasks. - // - // The comparison is on TaskQuery only (package_query + task_name + - // include_explicit_deps). Extra args live in PlanOptions, so - // `vp run -r build extra_arg` still matches `vp run -r build`. - // Conversely, `cd packages/a && vp run build` does NOT match a - // parent `vp run build` from root because `cd` changes the cwd, - // producing a different ContainingPackage in the PackageQuery. - if query_plan_request.query == *context.parent_query() { - continue; - } + // Try to parse the args of an and_item to a plan request like `run -r build` + let envs: Arc, Arc>> = context.envs().clone().into(); + let mut script_command = ScriptCommand { + program: and_item.program.clone(), + args: args.into(), + envs, + cwd: Arc::clone(&cwd), + }; + let plan_request = + context.callbacks().get_plan_request(&mut script_command).await.map_err( + |error| Error::ParsePlanRequest { + program: script_command.program.clone(), + args: Arc::clone(&script_command.args), + cwd: Arc::clone(&script_command.cwd), + error, + }, + )?; + + let execution_item_kind: ExecutionItemKind = match plan_request { + // Expand task query like `vp run -r build` + Some(PlanRequest::Query(query_plan_request)) => { + // Skip rule: skip if this nested query is the same as the parent expansion. + if query_plan_request.query == *context.parent_query() { + continue; + } - // Save task name before consuming the request - let task_name = query_plan_request.query.task_name.clone(); - // Add prefix envs to the context - context.add_envs(and_item.envs.iter()); - let QueryPlanRequest { query, plan_options } = query_plan_request; - let query = Arc::new(query); - let execution_graph = - plan_query_request(Arc::clone(&query), plan_options, context) - .await - .map_err(|error| Error::NestPlan { + let task_name = query_plan_request.query.task_name.clone(); + context.add_envs(and_item.envs.iter()); + let QueryPlanRequest { query, plan_options } = query_plan_request; + let query = Arc::new(query); + let execution_graph = + plan_query_request(Arc::clone(&query), plan_options, context) + .await + .map_err(|error| Error::NestPlan { + task_display: task_node.task_display.clone(), + command: display.clone(), + error: Box::new(error), + })?; + 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.clone()]), - error: Box::new(error), - })?; - // 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.graph.node_count() == 0 { - return Err(Error::NestPlan { - task_display: task_node.task_display.clone(), - command: Str::from(&command_str[add_item_span]), - error: Box::new(Error::NoTasksMatched(task_name)), - }); + command: display, + error: Box::new(Error::NoTasksMatched(task_name)), + }); + } + ExecutionItemKind::Expanded(execution_graph) } - ExecutionItemKind::Expanded(execution_graph) - } - // Synthetic task (from CommandHandler) - Some(PlanRequest::Synthetic(synthetic_plan_request)) => { - let task_effective_cache = effective_cache_config( - task_node.resolved_config.resolved_options.cache_config.as_ref(), - task_node.source, - *context.resolved_global_cache(), - ); - let parent_cache_config = task_effective_cache - .as_ref() - .map_or(ParentCacheConfig::Disabled, |config| { - ParentCacheConfig::Inherited(config.clone()) - }); - let spawn_execution = plan_synthetic_request( - context.workspace_path(), - &and_item.envs, - synthetic_plan_request, - Some(task_execution_cache_key), - &cwd, - package_path, - parent_cache_config, - )?; - ExecutionItemKind::Leaf(LeafExecutionKind::Spawn(spawn_execution)) - } - // Normal 3rd party tool command (like `tsc --noEmit`), using potentially mutated script_command - None => { - let program_path = which( - &OsStr::new(&script_command.program).into(), - &script_command.envs, - &script_command.cwd, - )?; - let (program_path, spawn_args) = crate::ps1_shim::rewrite_cmd_shim_with_args( - program_path, - script_command.args, - &task_node.resolved_config.resolved_options.cwd, - context.workspace_path(), - ); - let resolved_options = ResolvedTaskOptions { - cwd: Arc::clone(&task_node.resolved_config.resolved_options.cwd), - cache_config: effective_cache_config( + // Synthetic task (from CommandHandler) + Some(PlanRequest::Synthetic(synthetic_plan_request)) => { + let task_effective_cache = effective_cache_config( task_node.resolved_config.resolved_options.cache_config.as_ref(), task_node.source, *context.resolved_global_cache(), - ), - }; - let spawn_execution = plan_spawn_execution( - context.workspace_path(), - Some(task_execution_cache_key), - &and_item.envs, - &resolved_options, - &script_command.envs, - program_path, - spawn_args, - )?; - ExecutionItemKind::Leaf(LeafExecutionKind::Spawn(spawn_execution)) - } - }; - items.push(ExecutionItem { execution_item_display, kind: execution_item_kind }); - } - } else { - #[expect(clippy::disallowed_types, reason = "PathBuf needed for which fallback path")] - static SHELL_PROGRAM_PATH: LazyLock> = - LazyLock::new(|| { - if cfg!(target_os = "windows") { - AbsolutePathBuf::new(which::which("cmd.exe").unwrap_or_else(|_| { - std::path::PathBuf::from("C:\\Windows\\System32\\cmd.exe") - })) - .unwrap() - .into() - } else { - AbsolutePath::new("/bin/sh").unwrap().into() - } - }); + ); + let parent_cache_config = task_effective_cache + .as_ref() + .map_or(ParentCacheConfig::Disabled, |config| { + ParentCacheConfig::Inherited(config.clone()) + }); + let spawn_execution = plan_synthetic_request( + context.workspace_path(), + &and_item.envs, + synthetic_plan_request, + Some(task_execution_cache_key), + &cwd, + package_path, + parent_cache_config, + )?; + ExecutionItemKind::Leaf(LeafExecutionKind::Spawn(spawn_execution)) + } + // Normal 3rd party tool command (like `tsc --noEmit`), using potentially mutated script_command + None => { + let program_path = which( + &OsStr::new(&script_command.program).into(), + &script_command.envs, + &script_command.cwd, + )?; + let (program_path, spawn_args) = + crate::ps1_shim::rewrite_cmd_shim_with_args( + program_path, + script_command.args, + &script_command.cwd, + context.workspace_path(), + ); + let resolved_options = ResolvedTaskOptions { + cwd: Arc::clone(&script_command.cwd), + cache_config: effective_cache_config( + task_node.resolved_config.resolved_options.cache_config.as_ref(), + task_node.source, + *context.resolved_global_cache(), + ), + }; + let spawn_execution = plan_spawn_execution( + context.workspace_path(), + Some(task_execution_cache_key), + &and_item.envs, + &resolved_options, + &script_command.envs, + program_path, + spawn_args, + )?; + ExecutionItemKind::Leaf(LeafExecutionKind::Spawn(spawn_execution)) + } + }; + items.push(ExecutionItem { execution_item_display, kind: execution_item_kind }); + } + PlannedCommand::Shell { command_item_index, script } => { + #[expect( + clippy::disallowed_types, + reason = "PathBuf needed for which fallback path" + )] + static SHELL_PROGRAM_PATH: LazyLock> = LazyLock::new(|| { + if cfg!(target_os = "windows") { + AbsolutePathBuf::new(which::which("cmd.exe").unwrap_or_else(|_| { + std::path::PathBuf::from("C:\\Windows\\System32\\cmd.exe") + })) + .unwrap() + .into() + } else { + AbsolutePath::new("/bin/sh").unwrap().into() + } + }); - static SHELL_ARGS: &[&str] = - if cfg!(target_os = "windows") { &["/d", "/s", "/c"] } else { &["-c"] }; + static SHELL_ARGS: &[&str] = + if cfg!(target_os = "windows") { &["/d", "/s", "/c"] } else { &["-c"] }; - let mut context = context.duplicate(); - context.push_stack_frame(task_node_index, 0..command_str.len()); + let mut context = context.duplicate(); + context.push_stack_frame(task_node_index, 0..script.len()); - let execution_item_display = ExecutionItemDisplay { - command: command_str.into(), - cwd, - task_display: task_node.task_display.clone(), - }; + let extra_args = if index == and_item_count - 1 { + Arc::clone(context.extra_args()) + } else { + Arc::new([]) + }; - let mut script = Str::from(command_str); - for arg in context.extra_args().iter() { - script.push(' '); - script.push_str(shell_escape::escape(arg.as_str().into()).as_ref()); - } + let execution_item_display = ExecutionItemDisplay { + command: script.clone(), + cwd: Arc::clone(&cwd), + task_display: task_node.task_display.clone(), + }; - let resolved_options = ResolvedTaskOptions { - cwd: Arc::clone(&task_node.resolved_config.resolved_options.cwd), - cache_config: effective_cache_config( - task_node.resolved_config.resolved_options.cache_config.as_ref(), - task_node.source, - *context.resolved_global_cache(), - ), - }; - let spawn_execution = plan_spawn_execution( - context.workspace_path(), - Some(ExecutionCacheKey::UserTask { - task_name: task_node.task_display.task_name.clone(), - and_item_index: 0, - extra_args: Arc::clone(context.extra_args()), - package_path: strip_prefix_for_cache(package_path, context.workspace_path()) - .map_err(|kind| PathFingerprintError { - kind, - path_type: PathType::PackagePath, - })?, - }), - &BTreeMap::new(), - &resolved_options, - context.envs(), - Arc::clone(&*SHELL_PROGRAM_PATH), - SHELL_ARGS.iter().map(|s| Str::from(*s)).chain(std::iter::once(script)).collect(), - )?; - items.push(ExecutionItem { - execution_item_display, - kind: ExecutionItemKind::Leaf(LeafExecutionKind::Spawn(spawn_execution)), - }); + let mut script_with_args = script; + for arg in extra_args.iter() { + script_with_args.push(' '); + script_with_args.push_str(shell_escape::escape(arg.as_str().into()).as_ref()); + } + + let resolved_options = ResolvedTaskOptions { + cwd: Arc::clone(&cwd), + cache_config: effective_cache_config( + task_node.resolved_config.resolved_options.cache_config.as_ref(), + task_node.source, + *context.resolved_global_cache(), + ), + }; + let spawn_execution = plan_spawn_execution( + context.workspace_path(), + Some(ExecutionCacheKey::UserTask { + task_name: task_node.task_display.task_name.clone(), + command_item_index, + and_item_index: 0, + extra_args: Arc::clone(&extra_args), + package_path: strip_prefix_for_cache( + package_path, + context.workspace_path(), + ) + .map_err(|kind| PathFingerprintError { + kind, + path_type: PathType::PackagePath, + })?, + }), + &BTreeMap::new(), + &resolved_options, + context.envs(), + Arc::clone(&*SHELL_PROGRAM_PATH), + SHELL_ARGS + .iter() + .map(|s| Str::from(*s)) + .chain(std::iter::once(script_with_args)) + .collect(), + )?; + items.push(ExecutionItem { + execution_item_display, + kind: ExecutionItemKind::Leaf(LeafExecutionKind::Spawn(spawn_execution)), + }); + } + } } // Expand post-hook (`postX`) for package.json scripts. diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional_env/snapshots/query_tool_synthetic_task_in_user_task.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional_env/snapshots/query_tool_synthetic_task_in_user_task.jsonc index ffd56ab48..8b99b4f2b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional_env/snapshots/query_tool_synthetic_task_in_user_task.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional_env/snapshots/query_tool_synthetic_task_in_user_task.jsonc @@ -50,6 +50,7 @@ "execution_cache_key": { "UserTask": { "task_name": "env-test", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional_env/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional_env/snapshots/task_graph.jsonc index da3f2d593..19aaa9ef5 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional_env/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional_env/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "TEST_VAR=hello_world vt tool print-env TEST_VAR", + "commands": [ + "TEST_VAR=hello_world vt tool print-env TEST_VAR" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo hello", + "commands": [ + "echo hello" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/query___cache_enables_script_caching.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/query___cache_enables_script_caching.jsonc index 9d5653b82..e405a1399 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/query___cache_enables_script_caching.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/query___cache_enables_script_caching.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "test", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" 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.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/query___cache_enables_task_caching_even_when_cache_tasks_is_false.jsonc index a074d3e67..1b35f15f5 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.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/query___cache_enables_task_caching_even_when_cache_tasks_is_false.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "build", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" 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.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/query___cache_on_task_with_per_task_cache_true_enables_caching.jsonc index dcaf06aef..66ca24ad6 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.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/query___cache_on_task_with_per_task_cache_true_enables_caching.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "check", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/task_graph.jsonc index d98768c05..2f5b12113 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_cli_override/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file vite-task.json", + "commands": [ + "vtt print-file vite-task.json" + ], "resolved_options": { "cwd": "/", "cache_config": null @@ -112,7 +118,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file vite-task.json", + "commands": [ + "vtt print-file vite-task.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -151,7 +159,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_echo_and_lint_with_extra_args.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_echo_and_lint_with_extra_args.jsonc index 9a0bdf81d..5cbf8ef4f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_echo_and_lint_with_extra_args.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_echo_and_lint_with_extra_args.jsonc @@ -74,6 +74,7 @@ "execution_cache_key": { "UserTask": { "task_name": "echo-and-lint", + "command_item_index": 0, "and_item_index": 1, "extra_args": [ "--fix" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_lint_and_echo_with_extra_args.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_lint_and_echo_with_extra_args.jsonc index 2c3cf57c1..f68b2c366 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_lint_and_echo_with_extra_args.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_lint_and_echo_with_extra_args.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "lint-and-echo", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_normal_task_with_extra_args.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_normal_task_with_extra_args.jsonc index 09d886a16..9b2d74d23 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_normal_task_with_extra_args.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_normal_task_with_extra_args.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "hello", + "command_item_index": 0, "and_item_index": 0, "extra_args": [ "a.txt" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_in_user_task.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_in_user_task.jsonc index 486ba4059..a7c5ab452 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_in_user_task.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_in_user_task.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "lint", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_in_user_task_with_cwd.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_in_user_task_with_cwd.jsonc index 486ba4059..a7c5ab452 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_in_user_task_with_cwd.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_in_user_task_with_cwd.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "lint", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_with_extra_args_in_user_task.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_with_extra_args_in_user_task.jsonc index c55f58cb4..13e4a85ce 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_with_extra_args_in_user_task.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/query_synthetic_task_with_extra_args_in_user_task.jsonc @@ -49,6 +49,7 @@ "execution_cache_key": { "UserTask": { "task_name": "lint", + "command_item_index": 0, "and_item_index": 0, "extra_args": [ "--fix" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/task_graph.jsonc index 13b2802fd..4179f7382 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_keys/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo Linting && vt tool print lint", + "commands": [ + "echo Linting && vt tool print lint" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file", + "commands": [ + "vtt print-file" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt tool print lint", + "commands": [ + "vt tool print lint" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -129,7 +135,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt tool print lint && echo", + "commands": [ + "vt tool print lint && echo" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_default/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_default/snapshots/task_graph.jsonc index 5129800c3..c4bd93f0b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_default/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_default/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_enabled/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_enabled/snapshots/task_graph.jsonc index 8f084f7de..22e54038a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_enabled/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_enabled/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo building", + "commands": [ + "echo building" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo testing", + "commands": [ + "echo testing" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/query_another_task_cached_by_default.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/query_another_task_cached_by_default.jsonc index 7290adb92..b3933036b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/query_another_task_cached_by_default.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/query_another_task_cached_by_default.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "deploy", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/query_task_cached_by_default.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/query_task_cached_by_default.jsonc index 2c6b4fac5..167bf9a8f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/query_task_cached_by_default.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/query_task_cached_by_default.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "build", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/task_graph.jsonc index cb6afda93..77af6bcf2 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_scripts_task_override/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_sharing/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_sharing/snapshots/task_graph.jsonc index ebfa2e8b3..2b490fd1a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_sharing/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_sharing/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo a", + "commands": [ + "echo a" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo a && echo b", + "commands": [ + "echo a && echo b" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo a && echo b && echo c", + "commands": [ + "echo a && echo b && echo c" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_subcommand/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_subcommand/snapshots/task_graph.jsonc index fb069d24d..872444f8a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_subcommand/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_subcommand/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt cache clean", + "commands": [ + "vt cache clean" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_tasks_disabled/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_tasks_disabled/snapshots/task_graph.jsonc index 55ebae45d..a0a7990f1 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_tasks_disabled/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_tasks_disabled/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/query_script_cached_when_global_cache_true.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/query_script_cached_when_global_cache_true.jsonc index b30a9353f..cecab6c3b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/query_script_cached_when_global_cache_true.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/query_script_cached_when_global_cache_true.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "test", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/query_task_cached_when_global_cache_true.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/query_task_cached_when_global_cache_true.jsonc index 9bedda875..4c9c80f26 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/query_task_cached_when_global_cache_true.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/query_task_cached_when_global_cache_true.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "deploy", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/task_graph.jsonc index fff2e8ef4..3c36b1936 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache_true_no_force_enable/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": null @@ -34,7 +36,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -73,7 +77,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { 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.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd_in_scripts/snapshots/query_cd_before_vt_lint_should_put_synthetic_task_under_cwd.jsonc index c520ea59e..6780f863e 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.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd_in_scripts/snapshots/query_cd_before_vt_lint_should_put_synthetic_task_under_cwd.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "cd-lint", + "command_item_index": 0, "and_item_index": 1, "extra_args": [], "package_path": "" 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.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd_in_scripts/snapshots/query_cd_before_vt_run_should_not_affect_expanded_task_cwd.jsonc index be8da5ff1..a339b4571 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.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd_in_scripts/snapshots/query_cd_before_vt_run_should_not_affect_expanded_task_cwd.jsonc @@ -73,6 +73,7 @@ "execution_cache_key": { "UserTask": { "task_name": "build", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd_in_scripts/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd_in_scripts/snapshots/task_graph.jsonc index a0ea080a3..a5840cb2b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd_in_scripts/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd_in_scripts/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "cd src && vt run build", + "commands": [ + "cd src && vt run build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "cd src && vt tool print lint", + "commands": [ + "cd src && vt tool print lint" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive_task_graph/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive_task_graph/snapshots/task_graph.jsonc index 9597c4b3a..761bbde32 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive_task_graph/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive_task_graph/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/packages/api" }, "resolved_config": { - "command": "echo Generate schemas && echo Compile TypeScript && echo Bundle API && echo Copy assets", + "commands": [ + "echo Generate schemas && echo Compile TypeScript && echo Bundle API && echo Copy assets" + ], "resolved_options": { "cwd": "/packages/api", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/api" }, "resolved_config": { - "command": "echo Watch mode && echo Start dev server", + "commands": [ + "echo Watch mode && echo Start dev server" + ], "resolved_options": { "cwd": "/packages/api", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/packages/api" }, "resolved_config": { - "command": "echo Starting API server", + "commands": [ + "echo Starting API server" + ], "resolved_options": { "cwd": "/packages/api", "cache_config": { @@ -129,7 +135,9 @@ "package_path": "/packages/api" }, "resolved_config": { - "command": "echo Testing API", + "commands": [ + "echo Testing API" + ], "resolved_options": { "cwd": "/packages/api", "cache_config": { @@ -168,7 +176,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo Clean dist && echo Build client && echo Build server && echo Generate manifest && echo Optimize assets", + "commands": [ + "echo Clean dist && echo Build client && echo Build server && echo Generate manifest && echo Optimize assets" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -207,7 +217,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo Validate && echo Upload && echo Verify", + "commands": [ + "echo Validate && echo Upload && echo Verify" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -246,7 +258,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo Running dev server", + "commands": [ + "echo Running dev server" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -285,7 +299,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo Preview build", + "commands": [ + "echo Preview build" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -324,7 +340,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo Unit tests && echo Integration tests", + "commands": [ + "echo Unit tests && echo Integration tests" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -363,7 +381,9 @@ "package_path": "/packages/config" }, "resolved_config": { - "command": "echo Building config", + "commands": [ + "echo Building config" + ], "resolved_options": { "cwd": "/packages/config", "cache_config": { @@ -402,7 +422,9 @@ "package_path": "/packages/config" }, "resolved_config": { - "command": "echo Validating config", + "commands": [ + "echo Validating config" + ], "resolved_options": { "cwd": "/packages/config", "cache_config": { @@ -441,7 +463,9 @@ "package_path": "/packages/pkg#special" }, "resolved_config": { - "command": "echo Building package with hash", + "commands": [ + "echo Building package with hash" + ], "resolved_options": { "cwd": "/packages/pkg#special", "cache_config": { @@ -480,7 +504,9 @@ "package_path": "/packages/pkg#special" }, "resolved_config": { - "command": "echo Testing package with hash", + "commands": [ + "echo Testing package with hash" + ], "resolved_options": { "cwd": "/packages/pkg#special", "cache_config": { @@ -519,7 +545,9 @@ "package_path": "/packages/shared" }, "resolved_config": { - "command": "echo Cleaning && echo Compiling shared && echo Generating types", + "commands": [ + "echo Cleaning && echo Compiling shared && echo Generating types" + ], "resolved_options": { "cwd": "/packages/shared", "cache_config": { @@ -558,7 +586,9 @@ "package_path": "/packages/shared" }, "resolved_config": { - "command": "echo Linting shared", + "commands": [ + "echo Linting shared" + ], "resolved_options": { "cwd": "/packages/shared", "cache_config": { @@ -597,7 +627,9 @@ "package_path": "/packages/shared" }, "resolved_config": { - "command": "echo Setting up test env && echo Running tests && echo Cleanup", + "commands": [ + "echo Setting up test env && echo Running tests && echo Cleanup" + ], "resolved_options": { "cwd": "/packages/shared", "cache_config": { @@ -636,7 +668,9 @@ "package_path": "/packages/shared" }, "resolved_config": { - "command": "echo Type checking shared", + "commands": [ + "echo Type checking shared" + ], "resolved_options": { "cwd": "/packages/shared", "cache_config": { @@ -675,7 +709,9 @@ "package_path": "/packages/tools" }, "resolved_config": { - "command": "echo Generating tools", + "commands": [ + "echo Generating tools" + ], "resolved_options": { "cwd": "/packages/tools", "cache_config": { @@ -714,7 +750,9 @@ "package_path": "/packages/tools" }, "resolved_config": { - "command": "echo Validating", + "commands": [ + "echo Validating" + ], "resolved_options": { "cwd": "/packages/tools", "cache_config": { @@ -753,7 +791,9 @@ "package_path": "/packages/ui" }, "resolved_config": { - "command": "echo Compile styles && echo Build components && echo Generate types", + "commands": [ + "echo Compile styles && echo Build components && echo Generate types" + ], "resolved_options": { "cwd": "/packages/ui", "cache_config": { @@ -792,7 +832,9 @@ "package_path": "/packages/ui" }, "resolved_config": { - "command": "echo Linting UI", + "commands": [ + "echo Linting UI" + ], "resolved_options": { "cwd": "/packages/ui", "cache_config": { @@ -831,7 +873,9 @@ "package_path": "/packages/ui" }, "resolved_config": { - "command": "echo Running storybook", + "commands": [ + "echo Running storybook" + ], "resolved_options": { "cwd": "/packages/ui", "cache_config": { @@ -870,7 +914,9 @@ "package_path": "/packages/ui" }, "resolved_config": { - "command": "echo Testing UI", + "commands": [ + "echo Testing UI" + ], "resolved_options": { "cwd": "/packages/ui", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict_test/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict_test/snapshots/task_graph.jsonc index e246a1db3..397877616 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict_test/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict_test/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/packages/scope-a" }, "resolved_config": { - "command": "echo Task b#c in scope-a", + "commands": [ + "echo Task b#c in scope-a" + ], "resolved_options": { "cwd": "/packages/scope-a", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/scope-a-b" }, "resolved_config": { - "command": "echo Task c in scope-a#b", + "commands": [ + "echo Task c in scope-a#b" + ], "resolved_options": { "cwd": "/packages/scope-a-b", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/packages/test-package" }, "resolved_config": { - "command": "echo Testing", + "commands": [ + "echo Testing" + ], "resolved_options": { "cwd": "/packages/test-package", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle_dependency/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle_dependency/snapshots/task_graph.jsonc index 2c07f9bd1..1ae727588 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle_dependency/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle_dependency/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo a", + "commands": [ + "echo a" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -56,7 +58,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo b", + "commands": [ + "echo b" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency_both_topo_and_explicit/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency_both_topo_and_explicit/snapshots/task_graph.jsonc index 9b4779c26..93b00d716 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency_both_topo_and_explicit/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency_both_topo_and_explicit/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/packages/a" }, "resolved_config": { - "command": "build a", + "commands": [ + "build a" + ], "resolved_options": { "cwd": "/packages/a", "cache_config": { @@ -56,7 +58,9 @@ "package_path": "/packages/b" }, "resolved_config": { - "command": "build b", + "commands": [ + "build b" + ], "resolved_options": { "cwd": "/packages/b", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate_package_names/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate_package_names/snapshots/task_graph.jsonc index b3d46d315..f33d9ee86 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate_package_names/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate_package_names/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/packages/pkg-a" }, "resolved_config": { - "command": "echo build-a", + "commands": [ + "echo build-a" + ], "resolved_options": { "cwd": "/packages/pkg-a", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/pkg-b" }, "resolved_config": { - "command": "echo build-b", + "commands": [ + "echo build-b" + ], "resolved_options": { "cwd": "/packages/pkg-b", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty_package_test/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty_package_test/snapshots/task_graph.jsonc index 0a88447df..4dcd4d244 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty_package_test/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty_package_test/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/packages/another-empty" }, "resolved_config": { - "command": "echo 'Building another-empty package'", + "commands": [ + "echo 'Building another-empty package'" + ], "resolved_options": { "cwd": "/packages/another-empty", "cache_config": { @@ -60,7 +62,9 @@ "package_path": "/packages/another-empty" }, "resolved_config": { - "command": "echo 'Deploying another-empty package'", + "commands": [ + "echo 'Deploying another-empty package'" + ], "resolved_options": { "cwd": "/packages/another-empty", "cache_config": null @@ -91,7 +95,9 @@ "package_path": "/packages/another-empty" }, "resolved_config": { - "command": "echo 'Linting another-empty package'", + "commands": [ + "echo 'Linting another-empty package'" + ], "resolved_options": { "cwd": "/packages/another-empty", "cache_config": { @@ -130,7 +136,9 @@ "package_path": "/packages/another-empty" }, "resolved_config": { - "command": "echo 'Testing another-empty package'", + "commands": [ + "echo 'Testing another-empty package'" + ], "resolved_options": { "cwd": "/packages/another-empty", "cache_config": { @@ -169,7 +177,9 @@ "package_path": "/packages/empty-name" }, "resolved_config": { - "command": "echo 'Building empty-name package'", + "commands": [ + "echo 'Building empty-name package'" + ], "resolved_options": { "cwd": "/packages/empty-name", "cache_config": { @@ -213,7 +223,9 @@ "package_path": "/packages/empty-name" }, "resolved_config": { - "command": "echo 'Linting empty-name package'", + "commands": [ + "echo 'Linting empty-name package'" + ], "resolved_options": { "cwd": "/packages/empty-name", "cache_config": { @@ -252,7 +264,9 @@ "package_path": "/packages/empty-name" }, "resolved_config": { - "command": "echo 'Testing empty-name package'", + "commands": [ + "echo 'Testing empty-name package'" + ], "resolved_options": { "cwd": "/packages/empty-name", "cache_config": { @@ -291,7 +305,9 @@ "package_path": "/packages/normal-package" }, "resolved_config": { - "command": "echo 'Building normal-package'", + "commands": [ + "echo 'Building normal-package'" + ], "resolved_options": { "cwd": "/packages/normal-package", "cache_config": { @@ -330,7 +346,9 @@ "package_path": "/packages/normal-package" }, "resolved_config": { - "command": "echo 'Testing normal-package'", + "commands": [ + "echo 'Testing normal-package'" + ], "resolved_options": { "cwd": "/packages/normal-package", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit_deps_workspace/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit_deps_workspace/snapshots/task_graph.jsonc index 4c6c21e3b..d5d74771d 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit_deps_workspace/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit_deps_workspace/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo 'Building @test/app'", + "commands": [ + "echo 'Building @test/app'" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "deploy-script --prod", + "commands": [ + "deploy-script --prod" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": null @@ -86,7 +90,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo 'Starting @test/app'", + "commands": [ + "echo 'Starting @test/app'" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -125,7 +131,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo 'Testing @test/app'", + "commands": [ + "echo 'Testing @test/app'" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -164,7 +172,9 @@ "package_path": "/packages/core" }, "resolved_config": { - "command": "echo 'Building @test/core'", + "commands": [ + "echo 'Building @test/core'" + ], "resolved_options": { "cwd": "/packages/core", "cache_config": { @@ -203,7 +213,9 @@ "package_path": "/packages/core" }, "resolved_config": { - "command": "echo 'Cleaning @test/core'", + "commands": [ + "echo 'Cleaning @test/core'" + ], "resolved_options": { "cwd": "/packages/core", "cache_config": { @@ -242,7 +254,9 @@ "package_path": "/packages/core" }, "resolved_config": { - "command": "eslint src", + "commands": [ + "eslint src" + ], "resolved_options": { "cwd": "/packages/core", "cache_config": { @@ -286,7 +300,9 @@ "package_path": "/packages/core" }, "resolved_config": { - "command": "echo 'Testing @test/core'", + "commands": [ + "echo 'Testing @test/core'" + ], "resolved_options": { "cwd": "/packages/core", "cache_config": { @@ -325,7 +341,9 @@ "package_path": "/packages/utils" }, "resolved_config": { - "command": "echo 'Building @test/utils'", + "commands": [ + "echo 'Building @test/utils'" + ], "resolved_options": { "cwd": "/packages/utils", "cache_config": { @@ -364,7 +382,9 @@ "package_path": "/packages/utils" }, "resolved_config": { - "command": "eslint src", + "commands": [ + "eslint src" + ], "resolved_options": { "cwd": "/packages/utils", "cache_config": { @@ -412,7 +432,9 @@ "package_path": "/packages/utils" }, "resolved_config": { - "command": "echo 'Testing @test/utils'", + "commands": [ + "echo 'Testing @test/utils'" + ], "resolved_options": { "cwd": "/packages/utils", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/extra_args_not_forwarded_to_depends_on/snapshots/query_extra_args_only_reach_requested_task.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/extra_args_not_forwarded_to_depends_on/snapshots/query_extra_args_only_reach_requested_task.jsonc index bd30bc241..b7f64fcfe 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/extra_args_not_forwarded_to_depends_on/snapshots/query_extra_args_only_reach_requested_task.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/extra_args_not_forwarded_to_depends_on/snapshots/query_extra_args_only_reach_requested_task.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "build", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" @@ -132,6 +133,7 @@ "execution_cache_key": { "UserTask": { "task_name": "test", + "command_item_index": 0, "and_item_index": 0, "extra_args": [ "some-filter" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/extra_args_not_forwarded_to_depends_on/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/extra_args_not_forwarded_to_depends_on/snapshots/task_graph.jsonc index e483d70c4..02b6721d1 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/extra_args_not_forwarded_to_depends_on/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/extra_args_not_forwarded_to_depends_on/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt tool print build", + "commands": [ + "vt tool print build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt tool print test", + "commands": [ + "vt tool print test" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/filter_workspace/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/filter_workspace/snapshots/task_graph.jsonc index 27c09ea17..14e964a61 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/filter_workspace/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/filter_workspace/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo 'Checking workspace'", + "commands": [ + "echo 'Checking workspace'" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo 'Building @test/app'", + "commands": [ + "echo 'Building @test/app'" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo 'Checking @test/app'", + "commands": [ + "echo 'Checking @test/app'" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -129,7 +135,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "vt run --filter .... build", + "commands": [ + "vt run --filter .... build" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -168,7 +176,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo 'Testing @test/app'", + "commands": [ + "echo 'Testing @test/app'" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -207,7 +217,9 @@ "package_path": "/packages/cli" }, "resolved_config": { - "command": "echo 'Building @test/cli'", + "commands": [ + "echo 'Building @test/cli'" + ], "resolved_options": { "cwd": "/packages/cli", "cache_config": { @@ -246,7 +258,9 @@ "package_path": "/packages/cli" }, "resolved_config": { - "command": "echo 'Testing @test/cli'", + "commands": [ + "echo 'Testing @test/cli'" + ], "resolved_options": { "cwd": "/packages/cli", "cache_config": { @@ -285,7 +299,9 @@ "package_path": "/packages/core" }, "resolved_config": { - "command": "echo 'Building @test/core'", + "commands": [ + "echo 'Building @test/core'" + ], "resolved_options": { "cwd": "/packages/core", "cache_config": { @@ -324,7 +340,9 @@ "package_path": "/packages/core" }, "resolved_config": { - "command": "echo 'Checking @test/core'", + "commands": [ + "echo 'Checking @test/core'" + ], "resolved_options": { "cwd": "/packages/core", "cache_config": { @@ -363,7 +381,9 @@ "package_path": "/packages/core" }, "resolved_config": { - "command": "echo 'Testing @test/core'", + "commands": [ + "echo 'Testing @test/core'" + ], "resolved_options": { "cwd": "/packages/core", "cache_config": { @@ -402,7 +422,9 @@ "package_path": "/packages/lib" }, "resolved_config": { - "command": "echo 'Building @test/lib'", + "commands": [ + "echo 'Building @test/lib'" + ], "resolved_options": { "cwd": "/packages/lib", "cache_config": { @@ -441,7 +463,9 @@ "package_path": "/packages/lib" }, "resolved_config": { - "command": "echo 'Testing @test/lib'", + "commands": [ + "echo 'Testing @test/lib'" + ], "resolved_options": { "cwd": "/packages/lib", "cache_config": { @@ -480,7 +504,9 @@ "package_path": "/packages/utils" }, "resolved_config": { - "command": "echo 'Building @test/utils'", + "commands": [ + "echo 'Building @test/utils'" + ], "resolved_options": { "cwd": "/packages/utils", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/input_trailing_slash/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/input_trailing_slash/snapshots/task_graph.jsonc index 11c015377..568c8842a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/input_trailing_slash/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/input_trailing_slash/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo build", + "commands": [ + "echo build" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/input_workspace_base/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/input_workspace_base/snapshots/task_graph.jsonc index b82a6e8da..456d4a2dc 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/input_workspace_base/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/input_workspace_base/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo build", + "commands": [ + "echo build" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_nested___cache_enables_inner_task_caching.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_nested___cache_enables_inner_task_caching.jsonc index 86f84738a..a7bc2ee10 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_nested___cache_enables_inner_task_caching.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_nested___cache_enables_inner_task_caching.jsonc @@ -73,6 +73,7 @@ "execution_cache_key": { "UserTask": { "task_name": "inner", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_outer___cache_propagates_to_nested_run_without_flags.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_outer___cache_propagates_to_nested_run_without_flags.jsonc index 67b355427..ccb1193b6 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_outer___cache_propagates_to_nested_run_without_flags.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_outer___cache_propagates_to_nested_run_without_flags.jsonc @@ -73,6 +73,7 @@ "execution_cache_key": { "UserTask": { "task_name": "inner", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" 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.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_outer___no_cache_does_not_propagate_into_nested___cache.jsonc index b33ee27d7..5a9b249ad 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_outer___no_cache_does_not_propagate_into_nested___cache.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/query_outer___no_cache_does_not_propagate_into_nested___cache.jsonc @@ -73,6 +73,7 @@ "execution_cache_key": { "UserTask": { "task_name": "inner", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/task_graph.jsonc index 1200a2faa..52878512d 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_cache_override/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vtt print-file package.json", + "commands": [ + "vtt print-file package.json" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run --cache inner", + "commands": [ + "vt run --cache inner" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run inner", + "commands": [ + "vt run inner" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -129,7 +135,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run --no-cache inner", + "commands": [ + "vt run --no-cache inner" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_tasks/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_tasks/snapshots/task_graph.jsonc index eef8a1a13..0c4bb0c11 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_tasks/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested_tasks/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo hello", + "commands": [ + "echo hello" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run script1", + "commands": [ + "vt run script1" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/package_self_dependency/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/package_self_dependency/snapshots/task_graph.jsonc index 599e3b086..af8f63a4b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/package_self_dependency/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/package_self_dependency/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/packages/self-dep" }, "resolved_config": { - "command": "echo building", + "commands": [ + "echo building" + ], "resolved_options": { "cwd": "/packages/self-dep", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel_and_concurrency/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel_and_concurrency/snapshots/task_graph.jsonc index 9c50b6a60..9dd2c8447 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel_and_concurrency/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/parallel_and_concurrency/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run -r build", + "commands": [ + "vt run -r build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run -r --concurrency-limit 5 build", + "commands": [ + "vt run -r --concurrency-limit 5 build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/packages/a" }, "resolved_config": { - "command": "echo building a", + "commands": [ + "echo building a" + ], "resolved_options": { "cwd": "/packages/a", "cache_config": { @@ -129,7 +135,9 @@ "package_path": "/packages/b" }, "resolved_config": { - "command": "echo building b", + "commands": [ + "echo building b" + ], "resolved_options": { "cwd": "/packages/b", "cache_config": { @@ -168,7 +176,9 @@ "package_path": "/packages/c" }, "resolved_config": { - "command": "echo building c", + "commands": [ + "echo building c" + ], "resolved_options": { "cwd": "/packages/c", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm_workspace_packages_optional/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm_workspace_packages_optional/snapshots/task_graph.jsonc index aef412250..48a036335 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm_workspace_packages_optional/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm_workspace_packages_optional/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo hello", + "commands": [ + "echo hello" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive_topological_workspace/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive_topological_workspace/snapshots/task_graph.jsonc index a902fcadd..faa37f82c 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive_topological_workspace/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive_topological_workspace/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/apps/web" }, "resolved_config": { - "command": "echo 'Building @test/web'", + "commands": [ + "echo 'Building @test/web'" + ], "resolved_options": { "cwd": "/apps/web", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/apps/web" }, "resolved_config": { - "command": "echo 'Running @test/web in dev mode'", + "commands": [ + "echo 'Running @test/web in dev mode'" + ], "resolved_options": { "cwd": "/apps/web", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo 'Building @test/app'", + "commands": [ + "echo 'Building @test/app'" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -129,7 +135,9 @@ "package_path": "/packages/app" }, "resolved_config": { - "command": "echo 'Testing @test/app'", + "commands": [ + "echo 'Testing @test/app'" + ], "resolved_options": { "cwd": "/packages/app", "cache_config": { @@ -168,7 +176,9 @@ "package_path": "/packages/core" }, "resolved_config": { - "command": "echo 'Building @test/core'", + "commands": [ + "echo 'Building @test/core'" + ], "resolved_options": { "cwd": "/packages/core", "cache_config": { @@ -207,7 +217,9 @@ "package_path": "/packages/core" }, "resolved_config": { - "command": "echo 'Testing @test/core'", + "commands": [ + "echo 'Testing @test/core'" + ], "resolved_options": { "cwd": "/packages/core", "cache_config": { @@ -246,7 +258,9 @@ "package_path": "/packages/utils" }, "resolved_config": { - "command": "echo 'Preparing @test/utils' && echo 'Building @test/utils' && echo 'Done @test/utils'", + "commands": [ + "echo 'Preparing @test/utils' && echo 'Building @test/utils' && echo 'Done @test/utils'" + ], "resolved_options": { "cwd": "/packages/utils", "cache_config": { @@ -285,7 +299,9 @@ "package_path": "/packages/utils" }, "resolved_config": { - "command": "echo 'Testing @test/utils'", + "commands": [ + "echo 'Testing @test/utils'" + ], "resolved_options": { "cwd": "/packages/utils", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks/snapshots/task_graph.jsonc index e5271222f..4fa9288d1 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo build", + "commands": [ + "echo build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo posttest", + "commands": [ + "echo posttest" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo prebuild", + "commands": [ + "echo prebuild" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -129,7 +135,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo prepretest", + "commands": [ + "echo prepretest" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -168,7 +176,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo pretest", + "commands": [ + "echo pretest" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -207,7 +217,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo test", + "commands": [ + "echo test" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_disabled/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_disabled/snapshots/task_graph.jsonc index 2961d7313..7e9ae1253 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_disabled/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_disabled/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo posttest", + "commands": [ + "echo posttest" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo pretest", + "commands": [ + "echo pretest" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo test", + "commands": [ + "echo test" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_nested_run/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_nested_run/snapshots/task_graph.jsonc index 36a3f67d0..159f52580 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_nested_run/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_nested_run/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo prescriptInHook", + "commands": [ + "echo prescriptInHook" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run scriptInHook", + "commands": [ + "vt run scriptInHook" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo scriptInHook", + "commands": [ + "echo scriptInHook" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -129,7 +135,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo test", + "commands": [ + "echo test" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_task_no_hook/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_task_no_hook/snapshots/task_graph.jsonc index 005d03240..dd84ccf32 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_task_no_hook/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script_hooks_task_no_hook/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo pretest-script", + "commands": [ + "echo pretest-script" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo test-task", + "commands": [ + "echo test-task" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell_fallback/snapshots/query_shell_fallback_for_pipe_command.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell_fallback/snapshots/query_shell_fallback_for_pipe_command.jsonc index 18d471a58..cfb4bd0eb 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell_fallback/snapshots/query_shell_fallback_for_pipe_command.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell_fallback/snapshots/query_shell_fallback_for_pipe_command.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "pipe-test", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell_fallback/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell_fallback/snapshots/task_graph.jsonc index 51fd7c317..cf06df8bd 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell_fallback/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell_fallback/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo hello | node -e \"process.stdin.pipe(process.stdout)\"", + "commands": [ + "echo hello | node -e \"process.stdin.pipe(process.stdout)\"" + ], "resolved_options": { "cwd": "/", "cache_config": { 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.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_parent_cache_false_does_not_affect_expanded_query_tasks.jsonc index aeecf7dfc..c4ea94550 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_parent_cache_false_does_not_affect_expanded_query_tasks.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_parent_cache_false_does_not_affect_expanded_query_tasks.jsonc @@ -73,6 +73,7 @@ "execution_cache_key": { "UserTask": { "task_name": "build", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" 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.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_script_cache_false_does_not_affect_expanded_synthetic_cache.jsonc index 9faff6db5..43a5ee254 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_script_cache_false_does_not_affect_expanded_synthetic_cache.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_script_cache_false_does_not_affect_expanded_synthetic_cache.jsonc @@ -73,6 +73,7 @@ "execution_cache_key": { "UserTask": { "task_name": "build", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_task_untrackedEnv_inherited_by_synthetic.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_task_untrackedEnv_inherited_by_synthetic.jsonc index b40c6ef5b..8b1ac16ea 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_task_untrackedEnv_inherited_by_synthetic.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_task_untrackedEnv_inherited_by_synthetic.jsonc @@ -49,6 +49,7 @@ "execution_cache_key": { "UserTask": { "task_name": "lint-with-untracked-env", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_task_with_cache_true_enables_synthetic_cache.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_task_with_cache_true_enables_synthetic_cache.jsonc index 25f889c6e..ed4410aff 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_task_with_cache_true_enables_synthetic_cache.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/query_task_with_cache_true_enables_synthetic_cache.jsonc @@ -48,6 +48,7 @@ "execution_cache_key": { "UserTask": { "task_name": "lint-with-cache", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/task_graph.jsonc index b550e3faf..a756b187a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_cache_disabled/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt tool print lint", + "commands": [ + "vt tool print lint" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt tool print lint", + "commands": [ + "vt tool print lint" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt tool print lint", + "commands": [ + "vt tool print lint" + ], "resolved_options": { "cwd": "/", "cache_config": null @@ -112,7 +118,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt tool print lint", + "commands": [ + "vt tool print lint" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -151,7 +159,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt tool print lint", + "commands": [ + "vt tool print lint" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -191,7 +201,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run build", + "commands": [ + "vt run build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -230,7 +242,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run build", + "commands": [ + "vt run build" + ], "resolved_options": { "cwd": "/", "cache_config": null diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_in_subpackage/snapshots/query_synthetic_in_subpackage.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_in_subpackage/snapshots/query_synthetic_in_subpackage.jsonc index e98570929..c33fba388 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_in_subpackage/snapshots/query_synthetic_in_subpackage.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_in_subpackage/snapshots/query_synthetic_in_subpackage.jsonc @@ -73,6 +73,7 @@ "execution_cache_key": { "UserTask": { "task_name": "lint", + "command_item_index": 0, "and_item_index": 0, "extra_args": [], "package_path": "packages/a" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_in_subpackage/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_in_subpackage/snapshots/task_graph.jsonc index f45c1001a..266bbc495 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_in_subpackage/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic_in_subpackage/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run a#lint", + "commands": [ + "vt run a#lint" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/a" }, "resolved_config": { - "command": "vt tool print lint", + "commands": [ + "vt tool print lint" + ], "resolved_options": { "cwd": "/packages/a", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/package.json new file mode 100644 index 000000000..a2538e229 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/package.json @@ -0,0 +1,4 @@ +{ + "name": "@test/task-command-shorthands", + "private": true +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots.toml new file mode 100644 index 000000000..1ae7c2d16 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots.toml @@ -0,0 +1,47 @@ +[[plan]] +name = "string_shorthand" +args = ["run", "string_shorthand"] + +[[plan]] +name = "array_shorthand" +args = ["run", "array_shorthand"] + +[[plan]] +name = "array_with_and" +args = ["run", "array_with_and"] + +[[plan]] +name = "nested_vt_array" +args = ["run", "nested_vt_array"] + +[[plan]] +name = "array_cd_spawn" +args = ["run", "array_cd_spawn"] + +[[plan]] +name = "array_cd_shell" +args = ["run", "array_cd_shell"] + +[[plan]] +name = "array_shell_cd_before_next" +args = ["run", "array_shell_cd_before_next"] + +[[plan]] +name = "array_compound_cd_before_next" +args = ["run", "array_compound_cd_before_next"] + +[[plan]] +name = "array_unbalanced_quotes" +args = ["run", "array_unbalanced_quotes"] + +[[plan]] +name = "object_array_depends_on" +args = ["run", "object_array_depends_on"] + +[[plan]] +name = "empty_array_error" +args = ["run", "empty_array"] + +[[plan]] +name = "empty_item_error" +args = ["run", "empty_item"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_cd_shell.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_cd_shell.jsonc new file mode 100644 index 000000000..54ad126f6 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_cd_shell.jsonc @@ -0,0 +1,90 @@ +// run array_cd_shell +{ + "graph": [ + { + "key": [ + "/", + "array_cd_shell" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_cd_shell", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_cd_shell", + "package_path": "/" + }, + "command": "echo $PWD", + "cwd": "/snapshots" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "snapshots", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "" + } + }, + "args": [ + "", + "echo $PWD" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "array_cd_shell", + "command_item_index": 1, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "", + "args": [ + "", + "echo $PWD" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/snapshots" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_cd_spawn.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_cd_spawn.jsonc new file mode 100644 index 000000000..b64baa901 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_cd_spawn.jsonc @@ -0,0 +1,90 @@ +// run array_cd_spawn +{ + "graph": [ + { + "key": [ + "/", + "array_cd_spawn" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_cd_spawn", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_cd_spawn", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "cwd": "/snapshots" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "snapshots", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "array_cd_spawn", + "command_item_index": 1, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/snapshots" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_compound_cd_before_next.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_compound_cd_before_next.jsonc new file mode 100644 index 000000000..e400ee23f --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_compound_cd_before_next.jsonc @@ -0,0 +1,158 @@ +// run array_compound_cd_before_next +{ + "graph": [ + { + "key": [ + "/", + "array_compound_cd_before_next" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_compound_cd_before_next", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_compound_cd_before_next", + "package_path": "/" + }, + "command": "if true; then cd snapshots; fi", + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "" + } + }, + "args": [ + "", + "if true; then cd snapshots; fi" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "array_compound_cd_before_next", + "command_item_index": 0, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "", + "args": [ + "", + "if true; then cd snapshots; fi" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_compound_cd_before_next", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "array_compound_cd_before_next", + "command_item_index": 1, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_shell_cd_before_next.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_shell_cd_before_next.jsonc new file mode 100644 index 000000000..1b8b770a9 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_shell_cd_before_next.jsonc @@ -0,0 +1,158 @@ +// run array_shell_cd_before_next +{ + "graph": [ + { + "key": [ + "/", + "array_shell_cd_before_next" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_shell_cd_before_next", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_shell_cd_before_next", + "package_path": "/" + }, + "command": "cd \"$APP_DIR\"", + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "" + } + }, + "args": [ + "", + "cd \"$APP_DIR\"" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "array_shell_cd_before_next", + "command_item_index": 0, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "", + "args": [ + "", + "cd \"$APP_DIR\"" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_shell_cd_before_next", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "array_shell_cd_before_next", + "command_item_index": 1, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_shorthand.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_shorthand.jsonc new file mode 100644 index 000000000..ee4e8ba36 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_shorthand.jsonc @@ -0,0 +1,226 @@ +// run array_shorthand +{ + "graph": [ + { + "key": [ + "/", + "array_shorthand" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_shorthand", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_shorthand", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "array_shorthand", + "command_item_index": 0, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_shorthand", + "package_path": "/" + }, + "command": "vtt print-file vite-task.json", + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "vite-task.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "array_shorthand", + "command_item_index": 1, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "vite-task.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_shorthand", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "array_shorthand", + "command_item_index": 2, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_unbalanced_quotes.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_unbalanced_quotes.jsonc new file mode 100644 index 000000000..f030cbed3 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_unbalanced_quotes.jsonc @@ -0,0 +1,158 @@ +// run array_unbalanced_quotes +{ + "graph": [ + { + "key": [ + "/", + "array_unbalanced_quotes" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_unbalanced_quotes", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_unbalanced_quotes", + "package_path": "/" + }, + "command": "foo '", + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "" + } + }, + "args": [ + "", + "foo '" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "array_unbalanced_quotes", + "command_item_index": 0, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "", + "args": [ + "", + "foo '" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_unbalanced_quotes", + "package_path": "/" + }, + "command": "' bar", + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "" + } + }, + "args": [ + "", + "' bar" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "array_unbalanced_quotes", + "command_item_index": 1, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "", + "args": [ + "", + "' bar" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_with_and.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_with_and.jsonc new file mode 100644 index 000000000..7f69f02f8 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_array_with_and.jsonc @@ -0,0 +1,226 @@ +// run array_with_and +{ + "graph": [ + { + "key": [ + "/", + "array_with_and" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_with_and", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_with_and", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "array_with_and", + "command_item_index": 0, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_with_and", + "package_path": "/" + }, + "command": "vtt print-file vite-task.json", + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "vite-task.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "array_with_and", + "command_item_index": 1, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "vite-task.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_with_and", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "array_with_and", + "command_item_index": 1, + "and_item_index": 1, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_empty_array_error.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_empty_array_error.snap new file mode 100644 index 000000000..071fcf32d --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_empty_array_error.snap @@ -0,0 +1 @@ +Invalid task command: command array must not be empty \ No newline at end of file diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_empty_item_error.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_empty_item_error.snap new file mode 100644 index 000000000..db31e66b7 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_empty_item_error.snap @@ -0,0 +1 @@ +Invalid task command: command array entries must not be empty \ No newline at end of file diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_nested_vt_array.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_nested_vt_array.jsonc new file mode 100644 index 000000000..23d89d1c8 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_nested_vt_array.jsonc @@ -0,0 +1,192 @@ +// run nested_vt_array +{ + "graph": [ + { + "key": [ + "/", + "nested_vt_array" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "nested_vt_array", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "nested_vt_array", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "nested_vt_array", + "command_item_index": 0, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "nested_vt_array", + "package_path": "/" + }, + "command": "vt run string_shorthand", + "cwd": "/" + }, + "kind": { + "Expanded": { + "graph": [ + { + "key": [ + "/", + "string_shorthand" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "string_shorthand", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "string_shorthand", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "string_shorthand", + "command_item_index": 0, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_object_array_depends_on.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_object_array_depends_on.jsonc new file mode 100644 index 000000000..d1abf688f --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_object_array_depends_on.jsonc @@ -0,0 +1,315 @@ +// run object_array_depends_on +{ + "graph": [ + { + "key": [ + "/", + "object_array_depends_on" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "object_array_depends_on", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "object_array_depends_on", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "object_array_depends_on", + "command_item_index": 0, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "object_array_depends_on", + "package_path": "/" + }, + "command": "vtt print-file vite-task.json", + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "vtt" + } + }, + "args": [ + "print-file", + "vite-task.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "untracked_env_config": [ + "" + ] + } + }, + "execution_cache_key": { + "UserTask": { + "task_name": "object_array_depends_on", + "command_item_index": 1, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "vite-task.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + }, + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "object_array_depends_on", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "object_array_depends_on", + "command_item_index": 2, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [ + [ + "/", + "string_shorthand" + ] + ] + }, + { + "key": [ + "/", + "string_shorthand" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "string_shorthand", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "string_shorthand", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "string_shorthand", + "command_item_index": 0, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_string_shorthand.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_string_shorthand.jsonc new file mode 100644 index 000000000..34f1adcbb --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/query_string_shorthand.jsonc @@ -0,0 +1,90 @@ +// run string_shorthand +{ + "graph": [ + { + "key": [ + "/", + "string_shorthand" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "string_shorthand", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "string_shorthand", + "package_path": "/" + }, + "command": "vtt print-file package.json", + "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": "string_shorthand", + "command_item_index": 0, + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + }, + "spawn_command": { + "program_path": "/vtt", + "args": [ + "print-file", + "package.json" + ], + "all_envs": { + "FORCE_COLOR": "1", + "PATH": "/node_modules/.bin:" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ], + "concurrency_limit": 4 +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/task_graph.jsonc new file mode 100644 index 000000000..dccdad68d --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/snapshots/task_graph.jsonc @@ -0,0 +1,510 @@ +// task graph +[ + { + "key": [ + "/", + "array_cd_shell" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_cd_shell", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "cd snapshots", + "echo $PWD" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "array_cd_spawn" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_cd_spawn", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "cd snapshots", + "vtt print-file package.json" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "array_compound_cd_before_next" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_compound_cd_before_next", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "if true; then cd snapshots; fi", + "vtt print-file package.json" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "array_shell_cd_before_next" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_shell_cd_before_next", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "cd \"$APP_DIR\"", + "vtt print-file package.json" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "array_shorthand" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_shorthand", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "vtt print-file package.json", + "vtt print-file vite-task.json", + "vtt print-file package.json" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "array_unbalanced_quotes" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_unbalanced_quotes", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "foo '", + "' bar" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "array_with_and" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "array_with_and", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "vtt print-file package.json", + "vtt print-file vite-task.json && vtt print-file package.json" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "empty_array" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "empty_array", + "package_path": "/" + }, + "resolved_config": { + "commands": [], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "empty_item" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "empty_item", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "vtt print-file package.json", + "" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "nested_vt_array" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "nested_vt_array", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "vtt print-file package.json", + "vt run string_shorthand" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "object_array_depends_on" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "object_array_depends_on", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "vtt print-file package.json", + "vtt print-file vite-task.json", + "vtt print-file package.json" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [ + [ + "/", + "string_shorthand" + ] + ] + }, + { + "key": [ + "/", + "string_shorthand" + ], + "node": { + "task_display": { + "package_name": "@test/task-command-shorthands", + "task_name": "string_shorthand", + "package_path": "/" + }, + "resolved_config": { + "commands": [ + "vtt print-file package.json" + ], + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "untracked_env": [ + "" + ] + }, + "input_config": { + "includes_auto": true, + "positive_globs": [], + "negative_globs": [] + }, + "output_config": { + "includes_auto": false, + "positive_globs": [], + "negative_globs": [] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/vite-task.json new file mode 100644 index 000000000..1973b033e --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/task_command_shorthands/vite-task.json @@ -0,0 +1,33 @@ +{ + "tasks": { + "string_shorthand": "vtt print-file package.json", + "array_shorthand": [ + "vtt print-file package.json", + "vtt print-file vite-task.json", + "vtt print-file package.json" + ], + "array_with_and": [ + "vtt print-file package.json", + "vtt print-file vite-task.json && vtt print-file package.json" + ], + "nested_vt_array": ["vtt print-file package.json", "vt run string_shorthand"], + "array_cd_spawn": ["cd snapshots", "vtt print-file package.json"], + "array_cd_shell": ["cd snapshots", "echo $PWD"], + "array_shell_cd_before_next": ["cd \"$APP_DIR\"", "vtt print-file package.json"], + "array_compound_cd_before_next": [ + "if true; then cd snapshots; fi", + "vtt print-file package.json" + ], + "array_unbalanced_quotes": ["foo '", "' bar"], + "object_array_depends_on": { + "command": [ + "vtt print-file package.json", + "vtt print-file vite-task.json", + "vtt print-file package.json" + ], + "dependsOn": ["string_shorthand"] + }, + "empty_array": [], + "empty_item": ["vtt print-file package.json", ""] + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive_skip_intermediate/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive_skip_intermediate/snapshots/task_graph.jsonc index 40ea1a092..cdba69027 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive_skip_intermediate/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive_skip_intermediate/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/packages/bottom" }, "resolved_config": { - "command": "echo 'Building @test/bottom'", + "commands": [ + "echo 'Building @test/bottom'" + ], "resolved_options": { "cwd": "/packages/bottom", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/middle" }, "resolved_config": { - "command": "echo 'Linting @test/middle'", + "commands": [ + "echo 'Linting @test/middle'" + ], "resolved_options": { "cwd": "/packages/middle", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/packages/top" }, "resolved_config": { - "command": "echo 'Building @test/top'", + "commands": [ + "echo 'Building @test/top'" + ], "resolved_options": { "cwd": "/packages/top", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr_shorthand/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr_shorthand/snapshots/task_graph.jsonc index 00be69c6c..fc12e3616 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr_shorthand/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr_shorthand/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vpr build", + "commands": [ + "vpr build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo building", + "commands": [ + "echo building" + ], "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_cd_no_skip/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_cd_no_skip/snapshots/task_graph.jsonc index f7ee35330..b970e4c84 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_cd_no_skip/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_cd_no_skip/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "cd packages/a && vt run deploy", + "commands": [ + "cd packages/a && vt run deploy" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/a" }, "resolved_config": { - "command": "echo deploying-a", + "commands": [ + "echo deploying-a" + ], "resolved_options": { "cwd": "/packages/a", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_depends_on_passthrough/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_depends_on_passthrough/snapshots/task_graph.jsonc index 2a23ddc71..989bb17aa 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_depends_on_passthrough/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_depends_on_passthrough/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run -r build", + "commands": [ + "vt run -r build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -56,7 +58,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo linting", + "commands": [ + "echo linting" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -95,7 +99,9 @@ "package_path": "/packages/a" }, "resolved_config": { - "command": "echo building-a", + "commands": [ + "echo building-a" + ], "resolved_options": { "cwd": "/packages/a", "cache_config": { @@ -134,7 +140,9 @@ "package_path": "/packages/a" }, "resolved_config": { - "command": "echo linting-a", + "commands": [ + "echo linting-a" + ], "resolved_options": { "cwd": "/packages/a", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_multi_command/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_multi_command/snapshots/task_graph.jsonc index f031c893d..499b87c67 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_multi_command/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_multi_command/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo pre && vt run -r build", + "commands": [ + "echo pre && vt run -r build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/a" }, "resolved_config": { - "command": "echo building-a", + "commands": [ + "echo building-a" + ], "resolved_options": { "cwd": "/packages/a", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_mutual_recursion/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_mutual_recursion/snapshots/task_graph.jsonc index 5e3cee720..396059783 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_mutual_recursion/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_mutual_recursion/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run -r test", + "commands": [ + "vt run -r test" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run -r build", + "commands": [ + "vt run -r build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/packages/a" }, "resolved_config": { - "command": "echo building-a", + "commands": [ + "echo building-a" + ], "resolved_options": { "cwd": "/packages/a", "cache_config": { @@ -129,7 +135,9 @@ "package_path": "/packages/a" }, "resolved_config": { - "command": "echo testing-a", + "commands": [ + "echo testing-a" + ], "resolved_options": { "cwd": "/packages/a", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_no_package_json/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_no_package_json/snapshots/task_graph.jsonc index 5a64e4c3a..ffeb873b5 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_no_package_json/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_no_package_json/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "echo deploying workspace", + "commands": [ + "echo deploying workspace" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/pkg-a" }, "resolved_config": { - "command": "echo building pkg-a", + "commands": [ + "echo building pkg-a" + ], "resolved_options": { "cwd": "/packages/pkg-a", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_self_reference/snapshots/task_graph.jsonc b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_self_reference/snapshots/task_graph.jsonc index 76f667459..3d8d8bfd5 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_self_reference/snapshots/task_graph.jsonc +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace_root_self_reference/snapshots/task_graph.jsonc @@ -12,7 +12,9 @@ "package_path": "/" }, "resolved_config": { - "command": "vt run -r build", + "commands": [ + "vt run -r build" + ], "resolved_options": { "cwd": "/", "cache_config": { @@ -51,7 +53,9 @@ "package_path": "/packages/a" }, "resolved_config": { - "command": "echo building-a", + "commands": [ + "echo building-a" + ], "resolved_options": { "cwd": "/packages/a", "cache_config": { @@ -90,7 +94,9 @@ "package_path": "/packages/b" }, "resolved_config": { - "command": "echo building-b", + "commands": [ + "echo building-b" + ], "resolved_options": { "cwd": "/packages/b", "cache_config": {