diff --git a/Cargo.lock b/Cargo.lock index bf305491..e498ad7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3279,15 +3279,12 @@ dependencies = [ "monostate", "regex", "serde", - "serde_json", "tempfile", "tokio", "toml", - "vite_graph_ser", "vite_path", "vite_str", "vite_task", - "vite_task_graph", "vite_workspace", "which", ] @@ -3319,20 +3316,30 @@ dependencies = [ "anyhow", "async-trait", "bincode", + "copy_dir", + "cow-utils", "futures-util", + "insta", "petgraph", "serde", + "serde_json", "sha2", "shell-escape", "supports-color", + "tempfile", "thiserror 2.0.17", + "tokio", + "toml", "tracing", "vite_glob", "vite_graph_ser", "vite_path", "vite_shell", "vite_str", + "vite_task", + "vite_task_bin", "vite_task_graph", + "vite_workspace", "which", ] diff --git a/Cargo.toml b/Cargo.toml index 361911db..82ead12e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -125,6 +125,7 @@ vite_path = { path = "crates/vite_path" } vite_shell = { path = "crates/vite_shell" } vite_str = { path = "crates/vite_str" } vite_task = { path = "crates/vite_task" } +vite_task_bin = { path = "crates/vite_task_bin" } vite_task_graph = { path = "crates/vite_task_graph" } vite_task_plan = { path = "crates/vite_task_plan" } vite_workspace = { path = "crates/vite_workspace" } diff --git a/crates/fspy/tests/oxlint.rs b/crates/fspy/tests/oxlint.rs index 87780f32..73053d02 100644 --- a/crates/fspy/tests/oxlint.rs +++ b/crates/fspy/tests/oxlint.rs @@ -5,36 +5,38 @@ use std::{env::vars_os, ffi::OsString}; use fspy::{AccessMode, PathAccessIterable}; use test_log::test; -/// Get the test_bins/.bin directory path -fn test_bins_bin_dir() -> std::path::PathBuf { +/// Get the packages/tools/.bin directory path +fn tools_bin_dir() -> std::path::PathBuf { std::path::Path::new(env!("CARGO_MANIFEST_DIR")) .parent() .unwrap() - .join("vite_task_bin") - .join("test_bins") + .parent() + .unwrap() + .join("packages") + .join("tools") .join("node_modules") .join(".bin") } -/// Find the oxlint executable in test_bins +/// Find the oxlint executable in packages/tools fn find_oxlint() -> std::path::PathBuf { - let test_bins_dir = test_bins_bin_dir(); - which::which_in("oxlint", Some(&test_bins_dir), std::env::current_dir().unwrap()) - .expect("oxlint not found in test_bins/node_modules/.bin") + let tools_dir = tools_bin_dir(); + which::which_in("oxlint", Some(&tools_dir), std::env::current_dir().unwrap()) + .expect("oxlint not found in packages/tools/node_modules/.bin") } async fn track_oxlint(dir: &std::path::Path, args: &[&str]) -> anyhow::Result { let oxlint_path = find_oxlint(); let mut command = fspy::Command::new(&oxlint_path); - // Build PATH with test_bins/.bin prepended so oxlint can find tsgolint - let test_bins_dir = test_bins_bin_dir(); + // Build PATH with packages/tools/.bin prepended so oxlint can find tsgolint + let tools_dir = tools_bin_dir(); let new_path = if let Some(existing_path) = std::env::var_os("PATH") { - let mut paths = vec![test_bins_dir.as_os_str().to_owned()]; + let mut paths = vec![tools_dir.as_os_str().to_owned()]; paths.extend(std::env::split_paths(&existing_path).map(|p| p.into_os_string())); std::env::join_paths(paths)? } else { - OsString::from(&test_bins_dir) + OsString::from(&tools_dir) }; command diff --git a/crates/vite_task_bin/Cargo.toml b/crates/vite_task_bin/Cargo.toml index e7234327..59d984dd 100644 --- a/crates/vite_task_bin/Cargo.toml +++ b/crates/vite_task_bin/Cargo.toml @@ -27,14 +27,14 @@ cow-utils = { workspace = true } insta = { workspace = true, features = ["glob", "json", "redactions", "filters", "ron"] } regex = { workspace = true } serde = { workspace = true, features = ["derive", "rc"] } -serde_json = { workspace = true } tempfile = { workspace = true } toml = { workspace = true } -vite_graph_ser = { workspace = true } vite_path = { workspace = true, features = ["absolute-redaction"] } -vite_task_graph = { workspace = true } vite_workspace = { workspace = true } -which = { workspace = true } [lints] workspace = true + +[[test]] +name = "e2e_snapshots" +harness = false diff --git a/crates/vite_task_bin/test_bins/README.md b/crates/vite_task_bin/test_bins/README.md deleted file mode 100644 index 40f338fd..00000000 --- a/crates/vite_task_bin/test_bins/README.md +++ /dev/null @@ -1 +0,0 @@ -This package contains test binaries used in the tests for vite_task_bin crate. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/README.md b/crates/vite_task_bin/tests/e2e_snapshots/README.md new file mode 100644 index 00000000..5c324416 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/README.md @@ -0,0 +1,38 @@ +# E2E Snapshot Tests + +End-to-end tests that execute the `vite` binary and verify its output. + +## When to add tests here + +- Testing CLI behavior and output formatting +- Testing cache hit/miss behavior across multiple command invocations +- Testing error messages shown to users +- Testing integration between multiple commands in sequence + +## How it works + +Each fixture in `fixtures/` is a self-contained workspace. Tests are defined in `snapshots.toml`: + +```toml +[[e2e]] +name = "descriptive test name" +steps = [ + "vite build", + "vite build", # second run to test caching +] +``` + +The test runner: + +1. Copies the fixture to a temp directory +2. Executes each step using `/bin/sh` (Unix) or `bash` (Windows) +3. Captures stdout/stderr and exit codes +4. Compares against snapshot in `fixtures//snapshots/` + +## Adding a new test + +1. Create a new fixture directory under `fixtures/` +2. Add `package.json` (and `pnpm-workspace.yaml` for monorepos) +3. Add `snapshots.toml` with test cases +4. Run `cargo test -p vite_task_bin --test e2e_snapshots` +5. Review and accept new snapshots diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-disabled/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-disabled/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-disabled/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-disabled/snapshots.toml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task with cache disabled@cache-disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task with cache disabled@cache-disabled.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task with cache enabled@cache-disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task with cache enabled@cache-disabled.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-disabled/test.txt b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/test.txt similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-disabled/test.txt rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/test.txt diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-disabled/vite.config.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-disabled/vite.config.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-miss-reasons/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-miss-reasons/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-miss-reasons/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-miss-reasons/snapshots.toml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__cwd changed@cache-miss-reasons.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__cwd changed@cache-miss-reasons.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env added@cache-miss-reasons.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env added@cache-miss-reasons.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env removed@cache-miss-reasons.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env removed@cache-miss-reasons.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env value changed@cache-miss-reasons.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env value changed@cache-miss-reasons.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__input content changed@cache-miss-reasons.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__input content changed@cache-miss-reasons.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__pass-through env added@cache-miss-reasons.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__pass-through env added@cache-miss-reasons.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__pass-through env removed@cache-miss-reasons.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__pass-through env removed@cache-miss-reasons.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-miss-reasons/test.txt b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/test.txt similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-miss-reasons/test.txt rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/test.txt diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-miss-reasons/vite.config.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-miss-reasons/vite.config.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/vite.config.json 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 new file mode 100644 index 00000000..9340d35d --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/package.json @@ -0,0 +1,4 @@ +{ + "name": "e2e-env-test", + "private": true +} 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 new file mode 100644 index 00000000..d711d565 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots.toml @@ -0,0 +1,12 @@ +[[e2e]] +name = "env-test prints value from additional_envs" +steps = [ + "vite env-test SYNTHETIC_ENV_VAR test_value_from_synthesizer", +] + +[[e2e]] +name = "env-test with different values" +steps = [ + "vite env-test FOO bar", + "vite env-test BAZ qux", +] diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env-test prints value from additional_envs@additional-envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap similarity index 65% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env-test prints value from additional_envs@additional-envs.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap index bfbe19c0..267e8e6d 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env-test prints value from additional_envs@additional-envs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap @@ -1,7 +1,8 @@ --- source: crates/vite_task_bin/tests/test_snapshots/main.rs +assertion_line: 152 expression: e2e_outputs -input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/additional-envs +input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/e2e-env-test --- > vite env-test SYNTHETIC_ENV_VAR test_value_from_synthesizer test_value_from_synthesizer diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env-test with different values@additional-envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap similarity index 60% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env-test with different values@additional-envs.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap index e0417374..2b651adb 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__env-test with different values@additional-envs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap @@ -1,7 +1,8 @@ --- source: crates/vite_task_bin/tests/test_snapshots/main.rs +assertion_line: 152 expression: e2e_outputs -input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/additional-envs +input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/e2e-env-test --- > vite env-test FOO bar bar 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 new file mode 100644 index 00000000..c9faaf6d --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json @@ -0,0 +1,4 @@ +{ + "name": "e2e-lint-cache", + "private": true +} 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 new file mode 100644 index 00000000..653e74b1 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml @@ -0,0 +1,7 @@ +[[e2e]] +name = "direct lint" +steps = [ + "vite lint", + "echo debugger > main.js", + "vite lint", +] diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__direct lint@cache-keys.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap similarity index 84% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__direct lint@cache-keys.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap index 78c6bac0..6fd04a41 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__direct lint@cache-keys.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap @@ -1,7 +1,8 @@ --- source: crates/vite_task_bin/tests/test_snapshots/main.rs +assertion_line: 152 expression: e2e_outputs -input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys +input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/e2e-lint-cache --- > vite lint Found 0 warnings and 0 errors. diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/error_cycle_dependency/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/error_cycle_dependency/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/error_cycle_dependency/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots.toml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/error_cycle_dependency/snapshots.toml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots.toml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__cycle dependency error@error_cycle_dependency.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots/cycle dependency error.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__cycle dependency error@error_cycle_dependency.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots/cycle dependency error.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/error_cycle_dependency/vite.config.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/error_cycle_dependency/vite.config.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes/packages/pkg-a/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-a/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes/packages/pkg-a/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-a/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes/packages/pkg-b/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-b/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes/packages/pkg-b/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-b/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes/pnpm-workspace.yaml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes/pnpm-workspace.yaml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes/snapshots.toml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__multiple task failures returns exit code 1@exit-codes.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__multiple task failures returns exit code 1@exit-codes.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__single task failure returns task exit code@exit-codes.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__single task failure returns task exit code@exit-codes.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-passthrough/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-passthrough/package.json new file mode 100644 index 00000000..5fd51717 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-passthrough/package.json @@ -0,0 +1,6 @@ +{ + "name": "stdin-passthrough", + "scripts": { + "echo-stdin": "node -e \"process.stdin.pipe(process.stdout)\"" + } +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-passthrough/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-passthrough/snapshots.toml new file mode 100644 index 00000000..abfae9a3 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-passthrough/snapshots.toml @@ -0,0 +1,5 @@ +[[e2e]] +name = "stdin passthrough to single task" +steps = [ + { cmd = "vite run echo-stdin", stdin = "hello from stdin" }, +] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-passthrough/snapshots/stdin passthrough to single task.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-passthrough/snapshots/stdin passthrough to single task.snap new file mode 100644 index 00000000..e7355cdb --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-passthrough/snapshots/stdin passthrough to single task.snap @@ -0,0 +1,22 @@ +--- +source: crates/vite_task_bin/tests/e2e_snapshots/main.rs +assertion_line: 203 +expression: e2e_outputs +input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-passthrough +--- +> vite run echo-stdin +$ node -e "process.stdin.pipe(process.stdout)" +hello from stdin + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + Vite+ Task Runner • Execution Summary +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +Statistics: 1 tasks • 0 cache hits • 1 cache misses +Performance: 0% cache hit rate + +Task Details: +──────────────────────────────────────────────── + [1] stdin-passthrough#echo-stdin: $ node -e "process.stdin.pipe(process.stdout)" ✓ + → Cache miss: no previous cache entry found +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/vite-task-smoke/main.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/main.js similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/vite-task-smoke/main.js rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/main.js diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/vite-task-smoke/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/vite-task-smoke/package.json rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/vite-task-smoke/pnpm-workspace.yaml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/vite-task-smoke/pnpm-workspace.yaml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/vite-task-smoke/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/vite-task-smoke/snapshots.toml rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__cache hit after file modification@vite-task-smoke.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__cache hit after file modification@vite-task-smoke.snap rename to crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap diff --git a/crates/vite_task_bin/tests/e2e_snapshots/main.rs b/crates/vite_task_bin/tests/e2e_snapshots/main.rs new file mode 100644 index 00000000..b1cb3ec3 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/main.rs @@ -0,0 +1,220 @@ +mod redact; + +use std::{ + env::{self, join_paths, split_paths}, + ffi::OsStr, + io::Write, + path::{Path, PathBuf}, + process::{Command, Stdio}, + sync::Arc, +}; + +use copy_dir::copy_dir; +use redact::redact_e2e_output; +use vite_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf}; +use vite_str::Str; +use vite_workspace::find_workspace_root; + +/// 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. +fn get_shell_exe() -> PathBuf { + if cfg!(windows) { + if let Some(bash) = std::env::var_os("BASH") { + PathBuf::from(bash) + } else { + let git_bash = PathBuf::from(r"C:\Program Files\Git\bin\bash.exe"); + if git_bash.exists() { + git_bash + } else { + panic!( + "Could not find bash executable for e2e tests.\n\ + Please set the BASH environment variable to point to a bash executable,\n\ + or install Git for Windows which provides bash at:\n\ + C:\\Program Files\\Git\\bin\\bash.exe" + ); + } + } + } else { + PathBuf::from("/bin/sh") + } +} + +#[derive(serde::Deserialize, Debug)] +#[serde(untagged)] +enum Step { + Simple(Str), + WithStdin { cmd: Str, stdin: Str }, +} + +impl Step { + fn cmd(&self) -> &str { + match self { + Step::Simple(s) => s.as_str(), + Step::WithStdin { cmd, .. } => cmd.as_str(), + } + } + + fn stdin(&self) -> Option<&str> { + match self { + Step::Simple(_) => None, + Step::WithStdin { stdin, .. } => Some(stdin.as_str()), + } + } +} + +#[derive(serde::Deserialize, Debug)] +struct E2e { + pub name: Str, + #[serde(default)] + pub cwd: RelativePathBuf, + pub steps: Vec, +} + +#[derive(serde::Deserialize, Default)] +struct SnapshotsFile { + #[serde(rename = "e2e", default)] // toml usually uses singular for arrays + pub e2e_cases: Vec, +} + +fn run_case(tmpdir: &AbsolutePath, fixture_path: &Path, filter: Option<&str>) { + let fixture_name = fixture_path.file_name().unwrap().to_str().unwrap(); + if fixture_name.starts_with(".") { + return; // skip hidden files like .DS_Store + } + + // Skip if filter doesn't match + if let Some(f) = filter { + if !fixture_name.contains(f) { + return; + } + } + + // Configure insta to write snapshots to fixture directory + let mut settings = insta::Settings::clone_current(); + settings.set_snapshot_path(fixture_path.join("snapshots")); + settings.set_prepend_module_to_snapshot(false); + settings.remove_snapshot_suffix(); + + settings.bind(|| run_case_inner(tmpdir, fixture_path, fixture_name)); +} + +fn run_case_inner(tmpdir: &AbsolutePath, fixture_path: &Path, fixture_name: &str) { + // Copy the case directory to a temporary directory to avoid discovering workspace outside of the test case. + let stage_path = tmpdir.join(fixture_name); + copy_dir(fixture_path, &stage_path).unwrap(); + + let (workspace_root, _cwd) = find_workspace_root(&stage_path).unwrap(); + + assert_eq!( + &stage_path, &*workspace_root.path, + "folder '{}' should be a workspace root", + fixture_name + ); + + let cases_toml_path = fixture_path.join("snapshots.toml"); + let cases_file: SnapshotsFile = match std::fs::read(&cases_toml_path) { + Ok(content) => toml::from_slice(&content).unwrap(), + Err(err) if err.kind() == std::io::ErrorKind::NotFound => Default::default(), + 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 + let repo_root = + std::path::Path::new(env!("CARGO_MANIFEST_DIR")).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 + let e2e_env_path = join_paths( + [ + // Include vite binary path to PATH so that e2e tests can run "vite ..." commands. + { + let vite_path = AbsolutePath::new(env!("CARGO_BIN_EXE_vite")).unwrap(); + let vite_dir = vite_path.parent().unwrap(); + vite_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( + // the existing PATH + split_paths(&env::var_os("PATH").unwrap()) + .map(|path| Arc::::from(path.into_os_string())), + ), + ) + .unwrap(); + + let mut e2e_count = 0u32; + for e2e in cases_file.e2e_cases { + let e2e_stage_path = tmpdir.join(format!("{}_e2e_stage_{}", fixture_name, e2e_count)); + e2e_count += 1; + assert!(copy_dir(fixture_path, &e2e_stage_path).unwrap().is_empty()); + + let e2e_stage_path_str = e2e_stage_path.as_path().to_str().unwrap(); + + let mut e2e_outputs = String::new(); + for step in e2e.steps { + let mut cmd = Command::new(&shell_exe); + cmd.arg("-c") + .arg(step.cmd()) + .env_clear() + .env("PATH", &e2e_env_path) + .env("NO_COLOR", "1") + .current_dir(e2e_stage_path.join(&e2e.cwd)); + + // On Windows, inherit PATHEXT for executable lookup + if cfg!(windows) { + if let Ok(pathext) = std::env::var("PATHEXT") { + cmd.env("PATHEXT", pathext); + } + } + + let output = if let Some(stdin_content) = step.stdin() { + cmd.stdin(Stdio::piped()); + cmd.stdout(Stdio::piped()); + cmd.stderr(Stdio::piped()); + let mut child = cmd.spawn().unwrap(); + child.stdin.take().unwrap().write_all(stdin_content.as_bytes()).unwrap(); + child.wait_with_output().unwrap() + } else { + cmd.output().unwrap() + }; + + let exit_code = output.status.code().unwrap_or(-1); + if exit_code != 0 { + e2e_outputs.push_str(format!("[{}]", exit_code).as_str()); + } + e2e_outputs.push_str("> "); + e2e_outputs.push_str(step.cmd()); + e2e_outputs.push('\n'); + + let stdout = String::from_utf8(output.stdout).unwrap(); + let stderr = String::from_utf8(output.stderr).unwrap(); + e2e_outputs.push_str(&redact_e2e_output(stdout, e2e_stage_path_str)); + e2e_outputs.push_str(&redact_e2e_output(stderr, e2e_stage_path_str)); + e2e_outputs.push('\n'); + } + insta::assert_snapshot!(e2e.name.as_str(), e2e_outputs); + } +} + +fn main() { + let filter = std::env::args().nth(1); + + let tmp_dir = tempfile::tempdir().unwrap(); + let tmp_dir_path = AbsolutePathBuf::new(tmp_dir.path().canonicalize().unwrap()).unwrap(); + + let tests_dir = std::env::current_dir().unwrap().join("tests"); + + insta::glob!(tests_dir, "e2e_snapshots/fixtures/*", |case_path| run_case( + &tmp_dir_path, + case_path, + filter.as_deref() + )); +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/redact.rs b/crates/vite_task_bin/tests/e2e_snapshots/redact.rs new file mode 100644 index 00000000..4877b243 --- /dev/null +++ b/crates/vite_task_bin/tests/e2e_snapshots/redact.rs @@ -0,0 +1,56 @@ +use std::borrow::Cow; + +fn redact_string(s: &mut String, redactions: &[(&str, &str)]) { + use cow_utils::CowUtils as _; + 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 + replaced = replaced.cow_replace("\\", "/").into_owned(); + } + *s = replaced; + } + } +} + +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(); + output = duration_regex.replace_all(&output, "").into_owned(); + + // 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(); + + // Remove Node.js experimental warnings (e.g., Type Stripping warnings) + let node_warning_regex = + regex::Regex::new(r"(?m)^\(node:\d+\) ExperimentalWarning:.*\n?").unwrap(); + output = node_warning_regex.replace_all(&output, "").into_owned(); + let node_trace_warning_regex = regex::Regex::new( + r"(?m)^\(Use `node --trace-warnings \.\.\.` to show where the warning was created\)\n?", + ) + .unwrap(); + output = node_trace_warning_regex.replace_all(&output, "").into_owned(); + + output +} diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/a/package.json b/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/a/package.json deleted file mode 100644 index 5d4fadc3..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/a/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "@test/a", - "version": "1.0.0", - "scripts": { - "build": "echo Building A" - }, - "dependencies": { - "@test/b1": "workspace:*", - "@test/b2": "workspace:*" - } -} diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/a/src/.gitkeep b/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/a/src/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/a/vite.config.json b/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/a/vite.config.json deleted file mode 100644 index 7f96f0dd..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/a/vite.config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "tasks": { - "build": { - "dependsOn": ["test"] - }, - "test": { - "command": "echo test a" - } - } -} diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/another-a/package.json b/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/another-a/package.json deleted file mode 100644 index 5841d16a..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/another-a/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@test/a", - "version": "1.0.0", - "scripts": { - "build": "echo Building another A" - } -} diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/b1/package.json b/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/b1/package.json deleted file mode 100644 index d034f217..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/b1/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@test/b1", - "version": "1.0.0", - "scripts": { - "lint": "echo lint b1" - }, - "dependencies": { - "@test/c": "workspace:*" - } -} diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/b2/package.json b/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/b2/package.json deleted file mode 100644 index 88b142ad..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/b2/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "@test/b2", - "version": "1.0.0", - "scripts": { - "build": "echo build b2" - }, - "dependencies": { - "@test/c": "workspace:*" - } -} diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/c/package.json b/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/c/package.json deleted file mode 100644 index 55776d2b..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/packages/c/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@test/c", - "version": "1.0.0", - "scripts": { - "lint": "echo lint c", - "build": "echo Building C" - } -} diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/pnpm-workspace.yaml b/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/pnpm-workspace.yaml deleted file mode 100644 index 18ec407e..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/pnpm-workspace.yaml +++ /dev/null @@ -1,2 +0,0 @@ -packages: - - 'packages/*' diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/snapshots.toml b/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/snapshots.toml deleted file mode 100644 index 8a612268..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace/snapshots.toml +++ /dev/null @@ -1,54 +0,0 @@ -# [[plan]] -# name = "simple task by name" -# cwd = "packages/a" -# args = ["build"] - -# [[plan]] -# name = "under subfolder of package" -# cwd = "packages/a/src" -# args = ["build"] - -# [[plan]] -# name = "explicit package name under different package" -# cwd = "packages/a" -# args = ["@test/c#build"] - -# [[plan]] -# name = "explicit package name under non-package cwd" -# cwd = "" -# args = ["@test/c#build"] - -# [[plan]] -# name = "ambiguous task name" -# cwd = "" -# args = ["@test/a#build"] - -# [[plan]] -# name = "ignore depends on" -# cwd = "packages/a" -# args = ["--ignore-depends-on", "build"] - -# [[plan]] -# name = "transitive" -# cwd = "packages/a" -# args = ["--transitive", "build"] - -# [[plan]] -# name = "transitive in package without the task" -# cwd = "packages/a" -# args = ["--transitive", "lint"] - -# [[plan]] -# name = "transitive non existent task" -# cwd = "packages/a" -# args = ["--transitive", "non-existent-task"] - -# [[plan]] -# name = "recursive" -# cwd = "" -# args = ["--recursive", "build"] - -# [[plan]] -# name = "recursive and transitive" -# cwd = "" -# args = ["--recursive", "--transitive", "build"] diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@cache-disabled.snap b/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@cache-disabled.snap deleted file mode 100644 index 8c693e83..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@cache-disabled.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -source: crates/vite_task_bin/tests/test_snapshots/main.rs -expression: task_graph_json -input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-disabled ---- -[ - { - "key": [ - "/", - "cached-task" - ], - "node": { - "task_display": { - "package_name": "cache-disabled-test", - "task_name": "cached-task", - "package_path": "/" - }, - "resolved_config": { - "command": "print-file test.txt", - "resolved_options": { - "cwd": "/", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [] - }, - { - "key": [ - "/", - "no-cache-task" - ], - "node": { - "task_display": { - "package_name": "cache-disabled-test", - "task_name": "no-cache-task", - "package_path": "/" - }, - "resolved_config": { - "command": "print-file test.txt", - "resolved_options": { - "cwd": "/", - "cache_config": null - } - } - }, - "neighbors": [] - } -] diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@cache-miss-reasons.snap b/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@cache-miss-reasons.snap deleted file mode 100644 index d1cdaf19..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@cache-miss-reasons.snap +++ /dev/null @@ -1,37 +0,0 @@ ---- -source: crates/vite_task_bin/tests/test_snapshots/main.rs -expression: task_graph_json -input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-miss-reasons ---- -[ - { - "key": [ - "/", - "test" - ], - "node": { - "task_display": { - "package_name": "cache-miss-reasons", - "task_name": "test", - "package_path": "/" - }, - "resolved_config": { - "command": "print-file test.txt", - "resolved_options": { - "cwd": "/", - "cache_config": { - "env_config": { - "fingerprinted_envs": [ - "MY_ENV" - ], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [] - } -] diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@error_cycle_dependency.snap b/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@error_cycle_dependency.snap deleted file mode 100644 index e51bbab1..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@error_cycle_dependency.snap +++ /dev/null @@ -1,79 +0,0 @@ ---- -source: crates/vite_task_bin/tests/test_snapshots/main.rs -expression: task_graph_json -input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/error_cycle_dependency ---- -[ - { - "key": [ - "/", - "task-a" - ], - "node": { - "task_display": { - "package_name": "error-cycle-dependency-test", - "task_name": "task-a", - "package_path": "/" - }, - "resolved_config": { - "command": "echo a", - "resolved_options": { - "cwd": "/", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [ - [ - [ - "/", - "task-b" - ], - "Explicit" - ] - ] - }, - { - "key": [ - "/", - "task-b" - ], - "node": { - "task_display": { - "package_name": "error-cycle-dependency-test", - "task_name": "task-b", - "package_path": "/" - }, - "resolved_config": { - "command": "echo b", - "resolved_options": { - "cwd": "/", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [ - [ - [ - "/", - "task-a" - ], - "Explicit" - ] - ] - } -] diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@exit-codes.snap b/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@exit-codes.snap deleted file mode 100644 index 9f76a0d2..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@exit-codes.snap +++ /dev/null @@ -1,64 +0,0 @@ ---- -source: crates/vite_task_bin/tests/test_snapshots/main.rs -assertion_line: 135 -expression: task_graph_json -input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/exit-codes ---- -[ - { - "key": [ - "/packages/pkg-a", - "fail" - ], - "node": { - "task_display": { - "package_name": "pkg-a", - "task_name": "fail", - "package_path": "/packages/pkg-a" - }, - "resolved_config": { - "command": "node -e \"process.exit(42)\"", - "resolved_options": { - "cwd": "/packages/pkg-a", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [] - }, - { - "key": [ - "/packages/pkg-b", - "fail" - ], - "node": { - "task_display": { - "package_name": "pkg-b", - "task_name": "fail", - "package_path": "/packages/pkg-b" - }, - "resolved_config": { - "command": "node -e \"process.exit(7)\"", - "resolved_options": { - "cwd": "/packages/pkg-b", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [] - } -] diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@transitive-dependency-workspace.snap b/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@transitive-dependency-workspace.snap deleted file mode 100644 index 5a8793a5..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@transitive-dependency-workspace.snap +++ /dev/null @@ -1,241 +0,0 @@ ---- -source: crates/vite_task_bin/tests/test_snapshots/main.rs -expression: task_graph_json -input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/transitive-dependency-workspace ---- -[ - { - "key": [ - "/packages/a", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/a", - "task_name": "build", - "package_path": "/packages/a" - }, - "resolved_config": { - "command": "echo Building A", - "resolved_options": { - "cwd": "/packages/a", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [ - [ - [ - "/packages/a", - "test" - ], - "Explicit" - ], - [ - [ - "/packages/b2", - "build" - ], - "Topological" - ], - [ - [ - "/packages/c", - "build" - ], - "Topological" - ] - ] - }, - { - "key": [ - "/packages/a", - "test" - ], - "node": { - "task_display": { - "package_name": "@test/a", - "task_name": "test", - "package_path": "/packages/a" - }, - "resolved_config": { - "command": "echo test a", - "resolved_options": { - "cwd": "/packages/a", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [] - }, - { - "key": [ - "/packages/another-a", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/a", - "task_name": "build", - "package_path": "/packages/another-a" - }, - "resolved_config": { - "command": "echo Building another A", - "resolved_options": { - "cwd": "/packages/another-a", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [] - }, - { - "key": [ - "/packages/b1", - "lint" - ], - "node": { - "task_display": { - "package_name": "@test/b1", - "task_name": "lint", - "package_path": "/packages/b1" - }, - "resolved_config": { - "command": "echo lint b1", - "resolved_options": { - "cwd": "/packages/b1", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [ - [ - [ - "/packages/c", - "lint" - ], - "Topological" - ] - ] - }, - { - "key": [ - "/packages/b2", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/b2", - "task_name": "build", - "package_path": "/packages/b2" - }, - "resolved_config": { - "command": "echo build b2", - "resolved_options": { - "cwd": "/packages/b2", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [ - [ - [ - "/packages/c", - "build" - ], - "Topological" - ] - ] - }, - { - "key": [ - "/packages/c", - "build" - ], - "node": { - "task_display": { - "package_name": "@test/c", - "task_name": "build", - "package_path": "/packages/c" - }, - "resolved_config": { - "command": "echo Building C", - "resolved_options": { - "cwd": "/packages/c", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [] - }, - { - "key": [ - "/packages/c", - "lint" - ], - "node": { - "task_display": { - "package_name": "@test/c", - "task_name": "lint", - "package_path": "/packages/c" - }, - "resolved_config": { - "command": "echo lint c", - "resolved_options": { - "cwd": "/packages/c", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [] - } -] diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@vite-task-smoke.snap b/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@vite-task-smoke.snap deleted file mode 100644 index 3b694ac6..00000000 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@vite-task-smoke.snap +++ /dev/null @@ -1,35 +0,0 @@ ---- -source: crates/vite_task_bin/tests/test_snapshots/main.rs -expression: task_graph_json -input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/vite-task-smoke ---- -[ - { - "key": [ - "/", - "test-task" - ], - "node": { - "task_display": { - "package_name": "vite-task-smoke", - "task_name": "test-task", - "package_path": "/" - }, - "resolved_config": { - "command": "echo hello && print-file main.js", - "resolved_options": { - "cwd": "/", - "cache_config": { - "env_config": { - "fingerprinted_envs": [], - "pass_through_envs": [ - "" - ] - } - } - } - } - }, - "neighbors": [] - } -] diff --git a/crates/vite_task_plan/Cargo.toml b/crates/vite_task_plan/Cargo.toml index 446e8130..571bcadc 100644 --- a/crates/vite_task_plan/Cargo.toml +++ b/crates/vite_task_plan/Cargo.toml @@ -29,3 +29,19 @@ vite_shell = { workspace = true } vite_str = { workspace = true } vite_task_graph = { workspace = true } which = { workspace = true } + +[dev-dependencies] +copy_dir = { workspace = true } +cow-utils = { workspace = true } +insta = { workspace = true, features = ["glob", "json", "redactions", "filters", "ron"] } +serde_json = { workspace = true } +tempfile = { workspace = true } +tokio = { workspace = true, features = ["rt", "macros"] } +toml = { workspace = true } +vite_task = { workspace = true } +vite_task_bin = { path = "../vite_task_bin" } +vite_workspace = { workspace = true } + +[[test]] +name = "plan_snapshots" +harness = false diff --git a/crates/vite_task_plan/tests/plan_snapshots/README.md b/crates/vite_task_plan/tests/plan_snapshots/README.md new file mode 100644 index 00000000..fe733b11 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/README.md @@ -0,0 +1,37 @@ +# Plan Snapshot Tests + +Tests for task graph construction and execution plan generation. + +## When to add tests here + +- Testing task graph structure (dependencies, task resolution) +- Testing execution plan generation from CLI arguments +- Testing task fingerprinting and cache key computation +- Testing workspace/package discovery and configuration parsing + +## How it works + +Each fixture in `fixtures/` is a self-contained workspace. Tests are defined in `snapshots.toml`: + +```toml +[[plan]] +name = "descriptive test name" +args = ["build", "--recursive"] +cwd = "packages/app" # optional, defaults to workspace root +``` + +The test runner: + +1. Copies the fixture to a temp directory +2. Loads the workspace and builds the task graph +3. Snapshots the task graph structure +4. For each plan test, parses CLI args and generates an execution plan +5. Compares against snapshots in `fixtures//snapshots/` + +## Adding a new test + +1. Create a new fixture directory under `fixtures/` +2. Add `package.json` (and `pnpm-workspace.yaml` for monorepos) +3. Add `snapshots.toml` with test cases (or omit for task-graph-only tests) +4. Run `cargo test -p vite_task_plan --test plan_snapshots` +5. Review and accept new snapshots diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/additional-envs/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/additional-envs/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/additional-envs/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots.toml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/additional-envs/snapshots.toml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots.toml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct env-test synthetic task@additional-envs.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/query - direct env-test synthetic task.snap similarity index 88% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct env-test synthetic task@additional-envs.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/query - direct env-test synthetic task.snap index 2595b543..9f844c66 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct env-test synthetic task@additional-envs.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/query - direct env-test synthetic task.snap @@ -41,13 +41,13 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/additional-envs } }, "spawn_command": { - "program_path": "/test_bins/node_modules/.bin/print-env", + "program_path": "/node_modules/.bin/print-env", "args": [ "TEST_VAR" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/test_bins/node_modules/.bin", + "PATH": "/node_modules/.bin:/node_modules/.bin", "TEST_VAR": "hello_world" }, "cwd": "/" diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@additional-envs.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@additional-envs.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots.toml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys/snapshots.toml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots.toml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct synthetic task with cwd@cache-keys.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - direct synthetic task with cwd.snap similarity index 87% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct synthetic task with cwd@cache-keys.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - direct synthetic task with cwd.snap index 3480f45e..9c47d777 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct synthetic task with cwd@cache-keys.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - direct synthetic task with cwd.snap @@ -36,11 +36,11 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/test_bins/node_modules/.bin/oxlint", + "program_path": "/node_modules/.bin/oxlint", "args": [], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/test_bins/node_modules/.bin" + "PATH": "/node_modules/.bin:/node_modules/.bin" }, "cwd": "/subdir" } diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct synthetic task with extra args@cache-keys.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - direct synthetic task with extra args.snap similarity index 87% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct synthetic task with extra args@cache-keys.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - direct synthetic task with extra args.snap index ea945313..5beaeec6 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct synthetic task with extra args@cache-keys.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - direct synthetic task with extra args.snap @@ -39,13 +39,13 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/test_bins/node_modules/.bin/oxlint", + "program_path": "/node_modules/.bin/oxlint", "args": [ "--fix" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/test_bins/node_modules/.bin" + "PATH": "/node_modules/.bin:/node_modules/.bin" }, "cwd": "/" } diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct synthetic task@cache-keys.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - direct synthetic task.snap similarity index 86% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct synthetic task@cache-keys.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - direct synthetic task.snap index 17b9440c..b13900b4 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - direct synthetic task@cache-keys.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - direct synthetic task.snap @@ -36,11 +36,11 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/test_bins/node_modules/.bin/oxlint", + "program_path": "/node_modules/.bin/oxlint", "args": [], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/test_bins/node_modules/.bin" + "PATH": "/node_modules/.bin:/node_modules/.bin" }, "cwd": "/" } diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - echo and lint with extra args@cache-keys.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap similarity index 96% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - echo and lint with extra args@cache-keys.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap index 3c786c97..1643cb47 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - echo and lint with extra args@cache-keys.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap @@ -91,13 +91,13 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/test_bins/node_modules/.bin/oxlint", + "program_path": "/node_modules/.bin/oxlint", "args": [ "--fix" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/test_bins/node_modules/.bin" + "PATH": "/node_modules/.bin:/node_modules/.bin" }, "cwd": "/" } diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - lint and echo with extra args@cache-keys.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap similarity index 96% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - lint and echo with extra args@cache-keys.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap index 4fd30268..c95a028d 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - lint and echo with extra args@cache-keys.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap @@ -61,11 +61,11 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/test_bins/node_modules/.bin/oxlint", + "program_path": "/node_modules/.bin/oxlint", "args": [], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/test_bins/node_modules/.bin" + "PATH": "/node_modules/.bin:/node_modules/.bin" }, "cwd": "/" } diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - normal task with extra args@cache-keys.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap similarity index 95% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - normal task with extra args@cache-keys.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap index e0e85351..8b4a858c 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - normal task with extra args@cache-keys.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - normal task with extra args.snap @@ -65,13 +65,13 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/test_bins/node_modules/.bin/print-file", + "program_path": "/node_modules/.bin/print-file", "args": [ "a.txt" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/test_bins/node_modules/.bin" + "PATH": "/node_modules/.bin:/node_modules/.bin" }, "cwd": "/" } diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - synthetic task in user task@cache-keys.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap similarity index 94% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - synthetic task in user task@cache-keys.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap index f06ef3ff..5d46256e 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - synthetic task in user task@cache-keys.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap @@ -61,11 +61,11 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/test_bins/node_modules/.bin/oxlint", + "program_path": "/node_modules/.bin/oxlint", "args": [], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/test_bins/node_modules/.bin" + "PATH": "/node_modules/.bin:/node_modules/.bin" }, "cwd": "/" } diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - synthetic task with extra args in user task@cache-keys.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap similarity index 95% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - synthetic task with extra args in user task@cache-keys.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap index a7bb6ce0..bbea6ce6 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - synthetic task with extra args in user task@cache-keys.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap @@ -65,13 +65,13 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/cache-keys } }, "spawn_command": { - "program_path": "/test_bins/node_modules/.bin/oxlint", + "program_path": "/node_modules/.bin/oxlint", "args": [ "--fix" ], "all_envs": { "NO_COLOR": "1", - "PATH": "/node_modules/.bin:/test_bins/node_modules/.bin" + "PATH": "/node_modules/.bin:/node_modules/.bin" }, "cwd": "/" } diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@cache-keys.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@cache-keys.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-sharing/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-sharing/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-sharing/pnpm-lock.yaml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/pnpm-lock.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-sharing/pnpm-lock.yaml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/pnpm-lock.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/cache-sharing/pnpm-workspace.yaml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/cache-sharing/pnpm-workspace.yaml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@cache-sharing.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@cache-sharing.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-sharing/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/api/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/api/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/api/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/api/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/app/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/app/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/app/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/app/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/config/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/config/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/config/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/config/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/pkg#special/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/pkg#special/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/pkg#special/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/pkg#special/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/shared/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/shared/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/shared/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/shared/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/tools/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/tools/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/tools/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/tools/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/ui/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/ui/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/packages/ui/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/packages/ui/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/pnpm-workspace.yaml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/comprehensive-task-graph/pnpm-workspace.yaml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@comprehensive-task-graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@comprehensive-task-graph.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/comprehensive-task-graph/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/packages/scope-a-b/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/packages/scope-a-b/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/packages/scope-a-b/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/packages/scope-a-b/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/packages/scope-a/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/packages/scope-a/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/packages/scope-a/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/packages/scope-a/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/packages/test-package/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/packages/test-package/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/packages/test-package/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/packages/test-package/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/packages/test-package/vite.config.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/packages/test-package/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/packages/test-package/vite.config.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/packages/test-package/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/pnpm-workspace.yaml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/conflict-test/pnpm-workspace.yaml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@conflict-test.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@conflict-test.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/conflict-test/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/dependency-both-topo-and-explicit/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/dependency-both-topo-and-explicit/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/dependency-both-topo-and-explicit/packages/a/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/packages/a/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/dependency-both-topo-and-explicit/packages/a/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/packages/a/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/dependency-both-topo-and-explicit/packages/a/vite.config.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/packages/a/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/dependency-both-topo-and-explicit/packages/a/vite.config.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/packages/a/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/dependency-both-topo-and-explicit/packages/b/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/packages/b/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/dependency-both-topo-and-explicit/packages/b/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/packages/b/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/dependency-both-topo-and-explicit/pnpm-workspace.yaml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/dependency-both-topo-and-explicit/pnpm-workspace.yaml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@dependency-both-topo-and-explicit.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@dependency-both-topo-and-explicit.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/dependency-both-topo-and-explicit/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/another-empty/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/another-empty/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/another-empty/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/another-empty/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/another-empty/vite.config.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/another-empty/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/another-empty/vite.config.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/another-empty/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/empty-name/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/empty-name/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/empty-name/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/empty-name/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/empty-name/vite.config.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/empty-name/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/empty-name/vite.config.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/empty-name/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/normal-package/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/normal-package/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/normal-package/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/normal-package/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/normal-package/vite.config.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/normal-package/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/packages/normal-package/vite.config.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/packages/normal-package/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/pnpm-workspace.yaml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/empty-package-test/pnpm-workspace.yaml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@empty-package-test.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@empty-package-test.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/empty-package-test/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/app/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/app/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/app/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/app/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/app/vite.config.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/app/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/app/vite.config.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/app/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/core/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/core/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/core/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/core/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/core/vite.config.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/core/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/core/vite.config.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/core/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/utils/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/utils/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/utils/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/utils/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/utils/vite.config.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/utils/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/packages/utils/vite.config.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/packages/utils/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/pnpm-workspace.yaml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/explicit-deps-workspace/pnpm-workspace.yaml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@explicit-deps-workspace.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@explicit-deps-workspace.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/explicit-deps-workspace/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/fingerprint-ignore-test/README.md b/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/README.md similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/fingerprint-ignore-test/README.md rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/README.md diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/fingerprint-ignore-test/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/fingerprint-ignore-test/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@fingerprint-ignore-test.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@fingerprint-ignore-test.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/fingerprint-ignore-test/vite.config.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/vite.config.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/fingerprint-ignore-test/vite.config.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/vite.config.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/apps/web/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/apps/web/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/apps/web/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/apps/web/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/packages/app/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/packages/app/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/packages/app/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/packages/app/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/packages/core/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/packages/core/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/packages/core/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/packages/core/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/packages/utils/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/packages/utils/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/packages/utils/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/packages/utils/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/pnpm-workspace.yaml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/recursive-topological-workspace/pnpm-workspace.yaml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@recursive-topological-workspace.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@recursive-topological-workspace.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/recursive-topological-workspace/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subpackage/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/package.json similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subpackage/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/package.json diff --git a/crates/vite_task_bin/tests/test_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 similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subpackage/packages/a/package.json rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/packages/a/package.json diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subpackage/pnpm-workspace.yaml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/pnpm-workspace.yaml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subpackage/pnpm-workspace.yaml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/pnpm-workspace.yaml diff --git a/crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subpackage/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots.toml similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subpackage/snapshots.toml rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots.toml diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - synthetic-in-subpackage@synthetic-in-subpackage.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap similarity index 95% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - synthetic-in-subpackage@synthetic-in-subpackage.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap index 57ca5097..c207584d 100644 --- a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__query - synthetic-in-subpackage@synthetic-in-subpackage.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap @@ -86,11 +86,11 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subp } }, "spawn_command": { - "program_path": "/test_bins/node_modules/.bin/oxlint", + "program_path": "/node_modules/.bin/oxlint", "args": [], "all_envs": { "NO_COLOR": "1", - "PATH": "/packages/a/node_modules/.bin:/node_modules/.bin:/test_bins/node_modules/.bin" + "PATH": "/packages/a/node_modules/.bin:/node_modules/.bin:/node_modules/.bin" }, "cwd": "/packages/a" } diff --git a/crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@synthetic-in-subpackage.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/task graph.snap similarity index 100% rename from crates/vite_task_bin/tests/test_snapshots/snapshots/test_snapshots__task graph@synthetic-in-subpackage.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/task graph.snap diff --git a/crates/vite_task_bin/tests/test_snapshots/main.rs b/crates/vite_task_plan/tests/plan_snapshots/main.rs similarity index 52% rename from crates/vite_task_bin/tests/test_snapshots/main.rs rename to crates/vite_task_plan/tests/plan_snapshots/main.rs index 755c5b79..2bff2bfb 100644 --- a/crates/vite_task_bin/tests/test_snapshots/main.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/main.rs @@ -1,17 +1,9 @@ mod redact; -use std::{ - collections::HashMap, - convert::Infallible, - env::{self, join_paths, split_paths}, - ffi::OsStr, - path::Path, - process::Command, - sync::Arc, -}; +use std::{collections::HashMap, convert::Infallible, ffi::OsStr, path::Path, sync::Arc}; use copy_dir::copy_dir; -use redact::{redact_e2e_output, redact_snapshot}; +use redact::redact_snapshot; use tokio::runtime::Runtime; use vite_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf}; use vite_str::Str; @@ -27,37 +19,44 @@ struct Plan { pub cwd: RelativePathBuf, } -#[derive(serde::Deserialize, Debug)] -struct E2e { - pub name: Str, - #[serde(default)] - pub cwd: RelativePathBuf, - pub steps: Vec, -} - #[derive(serde::Deserialize, Default)] struct SnapshotsFile { #[serde(rename = "plan", default)] // toml usually uses singular for arrays pub plan_cases: Vec, - #[serde(rename = "e2e", default)] // toml usually uses singular for arrays - pub e2e_cases: Vec, } -fn run_case(runtime: &Runtime, tmpdir: &AbsolutePath, fixture_path: &Path) { +fn run_case(runtime: &Runtime, tmpdir: &AbsolutePath, fixture_path: &Path, filter: Option<&str>) { let fixture_name = fixture_path.file_name().unwrap().to_str().unwrap(); if fixture_name.starts_with(".") { return; // skip hidden files like .DS_Store } + // Skip if filter doesn't match + if let Some(f) = filter { + if !fixture_name.contains(f) { + return; + } + } + + // Configure insta to write snapshots to fixture directory + let mut settings = insta::Settings::clone_current(); + settings.set_snapshot_path(fixture_path.join("snapshots")); + settings.set_prepend_module_to_snapshot(false); + settings.remove_snapshot_suffix(); + + settings.bind(|| run_case_inner(runtime, tmpdir, fixture_path, fixture_name)); +} + +fn run_case_inner( + runtime: &Runtime, + tmpdir: &AbsolutePath, + fixture_path: &Path, + fixture_name: &str, +) { // Copy the case directory to a temporary directory to avoid discovering workspace outside of the test case. let stage_path = tmpdir.join(fixture_name); copy_dir(fixture_path, &stage_path).unwrap(); - // let mut settings = insta::Settings::clone_current(); - // let case_stage_path_str = case_stage_path.as_path().to_str().expect("path is valid unicode"); - // settings.add_filter(®ex::escape(case_stage_path_str), ""); - // let _guard = settings.bind_to_scope(); - let (workspace_root, _cwd) = find_workspace_root(&stage_path).unwrap(); assert_eq!( @@ -73,21 +72,14 @@ fn run_case(runtime: &Runtime, tmpdir: &AbsolutePath, fixture_path: &Path) { 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 + let repo_root = + std::path::Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().parent().unwrap(); let test_bin_path = Arc::::from( - std::env::current_dir() - .unwrap() - .join("test_bins") - .join("node_modules") - .join(".bin") - .into_os_string(), + repo_root.join("packages").join("tools").join("node_modules").join(".bin").into_os_string(), ); - // Find @yarnpkg/shell executable in test_bins - let shell_exe = - which::which_in("shell", Some(&*test_bin_path), std::env::current_dir().unwrap()) - .expect("shell executable not found in test_bins/node_modules/.bin"); - - // Add test_bins to PATH so test programs (such as print-file) in fixtures can be found. + // Add packages/tools to PATH so test programs (such as print-file) in fixtures can be found. let plan_envs: HashMap, Arc> = [ (Arc::::from(OsStr::new("PATH")), Arc::clone(&test_bin_path)), (Arc::::from(OsStr::new("NO_COLOR")), Arc::::from(OsStr::new("1"))), @@ -95,27 +87,6 @@ fn run_case(runtime: &Runtime, tmpdir: &AbsolutePath, fixture_path: &Path) { .into_iter() .collect(); - // Prepare PATH for e2e tests - let e2e_env_path = join_paths( - [ - // Include vite binary path to PATH so that e2e tests can run "vite ..." commands. - { - let vite_path = AbsolutePath::new(env!("CARGO_BIN_EXE_vite")).unwrap(); - let vite_dir = vite_path.parent().unwrap(); - vite_dir.as_path().as_os_str().into() - }, - // Include test_bins to PATH so that e2e tests can run utilities such as json-edit. - test_bin_path, - ] - .into_iter() - .chain( - // the existing PATH - split_paths(&env::var_os("PATH").unwrap()) - .map(|path| Arc::::from(path.into_os_string())), - ), - ) - .unwrap(); - runtime.block_on(async { let workspace_root_str = workspace_root.path.as_path().to_str().unwrap(); let mut owned_callbacks = vite_task_bin::OwnedSessionCallbacks::default(); @@ -134,7 +105,6 @@ fn run_case(runtime: &Runtime, tmpdir: &AbsolutePath, fixture_path: &Path) { ); insta::assert_json_snapshot!("task graph", task_graph_json); - let mut e2e_count = 0u32; for plan in cases_file.plan_cases { let snapshot_name = format!("query - {}", plan.name); @@ -168,54 +138,22 @@ fn run_case(runtime: &Runtime, tmpdir: &AbsolutePath, fixture_path: &Path) { let plan_json = redact_snapshot(&plan, workspace_root_str); insta::assert_json_snapshot!(snapshot_name, &plan_json); } - for e2e in cases_file.e2e_cases { - let e2e_stage_path = tmpdir.join(format!("{}_e2e_stage_{}", fixture_name, e2e_count)); - e2e_count += 1; - assert!(copy_dir(fixture_path, &e2e_stage_path).unwrap().is_empty()); - - let e2e_stage_path_str = e2e_stage_path.as_path().to_str().unwrap(); - - let mut e2e_outputs = String::new(); - for step in e2e.steps { - // Use @yarnpkg/shell for cross-platform shell execution - let mut cmd = Command::new(&shell_exe); - cmd.arg(step.as_str()) - .env_clear() - .env("PATH", &e2e_env_path) - .env("NO_COLOR", "1") - .current_dir(e2e_stage_path.join(&e2e.cwd)); - let output = cmd.output().unwrap(); - - let exit_code = output.status.code().unwrap_or(-1); - if exit_code != 0 { - e2e_outputs.push_str(format!("[{}]", exit_code).as_str()); - } - e2e_outputs.push_str("> "); - e2e_outputs.push_str(step.as_str()); - e2e_outputs.push('\n'); - - let stdout = String::from_utf8(output.stdout).unwrap(); - let stderr = String::from_utf8(output.stderr).unwrap(); - e2e_outputs.push_str(&redact_e2e_output(stdout, e2e_stage_path_str)); - e2e_outputs.push_str(&redact_e2e_output(stderr, e2e_stage_path_str)); - e2e_outputs.push('\n'); - } - insta::assert_snapshot!(e2e.name.as_str(), e2e_outputs); - } }); } -#[test] -fn test_snapshots() { +fn main() { + let filter = std::env::args().nth(1); + let tokio_runtime = Runtime::new().unwrap(); let tmp_dir = tempfile::tempdir().unwrap(); let tmp_dir_path = AbsolutePathBuf::new(tmp_dir.path().canonicalize().unwrap()).unwrap(); let tests_dir = std::env::current_dir().unwrap().join("tests"); - insta::glob!(tests_dir, "test_snapshots/fixtures/*", |case_path| run_case( + insta::glob!(tests_dir, "plan_snapshots/fixtures/*", |case_path| run_case( &tokio_runtime, &tmp_dir_path, - case_path + case_path, + filter.as_deref() )); } diff --git a/crates/vite_task_bin/tests/test_snapshots/redact.rs b/crates/vite_task_plan/tests/plan_snapshots/redact.rs similarity index 76% rename from crates/vite_task_bin/tests/test_snapshots/redact.rs rename to crates/vite_task_plan/tests/plan_snapshots/redact.rs index 3bcd50a4..cbcb2994 100644 --- a/crates/vite_task_bin/tests/test_snapshots/redact.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/redact.rs @@ -52,43 +52,24 @@ 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(); - - redact_string( - &mut output, - &[(workspace_root, ""), (manifest_dir.as_str(), "")], - ); - - // Redact durations like "123ms" or "1.23s" to "ms" or "s" - let duration_regex = regex::Regex::new(r"\d+(\.\d+)?(ms|s)").unwrap(); - output = duration_regex.replace_all(&output, "").into_owned(); - - // 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(); - - // Remove Node.js experimental warnings (e.g., Type Stripping warnings) - let node_warning_regex = - regex::Regex::new(r"(?m)^\(node:\d+\) ExperimentalWarning:.*\n?").unwrap(); - output = node_warning_regex.replace_all(&output, "").into_owned(); - let node_trace_warning_regex = regex::Regex::new( - r"(?m)^\(Use `node --trace-warnings \.\.\.` to show where the warning was created\)\n?", - ) - .unwrap(); - output = node_trace_warning_regex.replace_all(&output, "").into_owned(); - - output -} - pub fn redact_snapshot(value: &impl Serialize, workspace_root: &str) -> serde_json::Value { let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); + // Get the packages/tools directory path + let tools_dir = std::path::Path::new(&manifest_dir) + .parent() + .unwrap() + .parent() + .unwrap() + .join("packages") + .join("tools"); + let tools_dir_str = tools_dir.to_str().unwrap().to_owned(); let mut json_value = serde_json::to_value(value).unwrap(); // On Windows, paths might use either backslashes or forward slashes - // Try both variants for workspace_root and manifest_dir + // Try both variants for workspace_root, manifest_dir, and tools_dir let workspace_root_forward = workspace_root.replace('\\', "/"); let manifest_dir_forward = manifest_dir.replace('\\', "/"); + let tools_dir_forward = tools_dir_str.replace('\\', "/"); redact_string_in_json( &mut json_value, @@ -97,6 +78,8 @@ pub fn redact_snapshot(value: &impl Serialize, workspace_root: &str) -> serde_js (workspace_root_forward.as_str(), ""), (manifest_dir.as_str(), ""), (manifest_dir_forward.as_str(), ""), + (tools_dir_str.as_str(), ""), + (tools_dir_forward.as_str(), ""), ], ); diff --git a/packages/tools/README.md b/packages/tools/README.md new file mode 100644 index 00000000..b44c946a --- /dev/null +++ b/packages/tools/README.md @@ -0,0 +1 @@ +This package contains test utilities and binaries used in the tests for vite_task_bin and fspy crates. diff --git a/crates/vite_task_bin/test_bins/package.json b/packages/tools/package.json similarity index 77% rename from crates/vite_task_bin/test_bins/package.json rename to packages/tools/package.json index 99651da9..3e530d79 100644 --- a/crates/vite_task_bin/test_bins/package.json +++ b/packages/tools/package.json @@ -1,5 +1,5 @@ { - "name": "vite-task-test-bins", + "name": "vite-task-tools", "type": "module", "private": true, "bin": { @@ -9,10 +9,9 @@ "replace-file-content": "./src/replace-file-content.ts" }, "dependencies": { - "@yarnpkg/shell": "catalog:", "cross-env": "^10.1.0", "oxlint": "catalog:", "oxlint-tsgolint": "catalog:", - "vite-task-test-bins": "link:" + "vite-task-tools": "link:" } } diff --git a/crates/vite_task_bin/test_bins/src/json-edit.ts b/packages/tools/src/json-edit.ts similarity index 100% rename from crates/vite_task_bin/test_bins/src/json-edit.ts rename to packages/tools/src/json-edit.ts diff --git a/crates/vite_task_bin/test_bins/src/print-env.js b/packages/tools/src/print-env.js similarity index 100% rename from crates/vite_task_bin/test_bins/src/print-env.js rename to packages/tools/src/print-env.js diff --git a/crates/vite_task_bin/test_bins/src/print-file.ts b/packages/tools/src/print-file.ts similarity index 100% rename from crates/vite_task_bin/test_bins/src/print-file.ts rename to packages/tools/src/print-file.ts diff --git a/crates/vite_task_bin/test_bins/src/replace-file-content.ts b/packages/tools/src/replace-file-content.ts similarity index 100% rename from crates/vite_task_bin/test_bins/src/replace-file-content.ts rename to packages/tools/src/replace-file-content.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd6305a3..200a128a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,9 +9,6 @@ catalogs: '@types/node': specifier: 25.0.3 version: 25.0.3 - '@yarnpkg/shell': - specifier: 4.1.3 - version: 4.1.3 husky: specifier: ^9.1.7 version: 9.1.7 @@ -45,11 +42,8 @@ importers: specifier: 'catalog:' version: 0.10.1 - crates/vite_task_bin/test_bins: + packages/tools: dependencies: - '@yarnpkg/shell': - specifier: 'catalog:' - version: 4.1.3(typanion@3.14.0) cross-env: specifier: ^10.1.0 version: 10.1.0 @@ -59,7 +53,7 @@ importers: oxlint-tsgolint: specifier: 'catalog:' version: 0.10.1 - vite-task-test-bins: + vite-task-tools: specifier: 'link:' version: 'link:' @@ -68,18 +62,6 @@ packages: '@epic-web/invariant@1.0.0': resolution: {integrity: sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==} - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - '@oxlint-tsgolint/darwin-arm64@0.10.1': resolution: {integrity: sha512-KGC4++BeEqrIcmDHiJt/e6/860PWJmUJjjp0mE+smpBmRXMjmOFFjrPmN+ZyCyVgf1WdmhPkQXsRSPeTR+2omw==} cpu: [arm64] @@ -157,19 +139,6 @@ packages: '@types/node@25.0.3': resolution: {integrity: sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==} - '@yarnpkg/fslib@3.1.4': - resolution: {integrity: sha512-Yyguw5RM+xI1Bv0RFbs1ZF5HwU+9/He4YT7yeT722yAlLfkz9IzZHO6a5yStEshxiliPn9Fdj4H54a785xpK/g==} - engines: {node: '>=18.12.0'} - - '@yarnpkg/parsers@3.0.3': - resolution: {integrity: sha512-mQZgUSgFurUtA07ceMjxrWkYz8QtDuYkvPlu0ZqncgjopQ0t6CNEo/OSealkmnagSUx8ZD5ewvezUwUuMqutQg==} - engines: {node: '>=18.12.0'} - - '@yarnpkg/shell@4.1.3': - resolution: {integrity: sha512-5igwsHbPtSAlLdmMdKqU3atXjwhtLFQXsYAG0sn1XcPb3yF8WxxtWxN6fycBoUvFyIHFz1G0KeRefnAy8n6gdw==} - engines: {node: '>=18.12.0'} - hasBin: true - ansi-escapes@7.2.0: resolution: {integrity: sha512-g6LhBsl+GBPRWGWsBtutpzBYuIIdBkLEvad5C/va/74Db018+5TZiyA26cZJAr3Rft5lprVqOIPxf5Vid6tqAw==} engines: {node: '>=18'} @@ -178,25 +147,14 @@ packages: resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} engines: {node: '>=12'} - ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - ansi-styles@6.2.3: resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - cli-cursor@5.0.0: resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} engines: {node: '>=18'} @@ -205,18 +163,6 @@ packages: resolution: {integrity: sha512-SroPvNHxUnk+vIW/dOSfNqdy1sPEFkrTk6TUtqLCnBlo3N7TNYYkzzN7uSD6+jVjrdO4+p8nH7JzH6cIvUem6A==} engines: {node: '>=20'} - clipanion@4.0.0-rc.4: - resolution: {integrity: sha512-CXkMQxU6s9GklO/1f714dkKBMu1lopS1WFF0B8o4AxPykR1hpozxSiUZ5ZUeBjfPgCWqbcNOtZVFhB8Lkfp1+Q==} - peerDependencies: - typanion: '*' - - color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - - color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} @@ -240,21 +186,9 @@ packages: resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} engines: {node: '>=18'} - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - eventemitter3@5.0.1: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} - fast-glob@3.3.3: - resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} - engines: {node: '>=8.6.0'} - - fastq@1.20.1: - resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} - fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -263,31 +197,15 @@ packages: resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==} engines: {node: '>=18'} - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - - has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - husky@9.1.7: resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} engines: {node: '>=18'} hasBin: true - is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - is-fullwidth-code-point@5.1.0: resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} engines: {node: '>=18'} - is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -295,10 +213,6 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - js-yaml@3.14.2: - resolution: {integrity: sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==} - hasBin: true - lint-staged@16.2.7: resolution: {integrity: sha512-lDIj4RnYmK7/kXMya+qJsmkRFkGolciXjrsZ6PC25GdTfWOAWetR0ZbsNXRAj1EHHImRSalc+whZFg56F5DVow==} engines: {node: '>=20.17'} @@ -312,10 +226,6 @@ packages: resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} engines: {node: '>=18'} - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - micromatch@4.0.8: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} @@ -359,23 +269,13 @@ packages: engines: {node: '>=0.10'} hasBin: true - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - restore-cursor@5.1.0: resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} engines: {node: '>=18'} - reusify@1.1.0: - resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rfdc@1.4.1: resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -392,9 +292,6 @@ packages: resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} engines: {node: '>=18'} - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - string-argv@0.3.2: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} engines: {node: '>=0.6.19'} @@ -411,20 +308,10 @@ packages: resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} engines: {node: '>=12'} - supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - - typanion@3.14.0: - resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} - undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} @@ -446,18 +333,6 @@ snapshots: '@epic-web/invariant@1.0.0': {} - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.20.1 - '@oxlint-tsgolint/darwin-arm64@0.10.1': optional: true @@ -504,53 +379,18 @@ snapshots: dependencies: undici-types: 7.16.0 - '@yarnpkg/fslib@3.1.4': - dependencies: - tslib: 2.8.1 - - '@yarnpkg/parsers@3.0.3': - dependencies: - js-yaml: 3.14.2 - tslib: 2.8.1 - - '@yarnpkg/shell@4.1.3(typanion@3.14.0)': - dependencies: - '@yarnpkg/fslib': 3.1.4 - '@yarnpkg/parsers': 3.0.3 - chalk: 4.1.2 - clipanion: 4.0.0-rc.4(typanion@3.14.0) - cross-spawn: 7.0.6 - fast-glob: 3.3.3 - micromatch: 4.0.8 - tslib: 2.8.1 - transitivePeerDependencies: - - typanion - ansi-escapes@7.2.0: dependencies: environment: 1.1.0 ansi-regex@6.2.2: {} - ansi-styles@4.3.0: - dependencies: - color-convert: 2.0.1 - ansi-styles@6.2.3: {} - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - braces@3.0.3: dependencies: fill-range: 7.1.1 - chalk@4.1.2: - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - cli-cursor@5.0.0: dependencies: restore-cursor: 5.1.0 @@ -560,16 +400,6 @@ snapshots: slice-ansi: 7.1.2 string-width: 8.1.0 - clipanion@4.0.0-rc.4(typanion@3.14.0): - dependencies: - typanion: 3.14.0 - - color-convert@2.0.1: - dependencies: - color-name: 1.1.4 - - color-name@1.1.4: {} - colorette@2.0.20: {} commander@14.0.2: {} @@ -589,55 +419,24 @@ snapshots: environment@1.1.0: {} - esprima@4.0.1: {} - eventemitter3@5.0.1: {} - fast-glob@3.3.3: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.8 - - fastq@1.20.1: - dependencies: - reusify: 1.1.0 - fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 get-east-asian-width@1.4.0: {} - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - - has-flag@4.0.0: {} - husky@9.1.7: {} - is-extglob@2.1.1: {} - is-fullwidth-code-point@5.1.0: dependencies: get-east-asian-width: 1.4.0 - is-glob@4.0.3: - dependencies: - is-extglob: 2.1.1 - is-number@7.0.0: {} isexe@2.0.0: {} - js-yaml@3.14.2: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 - lint-staged@16.2.7: dependencies: commander: 14.0.2 @@ -665,8 +464,6 @@ snapshots: strip-ansi: 7.1.2 wrap-ansi: 9.0.2 - merge2@1.4.1: {} - micromatch@4.0.8: dependencies: braces: 3.0.3 @@ -707,21 +504,13 @@ snapshots: pidtree@0.6.0: {} - queue-microtask@1.2.3: {} - restore-cursor@5.1.0: dependencies: onetime: 7.0.0 signal-exit: 4.1.0 - reusify@1.1.0: {} - rfdc@1.4.1: {} - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 @@ -735,8 +524,6 @@ snapshots: ansi-styles: 6.2.3 is-fullwidth-code-point: 5.1.0 - sprintf-js@1.0.3: {} - string-argv@0.3.2: {} string-width@7.2.0: @@ -754,18 +541,10 @@ snapshots: dependencies: ansi-regex: 6.2.2 - supports-color@7.2.0: - dependencies: - has-flag: 4.0.0 - to-regex-range@5.0.1: dependencies: is-number: 7.0.0 - tslib@2.8.1: {} - - typanion@3.14.0: {} - undici-types@7.16.0: {} which@2.0.2: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index df1ce3dc..1ff92ca3 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,10 +1,9 @@ packages: - . - - crates/vite_task_bin/test_bins + - packages/tools catalog: '@types/node': 25.0.3 - '@yarnpkg/shell': 4.1.3 husky: ^9.1.7 lint-staged: ^16.2.6 oxlint: ^1.34.0