diff --git a/crates/vite_task/src/cli/mod.rs b/crates/vite_task/src/cli/mod.rs index 15adc85f..07ca39c2 100644 --- a/crates/vite_task/src/cli/mod.rs +++ b/crates/vite_task/src/cli/mod.rs @@ -4,7 +4,7 @@ use clap::Parser; use vite_path::AbsolutePath; use vite_str::Str; use vite_task_graph::{TaskSpecifier, query::TaskQuery}; -use vite_task_plan::plan_request::{PlanOptions, QueryPlanRequest}; +use vite_task_plan::plan_request::{CacheOverride, PlanOptions, QueryPlanRequest}; use vite_workspace::package_filter::{PackageQueryArgs, PackageQueryError}; #[derive(Debug, Clone, clap::Subcommand)] @@ -15,6 +15,7 @@ pub enum CacheSubcommand { /// Flags that control how a `run` command selects tasks. #[derive(Debug, Clone, PartialEq, Eq, clap::Args)] +#[expect(clippy::struct_excessive_bools, reason = "CLI flags are naturally boolean")] pub struct RunFlags { #[clap(flatten)] pub package_query: PackageQueryArgs, @@ -26,6 +27,27 @@ pub struct RunFlags { /// Show full detailed summary after execution. #[clap(default_value = "false", short = 'v', long)] pub verbose: bool, + + /// Force caching on for all tasks and scripts. + #[clap(long, conflicts_with = "no_cache")] + pub cache: bool, + + /// Force caching off for all tasks and scripts. + #[clap(long, conflicts_with = "cache")] + pub no_cache: bool, +} + +impl RunFlags { + #[must_use] + pub const fn cache_override(&self) -> CacheOverride { + if self.cache { + CacheOverride::ForceEnabled + } else if self.no_cache { + CacheOverride::ForceDisabled + } else { + CacheOverride::None + } + } } // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -155,11 +177,12 @@ impl ResolvedRunCommand { let raw_specifier = self.task_specifier.ok_or(CLITaskQueryError::MissingTaskSpecifier)?; let task_specifier = TaskSpecifier::parse_raw(&raw_specifier); + let cache_override = self.flags.cache_override(); + let include_explicit_deps = !self.flags.ignore_depends_on; + let (package_query, is_cwd_only) = self.flags.package_query.into_package_query(task_specifier.package_name, cwd)?; - let include_explicit_deps = !self.flags.ignore_depends_on; - Ok(( QueryPlanRequest { query: TaskQuery { @@ -167,7 +190,10 @@ impl ResolvedRunCommand { task_name: task_specifier.task_name, include_explicit_deps, }, - plan_options: PlanOptions { extra_args: self.additional_args.into() }, + plan_options: PlanOptions { + extra_args: self.additional_args.into(), + cache_override, + }, }, is_cwd_only, )) diff --git a/crates/vite_task_graph/src/config/mod.rs b/crates/vite_task_graph/src/config/mod.rs index 6512c3f2..34ba3d8c 100644 --- a/crates/vite_task_graph/src/config/mod.rs +++ b/crates/vite_task_graph/src/config/mod.rs @@ -100,29 +100,18 @@ pub enum ResolveTaskConfigError { } impl ResolvedTaskConfig { - /// Resolve from package.json script only (no vite-task.json config for this task) + /// Resolve from package.json script only (no config entry for this task). /// - /// The `cache_scripts` parameter determines whether caching is enabled for the script. - /// When `true`, caching is enabled with default settings. - /// When `false`, caching is disabled. + /// Always resolves with caching enabled (default settings). + /// The global cache config is applied at plan time, not here. #[must_use] pub fn resolve_package_json_script( package_dir: &Arc, package_json_script: &str, - cache_scripts: bool, ) -> Self { - let cache_config = if cache_scripts { - UserCacheConfig::Enabled { - cache: None, - enabled_cache_config: EnabledCacheConfig { envs: None, pass_through_envs: None }, - } - } else { - UserCacheConfig::Disabled { cache: MustBe!(false) } - }; - let options = UserTaskOptions { cache_config, ..Default::default() }; Self { command: package_json_script.into(), - resolved_options: ResolvedTaskOptions::resolve(options, package_dir), + resolved_options: ResolvedTaskOptions::resolve(UserTaskOptions::default(), package_dir), } } diff --git a/crates/vite_task_graph/src/config/user.rs b/crates/vite_task_graph/src/config/user.rs index 60feb652..8a54ad58 100644 --- a/crates/vite_task_graph/src/config/user.rs +++ b/crates/vite_task_graph/src/config/user.rs @@ -150,6 +150,7 @@ pub enum UserGlobalCacheConfig { } /// Resolved global cache configuration with concrete boolean values. +#[derive(Debug, Clone, Copy)] pub struct ResolvedGlobalCacheConfig { pub scripts: bool, pub tasks: bool, diff --git a/crates/vite_task_graph/src/lib.rs b/crates/vite_task_graph/src/lib.rs index d09e7fe5..d0f91a81 100644 --- a/crates/vite_task_graph/src/lib.rs +++ b/crates/vite_task_graph/src/lib.rs @@ -6,7 +6,7 @@ mod specifier; use std::{convert::Infallible, sync::Arc}; -use config::{ResolvedTaskConfig, UserRunConfig}; +use config::{ResolvedGlobalCacheConfig, ResolvedTaskConfig, UserRunConfig}; use petgraph::graph::{DefaultIx, DiGraph, EdgeIndex, IndexType, NodeIndex}; use rustc_hash::{FxBuildHasher, FxHashMap}; use serde::Serialize; @@ -47,6 +47,15 @@ pub(crate) struct TaskId { pub task_name: Str, } +/// Whether a task originates from the `tasks` map or from a package.json script. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] +pub enum TaskSource { + /// Defined in the `tasks` map in the workspace config. + TaskConfig, + /// Pure package.json script (not in the tasks map). + PackageJsonScript, +} + /// A node in the task graph, representing a task with its resolved configuration. #[derive(Debug, Serialize)] pub struct TaskNode { @@ -60,6 +69,9 @@ pub struct TaskNode { /// /// However, it does not contain external factors like additional args from cli and env vars. pub resolved_config: ResolvedTaskConfig, + + /// Whether this task comes from the tasks map or a package.json script. + pub source: TaskSource, } impl vite_graph_ser::GetKey for TaskNode { @@ -166,6 +178,9 @@ pub struct IndexedTaskGraph { /// task indices by task id for quick lookup pub(crate) node_indices_by_task_id: FxHashMap, + + /// Global cache configuration resolved from the workspace root config. + resolved_global_cache: ResolvedGlobalCacheConfig, } pub type TaskGraph = DiGraph; @@ -234,11 +249,9 @@ impl IndexedTaskGraph { package_configs.push((package_index, package_dir, user_config)); } - let resolved_cache = config::ResolvedGlobalCacheConfig::resolve_from(root_cache.as_ref()); - let cache_scripts = resolved_cache.scripts; - let cache_tasks = resolved_cache.tasks; + let resolved_global_cache = ResolvedGlobalCacheConfig::resolve_from(root_cache.as_ref()); - // Second pass: create task nodes using resolved cache config + // Second pass: create task nodes (cache is NOT applied here; it's applied at plan time) for (package_index, package_dir, user_config) in package_configs { let package = &package_graph[package_index]; @@ -250,19 +263,15 @@ impl IndexedTaskGraph { .map(|(name, value)| (name.as_str(), value.as_str())) .collect(); - for (task_name, mut task_user_config) in user_config.tasks.unwrap_or_default() { - // Apply cache.tasks kill switch: when false, override all tasks to disable caching - if !cache_tasks { - task_user_config.options.cache_config = config::UserCacheConfig::disabled(); - } - // For each task defined in vite.config.*, look up the corresponding package.json script (if any) + for (task_name, task_user_config) in user_config.tasks.unwrap_or_default() { + // For each task defined in the config, look up the corresponding package.json script (if any) let package_json_script = package_json_scripts.remove(task_name.as_str()); let task_id = TaskId { task_name: task_name.clone(), package_index }; let dependency_specifiers = task_user_config.options.depends_on.clone(); - // Resolve the task configuration combining vite.config.* and package.json script + // Resolve the task configuration combining config and package.json script let resolved_config = ResolvedTaskConfig::resolve( task_user_config, &package_dir, @@ -284,6 +293,7 @@ impl IndexedTaskGraph { package_path: Arc::clone(&package_dir), }, resolved_config, + source: TaskSource::TaskConfig, }; let node_index = task_graph.add_node(task_node); @@ -291,13 +301,12 @@ impl IndexedTaskGraph { node_indices_by_task_id.insert(task_id, node_index); } - // For remaining package.json scripts not defined in vite.config.*, create tasks with default config + // For remaining package.json scripts not in the tasks map, create tasks with default config for (script_name, package_json_script) in package_json_scripts { let task_id = TaskId { task_name: Str::from(script_name), package_index }; let resolved_config = ResolvedTaskConfig::resolve_package_json_script( &package_dir, package_json_script, - cache_scripts, ); let node_index = task_graph.add_node(TaskNode { task_display: TaskDisplay { @@ -306,6 +315,7 @@ impl IndexedTaskGraph { package_path: Arc::clone(&package_dir), }, resolved_config, + source: TaskSource::PackageJsonScript, }); node_indices_by_task_id.insert(task_id, node_index); } @@ -316,6 +326,7 @@ impl IndexedTaskGraph { task_graph, indexed_package_graph: IndexedPackageGraph::index(package_graph), node_indices_by_task_id, + resolved_global_cache, }; // Add explicit dependencies @@ -420,4 +431,9 @@ impl IndexedTaskGraph { let index = self.indexed_package_graph.get_package_index_from_cwd(cwd)?; Some(self.get_package_path(index)) } + + #[must_use] + pub const fn global_cache_config(&self) -> &ResolvedGlobalCacheConfig { + &self.resolved_global_cache + } } diff --git a/crates/vite_task_plan/src/context.rs b/crates/vite_task_plan/src/context.rs index 0f67a05f..3f2ec1fe 100644 --- a/crates/vite_task_plan/src/context.rs +++ b/crates/vite_task_plan/src/context.rs @@ -3,7 +3,7 @@ use std::{env::JoinPathsError, ffi::OsStr, ops::Range, sync::Arc}; use rustc_hash::FxHashMap; use vite_path::AbsolutePath; use vite_str::Str; -use vite_task_graph::{IndexedTaskGraph, TaskNodeIndex}; +use vite_task_graph::{IndexedTaskGraph, TaskNodeIndex, config::ResolvedGlobalCacheConfig}; use crate::{PlanRequestParser, path_env::prepend_path_env}; @@ -39,6 +39,9 @@ pub struct PlanContext<'a> { extra_args: Arc<[Str]>, indexed_task_graph: &'a IndexedTaskGraph, + + /// Final resolved global cache config, combining the graph's config with any CLI override. + resolved_global_cache: ResolvedGlobalCacheConfig, } impl<'a> PlanContext<'a> { @@ -48,6 +51,7 @@ impl<'a> PlanContext<'a> { envs: FxHashMap, Arc>, callbacks: &'a mut (dyn PlanRequestParser + 'a), indexed_task_graph: &'a IndexedTaskGraph, + resolved_global_cache: ResolvedGlobalCacheConfig, ) -> Self { Self { workspace_path, @@ -57,6 +61,7 @@ impl<'a> PlanContext<'a> { task_call_stack: Vec::new(), indexed_task_graph, extra_args: Arc::default(), + resolved_global_cache, } } @@ -115,6 +120,14 @@ impl<'a> PlanContext<'a> { self.extra_args = extra_args; } + pub const fn resolved_global_cache(&self) -> &ResolvedGlobalCacheConfig { + &self.resolved_global_cache + } + + pub const fn set_resolved_global_cache(&mut self, config: ResolvedGlobalCacheConfig) { + self.resolved_global_cache = config; + } + pub fn duplicate(&mut self) -> PlanContext<'_> { PlanContext { workspace_path: self.workspace_path, @@ -124,6 +137,7 @@ impl<'a> PlanContext<'a> { task_call_stack: self.task_call_stack.clone(), indexed_task_graph: self.indexed_task_graph, extra_args: Arc::clone(&self.extra_args), + resolved_global_cache: self.resolved_global_cache, } } } diff --git a/crates/vite_task_plan/src/lib.rs b/crates/vite_task_plan/src/lib.rs index c321c893..61178566 100644 --- a/crates/vite_task_plan/src/lib.rs +++ b/crates/vite_task_plan/src/lib.rs @@ -16,7 +16,7 @@ pub use execution_graph::ExecutionGraph; pub use in_process::InProcessExecution; pub use path_env::{get_path_env, prepend_path_env}; use plan::{ParentCacheConfig, plan_query_request, plan_synthetic_request}; -use plan_request::{PlanRequest, QueryPlanRequest, SyntheticPlanRequest}; +use plan_request::{CacheOverride, PlanRequest, QueryPlanRequest, SyntheticPlanRequest}; use rustc_hash::FxHashMap; use serde::{Serialize, ser::SerializeMap as _}; use vite_path::AbsolutePath; @@ -200,16 +200,37 @@ pub async fn plan_query( ) -> Result { let indexed_task_graph = task_graph_loader.load_task_graph().await?; + let resolved_global_cache = resolve_cache_with_override( + *indexed_task_graph.global_cache_config(), + query_plan_request.plan_options.cache_override, + ); + let context = PlanContext::new( workspace_path, Arc::clone(cwd), envs.clone(), plan_request_parser, indexed_task_graph, + resolved_global_cache, ); plan_query_request(query_plan_request, context).await } +const fn resolve_cache_with_override( + graph_cache: vite_task_graph::config::ResolvedGlobalCacheConfig, + cache_override: CacheOverride, +) -> vite_task_graph::config::ResolvedGlobalCacheConfig { + match cache_override { + CacheOverride::ForceEnabled => { + vite_task_graph::config::ResolvedGlobalCacheConfig { scripts: true, tasks: true } + } + CacheOverride::ForceDisabled => { + vite_task_graph::config::ResolvedGlobalCacheConfig { scripts: false, tasks: false } + } + CacheOverride::None => graph_cache, + } +} + /// Plan a synthetic task execution, returning the resolved [`SpawnExecution`] directly. /// /// Unlike [`plan_query`] which returns a full execution graph, synthetic executions diff --git a/crates/vite_task_plan/src/plan.rs b/crates/vite_task_plan/src/plan.rs index 0d95dad3..78495e0f 100644 --- a/crates/vite_task_plan/src/plan.rs +++ b/crates/vite_task_plan/src/plan.rs @@ -17,9 +17,9 @@ use vite_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf, relative::Invali use vite_shell::try_parse_as_and_list; use vite_str::Str; use vite_task_graph::{ - TaskNodeIndex, + TaskNodeIndex, TaskSource, config::{ - CacheConfig, ResolvedTaskOptions, + CacheConfig, ResolvedGlobalCacheConfig, ResolvedTaskOptions, user::{UserCacheConfig, UserTaskOptions}, }, }; @@ -33,7 +33,10 @@ use crate::{ execution_graph::{ExecutionGraph, ExecutionNodeIndex, InnerExecutionGraph}, in_process::InProcessExecution, path_env::get_path_env, - plan_request::{PlanRequest, QueryPlanRequest, ScriptCommand, SyntheticPlanRequest}, + plan_request::{ + CacheOverride, PlanRequest, QueryPlanRequest, ScriptCommand, SyntheticPlanRequest, + }, + resolve_cache_with_override, }; /// Locate the executable path for a given program name in the provided envs and cwd. @@ -56,6 +59,23 @@ fn which( .into()) } +/// Compute the effective cache config for a task, applying the global cache config. +/// +/// The task graph stores per-task cache config without applying the global kill switch. +/// This function applies the global config at plan time, checking `cache.scripts` for +/// package.json scripts and `cache.tasks` for task-map entries. +fn effective_cache_config( + task_cache_config: Option<&CacheConfig>, + source: TaskSource, + resolved_global_cache: ResolvedGlobalCacheConfig, +) -> Option { + let enabled = match source { + TaskSource::PackageJsonScript => resolved_global_cache.scripts, + TaskSource::TaskConfig => resolved_global_cache.tasks, + }; + if enabled { task_cache_config.cloned() } else { None } +} + #[expect(clippy::too_many_lines, reason = "sequential planning steps are clearer in one function")] #[expect(clippy::future_not_send, reason = "PlanContext contains !Send dyn PlanRequestParser")] async fn plan_task_as_execution_node( @@ -202,10 +222,12 @@ async fn plan_task_as_execution_node( } // Synthetic task (from CommandHandler) Some(PlanRequest::Synthetic(synthetic_plan_request)) => { - let parent_cache_config = task_node - .resolved_config - .resolved_options - .cache_config + 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()) @@ -227,11 +249,19 @@ async fn plan_task_as_execution_node( &script_command.envs, &script_command.cwd, )?; + 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(task_execution_cache_key), &and_item.envs, - &task_node.resolved_config.resolved_options, + &resolved_options, &script_command.envs, program_path, script_command.args, @@ -275,6 +305,14 @@ async fn plan_task_as_execution_node( script.push_str(shell_escape::escape(arg.as_str().into()).as_ref()); } + 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 { @@ -288,7 +326,7 @@ async fn plan_task_as_execution_node( })?, }), &BTreeMap::new(), - &task_node.resolved_config.resolved_options, + &resolved_options, context.envs(), Arc::clone(&*SHELL_PROGRAM_PATH), SHELL_ARGS.iter().map(|s| Str::from(*s)).chain(std::iter::once(script)).collect(), @@ -519,6 +557,23 @@ pub async fn plan_query_request( query_plan_request: QueryPlanRequest, mut context: PlanContext<'_>, ) -> Result { + // Apply cache override from `--cache` / `--no-cache` flags on this request. + // + // When `None`, we skip the update so the context keeps whatever the parent + // resolved — this is how `vp run --cache outer` propagates to a nested + // `vp run inner` that has no flags of its own. + let cache_override = query_plan_request.plan_options.cache_override; + if cache_override != CacheOverride::None { + // Override is relative to the *workspace* config, not the parent's + // resolved config. This means `vp run --no-cache outer` where outer + // runs `vp run --cache inner` re-enables caching from the workspace + // defaults, rather than from the parent's disabled state. + let final_cache = resolve_cache_with_override( + *context.indexed_task_graph().global_cache_config(), + cache_override, + ); + context.set_resolved_global_cache(final_cache); + } context.set_extra_args(Arc::clone(&query_plan_request.plan_options.extra_args)); // Query matching tasks from the task graph. // An empty graph means no tasks matched; the caller (session) handles diff --git a/crates/vite_task_plan/src/plan_request.rs b/crates/vite_task_plan/src/plan_request.rs index cd85f651..71474f77 100644 --- a/crates/vite_task_plan/src/plan_request.rs +++ b/crates/vite_task_plan/src/plan_request.rs @@ -31,9 +31,24 @@ impl ScriptCommand { } } +/// CLI-level cache override from `--cache` / `--no-cache` flags. +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] +pub enum CacheOverride { + /// No override — inherit the parent's resolved cache config. + /// For a top-level `vp run`, this is the workspace config. + /// For a nested `vp run` inside a script, this is whatever the parent resolved. + #[default] + None, + /// Force all caching on (`--cache` flag). + ForceEnabled, + /// Force all caching off (`--no-cache` flag). + ForceDisabled, +} + #[derive(Debug)] pub struct PlanOptions { pub extra_args: Arc<[Str]>, + pub cache_override: CacheOverride, } #[derive(Debug)] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap index 65a1b8fd..19119cb4 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/package.json new file mode 100644 index 00000000..d8674607 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/package.json @@ -0,0 +1,7 @@ +{ + "name": "@test/cache-cli-override", + "scripts": { + "test": "print-file package.json", + "lint": "print-file vite-task.json" + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots.toml new file mode 100644 index 00000000..7b36dc48 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots.toml @@ -0,0 +1,41 @@ +# Tests --cache and --no-cache CLI flag overriding rules + +# Baseline: without flags, tasks are not cached because cache.tasks is false +[[plan]] +name = "baseline - tasks not cached when cache.tasks is false" +args = ["run", "build"] + +# --cache enables caching for tasks that don't have explicit cache: false +[[plan]] +name = "--cache enables task caching even when cache.tasks is false" +args = ["run", "--cache", "build"] + +# --cache does NOT force-enable tasks with explicit cache: false +[[plan]] +name = "--cache does not override per-task cache false" +args = ["run", "--cache", "deploy"] + +# --cache enables script caching even when cache.scripts is not set +[[plan]] +name = "--cache enables script caching" +args = ["run", "--cache", "test"] + +# --no-cache disables caching for everything +[[plan]] +name = "--no-cache disables task caching" +args = ["run", "--no-cache", "build"] + +# --no-cache overrides per-task cache: true +[[plan]] +name = "--no-cache overrides per-task cache true" +args = ["run", "--no-cache", "check"] + +# --cache on task with per-task cache: true (redundant but valid) +[[plan]] +name = "--cache on task with per-task cache true enables caching" +args = ["run", "--cache", "check"] + +# --cache and --no-cache conflict +[[plan]] +name = "--cache and --no-cache conflict" +args = ["run", "--cache", "--no-cache", "build"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache and --no-cache conflict.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache and --no-cache conflict.snap new file mode 100644 index 00000000..68cdd5f7 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache and --no-cache conflict.snap @@ -0,0 +1,16 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: err +info: + args: + - run + - "--cache" + - "--no-cache" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override +--- +error: the argument '--cache' cannot be used with '--no-cache' + +Usage: vp run --cache [ADDITIONAL_ARGS]... + +For more information, try '--help'. diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap new file mode 100644 index 00000000..56305ec9 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap @@ -0,0 +1,58 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "--cache" + - deploy +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override +--- +[ + { + "key": [ + "/", + "deploy" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "deploy", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "deploy", + "package_path": "/" + }, + "command": "print-file vite-task.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "vite-task.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap new file mode 100644 index 00000000..06a1e725 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap @@ -0,0 +1,85 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "--cache" + - test +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override +--- +[ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "test", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "test", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap new file mode 100644 index 00000000..0b09b38f --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap @@ -0,0 +1,85 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "--cache" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override +--- +[ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap new file mode 100644 index 00000000..517c6f69 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap @@ -0,0 +1,85 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "--cache" + - check +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override +--- +[ + { + "key": [ + "/", + "check" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "check", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "check", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "check", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap new file mode 100644 index 00000000..115f4b49 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap @@ -0,0 +1,58 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "--no-cache" + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override +--- +[ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap new file mode 100644 index 00000000..17c00630 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap @@ -0,0 +1,58 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "--no-cache" + - check +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override +--- +[ + { + "key": [ + "/", + "check" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "check", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "check", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap new file mode 100644 index 00000000..222b403f --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap @@ -0,0 +1,57 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override +--- +[ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/task graph.snap new file mode 100644 index 00000000..59d13b75 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/task graph.snap @@ -0,0 +1,145 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: task_graph_json +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override +--- +[ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "build", + "package_path": "/" + }, + "resolved_config": { + "command": "print-file package.json", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "check" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "check", + "package_path": "/" + }, + "resolved_config": { + "command": "print-file package.json", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "deploy" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "deploy", + "package_path": "/" + }, + "resolved_config": { + "command": "print-file vite-task.json", + "resolved_options": { + "cwd": "/", + "cache_config": null + } + }, + "source": "TaskConfig" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "lint" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "lint", + "package_path": "/" + }, + "resolved_config": { + "command": "print-file vite-task.json", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/cache-cli-override", + "task_name": "test", + "package_path": "/" + }, + "resolved_config": { + "command": "print-file package.json", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/vite-task.json new file mode 100644 index 00000000..12d7aec7 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/vite-task.json @@ -0,0 +1,16 @@ +{ + "cache": { "tasks": false }, + "tasks": { + "build": { + "command": "print-file package.json" + }, + "deploy": { + "command": "print-file vite-task.json", + "cache": false + }, + "check": { + "command": "print-file package.json", + "cache": true + } + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/task graph.snap index 563cf097..1159aa12 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -84,7 +86,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -112,7 +115,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/package.json index 6bfb25cc..d717f308 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/package.json @@ -1,7 +1,7 @@ { "name": "@test/cache-scripts-default", "scripts": { - "build": "echo building", - "test": "echo testing" + "build": "print-file package.json", + "test": "print-file package.json" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots.toml new file mode 100644 index 00000000..a487879e --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots.toml @@ -0,0 +1,6 @@ +# Verifies default behavior: scripts are not cached without explicit cache.scripts + +# Script should not be cached by default +[[plan]] +name = "script not cached by default" +args = ["run", "build"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap new file mode 100644 index 00000000..675d76d8 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap @@ -0,0 +1,57 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default +--- +[ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-scripts-default", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-scripts-default", + "task_name": "build", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/task graph.snap index b20ad283..852aa4cf 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/task graph.snap @@ -16,12 +16,20 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-de "package_path": "/" }, "resolved_config": { - "command": "echo building", + "command": "print-file package.json", "resolved_options": { "cwd": "/", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -37,12 +45,20 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-de "package_path": "/" }, "resolved_config": { - "command": "echo testing", + "command": "print-file package.json", "resolved_options": { "cwd": "/", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-enabled/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-enabled/snapshots/task graph.snap index 457d4193..fcaa05d4 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-enabled/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-enabled/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-en } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-en } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/package.json index 2990ff19..7c4673a3 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/package.json @@ -1,7 +1,7 @@ { "name": "@test/cache-scripts-task-override", "scripts": { - "build": "echo building", - "test": "echo testing" + "build": "print-file package.json", + "test": "print-file package.json" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots.toml new file mode 100644 index 00000000..28ad4d0d --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots.toml @@ -0,0 +1,16 @@ +# Verifies default cache behavior: tasks cached, scripts not cached + +# Task should be cached (tasks default to true) +[[plan]] +name = "task cached by default" +args = ["run", "build"] + +# Task with explicit command should be cached +[[plan]] +name = "task with command cached by default" +args = ["run", "deploy"] + +# Script not wrapped by a task should not be cached +[[plan]] +name = "script not cached by default" +args = ["run", "test"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap new file mode 100644 index 00000000..dafc235f --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap @@ -0,0 +1,57 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - test +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override +--- +[ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "test", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap new file mode 100644 index 00000000..54a470d9 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap @@ -0,0 +1,84 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override +--- +[ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "build", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task with command cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task with command cached by default.snap new file mode 100644 index 00000000..b816a161 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task with command cached by default.snap @@ -0,0 +1,84 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - deploy +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override +--- +[ + { + "key": [ + "/", + "deploy" + ], + "node": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "deploy", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-scripts-task-override", + "task_name": "deploy", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "deploy", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/task graph.snap index fcf03317..4c99d0c5 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/task graph.snap @@ -16,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "package_path": "/" }, "resolved_config": { - "command": "echo building", + "command": "print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -44,7 +45,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "package_path": "/" }, "resolved_config": { - "command": "echo deploying", + "command": "print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -72,12 +74,20 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "package_path": "/" }, "resolved_config": { - "command": "echo testing", + "command": "print-file package.json", "resolved_options": { "cwd": "/", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/vite-task.json index 5c71428c..8a8200da 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/vite-task.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/vite-task.json @@ -2,7 +2,7 @@ "tasks": { "build": {}, "deploy": { - "command": "echo deploying" + "command": "print-file package.json" } } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/snapshots/task graph.snap index 73487482..75c12f88 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -84,7 +86,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/task graph.snap index 34095de6..bc3ce966 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/package.json index 877751fb..96eab87e 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/package.json @@ -1,7 +1,7 @@ { "name": "@test/cache-tasks-disabled", "scripts": { - "build": "echo building", - "test": "echo testing" + "build": "print-file package.json", + "test": "print-file package.json" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots.toml new file mode 100644 index 00000000..a4fc9cb3 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots.toml @@ -0,0 +1,16 @@ +# Verifies cache.tasks: false disables caching at plan time + +# Task without per-task cache override should not be cached +[[plan]] +name = "task not cached when cache.tasks is false" +args = ["run", "build"] + +# Task with per-task cache: true is still disabled by cache.tasks: false +[[plan]] +name = "per-task cache true still disabled by cache.tasks false" +args = ["run", "deploy"] + +# Script should not be cached (scripts default to false) +[[plan]] +name = "script not cached" +args = ["run", "test"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap new file mode 100644 index 00000000..9118bb90 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap @@ -0,0 +1,57 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - deploy +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled +--- +[ + { + "key": [ + "/", + "deploy" + ], + "node": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "deploy", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "deploy", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap new file mode 100644 index 00000000..af460270 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap @@ -0,0 +1,57 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - test +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled +--- +[ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "test", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap new file mode 100644 index 00000000..f4406214 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap @@ -0,0 +1,57 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled +--- +[ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-tasks-disabled", + "task_name": "build", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/task graph.snap index 781d1cbf..370cea7b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/task graph.snap @@ -16,12 +16,20 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "package_path": "/" }, "resolved_config": { - "command": "echo building", + "command": "print-file package.json", "resolved_options": { "cwd": "/", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -37,12 +45,20 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "package_path": "/" }, "resolved_config": { - "command": "echo deploying", + "command": "print-file package.json", "resolved_options": { "cwd": "/", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -58,12 +74,20 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "package_path": "/" }, "resolved_config": { - "command": "echo testing", + "command": "print-file package.json", "resolved_options": { "cwd": "/", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/vite-task.json index eb7bf948..31908df8 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/vite-task.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/vite-task.json @@ -3,7 +3,7 @@ "tasks": { "build": {}, "deploy": { - "command": "echo deploying", + "command": "print-file package.json", "cache": true } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/package.json index ae0f53ab..8bace95e 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/package.json @@ -1,7 +1,7 @@ { "name": "@test/cache-true-no-force-enable", "scripts": { - "build": "echo building", - "test": "echo testing" + "build": "print-file package.json", + "test": "print-file package.json" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots.toml new file mode 100644 index 00000000..06941988 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots.toml @@ -0,0 +1,16 @@ +# Verifies cache: true enables caching but does not override per-task cache: false + +# Task with per-task cache: false should not be cached +[[plan]] +name = "task with cache false not cached despite global cache true" +args = ["run", "build"] + +# Task without per-task override should be cached +[[plan]] +name = "task cached when global cache true" +args = ["run", "deploy"] + +# Script should be cached (cache: true enables scripts too) +[[plan]] +name = "script cached when global cache true" +args = ["run", "test"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap new file mode 100644 index 00000000..2e7fc39b --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap @@ -0,0 +1,84 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - test +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable +--- +[ + { + "key": [ + "/", + "test" + ], + "node": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "test", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "test", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "test", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap new file mode 100644 index 00000000..50210a10 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap @@ -0,0 +1,84 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - deploy +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable +--- +[ + { + "key": [ + "/", + "deploy" + ], + "node": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "deploy", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "deploy", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "deploy", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap new file mode 100644 index 00000000..301ceab8 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap @@ -0,0 +1,57 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - build +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable +--- +[ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/cache-true-no-force-enable", + "task_name": "build", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/task graph.snap index a62b5101..a865f485 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/task graph.snap @@ -16,12 +16,13 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "package_path": "/" }, "resolved_config": { - "command": "echo building", + "command": "print-file package.json", "resolved_options": { "cwd": "/", "cache_config": null } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -37,7 +38,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "package_path": "/" }, "resolved_config": { - "command": "echo deploying", + "command": "print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -49,7 +50,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -65,7 +67,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "package_path": "/" }, "resolved_config": { - "command": "echo testing", + "command": "print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -77,7 +79,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/vite-task.json index b1e5d424..7f6f8a25 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/vite-task.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/vite-task.json @@ -5,7 +5,7 @@ "cache": false }, "deploy": { - "command": "echo deploying" + "command": "print-file package.json" } } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/task graph.snap index 2d914518..09efb044 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -84,7 +86,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/snapshots/task graph.snap index 47530078..a4a0ceda 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -84,7 +86,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -112,7 +115,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -140,7 +144,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -168,7 +173,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -196,7 +202,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -224,7 +231,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -252,7 +260,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -280,7 +289,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -308,7 +318,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -336,7 +347,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -364,7 +376,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -392,7 +405,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -420,7 +434,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -448,7 +463,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -476,7 +492,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -504,7 +521,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -532,7 +550,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -560,7 +579,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -588,7 +608,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -616,7 +637,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -644,7 +666,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-ta } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/snapshots/task graph.snap index 9dfc5dae..441061e3 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -84,7 +86,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test } } } - } + }, + "source": "TaskConfig" }, "neighbors": [ [ diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle-dependency/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle-dependency/snapshots/task graph.snap index 41ec81de..8e578194 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle-dependency/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle-dependency/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle-dependency } } } - } + }, + "source": "TaskConfig" }, "neighbors": [ [ @@ -61,7 +62,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle-dependency } } } - } + }, + "source": "TaskConfig" }, "neighbors": [ [ diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/snapshots/task graph.snap index 79d4c1e1..659a3440 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both- } } } - } + }, + "source": "TaskConfig" }, "neighbors": [ [ @@ -61,7 +62,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both- } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/task graph.snap index 4a80eea2..3df2b750 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/task graph.snap @@ -19,9 +19,17 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-packag "command": "echo build-a", "resolved_options": { "cwd": "/packages/pkg-a", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -40,9 +48,17 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-packag "command": "echo build-b", "resolved_options": { "cwd": "/packages/pkg-b", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/snapshots/task graph.snap index 1b3f0a3d..f33ccfee 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-te } } } - } + }, + "source": "TaskConfig" }, "neighbors": [ [ @@ -58,7 +59,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-te "cwd": "/packages/another-empty", "cache_config": null } - } + }, + "source": "TaskConfig" }, "neighbors": [ [ @@ -95,7 +97,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-te } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -123,7 +126,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-te } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -151,7 +155,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-te } } } - } + }, + "source": "TaskConfig" }, "neighbors": [ [ @@ -184,7 +189,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-te } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -212,7 +218,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-te } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -240,7 +247,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-te } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -268,7 +276,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-te } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/snapshots/task graph.snap index f6ab0d3f..316a0ad9 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -49,7 +50,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo "cwd": "/packages/app", "cache_config": null } - } + }, + "source": "TaskConfig" }, "neighbors": [ [ @@ -90,7 +92,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -118,7 +121,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -146,7 +150,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -174,7 +179,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -202,7 +208,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo } } } - } + }, + "source": "TaskConfig" }, "neighbors": [ [ @@ -235,7 +242,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -263,7 +271,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -291,7 +300,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo } } } - } + }, + "source": "TaskConfig" }, "neighbors": [ [ @@ -328,7 +338,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-wo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace/snapshots/task graph.snap index 940f7cb9..16271d36 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -84,7 +86,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -112,7 +115,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -140,7 +144,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -168,7 +173,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -196,7 +202,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -224,7 +231,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -252,7 +260,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -280,7 +289,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -308,7 +318,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -336,7 +347,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -364,7 +376,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/filter-workspace } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/snapshots/task graph.snap index c8846d14..0036eca1 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-igno } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/package.json new file mode 100644 index 00000000..03221999 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/nested-cache-override", + "scripts": { + "inner": "print-file package.json", + "outer-no-cache": "vp run --no-cache inner", + "outer-cache": "vp run --cache inner", + "outer-inherit": "vp run inner" + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots.toml new file mode 100644 index 00000000..805b52fd --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots.toml @@ -0,0 +1,31 @@ +# Tests scope of --cache/--no-cache in nested vp run commands + +# Nested vp run --no-cache disables caching for inner task +[[plan]] +name = "nested --no-cache disables inner task caching" +args = ["run", "outer-no-cache"] + +# Nested vp run --cache enables caching for inner task +[[plan]] +name = "nested --cache enables inner task caching" +args = ["run", "outer-cache"] + +# Nested vp run without flags inherits parent resolved cache +[[plan]] +name = "nested run without flags inherits parent cache" +args = ["run", "outer-inherit"] + +# Outer --cache propagates to nested run without flags +[[plan]] +name = "outer --cache propagates to nested run without flags" +args = ["run", "--cache", "outer-inherit"] + +# Outer --no-cache with nested --cache: inner overrides outer +[[plan]] +name = "outer --no-cache does not propagate into nested --cache" +args = ["run", "--no-cache", "outer-cache"] + +# Outer --no-cache with nested run (no flags): inner inherits outer +[[plan]] +name = "outer --no-cache propagates to nested run without flags" +args = ["run", "--no-cache", "outer-inherit"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap new file mode 100644 index 00000000..f80fb7d7 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap @@ -0,0 +1,116 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - outer-cache +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override +--- +[ + { + "key": [ + "/", + "outer-cache" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-cache", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-cache", + "package_path": "/" + }, + "command": "vp run --cache inner", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Expanded": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "inner", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ] + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap new file mode 100644 index 00000000..d690e74e --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap @@ -0,0 +1,89 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - outer-no-cache +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override +--- +[ + { + "key": [ + "/", + "outer-no-cache" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-no-cache", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-no-cache", + "package_path": "/" + }, + "command": "vp run --no-cache inner", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Expanded": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ] + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap new file mode 100644 index 00000000..4d2c993a --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap @@ -0,0 +1,89 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - outer-inherit +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override +--- +[ + { + "key": [ + "/", + "outer-inherit" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "command": "vp run inner", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Expanded": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ] + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap new file mode 100644 index 00000000..89d3c5aa --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap @@ -0,0 +1,117 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "--cache" + - outer-inherit +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override +--- +[ + { + "key": [ + "/", + "outer-inherit" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "command": "vp run inner", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Expanded": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "inner", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ] + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap new file mode 100644 index 00000000..51d15e09 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap @@ -0,0 +1,117 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "--no-cache" + - outer-cache +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override +--- +[ + { + "key": [ + "/", + "outer-cache" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-cache", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-cache", + "package_path": "/" + }, + "command": "vp run --cache inner", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Expanded": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "inner", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ] + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap new file mode 100644 index 00000000..b5e9b0cb --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap @@ -0,0 +1,90 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +info: + args: + - run + - "--no-cache" + - outer-inherit +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override +--- +[ + { + "key": [ + "/", + "outer-inherit" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "command": "vp run inner", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Expanded": [ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": null, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ] + } + } + ] + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/task graph.snap new file mode 100644 index 00000000..72e7589a --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/task graph.snap @@ -0,0 +1,123 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: task_graph_json +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override +--- +[ + { + "key": [ + "/", + "inner" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "inner", + "package_path": "/" + }, + "resolved_config": { + "command": "print-file package.json", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "outer-cache" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-cache", + "package_path": "/" + }, + "resolved_config": { + "command": "vp run --cache inner", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "outer-inherit" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-inherit", + "package_path": "/" + }, + "resolved_config": { + "command": "vp run inner", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + }, + { + "key": [ + "/", + "outer-no-cache" + ], + "node": { + "task_display": { + "package_name": "@test/nested-cache-override", + "task_name": "outer-no-cache", + "package_path": "/" + }, + "resolved_config": { + "command": "vp run --no-cache inner", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + }, + "source": "PackageJsonScript" + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/vite-task.json new file mode 100644 index 00000000..2c63c085 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/vite-task.json @@ -0,0 +1,2 @@ +{ +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/task graph.snap index ead28462..f70f89a4 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-packages-optional/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-packages-optional/snapshots/task graph.snap index 2a686412..728b66a7 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-packages-optional/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-packages-optional/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-p } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/snapshots/task graph.snap index 078a225b..5a9fd1c4 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topolo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topolo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -84,7 +86,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topolo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -112,7 +115,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topolo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -140,7 +144,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topolo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -168,7 +173,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topolo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -196,7 +202,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topolo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -224,7 +231,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topolo } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/task graph.snap index bdf877e4..79b113c1 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/task graph.snap index ffe498b2..7be0e02e 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -47,9 +48,17 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "command": "vp lint", "resolved_options": { "cwd": "/", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -70,7 +79,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "cwd": "/", "cache_config": null } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -98,7 +108,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -127,7 +138,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -146,9 +158,17 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "command": "vp run build", "resolved_options": { "cwd": "/", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -169,7 +189,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "cwd": "/", "cache_config": null } - } + }, + "source": "TaskConfig" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/task graph.snap index c94cb31e..07ed52b1 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-sub } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-sub } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive-skip-intermediate/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive-skip-intermediate/snapshots/task graph.snap index 0bf76c85..30771c36 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive-skip-intermediate/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive-skip-intermediate/snapshots/task graph.snap @@ -19,9 +19,17 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive-skip- "command": "echo 'Building @test/bottom'", "resolved_options": { "cwd": "/packages/bottom", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -40,9 +48,17 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive-skip- "command": "echo 'Linting @test/middle'", "resolved_options": { "cwd": "/packages/middle", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -61,9 +77,17 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/transitive-skip- "command": "echo 'Building @test/top'", "resolved_options": { "cwd": "/packages/top", - "cache_config": null + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/task graph.snap index 1dcf808c..5aeff92d 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace-root-no-package-json/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace-root-no-package-json/snapshots/task graph.snap index 051e2c04..520f4db9 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace-root-no-package-json/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace-root-no-package-json/snapshots/task graph.snap @@ -28,7 +28,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace-root-n } } } - } + }, + "source": "TaskConfig" }, "neighbors": [] }, @@ -56,7 +57,8 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace-root-n } } } - } + }, + "source": "PackageJsonScript" }, "neighbors": [] }