diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41aaa1b3..6c1bc887 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,10 +127,20 @@ jobs: # Must run after setup-node so correct native binaries are installed - run: pnpm install - - run: cargo test --target ${{ matrix.target }} + - name: Build tests + run: cargo test --no-run --target ${{ matrix.target }} if: ${{ matrix.os != 'ubuntu-latest' }} - - run: cargo-zigbuild test --target x86_64-unknown-linux-gnu.2.17 + - name: Build tests + run: cargo-zigbuild test --no-run --target x86_64-unknown-linux-gnu.2.17 + if: ${{ matrix.os == 'ubuntu-latest' }} + + - name: Run tests + run: cargo test --target ${{ matrix.target }} + if: ${{ matrix.os != 'ubuntu-latest' }} + + - name: Run tests + run: cargo-zigbuild test --target x86_64-unknown-linux-gnu.2.17 if: ${{ matrix.os == 'ubuntu-latest' }} test-musl: @@ -175,7 +185,11 @@ jobs: corepack enable pnpm install - - run: cargo test + - name: Build tests + run: cargo test --no-run + + - name: Run tests + run: cargo test fmt: name: Format and Check Deps diff --git a/Cargo.lock b/Cargo.lock index 905cd6b9..69fe4e2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3959,6 +3959,7 @@ dependencies = [ "cow-utils", "futures-util", "insta", + "pathdiff", "petgraph", "rustc-hash", "serde", diff --git a/Cargo.toml b/Cargo.toml index 87013713..8a2f675f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -167,6 +167,9 @@ ignored = [ # and we don't rely on it for debugging that much. debug = false +[profile.test] +debug = false + [profile.release] # Configurations explicitly listed here for clarity. # Using the best options for performance. diff --git a/crates/vite_task_bin/Cargo.toml b/crates/vite_task_bin/Cargo.toml index 940f7afa..bd574aaf 100644 --- a/crates/vite_task_bin/Cargo.toml +++ b/crates/vite_task_bin/Cargo.toml @@ -10,6 +10,10 @@ rust-version.workspace = true name = "vt" path = "src/main.rs" +[[bin]] +name = "vtt" +path = "src/vtt.rs" + [dependencies] anyhow = { workspace = true } async-trait = { workspace = true } diff --git a/crates/vite_task_bin/src/lib.rs b/crates/vite_task_bin/src/lib.rs index 16404b46..7b9eb6be 100644 --- a/crates/vite_task_bin/src/lib.rs +++ b/crates/vite_task_bin/src/lib.rs @@ -6,7 +6,6 @@ use std::{ }; use clap::Parser; -use rustc_hash::FxHashMap; use vite_path::AbsolutePath; use vite_str::Str; use vite_task::{ @@ -47,44 +46,14 @@ pub fn find_executable( Ok(executable_path.into_os_string().into()) } -/// Create a synthetic plan request for running a tool from `node_modules/.bin`. -/// -/// # Errors -/// -/// Returns an error if the executable cannot be found. -fn synthesize_node_modules_bin_task( - executable_name: &str, - args: &[Str], - envs: &Arc, Arc>>, - cwd: &Arc, -) -> anyhow::Result { - Ok(SyntheticPlanRequest { - program: find_executable(get_path_env(envs), cwd, executable_name)?, - args: args.into(), - cache_config: UserCacheConfig::with_config(EnabledCacheConfig { - env: None, - untracked_env: None, - input: None, - }), - envs: Arc::clone(envs), - }) -} - #[derive(Debug, Parser)] #[command(name = "vt", version)] pub enum Args { - Lint { + /// Run a tool via vtt. + Tool { #[clap(trailing_var_arg = true, allow_hyphen_values = true)] args: Vec, }, - Test { - #[clap(trailing_var_arg = true, allow_hyphen_values = true)] - args: Vec, - }, - EnvTest { - name: Str, - value: Str, - }, #[command(flatten)] Task(Command), } @@ -109,30 +78,17 @@ impl vite_task::CommandHandler for CommandHandler { std::iter::once(command.program.as_str()).chain(command.args.iter().map(Str::as_str)), )?; match args { - Args::Lint { args } => Ok(HandledCommand::Synthesized( - synthesize_node_modules_bin_task("oxlint", &args, &command.envs, &command.cwd)?, - )), - Args::Test { args } => Ok(HandledCommand::Synthesized( - synthesize_node_modules_bin_task("vitest", &args, &command.envs, &command.cwd)?, - )), - Args::EnvTest { name, value } => { - let mut envs = FxHashMap::clone(&command.envs); - envs.insert( - Arc::from(OsStr::new(name.as_str())), - Arc::from(OsStr::new(value.as_str())), - ); - + Args::Tool { args } => { + let program = find_executable(get_path_env(&command.envs), &command.cwd, "vtt")?; Ok(HandledCommand::Synthesized(SyntheticPlanRequest { - program: find_executable(get_path_env(&envs), &command.cwd, "print-env")?, - args: [name.clone()].into(), - cache_config: UserCacheConfig::with_config({ - EnabledCacheConfig { - env: None, - untracked_env: Some(vec![name]), - input: None, - } + program, + args: args.into_iter().filter(|a| a.as_str() != "--").collect(), + cache_config: UserCacheConfig::with_config(EnabledCacheConfig { + env: None, + untracked_env: None, + input: None, }), - envs: Arc::new(envs), + envs: Arc::clone(&command.envs), })) } Args::Task(parsed) => Ok(HandledCommand::ViteTaskCommand(parsed)), diff --git a/crates/vite_task_bin/src/main.rs b/crates/vite_task_bin/src/main.rs index e5c213a6..bd2544a1 100644 --- a/crates/vite_task_bin/src/main.rs +++ b/crates/vite_task_bin/src/main.rs @@ -1,16 +1,11 @@ -use std::{process::ExitCode, sync::Arc}; +use std::process::ExitCode; use clap::Parser; -use vite_str::Str; -use vite_task::{ - EnabledCacheConfig, ExitStatus, Session, UserCacheConfig, get_path_env, - plan_request::SyntheticPlanRequest, -}; -use vite_task_bin::{Args, OwnedSessionConfig, find_executable}; +use vite_task::{ExitStatus, Session}; +use vite_task_bin::{Args, OwnedSessionConfig}; #[tokio::main] async fn main() -> anyhow::Result { - #[expect(clippy::large_futures, reason = "top-level await in main, no alternative")] let exit_status = run().await?; Ok(exit_status.0.into()) } @@ -21,34 +16,7 @@ async fn run() -> anyhow::Result { let session = Session::init(owned_config.as_config())?; match args { Args::Task(parsed) => session.main(parsed).await, - args => { - // If env FOO is set, run `print-env FOO` via Session::exec before proceeding. - // In vite-plus, Session::exec is used for auto-install. - let envs = session.envs(); - if envs.contains_key(std::ffi::OsStr::new("FOO")) { - let program = find_executable(get_path_env(envs), session.cwd(), "print-env")?; - let request = SyntheticPlanRequest { - program, - args: [Str::from("FOO")].into(), - cache_config: UserCacheConfig::with_config({ - EnabledCacheConfig { - env: Some(Box::from([Str::from("FOO")])), - untracked_env: None, - input: None, - } - }), - envs: Arc::clone(envs), - }; - let cache_key: Arc<[Str]> = Arc::from([Str::from("print-env-foo")]); - #[expect( - clippy::large_futures, - reason = "execute_synthetic produces a large future" - )] - let status = session.execute_synthetic(request, cache_key, true).await?; - if status != ExitStatus::SUCCESS { - return Ok(status); - } - } + args @ Args::Tool { .. } => { #[expect(clippy::print_stdout, reason = "CLI binary output for non-task commands")] { println!("{args:?}"); diff --git a/crates/vite_task_bin/src/vtt.rs b/crates/vite_task_bin/src/vtt.rs new file mode 100644 index 00000000..ed94a4e6 --- /dev/null +++ b/crates/vite_task_bin/src/vtt.rs @@ -0,0 +1,126 @@ +// This is a standalone test utility binary that deliberately uses std types +// rather than the project's custom types (vite_str, vite_path, etc.). +#![expect(clippy::disallowed_types, reason = "standalone test utility uses std types")] +#![expect(clippy::disallowed_macros, reason = "standalone test utility uses std macros")] +#![expect(clippy::disallowed_methods, reason = "standalone test utility uses std methods")] +#![expect(clippy::print_stderr, reason = "CLI tool error output")] +#![expect(clippy::print_stdout, reason = "CLI tool output")] + +fn main() { + let args: Vec = std::env::args().collect(); + if args.len() < 2 { + eprintln!("Usage: vtt [args...]"); + eprintln!( + "Subcommands: check-tty, print, print-cwd, print-env, print-file, read-stdin, replace-file-content, touch-file" + ); + std::process::exit(1); + } + + let result: Result<(), Box> = match args[1].as_str() { + "check-tty" => { + cmd_check_tty(); + Ok(()) + } + "print" => { + cmd_print(&args[2..]); + Ok(()) + } + "print-cwd" => cmd_print_cwd(), + "print-env" => cmd_print_env(&args[2..]), + "print-file" => cmd_print_file(&args[2..]), + "read-stdin" => cmd_read_stdin(), + "replace-file-content" => cmd_replace_file_content(&args[2..]), + "touch-file" => cmd_touch_file(&args[2..]), + other => { + eprintln!("Unknown subcommand: {other}"); + std::process::exit(1); + } + }; + + if let Err(err) = result { + eprintln!("{err}"); + std::process::exit(1); + } +} + +fn cmd_check_tty() { + use std::io::IsTerminal as _; + let stdin_tty = if std::io::stdin().is_terminal() { "tty" } else { "not-tty" }; + let stdout_tty = if std::io::stdout().is_terminal() { "tty" } else { "not-tty" }; + let stderr_tty = if std::io::stderr().is_terminal() { "tty" } else { "not-tty" }; + println!("stdin:{stdin_tty}"); + println!("stdout:{stdout_tty}"); + println!("stderr:{stderr_tty}"); +} + +fn cmd_print(args: &[String]) { + println!("{}", args.join(" ")); +} + +fn cmd_print_cwd() -> Result<(), Box> { + let cwd = std::env::current_dir()?; + println!("{}", cwd.display()); + Ok(()) +} + +fn cmd_print_env(args: &[String]) -> Result<(), Box> { + if args.is_empty() { + return Err("Usage: vtt print-env ".into()); + } + let value = std::env::var(&args[0]).unwrap_or_else(|_| "(undefined)".to_string()); + println!("{value}"); + Ok(()) +} + +fn cmd_print_file(args: &[String]) -> Result<(), Box> { + use std::io::Write as _; + let stdout = std::io::stdout(); + let mut out = stdout.lock(); + for file in args { + match std::fs::read(file) { + Ok(content) => out.write_all(&content)?, + Err(_) => eprintln!("{file}: not found"), + } + } + Ok(()) +} + +fn cmd_read_stdin() -> Result<(), Box> { + use std::io::{Read as _, Write as _}; + let mut stdin = std::io::stdin().lock(); + let mut stdout = std::io::stdout().lock(); + let mut buf = [0u8; 8192]; + loop { + match stdin.read(&mut buf) { + Ok(0) | Err(_) => break, + Ok(n) => stdout.write_all(&buf[..n])?, + } + } + Ok(()) +} + +fn cmd_replace_file_content(args: &[String]) -> Result<(), Box> { + if args.len() < 3 { + return Err("Usage: vtt replace-file-content ".into()); + } + let filename = &args[0]; + let search_value = &args[1]; + let new_value = &args[2]; + + let filepath = std::path::Path::new(filename).canonicalize()?; + let content = std::fs::read_to_string(&filepath)?; + if !content.contains(search_value) { + return Err(std::format!("searchValue not found in {filename}: {search_value:?}").into()); + } + let new_content = content.replacen(search_value, new_value, 1); + std::fs::write(&filepath, new_content)?; + Ok(()) +} + +fn cmd_touch_file(args: &[String]) -> Result<(), Box> { + if args.is_empty() { + return Err("Usage: vtt touch-file ".into()); + } + let _file = std::fs::OpenOptions::new().read(true).write(true).open(&args[0])?; + Ok(()) +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/package.json index ab3f4d17..601a7860 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/package.json @@ -1,6 +1,6 @@ { "scripts": { - "script1": "print hello", - "script2": "print hello" + "script1": "vtt print hello", + "script2": "vtt print hello" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml index a4ae9549..cb717e55 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml @@ -5,6 +5,6 @@ name = "associate existing cache" steps = [ "vt run script1 # cache miss", "vt run script2 # cache hit, same command as script1", - "json-edit package.json '_.scripts.script2 = \"print world\"' # change script2", + "vtt replace-file-content package.json '\"script2\": \"vtt print hello\"' '\"script2\": \"vtt print world\"' # change script2", "vt run script2 # cache miss", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap index e5dc36b2..b3ab1305 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap @@ -3,16 +3,16 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run script1 # cache miss -$ print hello +$ vtt print hello hello > vt run script2 # cache hit, same command as script1 -$ print hello ◉ cache hit, replaying +$ vtt print hello ◉ cache hit, replaying hello --- -vt run: cache hit, saved. -> json-edit package.json '_.scripts.script2 = "print world"' # change script2 +vt run: cache hit. +> vtt replace-file-content package.json '"script2": "vtt print hello"' '"script2": "vtt print world"' # change script2 > vt run script2 # cache miss -$ print world ○ cache miss: args changed, executing +$ vtt print world ○ cache miss: args changed, executing world diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/.gitignore b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/.gitignore deleted file mode 100644 index 231280da..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# Prevent oxlint from scanning node_modules. -# Without this, oxlint reads files in node_modules/.vite/task-cache, causing -# fspy to fingerprint the cache directory as an input. The cache directory -# changes between runs (DB writes, last-summary.json), producing flaky -# cache-miss reasons that alternate between '' and -# 'node_modules/.vite/task-cache'. -node_modules diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/folder1/a.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/folder1/a.js deleted file mode 100644 index dddcb9f2..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/folder1/a.js +++ /dev/null @@ -1 +0,0 @@ -// Empty JS file for oxlint diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/folder2/a.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/folder2/a.js deleted file mode 100644 index dddcb9f2..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/folder2/a.js +++ /dev/null @@ -1 +0,0 @@ -// Empty JS file for oxlint diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/package.json index 6c5372ed..0bb387b0 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/package.json @@ -1,5 +1,6 @@ { "scripts": { - "lint": "vt lint" + "cwd1": "cd folder1 && vt tool print-cwd", + "cwd2": "cd folder2 && vt tool print-cwd" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml index ad55636d..3851f92c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml @@ -1,11 +1,10 @@ -# Tests that tasks have separate cache per cwd +# Tests that synthetic tasks have separate cache per cwd [[e2e]] name = "builtin different cwd" steps = [ - "cd folder1 && vt run lint # cache miss in folder1", - "cd folder2 && vt run lint # cache miss in folder2", - "echo 'console.log(1);' > folder2/a.js # modify folder2", - "cd folder1 && vt run lint # cache hit", - "cd folder2 && vt run lint # cache miss", + "vt run cwd1 # cache miss in folder1", + "vt run cwd2 # cache miss in folder2 (different cwd)", + "vt run cwd1 # cache hit in folder1", + "vt run cwd2 # cache hit in folder2", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap index c1665105..8c9a623e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap @@ -2,73 +2,21 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cd folder1 && vt run lint # cache miss in folder1 -$ vt lint - - ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. - ,-[folder1/a.js:1:1] - 1 | // Empty JS file for oxlint - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `---- - help: Delete this file or add some code to it. - - ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. - ,-[folder2/a.js:1:1] - 1 | // Empty JS file for oxlint - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `---- - help: Delete this file or add some code to it. - -Found 2 warnings and 0 errors. -Finished in on 2 files with 93 rules using threads. -> cd folder2 && vt run lint # cache miss in folder2 -$ vt lint ◉ cache hit, replaying - - ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. - ,-[folder1/a.js:1:1] - 1 | // Empty JS file for oxlint - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `---- - help: Delete this file or add some code to it. - - ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. - ,-[folder2/a.js:1:1] - 1 | // Empty JS file for oxlint - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `---- - help: Delete this file or add some code to it. - -Found 2 warnings and 0 errors. -Finished in on 2 files with 93 rules using threads. +> vt run cwd1 # cache miss in folder1 +~/folder1$ vt tool print-cwd +/folder1 +> vt run cwd2 # cache miss in folder2 (different cwd) +~/folder2$ vt tool print-cwd +/folder2 +> vt run cwd1 # cache hit in folder1 +~/folder1$ vt tool print-cwd ◉ cache hit, replaying +/folder1 --- -vt run: cache hit, saved. -> echo 'console.log(1);' > folder2/a.js # modify folder2 - -> cd folder1 && vt run lint # cache hit -$ vt lint ○ cache miss: 'folder2/a.js' modified, executing - - ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. - ,-[folder1/a.js:1:1] - 1 | // Empty JS file for oxlint - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `---- - help: Delete this file or add some code to it. - -Found 1 warning and 0 errors. -Finished in on 2 files with 93 rules using threads. -> cd folder2 && vt run lint # cache miss -$ vt lint ◉ cache hit, replaying - - ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. - ,-[folder1/a.js:1:1] - 1 | // Empty JS file for oxlint - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `---- - help: Delete this file or add some code to it. - -Found 1 warning and 0 errors. -Finished in on 2 files with 93 rules using threads. +vt run: cache hit. +> vt run cwd2 # cache hit in folder2 +~/folder2$ vt tool print-cwd ◉ cache hit, replaying +/folder2 --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/package.json index 41cc41a8..901ecdb5 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/package.json @@ -1,6 +1,6 @@ { "name": "builtin-non-zero-exit-test", "scripts": { - "lint": "vt lint" + "lint": "vt tool replace-file-content bad.js NOTFOUND replacement" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml index 691f16ee..e6eedf73 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml @@ -1,3 +1,3 @@ [[e2e]] name = "builtin command with non-zero exit does not show cache not updated" -steps = ["vt run lint -- -D no-debugger", "vt run lint -- -D no-debugger"] +steps = ["vt run lint", "vt run lint"] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap index b74a8fc0..74d10019 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap @@ -2,27 +2,9 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[1]> vt run lint -- -D no-debugger -$ vt lint -- -D no-debugger - - x eslint(no-debugger): `debugger` statement is not allowed - ,-[bad.js:1:1] - 1 | debugger; - : ^^^^^^^^^ - `---- - help: Remove the debugger statement - -Found 0 warnings and 1 error. -Finished in on 1 file with 93 rules using threads. -[1]> vt run lint -- -D no-debugger -$ vt lint -- -D no-debugger - - x eslint(no-debugger): `debugger` statement is not allowed - ,-[bad.js:1:1] - 1 | debugger; - : ^^^^^^^^^ - `---- - help: Remove the debugger statement - -Found 0 warnings and 1 error. -Finished in on 1 file with 93 rules using threads. +[1]> vt run lint +$ vt tool replace-file-content bad.js NOTFOUND replacement +searchValue not found in bad.js: "NOTFOUND" +[1]> vt run lint +$ vt tool replace-file-content bad.js NOTFOUND replacement +searchValue not found in bad.js: "NOTFOUND" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap index d77347ca..55f21ff3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run no-cache-task # cache miss -$ print-file test.txt ⊘ cache disabled +$ vtt print-file test.txt ⊘ cache disabled test content > vt run no-cache-task # cache disabled, runs again -$ print-file test.txt ⊘ cache disabled +$ vtt print-file test.txt ⊘ cache disabled test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap index ba1d4b0c..2af15642 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap @@ -3,11 +3,11 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run cached-task # cache miss -$ print-file test.txt +$ vtt print-file test.txt test content > vt run cached-task # cache hit -$ print-file test.txt ◉ cache hit, replaying +$ vtt print-file test.txt ◉ cache hit, replaying test content --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/vite-task.json index c1d2fecf..38fffec4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/vite-task.json @@ -2,11 +2,11 @@ "cache": true, "tasks": { "no-cache-task": { - "command": "print-file test.txt", + "command": "vtt print-file test.txt", "cache": false }, "cached-task": { - "command": "print-file test.txt", + "command": "vtt print-file test.txt", "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml index d6470879..e4d13a92 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml @@ -4,8 +4,8 @@ name = "cache miss command change" steps = [ "vt run task # cache miss", - "json-edit vite-task.json '_.tasks.task.command = \"print baz && print bar\"' # change first subtask", + "vtt replace-file-content vite-task.json 'vtt print foo && vtt print bar' 'vtt print baz && vtt print bar' # change first subtask", "vt run task # first: cache miss, second: cache hit", - "json-edit vite-task.json '_.tasks.task.command = \"print bar\"' # remove first subtask", + "vtt replace-file-content vite-task.json 'vtt print baz && vtt print bar' 'vtt print bar' # remove first subtask", "vt run task # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap index 8f9c0e75..187841f5 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap @@ -3,30 +3,30 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run task # cache miss -$ print foo +$ vtt print foo foo -$ print bar +$ vtt print bar bar --- vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details) -> json-edit vite-task.json '_.tasks.task.command = "print baz && print bar"' # change first subtask +> vtt replace-file-content vite-task.json 'vtt print foo && vtt print bar' 'vtt print baz && vtt print bar' # change first subtask > vt run task # first: cache miss, second: cache hit -$ print baz ○ cache miss: args changed, executing +$ vtt print baz ○ cache miss: args changed, executing baz -$ print bar ◉ cache hit, replaying +$ vtt print bar ◉ cache hit, replaying bar --- -vt run: 1/2 cache hit (50%), saved. (Run `vt run --last-details` for full details) -> json-edit vite-task.json '_.tasks.task.command = "print bar"' # remove first subtask +vt run: 1/2 cache hit (50%). (Run `vt run --last-details` for full details) +> vtt replace-file-content vite-task.json 'vtt print baz && vtt print bar' 'vtt print bar' # remove first subtask > vt run task # cache hit -$ print bar ◉ cache hit, replaying +$ vtt print bar ◉ cache hit, replaying bar --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/vite-task.json index 11b87a3f..ffb999e7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/vite-task.json @@ -1,7 +1,7 @@ { "tasks": { "task": { - "command": "print foo && print bar" + "command": "vtt print foo && vtt print bar" } } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml index 4662e0e1..9709fef2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml @@ -3,32 +3,32 @@ [[e2e]] name = "env value changed" steps = [ - "cross-env MY_ENV=1 vt run test # cache miss", - "cross-env MY_ENV=2 vt run test # cache miss: env value changed", + "MY_ENV=1 vt run test # cache miss", + "MY_ENV=2 vt run test # cache miss: env value changed", ] [[e2e]] name = "env added" -steps = ["vt run test # cache miss", "cross-env MY_ENV=1 vt run test # cache miss: env added"] +steps = ["vt run test # cache miss", "MY_ENV=1 vt run test # cache miss: env added"] [[e2e]] name = "env removed" -steps = ["cross-env MY_ENV=1 vt run test # cache miss", "vt run test # cache miss: env removed"] +steps = ["MY_ENV=1 vt run test # cache miss", "vt run test # cache miss: env removed"] [[e2e]] name = "untracked env added" steps = [ "vt run test # cache miss", - "json-edit vite-task.json \"_.tasks.test.untrackedEnv = ['MY_UNTRACKED']\" # add untracked env", + """vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "untrackedEnv": ["MY_UNTRACKED"]' # add untracked env""", "vt run test # cache miss: untracked env added", ] [[e2e]] name = "untracked env removed" steps = [ - "json-edit vite-task.json \"_.tasks.test.untrackedEnv = ['MY_UNTRACKED']\" # setup", + """vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "untrackedEnv": ["MY_UNTRACKED"]' # setup""", "vt run test # cache miss", - "json-edit vite-task.json \"delete _.tasks.test.untrackedEnv\" # remove untracked env", + """vtt replace-file-content vite-task.json '"cache": true, "untrackedEnv": ["MY_UNTRACKED"]' '"cache": true' # remove untracked env""", "vt run test # cache miss: untracked env removed", ] @@ -38,7 +38,7 @@ steps = [ "vt run test # cache miss", "mkdir -p subfolder", "cp test.txt subfolder/test.txt", - "json-edit vite-task.json \"_.tasks.test.cwd = 'subfolder'\" # change cwd", + """vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "cwd": "subfolder"' # change cwd""", "vt run test # cache miss: cwd changed", ] @@ -46,7 +46,7 @@ steps = [ name = "inferred input changes" steps = [ "vt run test # cache miss", - "replace-file-content test.txt initial modified # modify input", + "vtt replace-file-content test.txt initial modified # modify input", "vt run test # cache miss: input modified", "rm test.txt # remove tracked input", "vt run test # cache miss: input removed", @@ -58,7 +58,7 @@ steps = [ name = "input config changed" steps = [ "vt run test # cache miss", - "json-edit vite-task.json \"_.tasks.test.input = ['test.txt']\" # change input config", + """vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "input": ["test.txt"]' # change input config""", "vt run test # cache miss: configuration changed", ] @@ -66,7 +66,7 @@ steps = [ name = "glob input changes" steps = [ "vt run glob-test # cache miss", - "replace-file-content test.txt initial modified # modify glob input", + "vtt replace-file-content test.txt initial modified # modify glob input", "vt run glob-test # cache miss: input modified", "echo new content > new.txt # add a new .txt file", "vt run glob-test # cache miss: input added", diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap index 40903169..233816ce 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap @@ -3,14 +3,14 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run test # cache miss -$ print-file test.txt +$ vtt print-file test.txt initial content > mkdir -p subfolder > cp test.txt subfolder/test.txt -> json-edit vite-task.json "_.tasks.test.cwd = 'subfolder'" # change cwd +> vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "cwd": "subfolder"' # change cwd > vt run test # cache miss: cwd changed -~/subfolder$ print-file test.txt ○ cache miss: working directory changed, executing +~/subfolder$ vtt print-file test.txt ○ cache miss: working directory changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap index e39f5a00..2759ff8d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run test # cache miss -$ print-file test.txt +$ vtt print-file test.txt initial content -> cross-env MY_ENV=1 vt run test # cache miss: env added -$ print-file test.txt ○ cache miss: envs changed, executing +> MY_ENV=1 vt run test # cache miss: env added +$ vtt print-file test.txt ○ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap index 436aa4d5..68adcaaa 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap @@ -2,9 +2,9 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cross-env MY_ENV=1 vt run test # cache miss -$ print-file test.txt +> MY_ENV=1 vt run test # cache miss +$ vtt print-file test.txt initial content > vt run test # cache miss: env removed -$ print-file test.txt ○ cache miss: envs changed, executing +$ vtt print-file test.txt ○ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap index 65601397..04cca402 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap @@ -2,9 +2,9 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> cross-env MY_ENV=1 vt run test # cache miss -$ print-file test.txt +> MY_ENV=1 vt run test # cache miss +$ vtt print-file test.txt initial content -> cross-env MY_ENV=2 vt run test # cache miss: env value changed -$ print-file test.txt ○ cache miss: envs changed, executing +> MY_ENV=2 vt run test # cache miss: env value changed +$ vtt print-file test.txt ○ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/glob input changes.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/glob input changes.snap index cfa939b7..c4ccf04b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/glob input changes.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/glob input changes.snap @@ -3,20 +3,20 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run glob-test # cache miss -$ print glob-test +$ vtt print glob-test glob-test -> replace-file-content test.txt initial modified # modify glob input +> vtt replace-file-content test.txt initial modified # modify glob input > vt run glob-test # cache miss: input modified -$ print glob-test ○ cache miss: 'test.txt' modified, executing +$ vtt print glob-test ○ cache miss: 'test.txt' modified, executing glob-test > echo new content > new.txt # add a new .txt file > vt run glob-test # cache miss: input added -$ print glob-test ○ cache miss: 'new.txt' added in workspace root, executing +$ vtt print glob-test ○ cache miss: 'new.txt' added in workspace root, executing glob-test > rm extra.txt # remove a .txt file > vt run glob-test # cache miss: input removed -$ print glob-test ○ cache miss: 'extra.txt' removed from workspace root, executing +$ vtt print glob-test ○ cache miss: 'extra.txt' removed from workspace root, executing glob-test diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inferred input changes.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inferred input changes.snap index 825cc02c..35dd17ab 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inferred input changes.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inferred input changes.snap @@ -3,20 +3,20 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run test # cache miss -$ print-file test.txt +$ vtt print-file test.txt initial content -> replace-file-content test.txt initial modified # modify input +> vtt replace-file-content test.txt initial modified # modify input > vt run test # cache miss: input modified -$ print-file test.txt ○ cache miss: 'test.txt' modified, executing +$ vtt print-file test.txt ○ cache miss: 'test.txt' modified, executing modified content > rm test.txt # remove tracked input > vt run test # cache miss: input removed -$ print-file test.txt ○ cache miss: 'test.txt' removed from workspace root, executing +$ vtt print-file test.txt ○ cache miss: 'test.txt' removed from workspace root, executing test.txt: not found > echo new content > test.txt # recreate previously removed file > vt run test # cache miss: input added -$ print-file test.txt ○ cache miss: 'test.txt' added in workspace root, executing +$ vtt print-file test.txt ○ cache miss: 'test.txt' added in workspace root, executing new content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input config changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input config changed.snap index 6d74a665..1e42d1d4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input config changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input config changed.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run test # cache miss -$ print-file test.txt +$ vtt print-file test.txt initial content -> json-edit vite-task.json "_.tasks.test.input = ['test.txt']" # change input config +> vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "input": ["test.txt"]' # change input config > vt run test # cache miss: configuration changed -$ print-file test.txt ○ cache miss: input configuration changed, executing +$ vtt print-file test.txt ○ cache miss: input configuration changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/untracked env added.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/untracked env added.snap index 4b3e45c8..e320457d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/untracked env added.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/untracked env added.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run test # cache miss -$ print-file test.txt +$ vtt print-file test.txt initial content -> json-edit vite-task.json "_.tasks.test.untrackedEnv = ['MY_UNTRACKED']" # add untracked env +> vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "untrackedEnv": ["MY_UNTRACKED"]' # add untracked env > vt run test # cache miss: untracked env added -$ print-file test.txt ○ cache miss: untracked env config changed, executing +$ vtt print-file test.txt ○ cache miss: untracked env config changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/untracked env removed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/untracked env removed.snap index 3d0aa0d5..0626582e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/untracked env removed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/untracked env removed.snap @@ -2,13 +2,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> json-edit vite-task.json "_.tasks.test.untrackedEnv = ['MY_UNTRACKED']" # setup +> vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "untrackedEnv": ["MY_UNTRACKED"]' # setup > vt run test # cache miss -$ print-file test.txt +$ vtt print-file test.txt initial content -> json-edit vite-task.json "delete _.tasks.test.untrackedEnv" # remove untracked env +> vtt replace-file-content vite-task.json '"cache": true, "untrackedEnv": ["MY_UNTRACKED"]' '"cache": true' # remove untracked env > vt run test # cache miss: untracked env removed -$ print-file test.txt ○ cache miss: untracked env config changed, executing +$ vtt print-file test.txt ○ cache miss: untracked env config changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/vite-task.json index 1a9f83b0..f3f877a9 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/vite-task.json @@ -1,13 +1,12 @@ { - "cache": true, "tasks": { "test": { - "command": "print-file test.txt", + "command": "vtt print-file test.txt", "env": ["MY_ENV"], "cache": true }, "glob-test": { - "command": "print glob-test", + "command": "vtt print glob-test", "input": ["*.txt"], "cache": true } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap index c987be2f..b2ee0c0b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap @@ -3,16 +3,16 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run cached-task # cache miss -$ print-file test.txt +$ vtt print-file test.txt test content > vt run cached-task # cache hit -$ print-file test.txt ◉ cache hit, replaying +$ vtt print-file test.txt ◉ cache hit, replaying test content --- -vt run: cache hit, saved. +vt run: cache hit. > vt cache clean > vt run cached-task # cache miss after clean -$ print-file test.txt +$ vtt print-file test.txt test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/vite-task.json index 0622bca6..74115796 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/vite-task.json @@ -2,7 +2,7 @@ "cache": true, "tasks": { "cached-task": { - "command": "print-file test.txt", + "command": "vtt print-file test.txt", "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap index 4df269d3..ea55f5a4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap @@ -8,4 +8,4 @@ $ node read_node_fs.js $ node read_node_fs.js ◉ cache hit, replaying --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/package.json deleted file mode 100644 index 4cf89ed9..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "e2e-env-test", - "private": true, - "scripts": { - "env-test": "vt env-test" - } -} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots.toml deleted file mode 100644 index 0976a836..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots.toml +++ /dev/null @@ -1,9 +0,0 @@ -# Tests env-test synthetic command - -[[e2e]] -name = "env-test prints value from additional_envs" -steps = ["vt run env-test -- SYNTHETIC_ENV_VAR test_value_from_synthesizer # prints env value"] - -[[e2e]] -name = "env-test with different values" -steps = ["vt run env-test -- FOO bar # sets FOO=bar", "vt run env-test -- BAZ qux # sets BAZ=qux"] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap deleted file mode 100644 index c2f767bb..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: crates/vite_task_bin/tests/e2e_snapshots/main.rs -expression: e2e_outputs ---- -> vt run env-test -- SYNTHETIC_ENV_VAR test_value_from_synthesizer # prints env value -$ vt env-test -- SYNTHETIC_ENV_VAR test_value_from_synthesizer -test_value_from_synthesizer diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap deleted file mode 100644 index 83de9cad..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -source: crates/vite_task_bin/tests/e2e_snapshots/main.rs -expression: e2e_outputs ---- -> vt run env-test -- FOO bar # sets FOO=bar -$ vt env-test -- FOO bar -bar -> vt run env-test -- BAZ qux # sets BAZ=qux -$ vt env-test -- BAZ qux -qux diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/vite-task.json deleted file mode 100644 index d548edfa..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/vite-task.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cache": true -} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/main.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/main.js new file mode 100644 index 00000000..e921523b --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/main.js @@ -0,0 +1 @@ +console.log('hello'); diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json index 3868e3ce..dc0ebe1c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json @@ -2,6 +2,6 @@ "name": "e2e-lint-cache", "private": true, "scripts": { - "lint": "vt lint" + "lint": "vt tool print-file main.js" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml index adf57ba2..b77fcf06 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml @@ -1,9 +1,9 @@ -# Tests lint caching with file changes +# Tests synthetic task caching with file changes [[e2e]] name = "direct lint" steps = [ "vt run lint # cache miss", - "echo debugger > main.js # add lint error", - "vt run lint # cache miss, lint fails", + "echo modified > main.js # modify tracked file", + "vt run lint # cache miss, file changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap index c55bf2c5..d6d4154d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap @@ -3,20 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run lint # cache miss -$ vt lint -Found 0 warnings and 0 errors. -Finished in on 0 files with 93 rules using threads. -> echo debugger > main.js # add lint error +$ vt tool print-file main.js +console.log("hello"); +> echo modified > main.js # modify tracked file -> vt run lint # cache miss, lint fails -$ vt lint ○ cache miss: 'main.js' added in workspace root, executing - - ! eslint(no-debugger): `debugger` statement is not allowed - ,-[main.js:1:1] - 1 | debugger - : ^^^^^^^^ - `---- - help: Remove the debugger statement - -Found 1 warning and 0 errors. -Finished in on 1 file with 93 rules using threads. +> vt run lint # cache miss, file changed +$ vt tool print-file main.js ○ cache miss: 'main.js' modified, executing +modified diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/package.json deleted file mode 100644 index 694ad26c..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "@test/exec-api", - "scripts": { - "lint-task": "vt lint" - } -} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots.toml deleted file mode 100644 index c22a5d45..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots.toml +++ /dev/null @@ -1,11 +0,0 @@ -[[e2e]] -name = "exec not triggered from script" -steps = ["FOO=bar vt run lint-task # no print-env FOO output"] - -[[e2e]] -name = "exec caching" -steps = [ - "FOO=bar vt lint # cache miss", - "FOO=bar vt lint # cache hit, silent", - "FOO=baz vt lint # env changed, cache miss", -] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec caching.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec caching.snap deleted file mode 100644 index 95f964f3..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec caching.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -source: crates/vite_task_bin/tests/e2e_snapshots/main.rs -expression: e2e_outputs ---- -> FOO=bar vt lint # cache miss -bar -Lint { args: [] } -> FOO=bar vt lint # cache hit, silent -Lint { args: [] } -> FOO=baz vt lint # env changed, cache miss -baz -Lint { args: [] } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap deleted file mode 100644 index 6d8aaf64..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap +++ /dev/null @@ -1,8 +0,0 @@ ---- -source: crates/vite_task_bin/tests/e2e_snapshots/main.rs -expression: e2e_outputs ---- -> FOO=bar vt run lint-task # no print-env FOO output -$ vt lint -Found 0 warnings and 0 errors. -Finished in on 0 files with 93 rules using threads. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/vite-task.json deleted file mode 100644 index d548edfa..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/vite-task.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cache": true -} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/packages/app/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/packages/app/package.json index eba70d8e..e008b9cb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/packages/app/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/packages/app/package.json @@ -1,7 +1,7 @@ { "name": "@test/app", "scripts": { - "build": "print built-app" + "build": "vtt print built-app" }, "dependencies": { "@test/lib": "workspace:*" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/packages/lib/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/packages/lib/package.json index 59d51c85..2b2d2bc6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/packages/lib/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/packages/lib/package.json @@ -1,6 +1,6 @@ { "name": "@test/lib", "scripts": { - "build": "print built-lib" + "build": "vtt print built-lib" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/multiple unmatched filters warn individually.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/multiple unmatched filters warn individually.snap index d5caa0a0..175d247b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/multiple unmatched filters warn individually.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/multiple unmatched filters warn individually.snap @@ -5,5 +5,5 @@ expression: e2e_outputs > vt run --filter @test/app --filter nope1 --filter nope2 build No packages matched the filter: nope1 No packages matched the filter: nope2 -~/packages/app$ print built-app +~/packages/app$ vtt print built-app built-app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/partial match warns for unmatched filter.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/partial match warns for unmatched filter.snap index 716fa210..2066e003 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/partial match warns for unmatched filter.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/partial match warns for unmatched filter.snap @@ -4,5 +4,5 @@ expression: e2e_outputs --- > vt run --filter @test/app --filter nonexistent build No packages matched the filter: nonexistent -~/packages/app$ print built-app +~/packages/app$ vtt print built-app built-app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched directory filter warns.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched directory filter warns.snap index 5c4f5ff5..d4615abc 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched directory filter warns.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched directory filter warns.snap @@ -4,5 +4,5 @@ expression: e2e_outputs --- > vt run --filter @test/app --filter ./packages/nope build No packages matched the filter: ./packages/nope -~/packages/app$ print built-app +~/packages/app$ vtt print built-app built-app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched exclusion filter does not warn.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched exclusion filter does not warn.snap index 58955522..27100651 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched exclusion filter does not warn.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched exclusion filter does not warn.snap @@ -3,5 +3,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --filter @test/app --filter '!nonexistent' build -~/packages/app$ print built-app +~/packages/app$ vtt print built-app built-app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched glob filter warns.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched glob filter warns.snap index 6f93e811..6e519b6f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched glob filter warns.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched glob filter warns.snap @@ -4,5 +4,5 @@ expression: e2e_outputs --- > vt run --filter @test/app --filter @nope/* build No packages matched the filter: @nope/* -~/packages/app$ print built-app +~/packages/app$ vtt print built-app built-app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/whitespace split filter warns for unmatched token.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/whitespace split filter warns for unmatched token.snap index c7ff4a2f..9b2bcc01 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/whitespace split filter warns for unmatched token.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/whitespace split filter warns for unmatched token.snap @@ -4,5 +4,5 @@ expression: e2e_outputs --- > vt run --filter '@test/app nope' build No packages matched the filter: nope -~/packages/app$ print built-app +~/packages/app$ vtt print built-app built-app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/packages/sub-pkg/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/packages/sub-pkg/vite-task.json index e8d4cf67..a0556a20 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/packages/sub-pkg/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/packages/sub-pkg/vite-task.json @@ -1,12 +1,12 @@ { "tasks": { "sub-glob-test": { - "command": "print-file src/sub.ts", + "command": "vtt print-file src/sub.ts", "input": ["src/**/*.ts"], "cache": true }, "sub-glob-with-cwd": { - "command": "print-file sub.ts", + "command": "vtt print-file sub.ts", "cwd": "src", "input": ["src/**/*.ts"], "cache": true diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots.toml index 32a2b75e..4e800b8c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots.toml @@ -8,7 +8,7 @@ name = "root glob - matches src files" steps = [ "vt run root-glob-test", # Modify matched file - "replace-file-content src/root.ts initial modified", + "vtt replace-file-content src/root.ts initial modified", # Cache miss: file matches glob "vt run root-glob-test", ] @@ -18,7 +18,7 @@ name = "root glob - unmatched directory" steps = [ "vt run root-glob-test", # Modify file outside glob pattern - "replace-file-content other/other.ts initial modified", + "vtt replace-file-content other/other.ts initial modified", # Cache hit: file doesn't match glob "vt run root-glob-test", ] @@ -28,7 +28,7 @@ name = "root glob - subpackage path unmatched by relative glob" steps = [ "vt run root-glob-test", # Modify file in subpackage - relative glob src/** doesn't reach packages/sub-pkg/src/ - "replace-file-content packages/sub-pkg/src/sub.ts initial modified", + "vtt replace-file-content packages/sub-pkg/src/sub.ts initial modified", # Cache hit: path simply doesn't match the relative glob pattern "vt run root-glob-test", ] @@ -39,7 +39,7 @@ name = "root glob with cwd - glob relative to package not cwd" steps = [ "vt run root-glob-with-cwd", # Modify file - glob is src/** relative to package root - "replace-file-content src/root.ts initial modified", + "vtt replace-file-content src/root.ts initial modified", # Cache miss: file matches glob (relative to package, not cwd) "vt run root-glob-with-cwd", ] @@ -50,7 +50,7 @@ name = "subpackage glob - matches own src files" steps = [ "vt run sub-pkg#sub-glob-test", # Modify matched file in subpackage - "replace-file-content packages/sub-pkg/src/sub.ts initial modified", + "vtt replace-file-content packages/sub-pkg/src/sub.ts initial modified", # Cache miss: file matches subpackage's glob "vt run sub-pkg#sub-glob-test", ] @@ -60,7 +60,7 @@ name = "subpackage glob - unmatched directory in subpackage" steps = [ "vt run sub-pkg#sub-glob-test", # Modify file outside glob pattern - "replace-file-content packages/sub-pkg/other/other.ts initial modified", + "vtt replace-file-content packages/sub-pkg/other/other.ts initial modified", # Cache hit: file doesn't match glob "vt run sub-pkg#sub-glob-test", ] @@ -70,7 +70,7 @@ name = "subpackage glob - root path unmatched by relative glob" steps = [ "vt run sub-pkg#sub-glob-test", # Modify file in root - relative glob src/** is resolved from subpackage dir - "replace-file-content src/root.ts initial modified", + "vtt replace-file-content src/root.ts initial modified", # Cache hit: path simply doesn't match the relative glob pattern "vt run sub-pkg#sub-glob-test", ] @@ -81,7 +81,7 @@ name = "subpackage glob with cwd - glob relative to package not cwd" steps = [ "vt run sub-pkg#sub-glob-with-cwd", # Modify file - glob is src/** relative to subpackage root - "replace-file-content packages/sub-pkg/src/sub.ts initial modified", + "vtt replace-file-content packages/sub-pkg/src/sub.ts initial modified", # Cache miss: file matches glob (relative to subpackage, not cwd) "vt run sub-pkg#sub-glob-with-cwd", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - matches src files.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - matches src files.snap index 8cab6f38..a9cb0e35 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - matches src files.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - matches src files.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run root-glob-test -$ print-file src/root.ts +$ vtt print-file src/root.ts export const root = 'initial'; -> replace-file-content src/root.ts initial modified +> vtt replace-file-content src/root.ts initial modified > vt run root-glob-test -$ print-file src/root.ts ○ cache miss: 'src/root.ts' modified, executing +$ vtt print-file src/root.ts ○ cache miss: 'src/root.ts' modified, executing export const root = 'modified'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - subpackage path unmatched by relative glob.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - subpackage path unmatched by relative glob.snap index 246fe004..ab0d79c7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - subpackage path unmatched by relative glob.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - subpackage path unmatched by relative glob.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run root-glob-test -$ print-file src/root.ts +$ vtt print-file src/root.ts export const root = 'initial'; -> replace-file-content packages/sub-pkg/src/sub.ts initial modified +> vtt replace-file-content packages/sub-pkg/src/sub.ts initial modified > vt run root-glob-test -$ print-file src/root.ts ◉ cache hit, replaying +$ vtt print-file src/root.ts ◉ cache hit, replaying export const root = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - unmatched directory.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - unmatched directory.snap index 1c0cb914..4d8586b8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - unmatched directory.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob - unmatched directory.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run root-glob-test -$ print-file src/root.ts +$ vtt print-file src/root.ts export const root = 'initial'; -> replace-file-content other/other.ts initial modified +> vtt replace-file-content other/other.ts initial modified > vt run root-glob-test -$ print-file src/root.ts ◉ cache hit, replaying +$ vtt print-file src/root.ts ◉ cache hit, replaying export const root = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob with cwd - glob relative to package not cwd.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob with cwd - glob relative to package not cwd.snap index 7c299de3..25929f16 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob with cwd - glob relative to package not cwd.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/root glob with cwd - glob relative to package not cwd.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run root-glob-with-cwd -~/src$ print-file root.ts +~/src$ vtt print-file root.ts export const root = 'initial'; -> replace-file-content src/root.ts initial modified +> vtt replace-file-content src/root.ts initial modified > vt run root-glob-with-cwd -~/src$ print-file root.ts ○ cache miss: 'src/root.ts' modified, executing +~/src$ vtt print-file root.ts ○ cache miss: 'src/root.ts' modified, executing export const root = 'modified'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - matches own src files.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - matches own src files.snap index dac20f8f..0384187b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - matches own src files.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - matches own src files.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#sub-glob-test -~/packages/sub-pkg$ print-file src/sub.ts +~/packages/sub-pkg$ vtt print-file src/sub.ts export const sub = 'initial'; -> replace-file-content packages/sub-pkg/src/sub.ts initial modified +> vtt replace-file-content packages/sub-pkg/src/sub.ts initial modified > vt run sub-pkg#sub-glob-test -~/packages/sub-pkg$ print-file src/sub.ts ○ cache miss: 'packages/sub-pkg/src/sub.ts' modified, executing +~/packages/sub-pkg$ vtt print-file src/sub.ts ○ cache miss: 'packages/sub-pkg/src/sub.ts' modified, executing export const sub = 'modified'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - root path unmatched by relative glob.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - root path unmatched by relative glob.snap index 9e898849..c9ca80da 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - root path unmatched by relative glob.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - root path unmatched by relative glob.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#sub-glob-test -~/packages/sub-pkg$ print-file src/sub.ts +~/packages/sub-pkg$ vtt print-file src/sub.ts export const sub = 'initial'; -> replace-file-content src/root.ts initial modified +> vtt replace-file-content src/root.ts initial modified > vt run sub-pkg#sub-glob-test -~/packages/sub-pkg$ print-file src/sub.ts ◉ cache hit, replaying +~/packages/sub-pkg$ vtt print-file src/sub.ts ◉ cache hit, replaying export const sub = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - unmatched directory in subpackage.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - unmatched directory in subpackage.snap index fde046b6..c6e80464 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - unmatched directory in subpackage.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob - unmatched directory in subpackage.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#sub-glob-test -~/packages/sub-pkg$ print-file src/sub.ts +~/packages/sub-pkg$ vtt print-file src/sub.ts export const sub = 'initial'; -> replace-file-content packages/sub-pkg/other/other.ts initial modified +> vtt replace-file-content packages/sub-pkg/other/other.ts initial modified > vt run sub-pkg#sub-glob-test -~/packages/sub-pkg$ print-file src/sub.ts ◉ cache hit, replaying +~/packages/sub-pkg$ vtt print-file src/sub.ts ◉ cache hit, replaying export const sub = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob with cwd - glob relative to package not cwd.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob with cwd - glob relative to package not cwd.snap index 3ead4769..ea3c3e56 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob with cwd - glob relative to package not cwd.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots/subpackage glob with cwd - glob relative to package not cwd.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#sub-glob-with-cwd -~/packages/sub-pkg/src$ print-file sub.ts +~/packages/sub-pkg/src$ vtt print-file sub.ts export const sub = 'initial'; -> replace-file-content packages/sub-pkg/src/sub.ts initial modified +> vtt replace-file-content packages/sub-pkg/src/sub.ts initial modified > vt run sub-pkg#sub-glob-with-cwd -~/packages/sub-pkg/src$ print-file sub.ts ○ cache miss: 'packages/sub-pkg/src/sub.ts' modified, executing +~/packages/sub-pkg/src$ vtt print-file sub.ts ○ cache miss: 'packages/sub-pkg/src/sub.ts' modified, executing export const sub = 'modified'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/vite-task.json index 474decce..548da075 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/vite-task.json @@ -1,12 +1,12 @@ { "tasks": { "root-glob-test": { - "command": "print-file src/root.ts", + "command": "vtt print-file src/root.ts", "input": ["src/**/*.ts"], "cache": true }, "root-glob-with-cwd": { - "command": "print-file root.ts", + "command": "vtt print-file root.ts", "cwd": "src", "input": ["src/**/*.ts"], "cache": true diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/packages/other/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/packages/other/package.json index 2821c718..6bf03d25 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/packages/other/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/packages/other/package.json @@ -1,8 +1,8 @@ { "name": "other", "scripts": { - "check-tty": "check-tty", - "check-tty-cached": "check-tty", - "read-stdin": "read-stdin" + "check-tty": "vtt check-tty", + "check-tty-cached": "vtt check-tty", + "read-stdin": "vtt read-stdin" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache hit, replayed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache hit, replayed.snap index 128beaae..6893d63e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache hit, replayed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache hit, replayed.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=grouped -r check-tty-cached -[other#check-tty-cached] ~/packages/other$ check-tty +[other#check-tty-cached] ~/packages/other$ vtt check-tty ── [other#check-tty-cached] ── stdin:not-tty stdout:not-tty stderr:not-tty -[grouped-stdio-test#check-tty-cached] $ check-tty +[grouped-stdio-test#check-tty-cached] $ vtt check-tty ── [grouped-stdio-test#check-tty-cached] ── stdin:not-tty stdout:not-tty @@ -18,17 +18,17 @@ stderr:not-tty --- vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details) > vt run --log=grouped -r check-tty-cached -[other#check-tty-cached] ~/packages/other$ check-tty ◉ cache hit, replaying +[other#check-tty-cached] ~/packages/other$ vtt check-tty ◉ cache hit, replaying ── [other#check-tty-cached] ── stdin:not-tty stdout:not-tty stderr:not-tty -[grouped-stdio-test#check-tty-cached] $ check-tty ◉ cache hit, replaying +[grouped-stdio-test#check-tty-cached] $ vtt check-tty ◉ cache hit, replaying ── [grouped-stdio-test#check-tty-cached] ── stdin:not-tty stdout:not-tty stderr:not-tty --- -vt run: 2/2 cache hit (100%), saved. (Run `vt run --last-details` for full details) +vt run: 2/2 cache hit (100%). (Run `vt run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache miss, grouped output.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache miss, grouped output.snap index 39d55242..918bcec7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache miss, grouped output.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache miss, grouped output.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=grouped -r check-tty-cached -[other#check-tty-cached] ~/packages/other$ check-tty +[other#check-tty-cached] ~/packages/other$ vtt check-tty ── [other#check-tty-cached] ── stdin:not-tty stdout:not-tty stderr:not-tty -[grouped-stdio-test#check-tty-cached] $ check-tty +[grouped-stdio-test#check-tty-cached] $ vtt check-tty ── [grouped-stdio-test#check-tty-cached] ── stdin:not-tty stdout:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache off, grouped output.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache off, grouped output.snap index d1093984..31313239 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache off, grouped output.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache off, grouped output.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=grouped -r check-tty -[other#check-tty] ~/packages/other$ check-tty +[other#check-tty] ~/packages/other$ vtt check-tty ── [other#check-tty] ── stdin:not-tty stdout:not-tty stderr:not-tty -[grouped-stdio-test#check-tty] $ check-tty ⊘ cache disabled +[grouped-stdio-test#check-tty] $ vtt check-tty ⊘ cache disabled ── [grouped-stdio-test#check-tty] ── stdin:not-tty stdout:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache hit, replayed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache hit, replayed.snap index 75b09a8e..da4b3f9c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache hit, replayed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache hit, replayed.snap @@ -3,17 +3,17 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=grouped check-tty-cached -[grouped-stdio-test#check-tty-cached] $ check-tty +[grouped-stdio-test#check-tty-cached] $ vtt check-tty ── [grouped-stdio-test#check-tty-cached] ── stdin:not-tty stdout:not-tty stderr:not-tty > vt run --log=grouped check-tty-cached -[grouped-stdio-test#check-tty-cached] $ check-tty ◉ cache hit, replaying +[grouped-stdio-test#check-tty-cached] $ vtt check-tty ◉ cache hit, replaying ── [grouped-stdio-test#check-tty-cached] ── stdin:not-tty stdout:not-tty stderr:not-tty --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache miss, grouped output.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache miss, grouped output.snap index eb058679..d6847f92 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache miss, grouped output.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache miss, grouped output.snap @@ -3,7 +3,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=grouped check-tty-cached -[grouped-stdio-test#check-tty-cached] $ check-tty +[grouped-stdio-test#check-tty-cached] $ vtt check-tty ── [grouped-stdio-test#check-tty-cached] ── stdin:not-tty stdout:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache off, grouped output.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache off, grouped output.snap index e2078511..78f7277a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache off, grouped output.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/single task, cache off, grouped output.snap @@ -3,7 +3,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=grouped check-tty -[grouped-stdio-test#check-tty] $ check-tty ⊘ cache disabled +[grouped-stdio-test#check-tty] $ vtt check-tty ⊘ cache disabled ── [grouped-stdio-test#check-tty] ── stdin:not-tty stdout:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/stdin is always null.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/stdin is always null.snap index 37320def..0e6c51c7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/stdin is always null.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/stdin is always null.snap @@ -3,4 +3,4 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > echo from-stdin | vt run --log=grouped read-stdin -[grouped-stdio-test#read-stdin] $ read-stdin ⊘ cache disabled +[grouped-stdio-test#read-stdin] $ vtt read-stdin ⊘ cache disabled diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/vite-task.json index 938ac52e..9f6a560f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/vite-task.json @@ -2,19 +2,19 @@ "cache": true, "tasks": { "check-tty": { - "command": "check-tty", + "command": "vtt check-tty", "cache": false }, "check-tty-cached": { - "command": "check-tty", + "command": "vtt check-tty", "cache": true }, "read-stdin": { - "command": "read-stdin", + "command": "vtt read-stdin", "cache": false }, "read-stdin-cached": { - "command": "read-stdin", + "command": "vtt read-stdin", "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/package.json index 9df11742..bd4ec99f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/package.json @@ -1,5 +1,5 @@ { "scripts": { - "say": "print" + "say": "vtt print" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap index 65dcf9c2..b056865f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap @@ -3,20 +3,20 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run say a # cache miss -$ print a +$ vtt print a a > vt run say b # cache miss, different args -$ print b +$ vtt print b b > vt run say a # cache hit -$ print a ◉ cache hit, replaying +$ vtt print a ◉ cache hit, replaying a --- -vt run: cache hit, saved. +vt run: cache hit. > vt run say b # cache hit -$ print b ◉ cache hit, replaying +$ vtt print b ◉ cache hit, replaying b --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots/individual cache for env.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots/individual cache for env.snap index 0dd32fa6..ea5ccb0a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots/individual cache for env.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots/individual cache for env.snap @@ -3,20 +3,20 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > FOO=1 vt run hello # cache miss -$ print-env FOO +$ vtt print-env FOO 1 > FOO=2 vt run hello # cache miss, different env -$ print-env FOO ○ cache miss: envs changed, executing +$ vtt print-env FOO ○ cache miss: envs changed, executing 2 > FOO=1 vt run hello # cache hit -$ print-env FOO ◉ cache hit, replaying +$ vtt print-env FOO ◉ cache hit, replaying 1 --- -vt run: cache hit, saved. +vt run: cache hit. > FOO=2 vt run hello # cache hit -$ print-env FOO ◉ cache hit, replaying +$ vtt print-env FOO ◉ cache hit, replaying 2 --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/vite-task.json index 95c16136..b4cb0e1b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/vite-task.json @@ -2,7 +2,7 @@ "cache": true, "tasks": { "hello": { - "command": "print-env FOO", + "command": "vtt print-env FOO", "env": ["FOO"], "cache": true } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml index 10294938..8827fd18 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml @@ -18,7 +18,7 @@ steps = [ # Initial run "vt run positive-globs-only", # Modify a file that matches the glob - "replace-file-content src/main.ts initial modified", + "vtt replace-file-content src/main.ts initial modified", # Cache miss: matched file changed "vt run positive-globs-only", ] @@ -29,7 +29,7 @@ steps = [ # Initial run "vt run positive-globs-only", # Modify a file that does NOT match the glob (test/ is outside src/) - "replace-file-content test/main.test.ts outside modified", + "vtt replace-file-content test/main.test.ts outside modified", # Cache hit: file not in input "vt run positive-globs-only", ] @@ -43,7 +43,7 @@ steps = [ # Initial run - reads both src/main.ts and src/utils.ts "vt run positive-globs-reads-unmatched", # Modify utils.ts - read by command but NOT in glob - "replace-file-content src/utils.ts initial modified", + "vtt replace-file-content src/utils.ts initial modified", # Cache hit: file was read but not matched by glob, inference is off "vt run positive-globs-reads-unmatched", ] @@ -57,7 +57,7 @@ steps = [ # Initial run "vt run positive-negative-globs", # Modify a file that matches positive but NOT negative - "replace-file-content src/main.ts initial modified", + "vtt replace-file-content src/main.ts initial modified", # Cache miss: file changed "vt run positive-negative-globs", ] @@ -68,7 +68,7 @@ steps = [ # Initial run "vt run positive-negative-globs", # Modify a file that matches the negative glob (excluded) - "replace-file-content src/main.test.ts main modified", + "vtt replace-file-content src/main.test.ts main modified", # Cache hit: file excluded by negative glob "vt run positive-negative-globs", ] @@ -82,7 +82,7 @@ steps = [ # Initial run - reads src/main.ts "vt run auto-only", # Modify the file that was read - "replace-file-content src/main.ts initial modified", + "vtt replace-file-content src/main.ts initial modified", # Cache miss: inferred input changed "vt run auto-only", ] @@ -93,7 +93,7 @@ steps = [ # Initial run - reads src/main.ts (NOT utils.ts) "vt run auto-only", # Modify a file that was NOT read by the command - "replace-file-content src/utils.ts initial modified", + "vtt replace-file-content src/utils.ts initial modified", # Cache hit: file not in inferred input "vt run auto-only", ] @@ -107,7 +107,7 @@ steps = [ # Initial run - reads both src/main.ts and dist/output.js "vt run auto-with-negative", # Modify file in excluded directory (dist/) - "replace-file-content dist/output.js initial modified", + "vtt replace-file-content dist/output.js initial modified", # Cache hit: dist/ is excluded by negative glob "vt run auto-with-negative", ] @@ -118,7 +118,7 @@ steps = [ # Initial run "vt run auto-with-negative", # Modify file NOT in excluded directory - "replace-file-content src/main.ts initial modified", + "vtt replace-file-content src/main.ts initial modified", # Cache miss: inferred input changed "vt run auto-with-negative", ] @@ -132,7 +132,7 @@ steps = [ # Initial run "vt run positive-auto-negative", # Modify explicit input file - "replace-file-content package.json inputs-cache-test modified-pkg", + "vtt replace-file-content package.json inputs-cache-test modified-pkg", # Cache miss: explicit input changed "vt run positive-auto-negative", ] @@ -143,7 +143,7 @@ steps = [ # Initial run "vt run positive-auto-negative", # Modify inferred input file (read by command) - "replace-file-content src/main.ts initial modified", + "vtt replace-file-content src/main.ts initial modified", # Cache miss: inferred input changed "vt run positive-auto-negative", ] @@ -154,7 +154,7 @@ steps = [ # Initial run "vt run positive-auto-negative", # Modify file excluded by negative glob - "replace-file-content src/main.test.ts main modified", + "vtt replace-file-content src/main.test.ts main modified", # Cache hit: file excluded by negative glob "vt run positive-auto-negative", ] @@ -168,7 +168,7 @@ steps = [ # Initial run "vt run empty-inputs", # Modify any file - should NOT affect cache - "replace-file-content src/main.ts initial modified", + "vtt replace-file-content src/main.ts initial modified", # Cache hit: no input configured "vt run empty-inputs", ] @@ -179,7 +179,7 @@ steps = [ # Initial run "vt run empty-inputs", # Change the command - "json-edit vite-task.json \"_.tasks['empty-inputs'].command = 'print-file src/utils.ts'\"", + "vtt replace-file-content vite-task.json 'vtt print-file ./src/main.ts' 'vtt print-file src/utils.ts'", # Cache miss: command changed "vt run empty-inputs", ] @@ -210,14 +210,14 @@ name = "folder slash input - miss on direct and nested file changes" steps = [ "vt run folder-slash-input", # Modify a direct file in src/ - "replace-file-content src/main.ts initial modified", + "vtt replace-file-content src/main.ts initial modified", # Cache miss: direct file changed "vt run folder-slash-input", # Reset and run again to re-establish cache - "replace-file-content src/main.ts modified initial", + "vtt replace-file-content src/main.ts modified initial", "vt run folder-slash-input", # Modify a nested file in src/sub/ - "replace-file-content src/sub/nested.ts initial modified", + "vtt replace-file-content src/sub/nested.ts initial modified", # Cache miss: nested file changed "vt run folder-slash-input", ] @@ -227,7 +227,7 @@ name = "folder slash input - hit on file outside directory" steps = [ "vt run folder-slash-input", # Modify a file outside src/ - "replace-file-content test/main.test.ts outside modified", + "vtt replace-file-content test/main.test.ts outside modified", # Cache hit: file not under src/ "vt run folder-slash-input", ] @@ -240,7 +240,7 @@ name = "folder input - hit despite file changes and folder deletion" steps = [ "vt run folder-input", # Modify a file inside the folder - "replace-file-content src/main.ts initial modified", + "vtt replace-file-content src/main.ts initial modified", # Cache hit: "src" matches the directory itself, not files inside it "vt run folder-input", # Delete the entire folder diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - hit on non-inferred file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - hit on non-inferred file change.snap index ea45c163..63657482 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - hit on non-inferred file change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - hit on non-inferred file change.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run auto-only -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content src/utils.ts initial modified +> vtt replace-file-content src/utils.ts initial modified > vt run auto-only -$ print-file src/main.ts ◉ cache hit, replaying +$ vtt print-file src/main.ts ◉ cache hit, replaying export const main = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - miss on inferred file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - miss on inferred file change.snap index 3083040a..b91b093c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - miss on inferred file change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto only - miss on inferred file change.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run auto-only -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content src/main.ts initial modified +> vtt replace-file-content src/main.ts initial modified > vt run auto-only -$ print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing +$ vtt print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing export const main = 'modified'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - hit on excluded inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - hit on excluded inferred file.snap index 790b08ac..6dca9c9d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - hit on excluded inferred file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - hit on excluded inferred file.snap @@ -3,15 +3,15 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run auto-with-negative -$ print-file src/main.ts dist/output.js +$ vtt print-file src/main.ts dist/output.js export const main = 'initial'; // initial output -> replace-file-content dist/output.js initial modified +> vtt replace-file-content dist/output.js initial modified > vt run auto-with-negative -$ print-file src/main.ts dist/output.js ◉ cache hit, replaying +$ vtt print-file src/main.ts dist/output.js ◉ cache hit, replaying export const main = 'initial'; // initial output --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - miss on non-excluded inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - miss on non-excluded inferred file.snap index 730e6d18..f3dc88e3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - miss on non-excluded inferred file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/auto with negative - miss on non-excluded inferred file.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run auto-with-negative -$ print-file src/main.ts dist/output.js +$ vtt print-file src/main.ts dist/output.js export const main = 'initial'; // initial output -> replace-file-content src/main.ts initial modified +> vtt replace-file-content src/main.ts initial modified > vt run auto-with-negative -$ print-file src/main.ts dist/output.js ○ cache miss: 'src/main.ts' modified, executing +$ vtt print-file src/main.ts dist/output.js ○ cache miss: 'src/main.ts' modified, executing export const main = 'modified'; // initial output diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - hit despite file changes.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - hit despite file changes.snap index fe718d0f..3f905608 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - hit despite file changes.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - hit despite file changes.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run empty-inputs -$ print-file src/main.ts +$ vtt print-file ./src/main.ts export const main = 'initial'; -> replace-file-content src/main.ts initial modified +> vtt replace-file-content src/main.ts initial modified > vt run empty-inputs -$ print-file src/main.ts ◉ cache hit, replaying +$ vtt print-file ./src/main.ts ◉ cache hit, replaying export const main = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - miss on command change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - miss on command change.snap index 7f401f02..a6da829a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - miss on command change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/empty input - miss on command change.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run empty-inputs -$ print-file src/main.ts +$ vtt print-file ./src/main.ts export const main = 'initial'; -> json-edit vite-task.json "_.tasks['empty-inputs'].command = 'print-file src/utils.ts'" +> vtt replace-file-content vite-task.json 'vtt print-file ./src/main.ts' 'vtt print-file src/utils.ts' > vt run empty-inputs -$ print-file src/utils.ts ○ cache miss: args changed, executing +$ vtt print-file src/utils.ts ○ cache miss: args changed, executing export const utils = 'initial'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap index 51c09946..7e376322 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap @@ -3,21 +3,21 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run folder-input -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content src/main.ts initial modified +> vtt replace-file-content src/main.ts initial modified > vt run folder-input -$ print-file src/main.ts ◉ cache hit, replaying +$ vtt print-file src/main.ts ◉ cache hit, replaying export const main = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. > rm -rf src > vt run folder-input -$ print-file src/main.ts ◉ cache hit, replaying +$ vtt print-file src/main.ts ◉ cache hit, replaying export const main = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - hit on file outside directory.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - hit on file outside directory.snap index 7409195f..ee1fbe2d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - hit on file outside directory.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - hit on file outside directory.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run folder-slash-input -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content test/main.test.ts outside modified +> vtt replace-file-content test/main.test.ts outside modified > vt run folder-slash-input -$ print-file src/main.ts ◉ cache hit, replaying +$ vtt print-file src/main.ts ◉ cache hit, replaying export const main = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - miss on direct and nested file changes.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - miss on direct and nested file changes.snap index a8c00328..068d0d65 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - miss on direct and nested file changes.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder slash input - miss on direct and nested file changes.snap @@ -3,20 +3,20 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run folder-slash-input -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content src/main.ts initial modified +> vtt replace-file-content src/main.ts initial modified > vt run folder-slash-input -$ print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing +$ vtt print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing export const main = 'modified'; -> replace-file-content src/main.ts modified initial +> vtt replace-file-content src/main.ts modified initial > vt run folder-slash-input -$ print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing +$ vtt print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing export const main = 'initial'; -> replace-file-content src/sub/nested.ts initial modified +> vtt replace-file-content src/sub/nested.ts initial modified > vt run folder-slash-input -$ print-file src/main.ts ○ cache miss: 'src/sub/nested.ts' modified, executing +$ vtt print-file src/main.ts ○ cache miss: 'src/sub/nested.ts' modified, executing export const main = 'initial'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - not set when auto inference disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - not set when auto inference disabled.snap index ac61b85e..6e120632 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - not set when auto inference disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - not set when auto inference disabled.snap @@ -3,5 +3,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run check-fspy-env-without-auto -$ print-env FSPY +$ vtt print-env FSPY (undefined) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - set when auto inference enabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - set when auto inference enabled.snap index d24a078f..abf2faef 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - set when auto inference enabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/fspy env - set when auto inference enabled.snap @@ -3,5 +3,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run check-fspy-env-with-auto -$ print-env FSPY +$ vtt print-env FSPY 1 diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - hit on excluded file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - hit on excluded file.snap index f28712aa..b6e32bc5 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - hit on excluded file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - hit on excluded file.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run positive-auto-negative -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content src/main.test.ts main modified +> vtt replace-file-content src/main.test.ts main modified > vt run positive-auto-negative -$ print-file src/main.ts ◉ cache hit, replaying +$ vtt print-file src/main.ts ◉ cache hit, replaying export const main = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on explicit glob file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on explicit glob file.snap index 2a35c6cd..df02c2f9 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on explicit glob file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on explicit glob file.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run positive-auto-negative -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content package.json inputs-cache-test modified-pkg +> vtt replace-file-content package.json inputs-cache-test modified-pkg > vt run positive-auto-negative -$ print-file src/main.ts ○ cache miss: 'package.json' modified, executing +$ vtt print-file src/main.ts ○ cache miss: 'package.json' modified, executing export const main = 'initial'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on inferred file.snap index faf3ed91..1a9dd120 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on inferred file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive auto negative - miss on inferred file.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run positive-auto-negative -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content src/main.ts initial modified +> vtt replace-file-content src/main.ts initial modified > vt run positive-auto-negative -$ print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing +$ vtt print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing export const main = 'modified'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs - hit on read but unmatched file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs - hit on read but unmatched file.snap index cd0ee480..ef72290b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs - hit on read but unmatched file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs - hit on read but unmatched file.snap @@ -3,15 +3,15 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run positive-globs-reads-unmatched -$ print-file src/main.ts src/utils.ts +$ vtt print-file src/main.ts src/utils.ts export const main = 'initial'; export const utils = 'initial'; -> replace-file-content src/utils.ts initial modified +> vtt replace-file-content src/utils.ts initial modified > vt run positive-globs-reads-unmatched -$ print-file src/main.ts src/utils.ts ◉ cache hit, replaying +$ vtt print-file src/main.ts src/utils.ts ◉ cache hit, replaying export const main = 'initial'; export const utils = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - cache hit on second run.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - cache hit on second run.snap index b01a27b0..65847426 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - cache hit on second run.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - cache hit on second run.snap @@ -3,11 +3,11 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run positive-globs-only -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; > vt run positive-globs-only -$ print-file src/main.ts ◉ cache hit, replaying +$ vtt print-file src/main.ts ◉ cache hit, replaying export const main = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - hit on unmatched file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - hit on unmatched file change.snap index 58bab9d3..4bfde2c2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - hit on unmatched file change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - hit on unmatched file change.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run positive-globs-only -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content test/main.test.ts outside modified +> vtt replace-file-content test/main.test.ts outside modified > vt run positive-globs-only -$ print-file src/main.ts ◉ cache hit, replaying +$ vtt print-file src/main.ts ◉ cache hit, replaying export const main = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - miss on matched file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - miss on matched file change.snap index 4c16b7ea..eec0d0d4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - miss on matched file change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive globs only - miss on matched file change.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run positive-globs-only -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content src/main.ts initial modified +> vtt replace-file-content src/main.ts initial modified > vt run positive-globs-only -$ print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing +$ vtt print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing export const main = 'modified'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - hit on excluded file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - hit on excluded file.snap index 9832788c..2fc29600 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - hit on excluded file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - hit on excluded file.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run positive-negative-globs -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content src/main.test.ts main modified +> vtt replace-file-content src/main.test.ts main modified > vt run positive-negative-globs -$ print-file src/main.ts ◉ cache hit, replaying +$ vtt print-file src/main.ts ◉ cache hit, replaying export const main = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - miss on non-excluded file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - miss on non-excluded file.snap index 50e6be3c..10b8982d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - miss on non-excluded file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/positive negative globs - miss on non-excluded file.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run positive-negative-globs -$ print-file src/main.ts +$ vtt print-file src/main.ts export const main = 'initial'; -> replace-file-content src/main.ts initial modified +> vtt replace-file-content src/main.ts initial modified > vt run positive-negative-globs -$ print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing +$ vtt print-file src/main.ts ○ cache miss: 'src/main.ts' modified, executing export const main = 'modified'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/vite-task.json index bdd9882c..53128ec3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/vite-task.json @@ -1,57 +1,76 @@ { "tasks": { "positive-globs-only": { - "command": "print-file src/main.ts", + "command": "vtt print-file src/main.ts", "input": ["src/**/*.ts"], "cache": true }, "positive-globs-reads-unmatched": { - "command": "print-file src/main.ts src/utils.ts", + "command": "vtt print-file src/main.ts src/utils.ts", "input": ["src/main.ts"], "cache": true }, "positive-negative-globs": { - "command": "print-file src/main.ts", + "command": "vtt print-file src/main.ts", "input": ["src/**", "!src/**/*.test.ts"], "cache": true }, "auto-only": { - "command": "print-file src/main.ts", - "input": [{ "auto": true }], + "command": "vtt print-file src/main.ts", + "input": [ + { + "auto": true + } + ], "cache": true }, "auto-with-negative": { - "command": "print-file src/main.ts dist/output.js", - "input": [{ "auto": true }, "!dist/**"], + "command": "vtt print-file src/main.ts dist/output.js", + "input": [ + { + "auto": true + }, + "!dist/**" + ], "cache": true }, "positive-auto-negative": { - "command": "print-file src/main.ts", - "input": ["package.json", { "auto": true }, "!src/**/*.test.ts"], + "command": "vtt print-file src/main.ts", + "input": [ + "package.json", + { + "auto": true + }, + "!src/**/*.test.ts" + ], "cache": true }, "empty-inputs": { - "command": "print-file src/main.ts", + "command": "vtt print-file ./src/main.ts", "input": [], "cache": true }, "check-fspy-env-with-auto": { - "command": "print-env FSPY", - "input": [{ "auto": true }], + "command": "vtt print-env FSPY", + "input": [ + { + "auto": true + } + ], "cache": true }, "check-fspy-env-without-auto": { - "command": "print-env FSPY", + "command": "vtt print-env FSPY", "input": ["src/**/*.ts"], "cache": true }, "folder-input": { - "command": "print-file src/main.ts", + "command": "vtt print-file src/main.ts", "input": ["src"], "cache": true }, "folder-slash-input": { - "command": "print-file src/main.ts", + "command": "vtt print-file src/main.ts", "input": ["src/"], "cache": true } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/vite-task.json index e09c87a3..788aec26 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/packages/[lib]/vite-task.json @@ -1,7 +1,7 @@ { "tasks": { "build": { - "command": "print-file src/main.ts", + "command": "vtt print-file src/main.ts", "input": ["src/**/*.ts"], "cache": true } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots.toml index c597843e..3a63506b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots.toml @@ -7,6 +7,6 @@ name = "cache hit then miss on file change" steps = [ "vt run [lib]#build", "vt run [lib]#build", - "replace-file-content packages/[lib]/src/main.ts initial modified", + "vtt replace-file-content packages/[lib]/src/main.ts initial modified", "vt run [lib]#build", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots/cache hit then miss on file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots/cache hit then miss on file change.snap index a3758a9c..c0a9a130 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots/cache hit then miss on file change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots/cache hit then miss on file change.snap @@ -3,16 +3,16 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run [lib]#build -~/packages/[lib]$ print-file src/main.ts +~/packages/[lib]$ vtt print-file src/main.ts export const lib = 'initial'; > vt run [lib]#build -~/packages/[lib]$ print-file src/main.ts ◉ cache hit, replaying +~/packages/[lib]$ vtt print-file src/main.ts ◉ cache hit, replaying export const lib = 'initial'; --- -vt run: cache hit, saved. -> replace-file-content packages/[lib]/src/main.ts initial modified +vt run: cache hit. +> vtt replace-file-content packages/[lib]/src/main.ts initial modified > vt run [lib]#build -~/packages/[lib]$ print-file src/main.ts ○ cache miss: 'packages/[lib]/src/main.ts' modified, executing +~/packages/[lib]$ vtt print-file src/main.ts ○ cache miss: 'packages/[lib]/src/main.ts' modified, executing export const lib = 'modified'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/vite-task.json index e3842a24..7236a771 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/packages/sub-pkg/vite-task.json @@ -1,23 +1,33 @@ { "tasks": { "auto-with-negative": { - "command": "print-file src/main.ts dist/output.js", - "input": [{ "auto": true }, "!dist/**"], + "command": "vtt print-file src/main.ts dist/output.js", + "input": [ + { + "auto": true + }, + "!dist/**" + ], "cache": true }, "dotdot-positive": { - "command": "print-file ../shared/src/utils.ts", + "command": "vtt print-file ../shared/src/utils.ts", "input": ["../shared/src/**"], "cache": true }, "dotdot-positive-negative": { - "command": "print-file ../shared/src/utils.ts ../shared/dist/output.js", + "command": "vtt print-file ../shared/src/utils.ts ../shared/dist/output.js", "input": ["../shared/**", "!../shared/dist/**"], "cache": true }, "dotdot-auto-negative": { - "command": "print-file ../shared/src/utils.ts ../shared/dist/output.js", - "input": [{ "auto": true }, "!../shared/dist/**"], + "command": "vtt print-file ../shared/src/utils.ts ../shared/dist/output.js", + "input": [ + { + "auto": true + }, + "!../shared/dist/**" + ], "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml index fb3f32d2..dc131685 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml @@ -12,7 +12,7 @@ steps = [ # First run - reads both src/main.ts and dist/output.js "vt run sub-pkg#auto-with-negative", # Modify file in excluded directory (dist/) - "replace-file-content packages/sub-pkg/dist/output.js initial modified", + "vtt replace-file-content packages/sub-pkg/dist/output.js initial modified", # Cache hit: dist/ is excluded by negative glob "vt run sub-pkg#auto-with-negative", ] @@ -23,7 +23,7 @@ steps = [ # First run "vt run sub-pkg#auto-with-negative", # Modify file NOT in excluded directory - "replace-file-content packages/sub-pkg/src/main.ts initial modified", + "vtt replace-file-content packages/sub-pkg/src/main.ts initial modified", # Cache miss: inferred input changed "vt run sub-pkg#auto-with-negative", ] @@ -36,7 +36,7 @@ name = "dotdot positive glob - miss on sibling file change" steps = [ "vt run sub-pkg#dotdot-positive", # Modify a file that matches ../shared/src/** - "replace-file-content packages/shared/src/utils.ts initial modified", + "vtt replace-file-content packages/shared/src/utils.ts initial modified", # Cache miss: matched file changed "vt run sub-pkg#dotdot-positive", ] @@ -46,7 +46,7 @@ name = "dotdot positive glob - hit on unmatched file change" steps = [ "vt run sub-pkg#dotdot-positive", # Modify a file NOT matched by ../shared/src/** - "replace-file-content packages/shared/dist/output.js initial modified", + "vtt replace-file-content packages/shared/dist/output.js initial modified", # Cache hit: file not in input "vt run sub-pkg#dotdot-positive", ] @@ -59,7 +59,7 @@ name = "dotdot positive negative - miss on non-excluded sibling file" steps = [ "vt run sub-pkg#dotdot-positive-negative", # Modify file matching positive but NOT negative - "replace-file-content packages/shared/src/utils.ts initial modified", + "vtt replace-file-content packages/shared/src/utils.ts initial modified", # Cache miss: file changed "vt run sub-pkg#dotdot-positive-negative", ] @@ -69,7 +69,7 @@ name = "dotdot positive negative - hit on excluded sibling file" steps = [ "vt run sub-pkg#dotdot-positive-negative", # Modify file in excluded sibling dist/ - "replace-file-content packages/shared/dist/output.js initial modified", + "vtt replace-file-content packages/shared/dist/output.js initial modified", # Cache hit: excluded by !../shared/dist/** "vt run sub-pkg#dotdot-positive-negative", ] @@ -82,7 +82,7 @@ name = "dotdot auto negative - hit on excluded sibling inferred file" steps = [ "vt run sub-pkg#dotdot-auto-negative", # Modify file in excluded sibling dist/ - "replace-file-content packages/shared/dist/output.js initial modified", + "vtt replace-file-content packages/shared/dist/output.js initial modified", # Cache hit: excluded by !../shared/dist/** "vt run sub-pkg#dotdot-auto-negative", ] @@ -92,7 +92,7 @@ name = "dotdot auto negative - miss on non-excluded sibling inferred file" steps = [ "vt run sub-pkg#dotdot-auto-negative", # Modify non-excluded sibling file - "replace-file-content packages/shared/src/utils.ts initial modified", + "vtt replace-file-content packages/shared/src/utils.ts initial modified", # Cache miss: inferred input changed "vt run sub-pkg#dotdot-auto-negative", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - hit on excluded sibling inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - hit on excluded sibling inferred file.snap index a93f7d40..8f4290e4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - hit on excluded sibling inferred file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - hit on excluded sibling inferred file.snap @@ -3,15 +3,15 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#dotdot-auto-negative -~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.js +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts ../shared/dist/output.js export const shared = 'initial'; // initial output -> replace-file-content packages/shared/dist/output.js initial modified +> vtt replace-file-content packages/shared/dist/output.js initial modified > vt run sub-pkg#dotdot-auto-negative -~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.js ◉ cache hit, replaying +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts ../shared/dist/output.js ◉ cache hit, replaying export const shared = 'initial'; // initial output --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap index 47c92fca..1722f033 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#dotdot-auto-negative -~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.js +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts ../shared/dist/output.js export const shared = 'initial'; // initial output -> replace-file-content packages/shared/src/utils.ts initial modified +> vtt replace-file-content packages/shared/src/utils.ts initial modified > vt run sub-pkg#dotdot-auto-negative -~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.js ○ cache miss: 'packages/shared/src/utils.ts' modified, executing +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts ../shared/dist/output.js ○ cache miss: 'packages/shared/src/utils.ts' modified, executing export const shared = 'modified'; // initial output diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - hit on unmatched file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - hit on unmatched file change.snap index 12f6b662..68d69088 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - hit on unmatched file change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - hit on unmatched file change.snap @@ -3,13 +3,13 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#dotdot-positive -~/packages/sub-pkg$ print-file ../shared/src/utils.ts +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts export const shared = 'initial'; -> replace-file-content packages/shared/dist/output.js initial modified +> vtt replace-file-content packages/shared/dist/output.js initial modified > vt run sub-pkg#dotdot-positive -~/packages/sub-pkg$ print-file ../shared/src/utils.ts ◉ cache hit, replaying +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts ◉ cache hit, replaying export const shared = 'initial'; --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - miss on sibling file change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - miss on sibling file change.snap index 42770fcc..69dca92c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - miss on sibling file change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive glob - miss on sibling file change.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#dotdot-positive -~/packages/sub-pkg$ print-file ../shared/src/utils.ts +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts export const shared = 'initial'; -> replace-file-content packages/shared/src/utils.ts initial modified +> vtt replace-file-content packages/shared/src/utils.ts initial modified > vt run sub-pkg#dotdot-positive -~/packages/sub-pkg$ print-file ../shared/src/utils.ts ○ cache miss: 'packages/shared/src/utils.ts' modified, executing +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts ○ cache miss: 'packages/shared/src/utils.ts' modified, executing export const shared = 'modified'; diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - hit on excluded sibling file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - hit on excluded sibling file.snap index aeedbaf9..cc6d22f6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - hit on excluded sibling file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - hit on excluded sibling file.snap @@ -3,15 +3,15 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#dotdot-positive-negative -~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.js +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts ../shared/dist/output.js export const shared = 'initial'; // initial output -> replace-file-content packages/shared/dist/output.js initial modified +> vtt replace-file-content packages/shared/dist/output.js initial modified > vt run sub-pkg#dotdot-positive-negative -~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.js ◉ cache hit, replaying +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts ../shared/dist/output.js ◉ cache hit, replaying export const shared = 'initial'; // initial output --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - miss on non-excluded sibling file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - miss on non-excluded sibling file.snap index aaf42157..acb2029d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - miss on non-excluded sibling file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/dotdot positive negative - miss on non-excluded sibling file.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#dotdot-positive-negative -~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.js +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts ../shared/dist/output.js export const shared = 'initial'; // initial output -> replace-file-content packages/shared/src/utils.ts initial modified +> vtt replace-file-content packages/shared/src/utils.ts initial modified > vt run sub-pkg#dotdot-positive-negative -~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.js ○ cache miss: 'packages/shared/src/utils.ts' modified, executing +~/packages/sub-pkg$ vtt print-file ../shared/src/utils.ts ../shared/dist/output.js ○ cache miss: 'packages/shared/src/utils.ts' modified, executing export const shared = 'modified'; // initial output diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - hit on excluded inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - hit on excluded inferred file.snap index 293f3083..2943696e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - hit on excluded inferred file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - hit on excluded inferred file.snap @@ -3,15 +3,15 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#auto-with-negative -~/packages/sub-pkg$ print-file src/main.ts dist/output.js +~/packages/sub-pkg$ vtt print-file src/main.ts dist/output.js export const main = 'initial'; // initial output -> replace-file-content packages/sub-pkg/dist/output.js initial modified +> vtt replace-file-content packages/sub-pkg/dist/output.js initial modified > vt run sub-pkg#auto-with-negative -~/packages/sub-pkg$ print-file src/main.ts dist/output.js ◉ cache hit, replaying +~/packages/sub-pkg$ vtt print-file src/main.ts dist/output.js ◉ cache hit, replaying export const main = 'initial'; // initial output --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - miss on non-excluded inferred file.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - miss on non-excluded inferred file.snap index 4d383241..386cbb95 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - miss on non-excluded inferred file.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots/subpackage auto with negative - miss on non-excluded inferred file.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run sub-pkg#auto-with-negative -~/packages/sub-pkg$ print-file src/main.ts dist/output.js +~/packages/sub-pkg$ vtt print-file src/main.ts dist/output.js export const main = 'initial'; // initial output -> replace-file-content packages/sub-pkg/src/main.ts initial modified +> vtt replace-file-content packages/sub-pkg/src/main.ts initial modified > vt run sub-pkg#auto-with-negative -~/packages/sub-pkg$ print-file src/main.ts dist/output.js ○ cache miss: 'packages/sub-pkg/src/main.ts' modified, executing +~/packages/sub-pkg$ vtt print-file src/main.ts dist/output.js ○ cache miss: 'packages/sub-pkg/src/main.ts' modified, executing export const main = 'modified'; // initial output diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/normal-pkg/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/normal-pkg/package.json index 36d604f3..ed1631df 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/normal-pkg/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/normal-pkg/package.json @@ -1,6 +1,6 @@ { "name": "@test/normal-pkg", "scripts": { - "task": "print hello" + "task": "vtt print hello" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/rw-pkg/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/rw-pkg/package.json index 88a7b0e0..69c53cf2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/rw-pkg/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/rw-pkg/package.json @@ -1,7 +1,7 @@ { "name": "@test/rw-pkg", "scripts": { - "task": "replace-file-content src/data.txt original modified" + "task": "vtt replace-file-content src/data.txt i !" }, "dependencies": { "@test/normal-pkg": "workspace:*" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/touch-pkg/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/touch-pkg/package.json index a34c6a22..80fee6fb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/touch-pkg/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/packages/touch-pkg/package.json @@ -1,6 +1,6 @@ { "name": "@test/touch-pkg", "scripts": { - "task": "touch-file src/data.txt" + "task": "vtt touch-file src/data.txt" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots.toml index 33301f5d..9db4c0dd 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots.toml @@ -1,5 +1,5 @@ # Tests that tasks modifying their own inputs (read-write overlap) are not cached. -# replace-file-content reads then writes the same file — fspy detects both. +# vtt replace-file-content reads then writes the same file — fspy detects both. # Single rw-task: compact summary shows "not cached because it modified its input" [[e2e]] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/multi task with read-write shows not cached in summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/multi task with read-write shows not cached in summary.snap index 290be903..0049752b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/multi task with read-write shows not cached in summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/multi task with read-write shows not cached in summary.snap @@ -3,22 +3,22 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run -r task -~/packages/normal-pkg$ print hello +~/packages/normal-pkg$ vtt print hello hello -~/packages/touch-pkg$ touch-file src/data.txt +~/packages/touch-pkg$ vtt touch-file src/data.txt -~/packages/rw-pkg$ replace-file-content src/data.txt original modified +~/packages/rw-pkg$ vtt replace-file-content src/data.txt i ! --- vt run: 0/3 cache hit (0%). @test/touch-pkg#task (and 1 more) not cached because they modified their inputs. (Run `vt run --last-details` for full details) > vt run -r task -~/packages/normal-pkg$ print hello ◉ cache hit, replaying +~/packages/normal-pkg$ vtt print hello ◉ cache hit, replaying hello -~/packages/touch-pkg$ touch-file src/data.txt +~/packages/touch-pkg$ vtt touch-file src/data.txt -~/packages/rw-pkg$ replace-file-content src/data.txt original modified +~/packages/rw-pkg$ vtt replace-file-content src/data.txt i ! --- -vt run: 1/3 cache hit (33%), saved. @test/touch-pkg#task (and 1 more) not cached because they modified their inputs. (Run `vt run --last-details` for full details) +vt run: 1/3 cache hit (33%). @test/touch-pkg#task (and 1 more) not cached because they modified their inputs. (Run `vt run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/single O_RDWR open is not cached.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/single O_RDWR open is not cached.snap index 5b506d1f..9f8ba0c5 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/single O_RDWR open is not cached.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/single O_RDWR open is not cached.snap @@ -5,12 +5,12 @@ info: cwd: packages/touch-pkg --- > vt run task -~/packages/touch-pkg$ touch-file src/data.txt +~/packages/touch-pkg$ vtt touch-file src/data.txt --- vt run: @test/touch-pkg#task not cached because it modified its input. (Run `vt run --last-details` for full details) > vt run task -~/packages/touch-pkg$ touch-file src/data.txt +~/packages/touch-pkg$ vtt touch-file src/data.txt --- vt run: @test/touch-pkg#task not cached because it modified its input. (Run `vt run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/single read-write task shows not cached message.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/single read-write task shows not cached message.snap index f4235b0b..e2f48659 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/single read-write task shows not cached message.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/single read-write task shows not cached message.snap @@ -5,12 +5,12 @@ info: cwd: packages/rw-pkg --- > vt run task -~/packages/rw-pkg$ replace-file-content src/data.txt original modified +~/packages/rw-pkg$ vtt replace-file-content src/data.txt i ! --- vt run: @test/rw-pkg#task not cached because it modified its input. (Run `vt run --last-details` for full details) > vt run task -~/packages/rw-pkg$ replace-file-content src/data.txt original modified +~/packages/rw-pkg$ vtt replace-file-content src/data.txt i ! --- vt run: @test/rw-pkg#task not cached because it modified its input. (Run `vt run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/verbose read-write task shows path in full summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/verbose read-write task shows path in full summary.snap index f82d5f07..65e6a2a5 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/verbose read-write task shows path in full summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots/verbose read-write task shows path in full summary.snap @@ -5,7 +5,7 @@ info: cwd: packages/rw-pkg --- > vt run -v task -~/packages/rw-pkg$ replace-file-content src/data.txt original modified +~/packages/rw-pkg$ vtt replace-file-content src/data.txt i ! ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -17,6 +17,6 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] @test/rw-pkg#task: ~/packages/rw-pkg$ replace-file-content src/data.txt original modified ✓ + [1] @test/rw-pkg#task: ~/packages/rw-pkg$ vtt replace-file-content src/data.txt i ! ✓ → Not cached: read and wrote 'packages/rw-pkg/src/data.txt' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/packages/other/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/packages/other/package.json index 2821c718..6bf03d25 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/packages/other/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/packages/other/package.json @@ -1,8 +1,8 @@ { "name": "other", "scripts": { - "check-tty": "check-tty", - "check-tty-cached": "check-tty", - "read-stdin": "read-stdin" + "check-tty": "vtt check-tty", + "check-tty-cached": "vtt check-tty", + "read-stdin": "vtt read-stdin" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache off inherits stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache off inherits stdin.snap index fcd7e799..fa7fabc7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache off inherits stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache off inherits stdin.snap @@ -3,5 +3,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > echo from-stdin | vt run read-stdin -$ read-stdin ⊘ cache disabled +$ vtt read-stdin ⊘ cache disabled from-stdin diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache on gets null stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache on gets null stdin.snap index f6bfcf44..1e14aed6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache on gets null stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache on gets null stdin.snap @@ -3,4 +3,4 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > echo from-stdin | vt run read-stdin-cached -$ read-stdin +$ vtt read-stdin diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache hit, replayed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache hit, replayed.snap index 04bccdfe..88d55ab1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache hit, replayed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache hit, replayed.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run -r check-tty-cached -~/packages/other$ check-tty +~/packages/other$ vtt check-tty stdin:not-tty stdout:not-tty stderr:not-tty -$ check-tty +$ vtt check-tty stdin:not-tty stdout:not-tty stderr:not-tty @@ -16,15 +16,15 @@ stderr:not-tty --- vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details) > vt run -r check-tty-cached -~/packages/other$ check-tty ◉ cache hit, replaying +~/packages/other$ vtt check-tty ◉ cache hit, replaying stdin:not-tty stdout:not-tty stderr:not-tty -$ check-tty ◉ cache hit, replaying +$ vtt check-tty ◉ cache hit, replaying stdin:not-tty stdout:not-tty stderr:not-tty --- -vt run: 2/2 cache hit (100%), saved. (Run `vt run --last-details` for full details) +vt run: 2/2 cache hit (100%). (Run `vt run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache miss, piped stdio.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache miss, piped stdio.snap index b775978f..9d0c4c41 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache miss, piped stdio.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache miss, piped stdio.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run -r check-tty-cached -~/packages/other$ check-tty +~/packages/other$ vtt check-tty stdin:not-tty stdout:not-tty stderr:not-tty -$ check-tty +$ vtt check-tty stdin:not-tty stdout:not-tty stderr:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache off, inherit stdio.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache off, inherit stdio.snap index 15c5f70a..db5ad977 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache off, inherit stdio.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/multiple tasks, cache off, inherit stdio.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run -r check-tty -~/packages/other$ check-tty +~/packages/other$ vtt check-tty stdin:not-tty stdout:not-tty stderr:not-tty -$ check-tty ⊘ cache disabled +$ vtt check-tty ⊘ cache disabled stdin:tty stdout:tty stderr:tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache hit, replayed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache hit, replayed.snap index 26d83b6f..2b087778 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache hit, replayed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache hit, replayed.snap @@ -3,15 +3,15 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run check-tty-cached -$ check-tty +$ vtt check-tty stdin:not-tty stdout:not-tty stderr:not-tty > vt run check-tty-cached -$ check-tty ◉ cache hit, replaying +$ vtt check-tty ◉ cache hit, replaying stdin:not-tty stdout:not-tty stderr:not-tty --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache miss, piped stdio.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache miss, piped stdio.snap index 2c8de911..b78b3dfe 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache miss, piped stdio.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache miss, piped stdio.snap @@ -3,7 +3,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run check-tty-cached -$ check-tty +$ vtt check-tty stdin:not-tty stdout:not-tty stderr:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache off, inherits stdio.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache off, inherits stdio.snap index 3db7617f..85c4a9b9 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache off, inherits stdio.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/single task, cache off, inherits stdio.snap @@ -3,7 +3,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run check-tty -$ check-tty ⊘ cache disabled +$ vtt check-tty ⊘ cache disabled stdin:tty stdout:tty stderr:tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/vite-task.json index 938ac52e..9f6a560f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/vite-task.json @@ -2,19 +2,19 @@ "cache": true, "tasks": { "check-tty": { - "command": "check-tty", + "command": "vtt check-tty", "cache": false }, "check-tty-cached": { - "command": "check-tty", + "command": "vtt check-tty", "cache": true }, "read-stdin": { - "command": "read-stdin", + "command": "vtt read-stdin", "cache": false }, "read-stdin-cached": { - "command": "read-stdin", + "command": "vtt read-stdin", "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/packages/other/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/packages/other/package.json index 2821c718..6bf03d25 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/packages/other/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/packages/other/package.json @@ -1,8 +1,8 @@ { "name": "other", "scripts": { - "check-tty": "check-tty", - "check-tty-cached": "check-tty", - "read-stdin": "read-stdin" + "check-tty": "vtt check-tty", + "check-tty-cached": "vtt check-tty", + "read-stdin": "vtt read-stdin" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache hit, replayed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache hit, replayed.snap index 694e0489..9ed6981e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache hit, replayed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache hit, replayed.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=labeled -r check-tty-cached -[other#check-tty-cached] ~/packages/other$ check-tty +[other#check-tty-cached] ~/packages/other$ vtt check-tty [other#check-tty-cached] stdin:not-tty [other#check-tty-cached] stdout:not-tty [other#check-tty-cached] stderr:not-tty -[labeled-stdio-test#check-tty-cached] $ check-tty +[labeled-stdio-test#check-tty-cached] $ vtt check-tty [labeled-stdio-test#check-tty-cached] stdin:not-tty [labeled-stdio-test#check-tty-cached] stdout:not-tty [labeled-stdio-test#check-tty-cached] stderr:not-tty @@ -16,15 +16,15 @@ expression: e2e_outputs --- vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details) > vt run --log=labeled -r check-tty-cached -[other#check-tty-cached] ~/packages/other$ check-tty ◉ cache hit, replaying +[other#check-tty-cached] ~/packages/other$ vtt check-tty ◉ cache hit, replaying [other#check-tty-cached] stdin:not-tty [other#check-tty-cached] stdout:not-tty [other#check-tty-cached] stderr:not-tty -[labeled-stdio-test#check-tty-cached] $ check-tty ◉ cache hit, replaying +[labeled-stdio-test#check-tty-cached] $ vtt check-tty ◉ cache hit, replaying [labeled-stdio-test#check-tty-cached] stdin:not-tty [labeled-stdio-test#check-tty-cached] stdout:not-tty [labeled-stdio-test#check-tty-cached] stderr:not-tty --- -vt run: 2/2 cache hit (100%), saved. (Run `vt run --last-details` for full details) +vt run: 2/2 cache hit (100%). (Run `vt run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache miss, piped stdio.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache miss, piped stdio.snap index e82b26ec..81d50a3d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache miss, piped stdio.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache miss, piped stdio.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=labeled -r check-tty-cached -[other#check-tty-cached] ~/packages/other$ check-tty +[other#check-tty-cached] ~/packages/other$ vtt check-tty [other#check-tty-cached] stdin:not-tty [other#check-tty-cached] stdout:not-tty [other#check-tty-cached] stderr:not-tty -[labeled-stdio-test#check-tty-cached] $ check-tty +[labeled-stdio-test#check-tty-cached] $ vtt check-tty [labeled-stdio-test#check-tty-cached] stdin:not-tty [labeled-stdio-test#check-tty-cached] stdout:not-tty [labeled-stdio-test#check-tty-cached] stderr:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache off, piped stdio.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache off, piped stdio.snap index ec446475..34486dc2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache off, piped stdio.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/multiple tasks, cache off, piped stdio.snap @@ -3,12 +3,12 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=labeled -r check-tty -[other#check-tty] ~/packages/other$ check-tty +[other#check-tty] ~/packages/other$ vtt check-tty [other#check-tty] stdin:not-tty [other#check-tty] stdout:not-tty [other#check-tty] stderr:not-tty -[labeled-stdio-test#check-tty] $ check-tty ⊘ cache disabled +[labeled-stdio-test#check-tty] $ vtt check-tty ⊘ cache disabled [labeled-stdio-test#check-tty] stdin:not-tty [labeled-stdio-test#check-tty] stdout:not-tty [labeled-stdio-test#check-tty] stderr:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache hit, replayed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache hit, replayed.snap index a9b29445..89d5dbf9 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache hit, replayed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache hit, replayed.snap @@ -3,15 +3,15 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=labeled check-tty-cached -[labeled-stdio-test#check-tty-cached] $ check-tty +[labeled-stdio-test#check-tty-cached] $ vtt check-tty [labeled-stdio-test#check-tty-cached] stdin:not-tty [labeled-stdio-test#check-tty-cached] stdout:not-tty [labeled-stdio-test#check-tty-cached] stderr:not-tty > vt run --log=labeled check-tty-cached -[labeled-stdio-test#check-tty-cached] $ check-tty ◉ cache hit, replaying +[labeled-stdio-test#check-tty-cached] $ vtt check-tty ◉ cache hit, replaying [labeled-stdio-test#check-tty-cached] stdin:not-tty [labeled-stdio-test#check-tty-cached] stdout:not-tty [labeled-stdio-test#check-tty-cached] stderr:not-tty --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache miss, piped stdio.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache miss, piped stdio.snap index 40929dc4..7b552bf6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache miss, piped stdio.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache miss, piped stdio.snap @@ -3,7 +3,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=labeled check-tty-cached -[labeled-stdio-test#check-tty-cached] $ check-tty +[labeled-stdio-test#check-tty-cached] $ vtt check-tty [labeled-stdio-test#check-tty-cached] stdin:not-tty [labeled-stdio-test#check-tty-cached] stdout:not-tty [labeled-stdio-test#check-tty-cached] stderr:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache off, piped stdio.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache off, piped stdio.snap index 94a7069a..174d0afa 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache off, piped stdio.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/single task, cache off, piped stdio.snap @@ -3,7 +3,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run --log=labeled check-tty -[labeled-stdio-test#check-tty] $ check-tty ⊘ cache disabled +[labeled-stdio-test#check-tty] $ vtt check-tty ⊘ cache disabled [labeled-stdio-test#check-tty] stdin:not-tty [labeled-stdio-test#check-tty] stdout:not-tty [labeled-stdio-test#check-tty] stderr:not-tty diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/stdin is always null.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/stdin is always null.snap index f1e1fdb8..49e243bb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/stdin is always null.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/stdin is always null.snap @@ -3,4 +3,4 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > echo from-stdin | vt run --log=labeled read-stdin -[labeled-stdio-test#read-stdin] $ read-stdin ⊘ cache disabled +[labeled-stdio-test#read-stdin] $ vtt read-stdin ⊘ cache disabled diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/vite-task.json index 938ac52e..9f6a560f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/vite-task.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/vite-task.json @@ -2,19 +2,19 @@ "cache": true, "tasks": { "check-tty": { - "command": "check-tty", + "command": "vtt check-tty", "cache": false }, "check-tty-cached": { - "command": "check-tty", + "command": "vtt check-tty", "cache": true }, "read-stdin": { - "command": "read-stdin", + "command": "vtt read-stdin", "cache": false }, "read-stdin-cached": { - "command": "read-stdin", + "command": "vtt read-stdin", "cache": true } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/package.json index 6c5372ed..5ab43984 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/package.json @@ -1,5 +1,5 @@ { "scripts": { - "lint": "vt lint" + "lint": "vt tool print-file a.js" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap index 2947f023..2f5c03e8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap @@ -5,31 +5,13 @@ expression: e2e_outputs > mkdir .git > vt run lint # cache miss -$ vt lint - - ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. - ,-[a.js:1:1] - 1 | // Empty JS file for oxlint - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `---- - help: Delete this file or add some code to it. - -Found 1 warning and 0 errors. -Finished in on 1 file with 93 rules using threads. +$ vt tool print-file a.js +// Empty JS file for oxlint > echo hello > .git/foo.txt # add file inside .git > vt run lint # cache hit, .git is ignored -$ vt lint ◉ cache hit, replaying - - ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. - ,-[a.js:1:1] - 1 | // Empty JS file for oxlint - : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - `---- - help: Delete this file or add some code to it. - -Found 1 warning and 0 errors. -Finished in on 1 file with 93 rules using threads. +$ vt tool print-file a.js ◉ cache hit, replaying +// Empty JS file for oxlint --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap index 8a8499a5..d16d57d0 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap @@ -194,7 +194,7 @@ $ node build.js ◉ cache hit, replaying [build.js] main process end --- -vt run: cache hit, saved. +vt run: cache hit. > vt run build # cache hit $ node build.js ◉ cache hit, replaying [build.js] -------------------------------- @@ -292,4 +292,4 @@ $ node build.js ◉ cache hit, replaying [build.js] main process end --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/package.json index 3ced4721..184880a8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/package.json @@ -1,6 +1,6 @@ { "scripts": { - "script1": "print-file foo.txt", - "script2": "print-file foo.txt" + "script1": "vtt print-file foo.txt", + "script2": "vtt print-file foo.txt" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml index 8ad542ba..7070bf80 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml @@ -5,7 +5,7 @@ name = "shared caching input" steps = [ "vt run script1 # cache miss", "vt run script2 # cache hit, same command as script1", - "replace-file-content foo.txt initial modified # modify shared input", + "vtt replace-file-content foo.txt initial modified # modify shared input", "vt run script2 # cache miss, input changed", "vt run script1 # cache hit, script2 already warmed cache", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots/shared caching input.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots/shared caching input.snap index 30ba1354..599b54bd 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots/shared caching input.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots/shared caching input.snap @@ -3,22 +3,22 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run script1 # cache miss -$ print-file foo.txt +$ vtt print-file foo.txt initial content > vt run script2 # cache hit, same command as script1 -$ print-file foo.txt ◉ cache hit, replaying +$ vtt print-file foo.txt ◉ cache hit, replaying initial content --- -vt run: cache hit, saved. -> replace-file-content foo.txt initial modified # modify shared input +vt run: cache hit. +> vtt replace-file-content foo.txt initial modified # modify shared input > vt run script2 # cache miss, input changed -$ print-file foo.txt ○ cache miss: 'foo.txt' modified, executing +$ vtt print-file foo.txt ○ cache miss: 'foo.txt' modified, executing modified content > vt run script1 # cache hit, script2 already warmed cache -$ print-file foo.txt ◉ cache hit, replaying +$ vtt print-file foo.txt ◉ cache hit, replaying modified content --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/a/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/a/package.json index e940683c..a724f1d8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/a/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/a/package.json @@ -1,6 +1,6 @@ { "name": "@summary/a", "scripts": { - "build": "print built-a" + "build": "vtt print built-a" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/b/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/b/package.json index f291c066..aa4c23fa 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/b/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/packages/b/package.json @@ -1,7 +1,7 @@ { "name": "@summary/b", "scripts": { - "build": "print built-b" + "build": "vtt print built-b" }, "dependencies": { "@summary/a": "workspace:*" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap index b2d21eae..478420a1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after multi task run shows saved summary.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run -r build # populate summary file -~/packages/a$ print built-a +~/packages/a$ vtt print built-a built-a -~/packages/b$ print built-b +~/packages/b$ vtt print built-b built-b --- @@ -22,9 +22,9 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] @summary/a#build: ~/packages/a$ print built-a ✓ + [1] @summary/a#build: ~/packages/a$ vtt print built-a ✓ → Cache miss: no previous cache entry found ······················································· - [2] @summary/b#build: ~/packages/b$ print built-b ✓ + [2] @summary/b#build: ~/packages/b$ vtt print built-b ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after run shows saved summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after run shows saved summary.snap index 0c08922a..d838f61d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after run shows saved summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/last details after run shows saved summary.snap @@ -5,7 +5,7 @@ info: cwd: packages/a --- > vt run build # populate summary file -~/packages/a$ print built-a +~/packages/a$ vtt print built-a built-a > vt run --last-details # display saved summary @@ -18,6 +18,6 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] @summary/a#build: ~/packages/a$ print built-a ✓ + [1] @summary/a#build: ~/packages/a$ vtt print built-a ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap index 71490c28..a52b6646 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task all cache miss shows compact summary.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run -r build -~/packages/a$ print built-a +~/packages/a$ vtt print built-a built-a -~/packages/b$ print built-b +~/packages/b$ vtt print built-b built-b --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose shows full summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose shows full summary.snap index 4a257a09..1c6cbffb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose shows full summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose shows full summary.snap @@ -3,10 +3,10 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run -r -v build -~/packages/a$ print built-a +~/packages/a$ vtt print built-a built-a -~/packages/b$ print built-b +~/packages/b$ vtt print built-b built-b @@ -19,9 +19,9 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] @summary/a#build: ~/packages/a$ print built-a ✓ + [1] @summary/a#build: ~/packages/a$ vtt print built-a ✓ → Cache miss: no previous cache entry found ······················································· - [2] @summary/b#build: ~/packages/b$ print built-b ✓ + [2] @summary/b#build: ~/packages/b$ vtt print built-b ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap index 21cec9dd..39f42f40 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task verbose with cache hits shows full summary.snap @@ -3,19 +3,19 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run -r build # first run, populate cache -~/packages/a$ print built-a +~/packages/a$ vtt print built-a built-a -~/packages/b$ print built-b +~/packages/b$ vtt print built-b built-b --- vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details) > vt run -r -v build # second run, verbose with cache hits -~/packages/a$ print built-a ◉ cache hit, replaying +~/packages/a$ vtt print built-a ◉ cache hit, replaying built-a -~/packages/b$ print built-b ◉ cache hit, replaying +~/packages/b$ vtt print built-b ◉ cache hit, replaying built-b @@ -24,13 +24,13 @@ built-b ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Statistics: 2 tasks • 2 cache hits • 0 cache misses -Performance: 100% cache hit rate, saved in total +Performance: 100% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] @summary/a#build: ~/packages/a$ print built-a ✓ - → Cache hit - output replayed - saved + [1] @summary/a#build: ~/packages/a$ vtt print built-a ✓ + → Cache hit - output replayed - ······················································· - [2] @summary/b#build: ~/packages/b$ print built-b ✓ - → Cache hit - output replayed - saved + [2] @summary/b#build: ~/packages/b$ vtt print built-b ✓ + → Cache hit - output replayed - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap index 9887d39e..19cae015 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/multi task with cache hits shows compact summary.snap @@ -3,20 +3,20 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run -r build # first run, all miss -~/packages/a$ print built-a +~/packages/a$ vtt print built-a built-a -~/packages/b$ print built-b +~/packages/b$ vtt print built-b built-b --- vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details) > vt run -r build # second run, all hit -~/packages/a$ print built-a ◉ cache hit, replaying +~/packages/a$ vtt print built-a ◉ cache hit, replaying built-a -~/packages/b$ print built-b ◉ cache hit, replaying +~/packages/b$ vtt print built-b ◉ cache hit, replaying built-b --- -vt run: 2/2 cache hit (100%), saved. (Run `vt run --last-details` for full details) +vt run: 2/2 cache hit (100%). (Run `vt run --last-details` for full details) diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache hit shows compact summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache hit shows compact summary.snap index 762fb9d7..4d922023 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache hit shows compact summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache hit shows compact summary.snap @@ -5,11 +5,11 @@ info: cwd: packages/a --- > vt run build # first run, cache miss -~/packages/a$ print built-a +~/packages/a$ vtt print built-a built-a > vt run build # second run, cache hit → compact summary -~/packages/a$ print built-a ◉ cache hit, replaying +~/packages/a$ vtt print built-a ◉ cache hit, replaying built-a --- -vt run: cache hit, saved. +vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache miss shows no summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache miss shows no summary.snap index 841f9db1..84daea86 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache miss shows no summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task cache miss shows no summary.snap @@ -5,5 +5,5 @@ info: cwd: packages/a --- > vt run build -~/packages/a$ print built-a +~/packages/a$ vtt print built-a built-a diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task verbose shows full summary.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task verbose shows full summary.snap index d5b63c4d..ebe40257 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task verbose shows full summary.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots/single task verbose shows full summary.snap @@ -5,7 +5,7 @@ info: cwd: packages/a --- > vt run -v build -~/packages/a$ print built-a +~/packages/a$ vtt print built-a built-a @@ -18,6 +18,6 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] @summary/a#build: ~/packages/a$ print built-a ✓ + [1] @summary/a#build: ~/packages/a$ vtt print built-a ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/package.json index 131accb5..18efcde7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/package.json @@ -2,6 +2,6 @@ "name": "vite-task-smoke", "private": true, "scripts": { - "test-task": "echo hello && print-file main.js" + "test-task": "echo hello && vtt print-file main.js" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml index 3fce5a5c..16cc13df 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml @@ -4,6 +4,6 @@ name = "cache hit after file modification" steps = [ "vt run test-task # cache miss", - "replace-file-content main.js foo bar # modify input file", + "vtt replace-file-content main.js foo bar # modify input file", "vt run test-task # cache miss, main.js changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap index 1de3a8f3..54e0f76b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap @@ -6,18 +6,18 @@ expression: e2e_outputs $ echo hello ⊘ cache disabled hello -$ print-file main.js +$ vtt print-file main.js console.log('foo'); --- vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details) -> replace-file-content main.js foo bar # modify input file +> vtt replace-file-content main.js foo bar # modify input file > vt run test-task # cache miss, main.js changed $ echo hello ⊘ cache disabled hello -$ print-file main.js ○ cache miss: 'main.js' modified, executing +$ vtt print-file main.js ○ cache miss: 'main.js' modified, executing console.log('bar'); --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/main.rs b/crates/vite_task_bin/tests/e2e_snapshots/main.rs index 47529395..046f7873 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/main.rs +++ b/crates/vite_task_bin/tests/e2e_snapshots/main.rs @@ -26,6 +26,7 @@ const STEP_TIMEOUT: Duration = const SCREEN_SIZE: ScreenSize = ScreenSize { rows: 500, cols: 500 }; const COMPILE_TIME_VT_PATH: &str = env!("CARGO_BIN_EXE_vt"); +const COMPILE_TIME_VTT_PATH: &str = env!("CARGO_BIN_EXE_vtt"); const COMPILE_TIME_MANIFEST_DIR: &str = env!("CARGO_MANIFEST_DIR"); /// Get the shell executable for running e2e test steps. @@ -58,36 +59,38 @@ fn get_shell_exe() -> std::path::PathBuf { } } +/// Resolve a binary's runtime path from its compile-time path. +/// +/// Computes `join(runtime_manifest, diff(compile_time_bin, compile_time_manifest))`. +/// This handles cases where compile-time and runtime paths differ (e.g. CI caches). #[expect( clippy::disallowed_types, - reason = "PathBuf required for compile-time/runtime vt path remapping" + reason = "PathBuf required for compile-time/runtime binary path remapping" )] -fn resolve_runtime_vt_path() -> AbsolutePathBuf { - let compile_time_vt = std::path::PathBuf::from(COMPILE_TIME_VT_PATH); +fn resolve_runtime_bin_path(compile_time_bin_path: &str) -> AbsolutePathBuf { + let compile_time_bin = std::path::PathBuf::from(compile_time_bin_path); let compile_time_manifest = std::path::PathBuf::from(COMPILE_TIME_MANIFEST_DIR); let runtime_manifest = std::path::PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let compile_time_repo_root = compile_time_manifest.parent().unwrap().parent().unwrap(); - let runtime_repo_root = runtime_manifest.parent().unwrap().parent().unwrap(); - - let relative_vt = diff_paths(&compile_time_vt, compile_time_repo_root).unwrap_or_else(|| { + let relative_bin = diff_paths(&compile_time_bin, &compile_time_manifest).unwrap_or_else(|| { panic!( - "Failed to diff vt path. vt={} repo_root={}", - compile_time_vt.display(), - compile_time_repo_root.display(), + "Failed to diff binary path. bin={} manifest={}", + compile_time_bin.display(), + compile_time_manifest.display(), ) }); - let runtime_vt = runtime_repo_root.join(&relative_vt); + let runtime_bin = runtime_manifest.join(&relative_bin); - assert!( - runtime_vt.exists(), - "Remapped vt path does not exist: {} (relative: {})", - runtime_vt.display(), - relative_vt.display(), - ); + let runtime_bin = runtime_bin.canonicalize().unwrap_or_else(|_| { + panic!( + "Remapped binary path does not exist: {} (relative: {})", + runtime_bin.display(), + relative_bin.display(), + ) + }); - AbsolutePathBuf::new(runtime_vt).unwrap() + AbsolutePathBuf::new(runtime_bin).unwrap() } #[derive(serde::Deserialize, Debug)] @@ -264,34 +267,16 @@ fn run_case_inner(tmpdir: &AbsolutePath, fixture_path: &std::path::Path, fixture Err(err) => panic!("Failed to read cases.toml for fixture {fixture_name}: {err}"), }; - // Navigate from runtime CARGO_MANIFEST_DIR to packages/tools at the repo root. - #[expect( - clippy::disallowed_types, - reason = "Path required for CARGO_MANIFEST_DIR path traversal" - )] - let repo_root = std::path::PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()); - let repo_root = repo_root.parent().unwrap().parent().unwrap(); - let test_bin_path = Arc::::from( - repo_root.join("packages").join("tools").join("node_modules").join(".bin").into_os_string(), - ); - // Get shell executable for running steps let shell_exe = get_shell_exe(); - // Prepare PATH for e2e tests + // Prepare PATH for e2e tests: include vt and vtt binary directories. + let bin_dirs: [Arc; 2] = [COMPILE_TIME_VT_PATH, COMPILE_TIME_VTT_PATH].map(|p| { + let bin = resolve_runtime_bin_path(p); + Arc::::from(bin.parent().unwrap().as_path().as_os_str()) + }); let e2e_env_path = join_paths( - [ - // Include vt binary path to PATH so that e2e tests can run "vt ..." commands. - { - let vt_path = resolve_runtime_vt_path(); - let vt_dir = vt_path.parent().unwrap(); - vt_dir.as_path().as_os_str().into() - }, - // Include packages/tools to PATH so that e2e tests can run utilities such as replace-file-content. - test_bin_path, - ] - .into_iter() - .chain( + bin_dirs.into_iter().chain( // the existing PATH split_paths(&env::var_os("PATH").unwrap()) .map(|path| Arc::::from(path.into_os_string())), diff --git a/crates/vite_task_bin/tests/e2e_snapshots/redact.rs b/crates/vite_task_bin/tests/e2e_snapshots/redact.rs index 438f948e..b2e85f22 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/redact.rs +++ b/crates/vite_task_bin/tests/e2e_snapshots/redact.rs @@ -9,8 +9,13 @@ fn redact_string(s: &mut String, redactions: &[(&str, &str)]) { for (from, to) in redactions { if let Cow::Owned(mut replaced) = s.as_str().cow_replace(from, to) { if cfg!(windows) { - // Also replace with backslashes on Windows + // Normalize backslashes to forward slashes on Windows replaced = replaced.cow_replace("\\", "/").into_owned(); + // Collapse double slashes that arise when an escaped path separator (\\) + // is only partially replaced (e.g., Debug-format paths end with \\") + while replaced.contains("//") { + replaced = replaced.cow_replace("//", "/").into_owned(); + } } *s = replaced; } @@ -23,29 +28,61 @@ fn redact_string(s: &mut String, redactions: &[(&str, &str)]) { )] pub fn redact_e2e_output(mut output: String, workspace_root: &str) -> String { let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); - // Get the packages/tools directory path - let tools_dir = std::path::Path::new(&manifest_dir) - .parent() - .unwrap() - .parent() - .unwrap() - .join("packages") - .join("tools"); - let tools_dir_str = tools_dir.to_str().unwrap(); - - redact_string( - &mut output, - &[ - (workspace_root, ""), - (manifest_dir.as_str(), ""), - (tools_dir_str, ""), - ], - ); - - // Redact durations like "123ms" or "1.23s" to "ms" or "s" - let duration_regex = regex::Regex::new(r"\d+(\.\d+)?(ms|s)").unwrap(); + + // On Windows, canonicalize() may produce verbatim paths (\\?\C:\...) while + // child processes report paths without the prefix. Try both variants. + let workspace_root_stripped = workspace_root.strip_prefix(r"\\?\").unwrap_or(workspace_root); + + // On Windows, paths displayed via Debug format ({:?}) have backslashes escaped + // to double-backslashes. Create escaped variants to match Debug-format output. + // The full escaped variant (with \\?\ prefix) must be tried first since it's + // the longest match and prevents leaving a stray "\\?\" in the output. + let workspace_root_full_escaped = { + use cow_utils::CowUtils as _; + workspace_root.cow_replace('\\', r"\\").into_owned() + }; + let workspace_root_stripped_escaped = { + use cow_utils::CowUtils as _; + workspace_root_stripped.cow_replace('\\', r"\\").into_owned() + }; + + let mut redactions: Vec<(&str, &str)> = vec![ + (workspace_root, ""), + (workspace_root_stripped, ""), + (manifest_dir.as_str(), ""), + ]; + + // Add escaped variants (longest first for correct matching) + if workspace_root_full_escaped != workspace_root { + redactions.insert(0, (&workspace_root_full_escaped, "")); + } + if workspace_root_stripped_escaped != workspace_root_stripped + && workspace_root_stripped_escaped != workspace_root_full_escaped + { + redactions.insert(1, (&workspace_root_stripped_escaped, "")); + } + + redact_string(&mut output, &redactions); + + // Redact durations like "0ns", "123ms" or "1.23s" to "" + let duration_regex = regex::Regex::new(r"\d+(\.\d+)?(ns|ms|s)").unwrap(); output = duration_regex.replace_all(&output, "").into_owned(); + // Normalize the ", saved" suffix in cache hit summaries. + // When tools are fast (e.g., Rust binaries), saved time may be 0ns and the + // runner omits the suffix entirely. Stripping it ensures stable snapshots. + let saved_regex = regex::Regex::new(r",? saved").unwrap(); + output = saved_regex.replace_all(&output, "").into_owned(); + + // Strip "in total" from verbose performance summary (includes time details + // that may be omitted when saved time is 0). + { + use cow_utils::CowUtils as _; + if let Cow::Owned(replaced) = output.as_str().cow_replace(" in total", "") { + output = replaced; + } + } + // Redact thread counts like "using 10 threads" to "using threads" let thread_regex = regex::Regex::new(r"using \d+ threads").unwrap(); output = thread_regex.replace_all(&output, "using threads").into_owned(); diff --git a/crates/vite_task_plan/Cargo.toml b/crates/vite_task_plan/Cargo.toml index 7ac860f9..588ed579 100644 --- a/crates/vite_task_plan/Cargo.toml +++ b/crates/vite_task_plan/Cargo.toml @@ -36,6 +36,7 @@ clap = { workspace = true, features = ["derive"] } copy_dir = { workspace = true } cow-utils = { workspace = true } insta = { workspace = true, features = ["glob", "json", "redactions", "filters", "ron"] } +pathdiff = { workspace = true } serde_json = { workspace = true } tempfile = { workspace = true } tokio = { workspace = true, features = ["rt", "macros"] } diff --git a/crates/vite_task_plan/build.rs b/crates/vite_task_plan/build.rs new file mode 100644 index 00000000..9a83f45d --- /dev/null +++ b/crates/vite_task_plan/build.rs @@ -0,0 +1,17 @@ +#![expect(clippy::disallowed_types, reason = "build script uses std types")] + +fn main() { + // OUT_DIR is something like `//build/-/out`. + // Navigate up to `/` to find workspace binaries. + let out_dir = std::env::var("OUT_DIR").unwrap(); + let out_path = std::path::Path::new(&out_dir); + // out -> build/- -> build -> + let profile_dir = out_path.parent().unwrap().parent().unwrap().parent().unwrap(); + + for (env_name, bin_name) in [ + ("COMPILE_TIME_VT_PATH", if cfg!(windows) { "vt.exe" } else { "vt" }), + ("COMPILE_TIME_VTT_PATH", if cfg!(windows) { "vtt.exe" } else { "vtt" }), + ] { + println!("cargo::rustc-env={env_name}={}", profile_dir.join(bin_name).display()); + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/package.json index ae293d3c..9e658aa6 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/package.json @@ -3,6 +3,6 @@ "private": true, "scripts": { "hello": "echo hello", - "env-test": "vt env-test TEST_VAR hello_world" + "env-test": "TEST_VAR=hello_world vt tool print-env TEST_VAR" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots.toml index 326567a0..9f321e04 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots.toml +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots.toml @@ -1,5 +1,5 @@ -# Tests env-test synthetic command with additional_envs +# Tests tool synthetic command with environment variables [[plan]] -name = "env-test synthetic task in user task" +name = "tool synthetic task in user task" args = ["run", "env-test"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - env-test synthetic task in user task.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - tool synthetic task in user task.snap similarity index 86% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - env-test synthetic task in user task.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - tool synthetic task in user task.snap index 0aae6b1d..672bda6f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - env-test synthetic task in user task.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/query - tool synthetic task in user task.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env "task_name": "env-test", "package_path": "/" }, - "command": "vt env-test TEST_VAR hello_world", + "command": "TEST_VAR=hello_world vt tool print-env TEST_VAR", "and_item_index": null, "cwd": "/" }, @@ -39,16 +39,18 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-env" + "program_name": "vtt" } }, "args": [ + "print-env", "TEST_VAR" ], "env_fingerprints": { - "fingerprinted_envs": {}, + "fingerprinted_envs": { + "TEST_VAR": "hello_world" + }, "untracked_env_config": [ - "TEST_VAR", "" ] } @@ -68,13 +70,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-env", + "program_path": "/vtt", "args": [ + "print-env", "TEST_VAR" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin", + "PATH": "/node_modules/.bin::", "TEST_VAR": "hello_world" }, "cwd": "/" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/task graph.snap index cca0fa24..5b46654e 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env/snapshots/task graph.snap @@ -16,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-env "package_path": "/" }, "resolved_config": { - "command": "vt env-test TEST_VAR hello_world", + "command": "TEST_VAR=hello_world vt tool print-env TEST_VAR", "resolved_options": { "cwd": "/", "cache_config": { 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 index d8674607..3d1d3b05 100644 --- 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 @@ -1,7 +1,7 @@ { "name": "@test/cache-cli-override", "scripts": { - "test": "print-file package.json", - "lint": "print-file vite-task.json" + "test": "vtt print-file package.json", + "lint": "vtt print-file vite-task.json" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap index 56305ec9..272f5a4f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache does not override per-task cache false.snap @@ -28,7 +28,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "task_name": "deploy", "package_path": "/" }, - "command": "print-file vite-task.json", + "command": "vtt print-file vite-task.json", "and_item_index": null, "cwd": "/" }, @@ -37,13 +37,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "vite-task.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap index 121aa6e4..b94e791f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables script caching.snap @@ -28,7 +28,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "task_name": "test", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -40,10 +40,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -68,13 +69,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap index d4c3cd11..3beffddd 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache enables task caching even when cache.tasks is false.snap @@ -28,7 +28,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "task_name": "build", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -40,10 +40,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -68,13 +69,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap index e9e9bcce..cb2c9791 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --cache on task with per-task cache true enables caching.snap @@ -28,7 +28,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "task_name": "check", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -40,10 +40,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -68,13 +69,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap index 115f4b49..e69d3215 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache disables task caching.snap @@ -28,7 +28,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "task_name": "build", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -37,13 +37,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap index 17c00630..d2b0591e 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - --no-cache overrides per-task cache true.snap @@ -28,7 +28,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "task_name": "check", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -37,13 +37,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap index 222b403f..e37722a8 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-override/snapshots/query - baseline - tasks not cached when cache.tasks is false.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "task_name": "build", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -36,13 +36,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } 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 index a66e1071..0c3f0fc6 100644 --- 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 @@ -16,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -50,7 +50,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -84,7 +84,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "package_path": "/" }, "resolved_config": { - "command": "print-file vite-task.json", + "command": "vtt print-file vite-task.json", "resolved_options": { "cwd": "/", "cache_config": null @@ -106,7 +106,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "package_path": "/" }, "resolved_config": { - "command": "print-file vite-task.json", + "command": "vtt print-file vite-task.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -140,7 +140,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-cli-overri "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { 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 index 12d7aec7..e4c72517 100644 --- 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 @@ -1,15 +1,17 @@ { - "cache": { "tasks": false }, + "cache": { + "tasks": false + }, "tasks": { "build": { - "command": "print-file package.json" + "command": "vtt print-file package.json" }, "deploy": { - "command": "print-file vite-task.json", + "command": "vtt print-file vite-task.json", "cache": false }, "check": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "cache": true } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/package.json index 77cb873a..1b634519 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/package.json @@ -1,8 +1,8 @@ { "scripts": { - "lint": "vt lint", - "hello": "print-file", - "lint-and-echo": "vt lint && echo", - "echo-and-lint": "echo Linting && vt lint" + "lint": "vt tool print lint", + "hello": "vtt print-file", + "lint-and-echo": "vt tool print lint && echo", + "echo-and-lint": "echo Linting && vt tool print lint" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap index 1dafd5a9..5eab4d36 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap @@ -54,7 +54,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "echo-and-lint", "package_path": "/" }, - "command": "vt lint --fix", + "command": "vt tool print lint --fix", "and_item_index": 1, "cwd": "/" }, @@ -66,10 +66,12 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, "args": [ + "print", + "lint", "--fix" ], "env_fingerprints": { @@ -96,13 +98,15 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", + "program_path": "/vtt", "args": [ + "print", + "lint", "--fix" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap index 0478d727..0a9f4838 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap @@ -28,7 +28,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "lint-and-echo", "package_path": "/" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": 0, "cwd": "/" }, @@ -40,10 +40,13 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, - "args": [], + "args": [ + "print", + "lint" + ], "env_fingerprints": { "fingerprinted_envs": {}, "untracked_env_config": [ @@ -66,11 +69,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap index 7a141feb..31e62869 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap @@ -28,7 +28,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "hello", "package_path": "/" }, - "command": "print-file a.txt", + "command": "vtt print-file a.txt", "and_item_index": null, "cwd": "/" }, @@ -40,10 +40,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "a.txt" ], "env_fingerprints": { @@ -70,13 +71,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "a.txt" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap index 325b4859..b5375bc4 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap @@ -28,7 +28,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "lint", "package_path": "/" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": null, "cwd": "/" }, @@ -40,10 +40,13 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, - "args": [], + "args": [ + "print", + "lint" + ], "env_fingerprints": { "fingerprinted_envs": {}, "untracked_env_config": [ @@ -66,11 +69,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap index 13746051..26b06a3d 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "lint", "package_path": "/" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": null, "cwd": "/" }, @@ -39,10 +39,13 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, - "args": [], + "args": [ + "print", + "lint" + ], "env_fingerprints": { "fingerprinted_envs": {}, "untracked_env_config": [ @@ -65,11 +68,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap index 5efaabce..a32e4cec 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap @@ -28,7 +28,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "lint", "package_path": "/" }, - "command": "vt lint --fix", + "command": "vt tool print lint --fix", "and_item_index": null, "cwd": "/" }, @@ -40,10 +40,12 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, "args": [ + "print", + "lint", "--fix" ], "env_fingerprints": { @@ -70,13 +72,15 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", + "program_path": "/vtt", "args": [ + "print", + "lint", "--fix" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } 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 fbd75339..5dd95d01 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 @@ -16,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "package_path": "/" }, "resolved_config": { - "command": "echo Linting && vt lint", + "command": "echo Linting && vt tool print lint", "resolved_options": { "cwd": "/", "cache_config": { @@ -50,7 +50,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "package_path": "/" }, "resolved_config": { - "command": "print-file", + "command": "vtt print-file", "resolved_options": { "cwd": "/", "cache_config": { @@ -84,7 +84,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "package_path": "/" }, "resolved_config": { - "command": "vt lint", + "command": "vt tool print lint", "resolved_options": { "cwd": "/", "cache_config": { @@ -118,7 +118,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "package_path": "/" }, "resolved_config": { - "command": "vt lint && echo", + "command": "vt tool print lint && echo", "resolved_options": { "cwd": "/", "cache_config": { 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 d717f308..c887e6ff 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": "print-file package.json", - "test": "print-file package.json" + "build": "vtt print-file package.json", + "test": "vtt print-file package.json" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap index 675d76d8..f47bbd44 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-default/snapshots/query - script not cached by default.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-de "task_name": "build", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -36,13 +36,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-de "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } 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 32480609..0bb81cd4 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,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-de "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -50,7 +50,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-de "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-error-non-root/snapshots/task graph load error.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-error-non-root/snapshots/task graph load error.snap index 8006fe4f..8c0a0e73 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-error-non-root/snapshots/task graph load error.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-error-non-root/snapshots/task graph load error.snap @@ -1,6 +1,6 @@ --- source: crates/vite_task_plan/tests/plan_snapshots/main.rs -expression: err_str.as_ref() +expression: "&err_str" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-error-non-root --- `cache` can only be set in the workspace root config, but found in /packages/pkg-a 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 7bbf8fa6..9f516c25 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,6 +1,6 @@ { "name": "@test/cache-scripts-task-override", "scripts": { - "test": "print-file package.json" + "test": "vtt print-file package.json" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - another task cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - another task cached by default.snap index 4ed9a5a3..e41fd0ff 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - another task cached by default.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - another task cached by default.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "task_name": "deploy", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -39,10 +39,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -67,13 +68,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap index dafc235f..71264ac1 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - script not cached by default.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "task_name": "test", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -36,13 +36,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap index d38e2b72..405ef893 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-task-override/snapshots/query - task cached by default.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "task_name": "build", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -39,10 +39,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -67,13 +68,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } 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 2d622a27..5a36d594 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": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -50,7 +50,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -84,7 +84,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-scripts-ta "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { 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 507d14b5..1439d982 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 @@ -1,10 +1,10 @@ { "tasks": { "build": { - "command": "print-file package.json" + "command": "vtt print-file package.json" }, "deploy": { - "command": "print-file package.json" + "command": "vtt print-file package.json" } } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap index 99041f9a..ab02b4e3 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap @@ -43,7 +43,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } 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 1aadb62c..7634cf12 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,6 +1,6 @@ { "name": "@test/cache-tasks-disabled", "scripts": { - "test": "print-file package.json" + "test": "vtt print-file package.json" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap index 9118bb90..b494168a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - per-task cache true still disabled by cache.tasks false.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "task_name": "deploy", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -36,13 +36,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap index af460270..f73c76ab 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - script not cached.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "task_name": "test", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -36,13 +36,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap index f4406214..d3f92f45 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disabled/snapshots/query - task not cached when cache.tasks is false.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "task_name": "build", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -36,13 +36,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } 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 433e4c43..d88be6a0 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,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -50,7 +50,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -84,7 +84,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-tasks-disa "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { 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 10d2e97d..e510e977 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 @@ -1,11 +1,13 @@ { - "cache": { "tasks": false }, + "cache": { + "tasks": false + }, "tasks": { "build": { - "command": "print-file package.json" + "command": "vtt print-file package.json" }, "deploy": { - "command": "print-file package.json", + "command": "vtt 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 74d15c2a..07a8c4e2 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,6 +1,6 @@ { "name": "@test/cache-true-no-force-enable", "scripts": { - "test": "print-file package.json" + "test": "vtt print-file package.json" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap index c74c1ccf..72170b87 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - script cached when global cache true.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "task_name": "test", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -39,10 +39,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -67,13 +68,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap index c8fc56e7..09644b2a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task cached when global cache true.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "task_name": "deploy", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -39,10 +39,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -67,13 +68,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap index 301ceab8..0a845cc1 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/snapshots/query - task with cache false not cached despite global cache true.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "task_name": "build", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -36,13 +36,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } 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 ed16f082..e40ec2fe 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,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": null @@ -38,7 +38,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -72,7 +72,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-fo "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-true-no-force-enable/vite-task.json index 48139b37..2deb66a6 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 @@ -2,11 +2,11 @@ "cache": true, "tasks": { "build": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "cache": false }, "deploy": { - "command": "print-file package.json" + "command": "vtt print-file package.json" } } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/package.json index 9addd701..b38b6b7b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/package.json @@ -1,7 +1,7 @@ { "scripts": { - "build": "print-file package.json", + "build": "vtt print-file package.json", "cd-build": "cd src && vt run build", - "cd-lint": "cd src && vt lint" + "cd-lint": "cd src && vt tool print lint" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt lint should put synthetic task under cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt lint should put synthetic task under cwd.snap index d708a120..2291c5c0 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt lint should put synthetic task under cwd.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt lint should put synthetic task under cwd.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts "task_name": "cd-lint", "package_path": "/" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": 1, "cwd": "/src" }, @@ -39,10 +39,13 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts "cwd": "src", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, - "args": [], + "args": [ + "print", + "lint" + ], "env_fingerprints": { "fingerprinted_envs": {}, "untracked_env_config": [ @@ -65,11 +68,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/src" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt run should not affect expanded task cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt run should not affect expanded task cwd.snap index 62ef0659..71db9006 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt run should not affect expanded task cwd.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vt run should not affect expanded task cwd.snap @@ -52,7 +52,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts "task_name": "build", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -64,10 +64,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -92,13 +93,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } 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 a6a2057d..21d84cb1 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 @@ -16,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { @@ -84,7 +84,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts "package_path": "/" }, "resolved_config": { - "command": "cd src && vt lint", + "command": "cd src && vt tool print lint", "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle-dependency/snapshots/query - cycle dependency error.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle-dependency/snapshots/query - cycle dependency error.snap index f2a62da2..0fd1545d 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle-dependency/snapshots/query - cycle dependency error.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cycle-dependency/snapshots/query - cycle dependency error.snap @@ -1,6 +1,6 @@ --- source: crates/vite_task_plan/tests/plan_snapshots/main.rs -expression: err_str.as_ref() +expression: "&err_str" info: args: - run diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/query - ambiguous package name with transitive.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/query - ambiguous package name with transitive.snap index 3a695001..bf9b98cc 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/query - ambiguous package name with transitive.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/query - ambiguous package name with transitive.snap @@ -1,6 +1,6 @@ --- source: crates/vite_task_plan/tests/plan_snapshots/main.rs -expression: err_str.as_ref() +expression: "&err_str" info: args: - run diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/query - ambiguous package name.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/query - ambiguous package name.snap index 05e375f0..8b21cc5a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/query - ambiguous package name.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/duplicate-package-names/snapshots/query - ambiguous package name.snap @@ -1,6 +1,6 @@ --- source: crates/vite_task_plan/tests/plan_snapshots/main.rs -expression: err_str.as_ref() +expression: "&err_str" info: args: - run 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 index 9e39b7f7..b826c785 100644 --- 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 @@ -1,7 +1,7 @@ { "name": "@test/nested-cache-override", "scripts": { - "inner": "print-file package.json", + "inner": "vtt print-file package.json", "outer-no-cache": "vt run --no-cache inner", "outer-cache": "vt run --cache inner", "outer-inherit": "vt run inner" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap index 9f530779..f732d75f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --cache enables inner task caching.snap @@ -52,7 +52,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "task_name": "inner", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -64,10 +64,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -92,13 +93,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap index 94c58825..b5d3dbe0 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested --no-cache disables inner task caching.snap @@ -52,7 +52,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "task_name": "inner", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -61,13 +61,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap index 8a79b3af..bbd817de 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - nested run without flags inherits parent cache.snap @@ -52,7 +52,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "task_name": "inner", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -61,13 +61,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap index c64bcdda..ab677f84 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --cache propagates to nested run without flags.snap @@ -53,7 +53,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "task_name": "inner", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -65,10 +65,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -93,13 +94,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap index 1155dabd..953668a2 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache does not propagate into nested --cache.snap @@ -53,7 +53,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "task_name": "inner", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -65,10 +65,11 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "print-file" + "program_name": "vtt" } }, "args": [ + "print-file", "package.json" ], "env_fingerprints": { @@ -93,13 +94,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove } }, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap index 48c4826a..72ef04d3 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-override/snapshots/query - outer --no-cache propagates to nested run without flags.snap @@ -53,7 +53,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "task_name": "inner", "package_path": "/" }, - "command": "print-file package.json", + "command": "vtt print-file package.json", "and_item_index": null, "cwd": "/" }, @@ -62,13 +62,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/print-file", + "program_path": "/vtt", "args": [ + "print-file", "package.json" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } 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 index 33c13073..ebcd664d 100644 --- 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 @@ -16,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-cache-ove "package_path": "/" }, "resolved_config": { - "command": "print-file package.json", + "command": "vtt print-file package.json", "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-conflict/snapshots/task graph load error.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-conflict/snapshots/task graph load error.snap index 4a7c6cd6..28007e5e 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-conflict/snapshots/task graph load error.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/script-conflict/snapshots/task graph load error.snap @@ -1,6 +1,6 @@ --- source: crates/vite_task_plan/tests/plan_snapshots/main.rs -expression: err_str.as_ref() +expression: "&err_str" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/script-conflict --- Task @test/script-conflict#build conflicts with a package.json script of the same name. Remove the script from package.json or rename the task diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/query - shell fallback for pipe command.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/query - shell fallback for pipe command.snap index 109dbe39..be3dd9f2 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/query - shell fallback for pipe command.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback/snapshots/query - shell fallback for pipe command.snap @@ -75,7 +75,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/shell-fallback ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/package.json index dda69ab5..cbf2c66a 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/package.json @@ -1,7 +1,7 @@ { "name": "@test/synthetic-cache-disabled", "scripts": { - "lint": "vt lint", + "lint": "vt tool print lint", "run-build-cache-false": "vt run build" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - parent cache false does not affect expanded query tasks.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - parent cache false does not affect expanded query tasks.snap index 3dad35d5..7d5dc23b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - parent cache false does not affect expanded query tasks.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - parent cache false does not affect expanded query tasks.snap @@ -52,7 +52,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "task_name": "build", "package_path": "/" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": null, "cwd": "/" }, @@ -64,10 +64,13 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, - "args": [], + "args": [ + "print", + "lint" + ], "env_fingerprints": { "fingerprinted_envs": {}, "untracked_env_config": [ @@ -90,11 +93,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script cache false does not affect expanded synthetic cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script cache false does not affect expanded synthetic cache.snap index 25b6b8a2..6be40dd4 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script cache false does not affect expanded synthetic cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script cache false does not affect expanded synthetic cache.snap @@ -52,7 +52,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "task_name": "build", "package_path": "/" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": null, "cwd": "/" }, @@ -64,10 +64,13 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, - "args": [], + "args": [ + "print", + "lint" + ], "env_fingerprints": { "fingerprinted_envs": {}, "untracked_env_config": [ @@ -90,11 +93,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cache.scripts defaults to no cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cache.scripts defaults to no cache.snap index f96f49c2..06fb12b2 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cache.scripts defaults to no cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - script without cache.scripts defaults to no cache.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "task_name": "lint", "package_path": "/" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": null, "cwd": "/" }, @@ -36,11 +36,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task untrackedEnv inherited by synthetic.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task untrackedEnv inherited by synthetic.snap index 4369d9c3..5f526fbb 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task untrackedEnv inherited by synthetic.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task untrackedEnv inherited by synthetic.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "task_name": "lint-with-untracked-env", "package_path": "/" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": null, "cwd": "/" }, @@ -39,10 +39,13 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, - "args": [], + "args": [ + "print", + "lint" + ], "env_fingerprints": { "fingerprinted_envs": {}, "untracked_env_config": [ @@ -66,11 +69,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache false disables synthetic cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache false disables synthetic cache.snap index ca6c71f5..83573a5f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache false disables synthetic cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache false disables synthetic cache.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "task_name": "lint-no-cache", "package_path": "/" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": null, "cwd": "/" }, @@ -36,11 +36,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache true enables synthetic cache.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache true enables synthetic cache.snap index d2ba7f47..ff429f43 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache true enables synthetic cache.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/snapshots/query - task with cache true enables synthetic cache.snap @@ -27,7 +27,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "task_name": "lint-with-cache", "package_path": "/" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": null, "cwd": "/" }, @@ -39,10 +39,13 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "cwd": "", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, - "args": [], + "args": [ + "print", + "lint" + ], "env_fingerprints": { "fingerprinted_envs": {}, "untracked_env_config": [ @@ -65,11 +68,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/node_modules/.bin" + "PATH": "/node_modules/.bin::" }, "cwd": "/" } 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 6c110baa..20f204e5 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 @@ -16,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "package_path": "/" }, "resolved_config": { - "command": "vt lint", + "command": "vt tool print lint", "resolved_options": { "cwd": "/", "cache_config": { @@ -50,7 +50,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "package_path": "/" }, "resolved_config": { - "command": "vt lint", + "command": "vt tool print lint", "resolved_options": { "cwd": "/", "cache_config": { @@ -84,7 +84,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "package_path": "/" }, "resolved_config": { - "command": "vt lint", + "command": "vt tool print lint", "resolved_options": { "cwd": "/", "cache_config": null @@ -106,7 +106,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "package_path": "/" }, "resolved_config": { - "command": "vt lint", + "command": "vt tool print lint", "resolved_options": { "cwd": "/", "cache_config": { @@ -140,7 +140,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache- "package_path": "/" }, "resolved_config": { - "command": "vt lint", + "command": "vt tool print lint", "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/vite-task.json index 08ccd883..ce6474ed 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/vite-task.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-cache-disabled/vite-task.json @@ -1,19 +1,19 @@ { "tasks": { "lint-no-cache": { - "command": "vt lint", + "command": "vt tool print lint", "cache": false }, "lint-with-cache": { - "command": "vt lint", + "command": "vt tool print lint", "cache": true }, "lint-with-untracked-env": { - "command": "vt lint", + "command": "vt tool print lint", "untrackedEnv": ["CUSTOM_VAR"] }, "build": { - "command": "vt lint", + "command": "vt tool print lint", "cache": true }, "run-build-no-cache": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/packages/a/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/packages/a/package.json index 2631a8fb..ba249a77 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/packages/a/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/packages/a/package.json @@ -1,6 +1,6 @@ { "name": "a", "scripts": { - "lint": "vt lint" + "lint": "vt tool print lint" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap index d90a0e00..b66b1abd 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap @@ -52,7 +52,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-sub "task_name": "lint", "package_path": "/packages/a" }, - "command": "vt lint", + "command": "vt tool print lint", "and_item_index": null, "cwd": "/packages/a" }, @@ -64,10 +64,13 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-sub "cwd": "packages/a", "program_fingerprint": { "OutsideWorkspace": { - "program_name": "oxlint" + "program_name": "vtt" } }, - "args": [], + "args": [ + "print", + "lint" + ], "env_fingerprints": { "fingerprinted_envs": {}, "untracked_env_config": [ @@ -90,11 +93,14 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-sub } }, "spawn_command": { - "program_path": "/node_modules/.bin/oxlint", - "args": [], + "program_path": "/vtt", + "args": [ + "print", + "lint" + ], "all_envs": { "NO_COLOR": "1", - "PATH": "/packages/a/node_modules/.bin:/node_modules/.bin:/node_modules/.bin" + "PATH": "/packages/a/node_modules/.bin:/node_modules/.bin::" }, "cwd": "/packages/a" } 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 8629a5ab..ebe0e7fd 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 @@ -50,7 +50,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-sub "package_path": "/packages/a" }, "resolved_config": { - "command": "vt lint", + "command": "vt tool print lint", "resolved_options": { "cwd": "/packages/a", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace-root-mutual-recursion/snapshots/query - mutual recursion error.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace-root-mutual-recursion/snapshots/query - mutual recursion error.snap index ea18f6a9..e8a939d8 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace-root-mutual-recursion/snapshots/query - mutual recursion error.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/workspace-root-mutual-recursion/snapshots/query - mutual recursion error.snap @@ -1,6 +1,6 @@ --- source: crates/vite_task_plan/tests/plan_snapshots/main.rs -expression: err_str.as_ref() +expression: "&err_str" info: args: - run diff --git a/crates/vite_task_plan/tests/plan_snapshots/main.rs b/crates/vite_task_plan/tests/plan_snapshots/main.rs index 7d99e759..eb6d0b8f 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/main.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/main.rs @@ -1,6 +1,7 @@ mod redact; use std::{ + borrow::Cow, collections::{BTreeMap, BTreeSet}, ffi::OsStr, sync::Arc, @@ -9,6 +10,7 @@ use std::{ use clap::Parser; use copy_dir::copy_dir; use cow_utils::CowUtils as _; +use pathdiff::diff_paths; use redact::redact_snapshot; use rustc_hash::FxHashMap; use serde::Serialize; @@ -20,6 +22,43 @@ use vite_task_graph::display::TaskDisplay; use vite_task_plan::{ExecutionGraph, ExecutionItemKind}; use vite_workspace::find_workspace_root; +const COMPILE_TIME_VT_PATH: &str = env!("COMPILE_TIME_VT_PATH"); +const COMPILE_TIME_VTT_PATH: &str = env!("COMPILE_TIME_VTT_PATH"); +const COMPILE_TIME_MANIFEST_DIR: &str = env!("CARGO_MANIFEST_DIR"); + +/// Resolve a binary's runtime path from its compile-time path. +/// +/// Computes `join(runtime_manifest, diff(compile_time_bin, compile_time_manifest))`. +#[expect( + clippy::disallowed_types, + reason = "PathBuf required for compile-time/runtime binary path remapping" +)] +fn resolve_runtime_bin_path(compile_time_bin_path: &str) -> AbsolutePathBuf { + let compile_time_bin = std::path::PathBuf::from(compile_time_bin_path); + let compile_time_manifest = std::path::PathBuf::from(COMPILE_TIME_MANIFEST_DIR); + let runtime_manifest = + std::path::PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()); + + let relative_bin = diff_paths(&compile_time_bin, &compile_time_manifest).unwrap_or_else(|| { + panic!( + "Failed to diff binary path. bin={} manifest={}", + compile_time_bin.display(), + compile_time_manifest.display(), + ) + }); + let runtime_bin = runtime_manifest.join(&relative_bin); + + let runtime_bin = runtime_bin.canonicalize().unwrap_or_else(|_| { + panic!( + "Remapped binary path does not exist: {} (relative: {})", + runtime_bin.display(), + relative_bin.display(), + ) + }); + + AbsolutePathBuf::new(runtime_bin).unwrap() +} + /// Local parser wrapper for `BuiltInCommand` #[derive(Parser)] #[command(name = "vt")] @@ -106,6 +145,55 @@ impl CompactPlan { } } +/// Redact workspace paths from error strings for snapshot stability. +/// +/// On Windows, error messages may contain Debug-format paths with escaped +/// backslashes (`\\`). This function tries both raw and escaped variants +/// of the workspace root, then normalizes backslashes to forward slashes. +#[expect( + clippy::disallowed_types, + reason = "String required for cow_replace and into_owned operations" +)] +fn redact_error_string(err_str: &str, workspace_root: &str) -> String { + let workspace_root_stripped = workspace_root.strip_prefix(r"\\?\").unwrap_or(workspace_root); + // Try matching the escaped variant first (Debug-format paths have \\ for each \) + let workspace_root_escaped = workspace_root.cow_replace('\\', r"\\"); + let workspace_root_stripped_escaped = workspace_root_stripped.cow_replace('\\', r"\\"); + + let mut result = err_str.to_owned(); + // Try escaped variants first (longest match) + if let Cow::Owned(replaced) = + result.as_str().cow_replace(workspace_root_escaped.as_ref(), "") + { + result = replaced; + } + if let Cow::Owned(replaced) = + result.as_str().cow_replace(workspace_root_stripped_escaped.as_ref(), "") + { + result = replaced; + } + // Try raw variants + if let Cow::Owned(replaced) = result.as_str().cow_replace(workspace_root, "") { + result = replaced; + } + if let Cow::Owned(replaced) = + result.as_str().cow_replace(workspace_root_stripped, "") + { + result = replaced; + } + // Normalize backslashes to forward slashes on Windows + if cfg!(windows) { + if let Cow::Owned(replaced) = result.as_str().cow_replace('\\', "/") { + result = replaced; + } + // Collapse double forward slashes + while result.contains("//") { + result = result.cow_replace("//", "/").into_owned(); + } + } + result +} + #[expect(clippy::disallowed_types, reason = "Path required by insta::glob! callback signature")] fn run_case( runtime: &Runtime, @@ -166,27 +254,18 @@ fn run_case_inner( Err(err) => panic!("Failed to read cases.toml for fixture {fixture_name}: {err}"), }; - // Navigate from CARGO_MANIFEST_DIR to packages/tools at the repo root - #[expect( - clippy::disallowed_types, - reason = "Path required for CARGO_MANIFEST_DIR path manipulation to locate packages/tools" - )] - let test_bin_path = { - let repo_root = - std::path::Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap(); - Arc::::from( - repo_root - .join("packages") - .join("tools") - .join("node_modules") - .join(".bin") - .into_os_string(), - ) - }; + // Resolve vt and vtt binary directories for PATH. + let bin_dirs: [Arc; 2] = [COMPILE_TIME_VT_PATH, COMPILE_TIME_VTT_PATH].map(|p| { + let bin = resolve_runtime_bin_path(p); + Arc::::from(bin.parent().unwrap().as_path().as_os_str()) + }); + let path_sep = if cfg!(windows) { ";" } else { ":" }; + let combined_path = Arc::::from(std::ffi::OsString::from( + [bin_dirs[0].to_str().unwrap(), bin_dirs[1].to_str().unwrap()].join(path_sep), + )); - // Add packages/tools to PATH so test programs (such as print-file) in fixtures can be found. let plan_envs: FxHashMap, Arc> = [ - (Arc::::from(OsStr::new("PATH")), Arc::clone(&test_bin_path)), + (Arc::::from(OsStr::new("PATH")), combined_path), (Arc::::from(OsStr::new("NO_COLOR")), Arc::::from(OsStr::new("1"))), ] .into_iter() @@ -207,15 +286,13 @@ fn run_case_inner( Ok(task_graph) => task_graph, Err(err) => { let err_formatted = vite_str::format!("{err:#}"); - let err_str = err_formatted.as_str().cow_replace(workspace_root_str, ""); - let err_str = - if cfg!(windows) { err_str.as_ref().cow_replace('\\', "/") } else { err_str }; + let err_str = redact_error_string(&err_formatted, workspace_root_str); #[expect( clippy::disallowed_macros, reason = "insta::assert_snapshot! internally uses std::format!" )] { - insta::assert_snapshot!("task graph load error", err_str.as_ref()); + insta::assert_snapshot!("task graph load error", &err_str); } return; } @@ -270,19 +347,13 @@ fn run_case_inner( // and redact workspace paths for snapshot stability. let anyhow_err: anyhow::Error = err.into(); let err_formatted = vite_str::format!("{anyhow_err:#}"); - let err_str = - err_formatted.as_str().cow_replace(workspace_root_str, ""); - let err_str = if cfg!(windows) { - err_str.as_ref().cow_replace('\\', "/") - } else { - err_str - }; + let err_str = redact_error_string(&err_formatted, workspace_root_str); #[expect( clippy::disallowed_macros, reason = "insta::assert_snapshot! internally uses std::format!" )] { - insta::assert_snapshot!(snapshot_name.as_str(), err_str.as_ref()); + insta::assert_snapshot!(snapshot_name.as_str(), &err_str); } continue; } diff --git a/crates/vite_task_plan/tests/plan_snapshots/redact.rs b/crates/vite_task_plan/tests/plan_snapshots/redact.rs index ecdc0626..cbcd421d 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/redact.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/redact.rs @@ -60,25 +60,11 @@ fn redact_string(s: &mut String, redactions: &[(&str, &str)]) { } } -#[expect( - clippy::disallowed_types, - reason = "String required by std::env::var return type and serde_json Value manipulation; Path required for CARGO_MANIFEST_DIR path manipulation" -)] -#[expect( - clippy::too_many_lines, - reason = "redaction logic is sequential and reads better in one function" -)] pub fn redact_snapshot(value: &impl Serialize, workspace_root: &str) -> serde_json::Value { let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); - // Get the packages/tools directory path - let tools_dir = std::path::Path::new(&manifest_dir) - .parent() - .unwrap() - .parent() - .unwrap() - .join("packages") - .join("tools"); - let tools_dir_str = tools_dir.to_str().unwrap().to_owned(); + // Get the vtt binary directory path via compile-time/runtime path remapping. + let tools_dir = super::resolve_runtime_bin_path(super::COMPILE_TIME_VTT_PATH); + let tools_dir_str = tools_dir.parent().unwrap().as_path().to_str().unwrap().to_owned(); let mut json_value = serde_json::to_value(value).unwrap(); // On Windows, paths might use either backslashes or forward slashes