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 07933b5c..d9b24f76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1143,6 +1143,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" +[[package]] +name = "fsevent-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +dependencies = [ + "libc", +] + [[package]] name = "fspy" version = "0.1.0" @@ -1552,6 +1561,26 @@ dependencies = [ "rustversion", ] +[[package]] +name = "inotify" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd5b3eaf1a28b758ac0faa5a4254e8ab2705605496f1b1f3fbbc3988ad73d199" +dependencies = [ + "bitflags 2.10.0", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + [[package]] name = "insta" version = "1.46.3" @@ -1676,6 +1705,26 @@ version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" +[[package]] +name = "kqueue" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.3.2", + "libc", +] + [[package]] name = "lab" version = "0.11.0" @@ -1968,6 +2017,33 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "notify" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" +dependencies = [ + "bitflags 2.10.0", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "log", + "mio", + "notify-types", + "walkdir", + "windows-sys 0.60.2", +] + +[[package]] +name = "notify-types" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b8cfee0e339a0337359f3c88165702ac6e600dc01c0cc9579a92d62b08477a" +dependencies = [ + "bitflags 2.10.0", +] + [[package]] name = "ntapi" version = "0.4.3" @@ -2261,12 +2337,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" -[[package]] -name = "pathdiff" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" - [[package]] name = "peg" version = "0.8.5" @@ -3911,11 +3981,11 @@ dependencies = [ "cp_r", "insta", "jsonc-parser", - "pathdiff", + "libc", + "notify", "pty_terminal", "pty_terminal_test", "regex", - "rustc-hash", "serde", "serde_json", "tempfile", @@ -3949,7 +4019,6 @@ dependencies = [ "vite_str", "vite_workspace", "wax", - "which", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 87013713..a39f596d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -93,8 +93,8 @@ os_str_bytes = "7.1.1" ouroboros = "0.18.5" owo-colors = { version = "4.1.0", features = ["supports-colors"] } passfd = { git = "https://github.com/polachok/passfd", rev = "d55881752c16aced1a49a75f9c428d38d3767213", default-features = false } +notify = "8.0.0" path-clean = "1.0.1" -pathdiff = "0.2.3" petgraph = "0.8.2" phf = { version = "0.11.3", features = ["macros"] } portable-pty = "0.9.0" @@ -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..d80200eb 100644 --- a/crates/vite_task_bin/Cargo.toml +++ b/crates/vite_task_bin/Cargo.toml @@ -10,12 +10,17 @@ rust-version.workspace = true name = "vt" path = "src/main.rs" +[[bin]] +name = "vtt" +path = "src/vtt/main.rs" + [dependencies] anyhow = { workspace = true } +libc = { workspace = true } +notify = { workspace = true } async-trait = { workspace = true } clap = { workspace = true, features = ["derive"] } jsonc-parser = { workspace = true } -rustc-hash = { workspace = true } serde_json = { workspace = true } tokio = { workspace = true, features = ["full"] } vite_path = { workspace = true } @@ -27,7 +32,6 @@ which = { workspace = true } cow-utils = { workspace = true } cp_r = { workspace = true } insta = { workspace = true, features = ["glob", "json", "redactions", "filters", "ron"] } -pathdiff = { workspace = true } pty_terminal = { workspace = true } pty_terminal_test = { workspace = true } regex = { workspace = true } diff --git a/crates/vite_task_bin/src/lib.rs b/crates/vite_task_bin/src/lib.rs index 16404b46..32dc72f3 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,25 @@ pub fn find_executable( Ok(executable_path.into_os_string().into()) } -/// Create a synthetic plan request for running a tool from `node_modules/.bin`. +/// Internal argument parser for `vt`/`vp` commands that appear inside task scripts. /// -/// # 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), - }) -} - +/// [`CommandHandler`] uses this to parse the command line when it intercepts a `vt` or `vp` +/// invocation during script execution. It extends [`Command`] with a `tool` subcommand that +/// forwards to the `vtt` test-utility binary — a subcommand that only makes sense within +/// script execution and is therefore not exposed on the top-level `vt` CLI entry point. #[derive(Debug, Parser)] #[command(name = "vt", version)] -pub enum Args { - Lint { +enum Args { + /// Forward arguments to the `vtt` test-utility binary. + /// + /// Resolves `vtt` via `node_modules/.bin` lookup (same as any other script executable), + /// then synthesizes a cached invocation with the given arguments. The `--` separator, + /// if present, is stripped before forwarding. + 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, - }, + /// Any other `vt` subcommand, delegated to the standard [`Command`] parser. #[command(flatten)] Task(Command), } @@ -109,30 +89,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..a0569897 100644 --- a/crates/vite_task_bin/src/main.rs +++ b/crates/vite_task_bin/src/main.rs @@ -1,59 +1,18 @@ -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 clap::Parser as _; +use vite_task::{Command, ExitStatus, Session}; +use vite_task_bin::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()) } async fn run() -> anyhow::Result { - let args = Args::parse(); + let args = Command::parse(); let mut owned_config = OwnedSessionConfig::default(); 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); - } - } - #[expect(clippy::print_stdout, reason = "CLI binary output for non-task commands")] - { - println!("{args:?}"); - } - Ok(ExitStatus::SUCCESS) - } - } + session.main(args).await } diff --git a/crates/vite_task_bin/src/vtt/barrier.rs b/crates/vite_task_bin/src/vtt/barrier.rs new file mode 100644 index 00000000..c79db027 --- /dev/null +++ b/crates/vite_task_bin/src/vtt/barrier.rs @@ -0,0 +1,89 @@ +/// barrier `` `` `` \[--exit=``\] \[--hang\] \[--daemonize\] +/// +/// Cross-platform concurrency barrier for testing. +/// Creates `/_`, then polls until `` files matching +/// `_*` exist in ``. +/// +/// Options: +/// - `--exit=`: Exit with the given code after the barrier is met. +/// - `--hang`: Keep process alive after the barrier (for kill tests). +/// - `--daemonize`: Close stdout/stderr but keep process alive (for daemon kill tests). +pub fn run(args: &[String]) -> Result<(), Box> { + use notify::Watcher as _; + let mut positional: Vec<&str> = Vec::new(); + let mut exit_code: i32 = 0; + let mut hang = false; + let mut daemonize = false; + + for arg in args { + if let Some(code) = arg.strip_prefix("--exit=") { + exit_code = code.parse()?; + } else if arg == "--hang" { + hang = true; + } else if arg == "--daemonize" { + daemonize = true; + } else { + positional.push(arg.as_str()); + } + } + + if positional.len() < 3 { + return Err( + "Usage: vtt barrier [--exit=] [--hang] [--daemonize]" + .into(), + ); + } + + let dir = std::path::Path::new(positional[0]); + let prefix = positional[1]; + let count: usize = positional[2].parse()?; + + std::fs::create_dir_all(dir)?; + + // Create this participant's marker file. + let pid = std::process::id(); + let marker = dir.join(std::format!("{prefix}_{pid}")); + std::fs::write(&marker, "")?; + + // Wait until matching files exist using filesystem notifications. + let prefix_match = std::format!("{prefix}_"); + let count_matches = |d: &std::path::Path| -> Result> { + Ok(std::fs::read_dir(d)? + .filter_map(Result::ok) + .filter(|e| e.file_name().to_string_lossy().starts_with(prefix_match.as_str())) + .count() + >= count) + }; + let (tx, rx) = std::sync::mpsc::channel(); + let mut watcher = notify::recommended_watcher(tx)?; + watcher.watch(dir, notify::RecursiveMode::NonRecursive)?; + if !count_matches(dir)? { + for _ in rx { + if count_matches(dir)? { + break; + } + } + } + + if daemonize { + // Close stdout/stderr but keep the process alive. Simulates a daemon that + // detaches from stdio — tests that the runner can still kill such processes. + // Closing the fds gives the parent's pipe an EOF. + // SAFETY: fds 1 and 2 are always valid (stdout/stderr). + unsafe { + libc::close(1); + libc::close(2); + } + loop { + std::thread::park(); + } + } + + if hang { + loop { + std::thread::park(); + } + } + + std::process::exit(exit_code); +} diff --git a/crates/vite_task_bin/src/vtt/check_tty.rs b/crates/vite_task_bin/src/vtt/check_tty.rs new file mode 100644 index 00000000..0c3f0a73 --- /dev/null +++ b/crates/vite_task_bin/src/vtt/check_tty.rs @@ -0,0 +1,9 @@ +pub fn run() { + 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}"); +} diff --git a/crates/vite_task_bin/src/vtt/main.rs b/crates/vite_task_bin/src/vtt/main.rs new file mode 100644 index 00000000..bddaf857 --- /dev/null +++ b/crates/vite_task_bin/src/vtt/main.rs @@ -0,0 +1,55 @@ +// 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")] + +mod barrier; +mod check_tty; +mod print; +mod print_cwd; +mod print_env; +mod print_file; +mod read_stdin; +mod replace_file_content; +mod touch_file; + +fn main() { + let args: Vec = std::env::args().collect(); + if args.len() < 2 { + eprintln!("Usage: vtt [args...]"); + eprintln!( + "Subcommands: barrier, 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() { + "barrier" => barrier::run(&args[2..]), + "check-tty" => { + check_tty::run(); + Ok(()) + } + "print" => { + print::run(&args[2..]); + Ok(()) + } + "print-cwd" => print_cwd::run(), + "print-env" => print_env::run(&args[2..]), + "print-file" => print_file::run(&args[2..]), + "read-stdin" => read_stdin::run(), + "replace-file-content" => replace_file_content::run(&args[2..]), + "touch-file" => touch_file::run(&args[2..]), + other => { + eprintln!("Unknown subcommand: {other}"); + std::process::exit(1); + } + }; + + if let Err(err) = result { + eprintln!("{err}"); + std::process::exit(1); + } +} diff --git a/crates/vite_task_bin/src/vtt/print.rs b/crates/vite_task_bin/src/vtt/print.rs new file mode 100644 index 00000000..e434e6cf --- /dev/null +++ b/crates/vite_task_bin/src/vtt/print.rs @@ -0,0 +1,3 @@ +pub fn run(args: &[String]) { + println!("{}", args.join(" ")); +} diff --git a/crates/vite_task_bin/src/vtt/print_cwd.rs b/crates/vite_task_bin/src/vtt/print_cwd.rs new file mode 100644 index 00000000..55db04cb --- /dev/null +++ b/crates/vite_task_bin/src/vtt/print_cwd.rs @@ -0,0 +1,5 @@ +pub fn run() -> Result<(), Box> { + let cwd = std::env::current_dir()?; + println!("{}", cwd.display()); + Ok(()) +} diff --git a/crates/vite_task_bin/src/vtt/print_env.rs b/crates/vite_task_bin/src/vtt/print_env.rs new file mode 100644 index 00000000..00387b46 --- /dev/null +++ b/crates/vite_task_bin/src/vtt/print_env.rs @@ -0,0 +1,8 @@ +pub fn run(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(()) +} diff --git a/crates/vite_task_bin/src/vtt/print_file.rs b/crates/vite_task_bin/src/vtt/print_file.rs new file mode 100644 index 00000000..8234dd3c --- /dev/null +++ b/crates/vite_task_bin/src/vtt/print_file.rs @@ -0,0 +1,12 @@ +pub fn run(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(()) +} diff --git a/crates/vite_task_bin/src/vtt/read_stdin.rs b/crates/vite_task_bin/src/vtt/read_stdin.rs new file mode 100644 index 00000000..1072df52 --- /dev/null +++ b/crates/vite_task_bin/src/vtt/read_stdin.rs @@ -0,0 +1,13 @@ +pub fn run() -> 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(()) +} diff --git a/crates/vite_task_bin/src/vtt/replace_file_content.rs b/crates/vite_task_bin/src/vtt/replace_file_content.rs new file mode 100644 index 00000000..df868e95 --- /dev/null +++ b/crates/vite_task_bin/src/vtt/replace_file_content.rs @@ -0,0 +1,17 @@ +pub fn run(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(()) +} diff --git a/crates/vite_task_bin/src/vtt/touch_file.rs b/crates/vite_task_bin/src/vtt/touch_file.rs new file mode 100644 index 00000000..96d2393b --- /dev/null +++ b/crates/vite_task_bin/src/vtt/touch_file.rs @@ -0,0 +1,7 @@ +pub fn run(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/.gitkeep b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/folder1/.gitkeep new file mode 100644 index 00000000..e69de29b 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/.gitkeep b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/folder2/.gitkeep new file mode 100644 index 00000000..e69de29b 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/.gitignore b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/.gitignore deleted file mode 100644 index 231280da..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/.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-non-zero-exit/bad.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/bad.js deleted file mode 100644 index eab74692..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/bad.js +++ /dev/null @@ -1 +0,0 @@ -debugger; 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 deleted file mode 100644 index 41cc41a8..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "builtin-non-zero-exit-test", - "scripts": { - "lint": "vt lint" - } -} 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 deleted file mode 100644 index 691f16ee..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml +++ /dev/null @@ -1,3 +0,0 @@ -[[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"] 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 deleted file mode 100644 index b74a8fc0..00000000 --- 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 +++ /dev/null @@ -1,28 +0,0 @@ ---- -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. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/vite-task.json deleted file mode 100644 index d548edfa..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/vite-task.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cache": true -} 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/concurrent-execution/packages/a/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/packages/a/package.json index 6a46b3fa..96676539 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/packages/a/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/packages/a/package.json @@ -1,8 +1,8 @@ { "name": "@concurrent/a", "scripts": { - "build": "barrier ../../.barrier sync 2", - "test": "barrier ../../.barrier test-sync 2 --exit=1", - "daemon": "barrier ../../.barrier daemon-sync 2 --exit=1" + "build": "vtt barrier ../../.barrier sync 2", + "test": "vtt barrier ../../.barrier test-sync 2 --exit=1", + "daemon": "vtt barrier ../../.barrier daemon-sync 2 --exit=1" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/packages/b/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/packages/b/package.json index 40e49f3c..26eed0c8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/packages/b/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/packages/b/package.json @@ -1,8 +1,8 @@ { "name": "@concurrent/b", "scripts": { - "build": "barrier ../../.barrier sync 2", - "test": "barrier ../../.barrier test-sync 2 --hang", - "daemon": "barrier ../../.barrier daemon-sync 2 --daemonize" + "build": "vtt barrier ../../.barrier sync 2", + "test": "vtt barrier ../../.barrier test-sync 2 --hang", + "daemon": "vtt barrier ../../.barrier daemon-sync 2 --daemonize" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills concurrent cached tasks.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills concurrent cached tasks.snap index 71c7dc36..21d12bf7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills concurrent cached tasks.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills concurrent cached tasks.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- [1]> vt run -r --cache test -~/packages/a$ barrier ../../.barrier test-sync 2 --exit=1 -~/packages/b$ barrier ../../.barrier test-sync 2 --hang +~/packages/a$ vtt barrier ../../.barrier test-sync 2 --exit=1 +~/packages/b$ vtt barrier ../../.barrier test-sync 2 --hang --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills concurrent tasks.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills concurrent tasks.snap index 6fd09500..9be79448 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills concurrent tasks.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills concurrent tasks.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- [1]> vt run -r test -~/packages/a$ barrier ../../.barrier test-sync 2 --exit=1 ⊘ cache disabled -~/packages/b$ barrier ../../.barrier test-sync 2 --hang ⊘ cache disabled +~/packages/a$ vtt barrier ../../.barrier test-sync 2 --exit=1 ⊘ cache disabled +~/packages/b$ vtt barrier ../../.barrier test-sync 2 --hang ⊘ cache disabled --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills daemonized concurrent tasks.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills daemonized concurrent tasks.snap index 4713ed55..0c230f23 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills daemonized concurrent tasks.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/failure kills daemonized concurrent tasks.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- [1]> vt run -r --cache daemon -~/packages/a$ barrier ../../.barrier daemon-sync 2 --exit=1 -~/packages/b$ barrier ../../.barrier daemon-sync 2 --daemonize +~/packages/a$ vtt barrier ../../.barrier daemon-sync 2 --exit=1 +~/packages/b$ vtt barrier ../../.barrier daemon-sync 2 --daemonize --- diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/independent tasks run concurrently.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/independent tasks run concurrently.snap index c8b10252..ede9c773 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/independent tasks run concurrently.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots/independent tasks run concurrently.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run -r build -~/packages/a$ barrier ../../.barrier sync 2 ⊘ cache disabled -~/packages/b$ barrier ../../.barrier sync 2 ⊘ cache disabled +~/packages/a$ vtt barrier ../../.barrier sync 2 ⊘ cache disabled +~/packages/b$ vtt barrier ../../.barrier sync 2 ⊘ cache disabled --- 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/.gitignore b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/.gitignore deleted file mode 100644 index 231280da..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/.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/e2e-lint-cache/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json deleted file mode 100644 index 3868e3ce..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "e2e-lint-cache", - "private": true, - "scripts": { - "lint": "vt lint" - } -} 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 deleted file mode 100644 index adf57ba2..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml +++ /dev/null @@ -1,9 +0,0 @@ -# Tests lint 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", -] 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 deleted file mode 100644 index c55bf2c5..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap +++ /dev/null @@ -1,22 +0,0 @@ ---- -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 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. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/vite-task.json deleted file mode 100644 index d548edfa..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/vite-task.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cache": true -} 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 72ebe436..740cdb1a 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/touch-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 ebf215e5..75747ab6 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,7 +1,7 @@ { "name": "@test/touch-pkg", "scripts": { - "task": "touch-file src/data.txt" + "task": "vtt touch-file src/data.txt" }, "dependencies": { "@test/normal-pkg": "workspace:*" 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/.gitignore b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/.gitignore deleted file mode 100644 index 231280da..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/.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/lint-dot-git/a.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/a.js deleted file mode 100644 index dddcb9f2..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/a.js +++ /dev/null @@ -1 +0,0 @@ -// Empty JS file for oxlint 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 deleted file mode 100644 index 6c5372ed..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "scripts": { - "lint": "vt lint" - } -} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml deleted file mode 100644 index 364c0dcc..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml +++ /dev/null @@ -1,10 +0,0 @@ -# Tests that .git directory is ignored by lint - -[[e2e]] -name = "lint dot git" -steps = [ - "mkdir .git", - "vt run lint # cache miss", - "echo hello > .git/foo.txt # add file inside .git", - "vt run lint # cache hit, .git is ignored", -] 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 deleted file mode 100644 index 2947f023..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap +++ /dev/null @@ -1,35 +0,0 @@ ---- -source: crates/vite_task_bin/tests/e2e_snapshots/main.rs -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. -> 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 run: cache hit, saved. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/vite-task.json deleted file mode 100644 index d548edfa..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/vite-task.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cache": true -} 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..36d4d168 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/main.rs +++ b/crates/vite_task_bin/tests/e2e_snapshots/main.rs @@ -9,7 +9,6 @@ use std::{ }; use cp_r::CopyOptions; -use pathdiff::diff_paths; use pty_terminal::{geo::ScreenSize, terminal::CommandBuilder}; use pty_terminal_test::TestTerminal; use redact::redact_e2e_output; @@ -25,9 +24,6 @@ const STEP_TIMEOUT: Duration = /// Screen size for the PTY terminal. Large enough to avoid line wrapping. const SCREEN_SIZE: ScreenSize = ScreenSize { rows: 500, cols: 500 }; -const COMPILE_TIME_VT_PATH: &str = env!("CARGO_BIN_EXE_vt"); -const COMPILE_TIME_MANIFEST_DIR: &str = env!("CARGO_MANIFEST_DIR"); - /// Get the shell executable for running e2e test steps. /// On Unix, uses /bin/sh. /// On Windows, uses BASH env var or falls back to Git Bash. @@ -58,38 +54,6 @@ fn get_shell_exe() -> std::path::PathBuf { } } -#[expect( - clippy::disallowed_types, - reason = "PathBuf required for compile-time/runtime vt path remapping" -)] -fn resolve_runtime_vt_path() -> AbsolutePathBuf { - let compile_time_vt = std::path::PathBuf::from(COMPILE_TIME_VT_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(|| { - panic!( - "Failed to diff vt path. vt={} repo_root={}", - compile_time_vt.display(), - compile_time_repo_root.display(), - ) - }); - let runtime_vt = runtime_repo_root.join(&relative_vt); - - assert!( - runtime_vt.exists(), - "Remapped vt path does not exist: {} (relative: {})", - runtime_vt.display(), - relative_vt.display(), - ); - - AbsolutePathBuf::new(runtime_vt).unwrap() -} - #[derive(serde::Deserialize, Debug)] #[serde(untagged)] enum Step { @@ -264,34 +228,17 @@ 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] = ["CARGO_BIN_EXE_vt", "CARGO_BIN_EXE_vtt"].map(|var| { + let bin_path = env::var_os(var).unwrap_or_else(|| panic!("{var} not set")); + let bin = AbsolutePathBuf::new(std::path::PathBuf::from(bin_path)).unwrap(); + 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_graph/Cargo.toml b/crates/vite_task_graph/Cargo.toml index 52a80138..1316b738 100644 --- a/crates/vite_task_graph/Cargo.toml +++ b/crates/vite_task_graph/Cargo.toml @@ -28,7 +28,6 @@ pretty_assertions = { workspace = true } ts-rs = { workspace = true, features = ["no-serde-warnings"] } vite_path = { workspace = true, features = ["ts-rs"] } vite_str = { workspace = true, features = ["ts-rs"] } -which = { workspace = true } [lints] workspace = true diff --git a/crates/vite_task_graph/run-config.ts b/crates/vite_task_graph/run-config.ts index 69e4a661..9c7852a9 100644 --- a/crates/vite_task_graph/run-config.ts +++ b/crates/vite_task_graph/run-config.ts @@ -1,117 +1,105 @@ // This file is auto-generated by `cargo test`. Do not edit manually. -export type AutoInput = { - /** - * Automatically track which files the task reads - */ - auto: boolean; -}; +export type AutoInput = { +/** + * Automatically track which files the task reads + */ +auto: boolean, }; -export type GlobWithBase = { - /** - * The glob pattern (positive or negative starting with `!`) - */ - pattern: string; - /** - * The base directory for resolving the pattern - */ - base: InputBase; -}; +export type GlobWithBase = { +/** + * The glob pattern (positive or negative starting with `!`) + */ +pattern: string, +/** + * The base directory for resolving the pattern + */ +base: InputBase, }; -export type InputBase = 'package' | 'workspace'; +export type InputBase = "package" | "workspace"; -export type Task = { - /** - * The command to run for the task. - */ - command: string; - /** - * The working directory for the task, relative to the package root (not workspace root). - */ - cwd?: string; - /** - * Dependencies of this task. Use `package-name#task-name` to refer to tasks in other packages. - */ - dependsOn?: Array; -} & ( - | { - /** - * Whether to cache the task - */ - cache?: true; - /** - * Environment variable names to be fingerprinted and passed to the task. - */ - env?: Array; - /** - * Environment variable names to be passed to the task without fingerprinting. - */ - untrackedEnv?: Array; - /** - * Files to include in the cache fingerprint. - * - * - Omitted: automatically tracks which files the task reads - * - `[]` (empty): disables file tracking entirely - * - Glob patterns (e.g. `"src/**"`) select specific files, relative to the package directory - * - `{pattern: "...", base: "workspace" | "package"}` specifies a glob with an explicit base directory - * - `{auto: true}` enables automatic file tracking - * - Negative patterns (e.g. `"!dist/**"`) exclude matched files - */ - input?: Array; - } - | { - /** - * Whether to cache the task - */ - cache: false; - } -); +export type Task = { +/** + * The command to run for the task. + */ +command: string, +/** + * The working directory for the task, relative to the package root (not workspace root). + */ +cwd?: string, +/** + * Dependencies of this task. Use `package-name#task-name` to refer to tasks in other packages. + */ +dependsOn?: Array, } & ({ +/** + * Whether to cache the task + */ +cache?: true, +/** + * Environment variable names to be fingerprinted and passed to the task. + */ +env?: Array, +/** + * Environment variable names to be passed to the task without fingerprinting. + */ +untrackedEnv?: Array, +/** + * Files to include in the cache fingerprint. + * + * - Omitted: automatically tracks which files the task reads + * - `[]` (empty): disables file tracking entirely + * - Glob patterns (e.g. `"src/**"`) select specific files, relative to the package directory + * - `{pattern: "...", base: "workspace" | "package"}` specifies a glob with an explicit base directory + * - `{auto: true}` enables automatic file tracking + * - Negative patterns (e.g. `"!dist/**"`) exclude matched files + */ +input?: Array, } | { +/** + * Whether to cache the task + */ +cache: false, }); -export type UserGlobalCacheConfig = - | boolean - | { - /** - * Enable caching for package.json scripts not defined in the `tasks` map. - * - * When `false`, package.json scripts will not be cached. - * When `true`, package.json scripts will be cached with default settings. - * - * Default: `false` - */ - scripts?: boolean; - /** - * Global cache kill switch for task entries. - * - * When `false`, overrides all tasks to disable caching, even tasks with `cache: true`. - * When `true`, respects each task's individual `cache` setting - * (each task's `cache` defaults to `true` if omitted). - * - * Default: `true` - */ - tasks?: boolean; - }; +export type UserGlobalCacheConfig = boolean | { +/** + * Enable caching for package.json scripts not defined in the `tasks` map. + * + * When `false`, package.json scripts will not be cached. + * When `true`, package.json scripts will be cached with default settings. + * + * Default: `false` + */ +scripts?: boolean, +/** + * Global cache kill switch for task entries. + * + * When `false`, overrides all tasks to disable caching, even tasks with `cache: true`. + * When `true`, respects each task's individual `cache` setting + * (each task's `cache` defaults to `true` if omitted). + * + * Default: `true` + */ +tasks?: boolean, }; -export type RunConfig = { - /** - * Root-level cache configuration. - * - * This option can only be set in the workspace root's config file. - * Setting it in a package's config will result in an error. - */ - cache?: UserGlobalCacheConfig; - /** - * Task definitions - */ - tasks?: { [key in string]?: Task }; - /** - * Whether to automatically run `preX`/`postX` package.json scripts as - * lifecycle hooks when script `X` is executed. - * - * When `true` (the default), running script `test` will automatically - * run `pretest` before and `posttest` after, if they exist. - * - * This option can only be set in the workspace root's config file. - * Setting it in a package's config will result in an error. - */ - enablePrePostScripts?: boolean; -}; +export type RunConfig = { +/** + * Root-level cache configuration. + * + * This option can only be set in the workspace root's config file. + * Setting it in a package's config will result in an error. + */ +cache?: UserGlobalCacheConfig, +/** + * Task definitions + */ +tasks?: { [key in string]?: Task }, +/** + * Whether to automatically run `preX`/`postX` package.json scripts as + * lifecycle hooks when script `X` is executed. + * + * When `true` (the default), running script `test` will automatically + * run `pretest` before and `posttest` after, if they exist. + * + * This option can only be set in the workspace root's config file. + * Setting it in a package's config will result in an error. + */ +enablePrePostScripts?: boolean, }; \ No newline at end of file diff --git a/crates/vite_task_graph/src/config/user.rs b/crates/vite_task_graph/src/config/user.rs index 1eaf9fe1..206f57cb 100644 --- a/crates/vite_task_graph/src/config/user.rs +++ b/crates/vite_task_graph/src/config/user.rs @@ -273,22 +273,12 @@ impl UserRunConfig { pub const TS_TYPE: &str = include_str!("../../run-config.ts"); /// Generates TypeScript type definitions for user task configuration. - /// - /// # Panics - /// - /// Panics if `oxfmt` is not found in `packages/tools`, if the formatter process - /// fails to spawn or write, or if the output is not valid UTF-8. #[cfg(all(test, not(clippy)))] #[must_use] // test code: uses std types for convenience #[expect(clippy::disallowed_types, reason = "test code uses std types for convenience")] pub fn generate_ts_definition() -> String { - use std::{ - any::TypeId, - collections::HashSet, - io::Write, - process::{Command, Stdio}, - }; + use std::{any::TypeId, collections::HashSet}; use ts_rs::TypeVisitor; @@ -335,32 +325,7 @@ impl UserRunConfig { types.push_str("\n\nexport "); types.push_str(&Self::decl()); - // Format using oxfmt from packages/tools - let workspace_root = - std::path::Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap(); - let tools_path = workspace_root.join("packages/tools/node_modules/.bin"); - - let oxfmt_path = which::which_in("oxfmt", Some(&tools_path), &tools_path) - .expect("oxfmt not found in packages/tools"); - - let mut child = Command::new(oxfmt_path) - .arg("--stdin-filepath=run-config.ts") - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .spawn() - .expect("failed to spawn oxfmt"); - - child - .stdin - .take() - .unwrap() - .write_all(types.as_bytes()) - .expect("failed to write to oxfmt stdin"); - - let output = child.wait_with_output().expect("failed to read oxfmt output"); - assert!(output.status.success(), "oxfmt failed"); - - String::from_utf8(output.stdout).expect("oxfmt output is not valid UTF-8") + types } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fake-bin/README.md b/crates/vite_task_plan/tests/plan_snapshots/fake-bin/README.md new file mode 100644 index 00000000..0ecd751a --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fake-bin/README.md @@ -0,0 +1,10 @@ +# fake-bin + +Stub executables used by plan snapshot tests. + +Plan tests need `vtt` to be resolvable on `PATH` so that `find_executable` can produce +an absolute path for task commands like `vtt print-file package.json`. The binary is +never actually executed during plan tests — only its resolved path appears in snapshots. + +- `vtt` — Unix stub (executable shell script) +- `vtt.cmd` — Windows stub (looked up via `PATHEXT`) diff --git a/crates/vite_task_plan/tests/plan_snapshots/fake-bin/vtt b/crates/vite_task_plan/tests/plan_snapshots/fake-bin/vtt new file mode 100755 index 00000000..39a3b707 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fake-bin/vtt @@ -0,0 +1 @@ +#\!/bin/sh diff --git a/crates/vite_task_plan/tests/plan_snapshots/fake-bin/vtt.cmd b/crates/vite_task_plan/tests/plan_snapshots/fake-bin/vtt.cmd new file mode 100644 index 00000000..e69de29b 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..e998b35c 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..96229013 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..a86068f2 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..43d87f5d 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..c468954c 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..54847471 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..80e8a5d3 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..aeeb3a97 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..369af88a 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..47c93c91 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..32b9abdd 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..0f6f310b 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..13da929a 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..1ad6b8d8 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..91936614 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-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..63557fe5 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..bb7aaffb 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..54467767 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..7594b7d3 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..6a53eb9f 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..796d0c9e 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..99ede03b 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..33282150 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..feb7b2ee 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..d87eb446 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..10b37328 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..90a78acb 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/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..6009b4ad 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..7c79d052 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..e645edb2 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..f16cc13a 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..fb6b11cd 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..5e754c41 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/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..db9b1c85 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..ddf0f97e 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..a917af98 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..10b9d818 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..155fb3a9 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..04079568 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..3b7ce025 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..655d1c5b 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/main.rs b/crates/vite_task_plan/tests/plan_snapshots/main.rs index 7d99e759..08ec2859 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/main.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/main.rs @@ -166,27 +166,13 @@ 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(), - ) - }; + let fake_bin_dir = std::path::PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()) + .join("tests/plan_snapshots/fake-bin"); + let combined_path = + Arc::::from(std::ffi::OsString::from(fake_bin_dir.to_str().unwrap())); - // 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() diff --git a/crates/vite_task_plan/tests/plan_snapshots/redact.rs b/crates/vite_task_plan/tests/plan_snapshots/redact.rs index ecdc0626..01e8ca3d 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/redact.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/redact.rs @@ -60,25 +60,14 @@ 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() + #[expect(clippy::disallowed_types, reason = "PathBuf needed to build fake-bin path from env")] + let tools_dir_str = std::path::PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()) + .join("tests/plan_snapshots/fake-bin") + .to_str() .unwrap() - .parent() - .unwrap() - .join("packages") - .join("tools"); - let tools_dir_str = tools_dir.to_str().unwrap().to_owned(); + .to_owned(); let mut json_value = serde_json::to_value(value).unwrap(); // On Windows, paths might use either backslashes or forward slashes @@ -92,10 +81,10 @@ pub fn redact_snapshot(value: &impl Serialize, workspace_root: &str) -> serde_js &[ (workspace_root, ""), (workspace_root_forward.as_ref(), ""), - (manifest_dir.as_str(), ""), - (manifest_dir_forward.as_ref(), ""), (tools_dir_str.as_str(), ""), (tools_dir_forward.as_ref(), ""), + (manifest_dir.as_str(), ""), + (manifest_dir_forward.as_ref(), ""), ], ); diff --git a/packages/tools/README.md b/packages/tools/README.md index b44c946a..629f20d9 100644 --- a/packages/tools/README.md +++ b/packages/tools/README.md @@ -1 +1 @@ -This package contains test utilities and binaries used in the tests for vite_task_bin and fspy crates. +This package provides Node.js dependencies (oxlint, oxfmt, cross-env) used by fspy tests. diff --git a/packages/tools/package.json b/packages/tools/package.json index e1e6acc3..7987eb77 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,23 +1,11 @@ { "name": "vite-task-tools", "private": true, - "bin": { - "barrier": "./src/barrier.js", - "check-tty": "./src/check-tty.js", - "json-edit": "./src/json-edit.ts", - "print": "./src/print.ts", - "print-env": "./src/print-env.js", - "print-file": "./src/print-file.ts", - "read-stdin": "./src/read-stdin.js", - "replace-file-content": "./src/replace-file-content.ts", - "touch-file": "./src/touch-file.ts" - }, "type": "module", "dependencies": { "cross-env": "^10.1.0", "oxfmt": "0.41.0", "oxlint": "catalog:", - "oxlint-tsgolint": "catalog:", - "vite-task-tools": "link:" + "oxlint-tsgolint": "catalog:" } } diff --git a/packages/tools/src/barrier.js b/packages/tools/src/barrier.js deleted file mode 100755 index 87f06aa1..00000000 --- a/packages/tools/src/barrier.js +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env node - -// barrier [--exit=] [--hang] [--daemonize] -// -// Cross-platform concurrency barrier for testing. -// Creates /_, then waits (via fs.watch) for files -// matching _* to exist in . -// -// Options: -// --exit= Exit with the given code after the barrier is met. -// --hang Keep process alive after the barrier (for kill tests). -// --daemonize Close stdout/stderr but keep process alive (for daemon kill tests). -// -// If tasks run concurrently, all participants arrive and the barrier resolves. -// If tasks run sequentially, the first participant waits forever (test timeout). - -import fs from 'node:fs'; -import path from 'node:path'; - -const positional = []; -let exitCode = 0; -let hang = false; -let daemonize = false; - -for (const arg of process.argv.slice(2)) { - if (arg.startsWith('--exit=')) { - exitCode = parseInt(arg.slice(7), 10); - } else if (arg === '--hang') { - hang = true; - } else if (arg === '--daemonize') { - daemonize = true; - } else { - positional.push(arg); - } -} - -const [dir, prefix, countStr] = positional; -const count = parseInt(countStr, 10); - -fs.mkdirSync(dir, { recursive: true }); - -// Create this participant's marker file. -const markerName = `${prefix}_${process.pid}`; -fs.writeFileSync(path.join(dir, markerName), ''); - -function countMatches() { - return fs.readdirSync(dir).filter((f) => f.startsWith(`${prefix}_`)).length; -} - -function onBarrierMet() { - if (daemonize) { - // Close stdout/stderr but keep the process alive. Simulates a daemon that - // detaches from stdio — tests that the runner can still kill such processes. - process.stdout.end(); - process.stderr.end(); - setInterval(() => {}, 1 << 30); - return; - } - if (hang) { - // Keep the process alive indefinitely — killed via signal when the runner cancels. - // Use setInterval rather than stdin.resume() for cross-platform reliability. - setInterval(() => {}, 1 << 30); - return; - } - process.exit(exitCode); -} - -// Start watching before the initial check to avoid missing events -// between the check and the watch setup. -const watcher = fs.watch(dir, () => { - if (countMatches() >= count) { - watcher.close(); - onBarrierMet(); - } -}); - -// Check immediately in case all participants already arrived. -if (countMatches() >= count) { - watcher.close(); - onBarrierMet(); -} diff --git a/packages/tools/src/check-tty.js b/packages/tools/src/check-tty.js deleted file mode 100755 index abe46e0e..00000000 --- a/packages/tools/src/check-tty.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node - -// Reports whether each stdio stream is connected to a TTY. -// Used to detect whether the task runner inherited stdio (TTY) or piped it. -// -// Output format: -// stdin:tty or stdin:not-tty -// stdout:tty or stdout:not-tty -// stderr:tty or stderr:not-tty -const stdinTty = process.stdin.isTTY ? 'tty' : 'not-tty'; -const stdoutTty = process.stdout.isTTY ? 'tty' : 'not-tty'; -const stderrTty = process.stderr.isTTY ? 'tty' : 'not-tty'; -console.log(`stdin:${stdinTty}`); -console.log(`stdout:${stdoutTty}`); -console.log(`stderr:${stderrTty}`); diff --git a/packages/tools/src/json-edit.ts b/packages/tools/src/json-edit.ts deleted file mode 100755 index d9593f21..00000000 --- a/packages/tools/src/json-edit.ts +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env node - -import { readFileSync, writeFileSync } from 'node:fs'; -import { parseArgs } from 'node:util'; - -const { positionals } = parseArgs({ - allowPositionals: true, -}); - -const filename = positionals[0]; -const script = positionals[1]; - -if (!filename || !script) { - console.error('Usage: json-edit