diff --git a/CLAUDE.md b/CLAUDE.md index 06b3de10..61e20b7e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -40,15 +40,15 @@ Test fixtures and snapshots: ```bash # Run a task defined in vite-task.json -vite run # run task in current package -vite run # # run task in specific package -vite run -r # run task in all packages (recursive) -vite run -t # run task in current package + transitive deps -vite run --extra --args # pass extra args to the task command +vp run # run task in current package +vp run # # run task in specific package +vp run -r # run task in all packages (recursive) +vp run -t # run task in current package + transitive deps +vp run --extra --args # pass extra args to the task command # Built-in commands (run tools from node_modules/.bin) -vite test [args...] # run vitest -vite lint [args...] # run oxlint +vp test [args...] # run vitest +vp lint [args...] # run oxlint # Flags -r, --recursive # run across all packages @@ -59,7 +59,7 @@ vite lint [args...] # run oxlint ## Key Architecture - **vite_task** - Main task runner with caching and session management -- **vite_task_bin** - CLI binary (`vite` command) and task synthesizer +- **vite_task_bin** - CLI binary (`vp` command) and task synthesizer - **vite_task_graph** - Task dependency graph construction and config loading - **vite_task_plan** - Execution planning (resolves env vars, working dirs, commands) - **vite_workspace** - Workspace detection and package dependency graph diff --git a/crates/vite_task/docs/boolean-flags.md b/crates/vite_task/docs/boolean-flags.md index 99aa91d4..6b75801d 100644 --- a/crates/vite_task/docs/boolean-flags.md +++ b/crates/vite_task/docs/boolean-flags.md @@ -35,7 +35,7 @@ The positive and negative forms of a flag are mutually exclusive. You cannot use ```bash # This will result in an error -vite run --recursive --no-recursive build +vp run --recursive --no-recursive build ``` ### Precedence @@ -44,7 +44,7 @@ When only the negative form is used, it takes precedence and explicitly sets the ```bash # Explicitly disable topological ordering -vite run build -r --no-topological +vp run build -r --no-topological ``` ### Default Values @@ -54,23 +54,23 @@ The negative flags are particularly useful for overriding default behaviors: - `--recursive` with `--no-topological`: By default, recursive runs enable topological ordering. Use `--no-topological` to disable it: ```bash # Recursive run WITHOUT topological ordering - vite run build -r --no-topological + vp run build -r --no-topological ``` ## Examples ```bash # Run with debugging disabled (useful if debug is enabled by default in config) -vite --no-debug build +vp --no-debug build # Recursive build without topological ordering -vite run build --recursive --no-topological +vp run build --recursive --no-topological # Explicitly disable parallel execution -vite run build --no-parallel +vp run build --no-parallel # Run tests sequentially, not in parallel -vite run test --no-parallel +vp run test --no-parallel ``` ## Implementation Details diff --git a/crates/vite_task/docs/task-cache.md b/crates/vite_task/docs/task-cache.md index db276b88..b2c450c0 100644 --- a/crates/vite_task/docs/task-cache.md +++ b/crates/vite_task/docs/task-cache.md @@ -29,18 +29,18 @@ For tasks defined as below: the task cache system is able to hit the same cache for `test` task and for the first subcommand in `build` task: -1. user runs `vite run build` -> no cache hit. run `echo $foo` and create cache -2. user runs `vite run test` +1. user runs `vp run build` -> no cache hit. run `echo $foo` and create cache +2. user runs `vp run test` 1. `echo $foo` -> **hit cache created in step 1 and replay** 2. `echo $bar` -> no cache hit. run `echo test` and create cache 3. user changes env `$foo` -4. user runs `vite run test` +4. user runs `vp run test` 1. `echo $foo` 1. the cache system should be able to **locate the cache that was created in step 1 and hit in step 2.1** 2. compare the command fingerprint and report cache miss because `$foo` is changed. 3. re-run and replace the cache with a new one. 2. `echo $bar` -> hit cache created in step 2.2 and replay -5. user runs `vite run build`: **hit the cache created in step 4.1.3 and replay**. +5. user runs `vp run build`: **hit the cache created in step 4.1.3 and replay**. ## Architecture @@ -498,10 +498,10 @@ The cache location can be configured via environment variable: ```bash # Custom cache location -VITE_CACHE_PATH=/tmp/vite-cache vite run build +VITE_CACHE_PATH=/tmp/vite-cache vp run build # Default: node_modules/.vite/task-cache in workspace root -vite run build +vp run build ``` ### Task-Level Cache Control @@ -614,7 +614,7 @@ CommandFingerprint { ### Example: Synthetic Task Cache Key ```rust -// Synthetic task (e.g., "vite lint" in a task script) +// Synthetic task (e.g., "vp lint" in a task script) TaskRunKey { task_id: TaskId { task_group_id: TaskGroupId { @@ -645,10 +645,10 @@ CommandFingerprint { ```bash # Enable debug logging -VITE_LOG=debug vite run build +VITE_LOG=debug vp run build # Show cache operations -VITE_LOG=trace vite run build +VITE_LOG=trace vp run build ``` ### Debug Output Examples @@ -718,8 +718,8 @@ Tasks with identical commands automatically share cache entries: Behavior: -1. `vite run script1` creates command cache for `cat foo.txt` -2. `vite run script2` hits the same command cache (shared) +1. `vp run script1` creates command cache for `cat foo.txt` +2. `vp run script2` hits the same command cache (shared) 3. If `foo.txt` changes, both tasks will see cache miss on next run 4. Cache update from either task benefits the other @@ -729,8 +729,8 @@ Tasks with different arguments get separate cache entries: ```bash # These create separate caches -vite run echo -- a # TaskRunKey with args: ["a"] -vite run echo -- b # TaskRunKey with args: ["b"] +vp run echo -- a # TaskRunKey with args: ["a"] +vp run echo -- b # TaskRunKey with args: ["b"] ``` ### 4. Compound Commands for Granular Caching @@ -787,23 +787,23 @@ No need to manually specify inputs - fspy captures actual dependencies. ```bash # Initial run creates command cache -> vite run script1 +> vp run script1 Cache not found bar # Different task, same command - hits shared cache -> vite run script2 +> vp run script2 Cache hit, replaying bar # File change invalidates shared cache > echo baz > foo.txt -> vite run script2 +> vp run script2 Cache miss: foo.txt content changed baz # Original task benefits from updated cache -> vite run script1 +> vp run script1 Cache hit, replaying baz ``` @@ -812,20 +812,20 @@ baz ```bash # Different args create separate caches -> vite run echo -- a +> vp run echo -- a Cache not found a -> vite run echo -- b +> vp run echo -- b Cache not found b # Each argument combination has its own cache -> vite run echo -- a +> vp run echo -- a Cache hit, replaying a -> vite run echo -- b +> vp run echo -- b Cache hit, replaying b ``` @@ -834,16 +834,16 @@ b ```bash # Different directories create separate caches for tasks -> cd folder1 && vite run lint +> cd folder1 && vp run lint Cache not found Found 0 warnings and 0 errors. -> cd folder2 && vite run lint +> cd folder2 && vp run lint Cache not found # Different cwd = different cache Found 0 warnings and 0 errors. # Each directory maintains its own cache -> cd folder1 && vite run lint +> cd folder1 && vp run lint Cache hit, replaying Found 0 warnings and 0 errors. ``` diff --git a/crates/vite_task/docs/terminologies.md b/crates/vite_task/docs/terminologies.md index ce16f8bd..39dd574e 100644 --- a/crates/vite_task/docs/terminologies.md +++ b/crates/vite_task/docs/terminologies.md @@ -31,4 +31,4 @@ The two task groups generates 3 tasks: These are **task names**. They are for displaying and filtering. -The user could execute `vite run build` under the `app` package, or execute `vite run app#build` from anywhere. The parameter `build` and `app#build` after `vite run` are **task requests**. They are used to match against task names to determine what tasks to run. +The user could execute `vp run build` under the `app` package, or execute `vp run app#build` from anywhere. The parameter `build` and `app#build` after `vp run` are **task requests**. They are used to match against task names to determine what tasks to run. diff --git a/crates/vite_task/docs/vite-run.md b/crates/vite_task/docs/vite-run.md index 1da30f19..2db416a1 100644 --- a/crates/vite_task/docs/vite-run.md +++ b/crates/vite_task/docs/vite-run.md @@ -1,9 +1,9 @@ -# `vite-plus run` +# `vp run` Vite-plus run has two modes: -1. Implicit mode is running `vite-plus` without `run` command, it will run the task in the current package, it supposed to replace the `pnpm/yarn run` command. -2. Explicit mode is running `vite-plus run` with run command, like `vite-plus run vite-plus#build`. +1. Implicit mode is running `vp` without `run` command, it will run the task in the current package, it supposed to replace the `pnpm/yarn run` command. +2. Explicit mode is running `vp run` with run command, like `vp run vite-plus#build`. ## Implicit mode @@ -15,7 +15,7 @@ Vite-plus run has two modes: > > This documentation describes the current behavior and should be updated when the Implicit Mode RFC is done. -With implicit mode, `vite` will run the task in the current package. It can't accept more than on task. The first argument will be treated as the task name; the args following the command will be treated as the task args and bypass to the task. +With implicit mode, `vp` will run the task in the current package. It can't accept more than on task. The first argument will be treated as the task name; the args following the command will be treated as the task args and bypass to the task. Given the following `package.json` file: @@ -31,54 +31,54 @@ Given the following `package.json` file: This command equivalent to `vite build`: ```bash -vite-plus build +vp build ``` This command equivalent to `vite build --mode production`: ```bash -vite-plus build --mode production +vp build --mode production ``` This command equivalent to `oxlint packages/cli/binding/index.js`: ```bash -vite-plus lint packages/cli/binding/index.js +vp lint packages/cli/binding/index.js ``` If the command contains `#`, the command will be treated as a task in the workspace subpackage. -This command equivalent to `vite-plus run cli#build`: +This command equivalent to `vp run cli#build`: ```bash -vite-plus cli#build +vp cli#build ``` ## Explicit mode -With explicit mode, `vite-plus run` will run the task in the workspace subpackage. It can accept more than one task. The arguments will be treated as the task names; the args following the `--` will be treated as the task args and bypass to the task. +With explicit mode, `vp run` will run the task in the workspace subpackage. It can accept more than one task. The arguments will be treated as the task names; the args following the `--` will be treated as the task args and bypass to the task. ### Default behavior -The `vite-plus run` command will run the scoped tasks in dependency order. +The `vp run` command will run the scoped tasks in dependency order. Task names without `#` will be resolved in the current package (the package containing the nearest package.json file from the current working directory). For example: -- `vite-plus run build` - runs the build task in the current package -- `vite-plus run test lint` - Throw `OnlyOneTaskRequest` error -- `vite-plus run @other/package#build` - runs the build task in @other/package +- `vp run build` - runs the build task in the current package +- `vp run test lint` - Throw `OnlyOneTaskRequest` error +- `vp run @other/package#build` - runs the build task in @other/package Behaviors when the package root and/or the workspace root is not found: -| package root | workspace root | behaviour | -| ------------ | -------------- | --------------------------------------------------------------------------------------------------------------------------- | -| found | not found | No possible: workspace root always fallbacks to package root. | -| not found | found | `vite-plus run build` should throw an `CurrentPackageNotFound` error. `vite-plus run @other/package#build` is still allowed | -| not found | not found | Throw an error on any `vite run`. The workspace root must always exist as it's where we store the cache. | +| package root | workspace root | behaviour | +| ------------ | -------------- | ------------------------------------------------------------------------------------------------------------- | +| found | not found | No possible: workspace root always fallbacks to package root. | +| not found | found | `vp run build` should throw an `CurrentPackageNotFound` error. `vp run @other/package#build` is still allowed | +| not found | not found | Throw an error on any `vp run`. The workspace root must always exist as it's where we store the cache. | ### `--recursive,-r` -With the `--recursive,-r` flag, the `vite-plus run` command will run the tasks in all monorepo packages. +With the `--recursive,-r` flag, the `vp run` command will run the tasks in all monorepo packages. The task name should't contain `#` with the `--recursive,-r` flag. If any task name contains `#`, it would cause an `RecursiveRunWithScope` error. @@ -98,16 +98,16 @@ Examples: ```bash # Recursive build with topological ordering (default) -vite-plus run build -r +vp run build -r # Recursive build WITHOUT topological ordering -vite-plus run build -r --no-topological +vp run build -r --no-topological # Single package with topological ordering enabled -vite-plus run app#build -t +vp run app#build -t # Multiple packages without topological ordering (default) -vite-plus run app#build web#build +vp run app#build web#build ``` Note: `--topological` and `--no-topological` are mutually exclusive and cannot be used together. See [boolean-flags.md](./boolean-flags.md) for more information about boolean flag patterns. @@ -172,7 +172,7 @@ Task Dependencies (explicit): utils#build → utils#test ``` -The execution flow for `vite-plus run build -r --topological`: +The execution flow for `vp run build -r --topological`: ``` ┌─────────────────────────────────────────────────────────────┐ @@ -342,12 +342,12 @@ The final step creates an execution plan: Task requests are in form of `task_name` or `pkg#task_name`. They occur in two places: -- one or multiple parameters following after `vite run`. +- one or multiple parameters following after `vp run`. - items in `dependsOn`. How task requests work: -- `build` in `vite run build` matches task `build` in the current package determined by cwd. +- `build` in `vp run build` matches task `build` in the current package determined by cwd. - `build` in `dependsOn: ["build"]` matches task `build` in the package where the config file is. - `app#build` matches task `build` in package `app`. - `app#build` raises an error if there are multiple packages named `app`. @@ -357,4 +357,4 @@ How task requests work: - `#build` raises an error if there are multiple nameless packages. - `build` does not match task `build` in the nameless package. -While task requests with multiple `#` are invalid, packages with `#` in their names are valid. For example, a package named `pkg#special` can have a task named `build`. It can be referenced by executing `vite run build` under the folder of package `pkg#special`. +While task requests with multiple `#` are invalid, packages with `#` in their names are valid. For example, a package named `pkg#special` can have a task named `build`. It can be referenced by executing `vp run build` under the folder of package `pkg#special`. diff --git a/crates/vite_task/src/session/mod.rs b/crates/vite_task/src/session/mod.rs index 36a8203c..7732d542 100644 --- a/crates/vite_task/src/session/mod.rs +++ b/crates/vite_task/src/session/mod.rs @@ -65,9 +65,9 @@ pub struct SessionCallbacks<'a> { /// The result of a [`CommandHandler::handle_command`] call. #[derive(Debug)] pub enum HandledCommand { - /// The command was synthesized into a task (e.g., `vite lint` → `oxlint`). + /// The command was synthesized into a task (e.g., `vp lint` → `oxlint`). Synthesized(SyntheticPlanRequest), - /// The command is a vite-task CLI command (e.g., `vite run build`). + /// The command is a vite task CLI command (e.g., `vp run build`). ViteTaskCommand(Command), /// The command should be executed verbatim as an external process. Verbatim, @@ -77,7 +77,7 @@ pub enum HandledCommand { /// /// The implementation should return: /// - [`HandledCommand::Synthesized`] to replace the command with a synthetic task. -/// - [`HandledCommand::ViteTaskCommand`] when the command is a vite-task CLI invocation. +/// - [`HandledCommand::ViteTaskCommand`] when the command is a vite task CLI invocation. /// - [`HandledCommand::Verbatim`] to execute the command as-is as an external process. #[async_trait::async_trait(?Send)] pub trait CommandHandler: Debug { @@ -133,7 +133,7 @@ pub struct Session<'a> { plan_request_parser: PlanRequestParser<'a>, /// Cache is lazily initialized to avoid SQLite race conditions when multiple - /// processes (e.g., parallel `vite lib` commands) start simultaneously. + /// processes (e.g., parallel `vp lib` commands) start simultaneously. cache: OnceCell, cache_path: AbsolutePathBuf, } @@ -273,7 +273,7 @@ impl<'a> Session<'a> { let plan_request = command.into_plan_request(&cwd).map_err(|error| { TaskPlanErrorKind::ParsePlanRequestError { error: error.into(), - program: Str::from("vite"), + program: Str::from("vp"), args: Default::default(), cwd: Arc::clone(&cwd), } diff --git a/crates/vite_task_bin/Cargo.toml b/crates/vite_task_bin/Cargo.toml index 29c22a15..c6bdf013 100644 --- a/crates/vite_task_bin/Cargo.toml +++ b/crates/vite_task_bin/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true rust-version.workspace = true [[bin]] -name = "vite" +name = "vp" path = "src/main.rs" [dependencies] diff --git a/crates/vite_task_bin/src/lib.rs b/crates/vite_task_bin/src/lib.rs index d665358a..28111255 100644 --- a/crates/vite_task_bin/src/lib.rs +++ b/crates/vite_task_bin/src/lib.rs @@ -54,7 +54,7 @@ fn synthesize_node_modules_bin_task( } #[derive(Debug, Parser)] -#[command(name = "vite", version)] +#[command(name = "vp", version)] pub enum Args { Lint { #[clap(trailing_var_arg = true, allow_hyphen_values = true)] @@ -79,10 +79,10 @@ impl vite_task::CommandHandler for CommandHandler { command: &mut ScriptCommand, ) -> anyhow::Result { match command.program.as_str() { - "vite" => {} - // `vpr ` is shorthand for `vite run ` + "vp" => {} + // `vpr ` is shorthand for `vp run ` "vpr" => { - command.program = Str::from("vite"); + command.program = Str::from("vp"); command.args = iter::once(Str::from("run")).chain(command.args.iter().cloned()).collect(); } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml index 43e7d26d..a7e54885 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "associate existing cache" steps = [ - "vite run script1 # cache miss", - "vite run script2 # cache hit, same command as script1", + "vp run script1 # cache miss", + "vp run script2 # cache hit, same command as script1", "json-edit package.json '_.scripts.script2 = \"print world\"' # change script2", - "vite run script2 # cache miss", + "vp run script2 # cache miss", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap index 57a2f9b1..fe495ca6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap @@ -1,10 +1,9 @@ --- 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/associate-existing-cache --- -> vite run script1 # cache miss +> vp run script1 # cache miss $ print hello hello @@ -22,7 +21,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run script2 # cache hit, same command as script1 +> vp run script2 # cache hit, same command as script1 $ print hello ✓ cache hit, replaying hello @@ -42,7 +41,7 @@ Task Details: > json-edit package.json '_.scripts.script2 = "print world"' # change script2 -> vite run script2 # cache miss +> vp run script2 # cache miss $ print world ✗ cache miss: args changed, executing world diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/package.json index 3f45091c..168c0101 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/package.json @@ -1,5 +1,5 @@ { "scripts": { - "lint": "vite lint" + "lint": "vp lint" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml index bb79544f..44289fd4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "builtin different cwd" steps = [ - "cd folder1 && vite run lint # cache miss in folder1", - "cd folder2 && vite run lint # cache miss in folder2", + "cd folder1 && vp run lint # cache miss in folder1", + "cd folder2 && vp run lint # cache miss in folder2", "echo 'console.log(1);' > folder2/a.js # modify folder2", - "cd folder1 && vite run lint # cache hit", - "cd folder2 && vite run lint # cache miss", + "cd folder1 && vp run lint # cache hit", + "cd folder2 && vp run lint # cache miss", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap index e86b760d..fbec0479 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd --- -> cd folder1 && vite run lint # cache miss in folder1 -$ vite lint +> cd folder1 && vp run lint # cache miss in folder1 +$ vp lint ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. ,-[folder1/a.js:1:1] @@ -33,12 +33,12 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] lint: $ vite lint ✓ + [1] lint: $ vp lint ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cd folder2 && vite run lint # cache miss in folder2 -$ vite lint ✓ cache hit, replaying +> cd folder2 && vp run lint # cache miss in folder2 +$ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. ,-[folder1/a.js:1:1] @@ -67,14 +67,14 @@ Performance: 100% cache hit rate, saved in total Task Details: ──────────────────────────────────────────────── - [1] lint: $ vite lint ✓ + [1] lint: $ vp lint ✓ → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo 'console.log(1);' > folder2/a.js # modify folder2 -> cd folder1 && vite run lint # cache hit -$ vite lint ✗ cache miss: content of input 'folder2/a.js' changed, executing +> cd folder1 && vp run lint # cache hit +$ vp lint ✗ cache miss: content of input 'folder2/a.js' changed, executing ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. ,-[folder1/a.js:1:1] @@ -96,12 +96,12 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] lint: $ vite lint ✓ + [1] lint: $ vp lint ✓ → Cache miss: content of input 'folder2/a.js' changed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cd folder2 && vite run lint # cache miss -$ vite lint ✓ cache hit, replaying +> cd folder2 && vp run lint # cache miss +$ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. ,-[folder1/a.js:1:1] @@ -123,6 +123,6 @@ Performance: 100% cache hit rate, saved in total Task Details: ──────────────────────────────────────────────── - [1] lint: $ vite lint ✓ + [1] lint: $ vp lint ✓ → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/package.json index 484cf605..f0e0f9f8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/package.json @@ -1,6 +1,6 @@ { "name": "builtin-non-zero-exit-test", "scripts": { - "lint": "vite lint" + "lint": "vp lint" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml index f50465ef..821b270b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots.toml @@ -1,6 +1,6 @@ [[e2e]] name = "builtin command with non-zero exit does not show cache not updated" steps = [ - "vite run lint -- -D no-debugger", - "vite run lint -- -D no-debugger", + "vp run lint -- -D no-debugger", + "vp run lint -- -D no-debugger", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap index 06b73644..154062bd 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit --- -[1]> vite run lint -- -D no-debugger -$ vite lint -D no-debugger +[1]> vp run lint -- -D no-debugger +$ vp lint -D no-debugger x eslint(no-debugger): `debugger` statement is not allowed ,-[bad.js:1:1] @@ -26,12 +26,12 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] builtin-non-zero-exit-test#lint: $ vite lint -D no-debugger ✗ (exit code: 1) + [1] builtin-non-zero-exit-test#lint: $ vp lint -D no-debugger ✗ (exit code: 1) → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -[1]> vite run lint -- -D no-debugger -$ vite lint -D no-debugger +[1]> vp run lint -- -D no-debugger +$ vp lint -D no-debugger x eslint(no-debugger): `debugger` statement is not allowed ,-[bad.js:1:1] @@ -53,6 +53,6 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] builtin-non-zero-exit-test#lint: $ vite lint -D no-debugger ✗ (exit code: 1) + [1] builtin-non-zero-exit-test#lint: $ vp lint -D no-debugger ✗ (exit code: 1) → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml index 245063b6..b79bd5cb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml @@ -3,13 +3,13 @@ [[e2e]] name = "task with cache disabled" steps = [ - "vite run no-cache-task # cache miss", - "vite run no-cache-task # cache disabled, runs again", + "vp run no-cache-task # cache miss", + "vp run no-cache-task # cache disabled, runs again", ] [[e2e]] name = "task with cache enabled" steps = [ - "vite run cached-task # cache miss", - "vite run cached-task # cache hit", + "vp run cached-task # cache miss", + "vp run cached-task # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap index 393064a3..a8087820 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap @@ -1,10 +1,9 @@ --- 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/cache-disabled --- -> vite run no-cache-task # cache miss +> vp run no-cache-task # cache miss $ print-file test.txt ⊘ cache disabled: no cache config test content @@ -22,7 +21,7 @@ Task Details: → Cache disabled in task configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run no-cache-task # cache disabled, runs again +> vp run no-cache-task # cache disabled, runs again $ print-file test.txt ⊘ cache disabled: no cache config test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap index bc1bd572..b8113c15 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap @@ -1,10 +1,9 @@ --- 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/cache-disabled --- -> vite run cached-task # cache miss +> vp run cached-task # cache miss $ print-file test.txt test content @@ -22,7 +21,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run cached-task # cache hit +> vp run cached-task # cache hit $ print-file test.txt ✓ cache hit, replaying test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml index 048da0cb..a70a462b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "cache miss command change" steps = [ - "vite run task # cache miss", + "vp run task # cache miss", "json-edit package.json '_.scripts.task = \"print baz && print bar\"' # change first subtask", - "vite run task # first: cache miss, second: cache hit", + "vp run task # first: cache miss, second: cache hit", "json-edit package.json '_.scripts.task = \"print bar\"' # remove first subtask", - "vite run task # cache hit", + "vp run task # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap index ced2ee4b..c4ec7531 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap @@ -1,10 +1,9 @@ --- 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/cache-miss-command-change --- -> vite run task # cache miss +> vp run task # cache miss $ print foo foo @@ -30,7 +29,7 @@ Task Details: > json-edit package.json '_.scripts.task = "print baz && print bar"' # change first subtask -> vite run task # first: cache miss, second: cache hit +> vp run task # first: cache miss, second: cache hit $ print baz ✗ cache miss: args changed, executing baz @@ -56,7 +55,7 @@ Task Details: > json-edit package.json '_.scripts.task = "print bar"' # remove first subtask -> vite run task # cache hit +> vp run task # cache hit $ print bar ✓ cache hit, replaying bar diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml index 93bd6593..150a6812 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml @@ -3,55 +3,55 @@ [[e2e]] name = "env value changed" steps = [ - "cross-env MY_ENV=1 vite run test # cache miss", - "cross-env MY_ENV=2 vite run test # cache miss: env value changed", + "cross-env MY_ENV=1 vp run test # cache miss", + "cross-env MY_ENV=2 vp run test # cache miss: env value changed", ] [[e2e]] name = "env added" steps = [ - "vite run test # cache miss", - "cross-env MY_ENV=1 vite run test # cache miss: env added", + "vp run test # cache miss", + "cross-env MY_ENV=1 vp run test # cache miss: env added", ] [[e2e]] name = "env removed" steps = [ - "cross-env MY_ENV=1 vite run test # cache miss", - "vite run test # cache miss: env removed", + "cross-env MY_ENV=1 vp run test # cache miss", + "vp run test # cache miss: env removed", ] [[e2e]] name = "pass-through env added" steps = [ - "vite run test # cache miss", + "vp run test # cache miss", "json-edit vite-task.json \"_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']\" # add pass-through env", - "vite run test # cache miss: pass-through env added", + "vp run test # cache miss: pass-through env added", ] [[e2e]] name = "pass-through env removed" steps = [ "json-edit vite-task.json \"_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']\" # setup", - "vite run test # cache miss", + "vp run test # cache miss", "json-edit vite-task.json \"delete _.tasks.test.passThroughEnvs\" # remove pass-through env", - "vite run test # cache miss: pass-through env removed", + "vp run test # cache miss: pass-through env removed", ] [[e2e]] name = "cwd changed" steps = [ - "vite run test # cache miss", + "vp run test # cache miss", "mkdir -p subfolder", "cp test.txt subfolder/test.txt", "json-edit vite-task.json \"_.tasks.test.cwd = 'subfolder'\" # change cwd", - "vite run test # cache miss: cwd changed", + "vp run test # cache miss: cwd changed", ] [[e2e]] name = "input content changed" steps = [ - "vite run test # cache miss", + "vp run test # cache miss", "replace-file-content test.txt initial modified # modify input", - "vite run test # cache miss: input changed", + "vp run test # cache miss: input changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap index 02264c04..349cf370 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap @@ -1,10 +1,9 @@ --- 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/cache-miss-reasons --- -> vite run test # cache miss +> vp run test # cache miss $ print-file test.txt initial content @@ -28,7 +27,7 @@ Task Details: > json-edit vite-task.json "_.tasks.test.cwd = 'subfolder'" # change cwd -> vite run test # cache miss: cwd changed +> vp run test # cache miss: cwd changed ~/subfolder$ print-file test.txt ✗ cache miss: working directory changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap index 353df5f3..3005cc61 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap @@ -1,10 +1,9 @@ --- 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/cache-miss-reasons --- -> vite run test # cache miss +> vp run test # cache miss $ print-file test.txt initial content @@ -22,7 +21,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cross-env MY_ENV=1 vite run test # cache miss: env added +> cross-env MY_ENV=1 vp run test # cache miss: env added $ print-file test.txt ✗ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap index 991d5f49..97670f4b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap @@ -1,10 +1,9 @@ --- 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/cache-miss-reasons --- -> cross-env MY_ENV=1 vite run test # cache miss +> cross-env MY_ENV=1 vp run test # cache miss $ print-file test.txt initial content @@ -22,7 +21,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run test # cache miss: env removed +> vp run test # cache miss: env removed $ print-file test.txt ✗ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap index af8288a6..8c21bbae 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env value changed.snap @@ -1,10 +1,9 @@ --- 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/cache-miss-reasons --- -> cross-env MY_ENV=1 vite run test # cache miss +> cross-env MY_ENV=1 vp run test # cache miss $ print-file test.txt initial content @@ -22,7 +21,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> cross-env MY_ENV=2 vite run test # cache miss: env value changed +> cross-env MY_ENV=2 vp run test # cache miss: env value changed $ print-file test.txt ✗ cache miss: envs changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap index 0bdc5517..dde18ff1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/input content changed.snap @@ -1,10 +1,9 @@ --- 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/cache-miss-reasons --- -> vite run test # cache miss +> vp run test # cache miss $ print-file test.txt initial content @@ -24,7 +23,7 @@ Task Details: > replace-file-content test.txt initial modified # modify input -> vite run test # cache miss: input changed +> vp run test # cache miss: input changed $ print-file test.txt ✗ cache miss: content of input 'test.txt' changed, executing modified content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap index fa63d424..12a6b18d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env added.snap @@ -1,10 +1,9 @@ --- 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/cache-miss-reasons --- -> vite run test # cache miss +> vp run test # cache miss $ print-file test.txt initial content @@ -24,7 +23,7 @@ Task Details: > json-edit vite-task.json "_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']" # add pass-through env -> vite run test # cache miss: pass-through env added +> vp run test # cache miss: pass-through env added $ print-file test.txt ✗ cache miss: pass-through env config changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap index 7de44e70..c61c1f44 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/pass-through env removed.snap @@ -1,12 +1,11 @@ --- 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/cache-miss-reasons --- > json-edit vite-task.json "_.tasks.test.passThroughEnvs = ['MY_PASSTHROUGH']" # setup -> vite run test # cache miss +> vp run test # cache miss $ print-file test.txt initial content @@ -26,7 +25,7 @@ Task Details: > json-edit vite-task.json "delete _.tasks.test.passThroughEnvs" # remove pass-through env -> vite run test # cache miss: pass-through env removed +> vp run test # cache miss: pass-through env removed $ print-file test.txt ✗ cache miss: pass-through env config changed, executing initial content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml index e647b042..348802e4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml @@ -1,8 +1,8 @@ [[e2e]] name = "cache clean" steps = [ - "vite run cached-task # cache miss", - "vite run cached-task # cache hit", - "vite cache clean", - "vite run cached-task # cache miss after clean", + "vp run cached-task # cache miss", + "vp run cached-task # cache hit", + "vp cache clean", + "vp run cached-task # cache miss after clean", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap index 9288581b..6a010e6c 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots/cache clean.snap @@ -3,7 +3,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand --- -> vite run cached-task # cache miss +> vp run cached-task # cache miss $ print-file test.txt test content @@ -21,7 +21,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run cached-task # cache hit +> vp run cached-task # cache hit $ print-file test.txt ✓ cache hit, replaying test content @@ -39,9 +39,9 @@ Task Details: → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite cache clean +> vp cache clean -> vite run cached-task # cache miss after clean +> vp run cached-task # cache miss after clean $ print-file test.txt test content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml index a229bf3f..48173624 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml @@ -3,6 +3,6 @@ [[e2e]] name = "read file with colon in name" steps = [ - "vite run read_colon_in_name # cache miss", - "vite run read_colon_in_name # cache hit", + "vp run read_colon_in_name # cache miss", + "vp run read_colon_in_name # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap index 862bfd25..54a1b5c6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap @@ -1,10 +1,9 @@ --- 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/colon-in-name --- -> vite run read_colon_in_name # cache miss +> vp run read_colon_in_name # cache miss $ node read_node_fs.js @@ -21,7 +20,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run read_colon_in_name # cache hit +> vp run read_colon_in_name # cache hit $ node read_node_fs.js ✓ cache hit, replaying 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 index ed6793f0..eaa57399 100644 --- 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 @@ -2,6 +2,6 @@ "name": "e2e-env-test", "private": true, "scripts": { - "env-test": "vite env-test" + "env-test": "vp env-test" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots.toml index 069aa8e5..5471be96 100644 --- 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 @@ -3,12 +3,12 @@ [[e2e]] name = "env-test prints value from additional_envs" steps = [ - "vite run env-test -- SYNTHETIC_ENV_VAR test_value_from_synthesizer # prints env value", + "vp run env-test -- SYNTHETIC_ENV_VAR test_value_from_synthesizer # prints env value", ] [[e2e]] name = "env-test with different values" steps = [ - "vite run env-test -- FOO bar # sets FOO=bar", - "vite run env-test -- BAZ qux # sets BAZ=qux", + "vp run env-test -- FOO bar # sets FOO=bar", + "vp run env-test -- BAZ qux # sets BAZ=qux", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap index eb60e270..0a88bf40 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test prints value from additional_envs.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test --- -> vite run env-test -- SYNTHETIC_ENV_VAR test_value_from_synthesizer # prints env value -$ vite env-test SYNTHETIC_ENV_VAR test_value_from_synthesizer +> vp run env-test -- SYNTHETIC_ENV_VAR test_value_from_synthesizer # prints env value +$ vp env-test SYNTHETIC_ENV_VAR test_value_from_synthesizer test_value_from_synthesizer @@ -17,6 +17,6 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] e2e-env-test#env-test: $ vite env-test SYNTHETIC_ENV_VAR test_value_from_synthesizer ✓ + [1] e2e-env-test#env-test: $ vp env-test SYNTHETIC_ENV_VAR test_value_from_synthesizer ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap index 43b582c2..3632750b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test/snapshots/env-test with different values.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-env-test --- -> vite run env-test -- FOO bar # sets FOO=bar -$ vite env-test FOO bar +> vp run env-test -- FOO bar # sets FOO=bar +$ vp env-test FOO bar bar @@ -17,12 +17,12 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] e2e-env-test#env-test: $ vite env-test FOO bar ✓ + [1] e2e-env-test#env-test: $ vp env-test FOO bar ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run env-test -- BAZ qux # sets BAZ=qux -$ vite env-test BAZ qux +> vp run env-test -- BAZ qux # sets BAZ=qux +$ vp env-test BAZ qux qux @@ -35,6 +35,6 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] e2e-env-test#env-test: $ vite env-test BAZ qux ✓ + [1] e2e-env-test#env-test: $ vp env-test BAZ qux ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json index 8aeca1bc..c123c1ea 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/package.json @@ -2,6 +2,6 @@ "name": "e2e-lint-cache", "private": true, "scripts": { - "lint": "vite lint" + "lint": "vp lint" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml index ed0f46fb..1117a3f1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots.toml @@ -3,7 +3,7 @@ [[e2e]] name = "direct lint" steps = [ - "vite run lint # cache miss", + "vp run lint # cache miss", "echo debugger > main.js # add lint error", - "vite run lint # cache miss, lint fails", + "vp run lint # cache miss, lint fails", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap index 66a27871..4d781723 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache/snapshots/direct lint.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/e2e-lint-cache --- -> vite run lint # cache miss -$ vite lint +> vp run lint # cache miss +$ vp lint Found 0 warnings and 0 errors. Finished in on 0 files with 90 rules using threads. @@ -18,14 +18,14 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] e2e-lint-cache#lint: $ vite lint ✓ + [1] e2e-lint-cache#lint: $ vp lint ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo debugger > main.js # add lint error -> vite run lint # cache miss, lint fails -$ vite lint ✗ cache miss: content of input '' changed, executing +> vp run lint # cache miss, lint fails +$ vp lint ✗ cache miss: content of input '' changed, executing ! eslint(no-debugger): `debugger` statement is not allowed ,-[main.js:1:1] @@ -47,6 +47,6 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] e2e-lint-cache#lint: $ vite lint ✓ + [1] e2e-lint-cache#lint: $ vp lint ✓ → Cache miss: content of input '' changed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots.toml index cc0778b3..d602c11a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots.toml @@ -3,5 +3,5 @@ [[e2e]] name = "cycle dependency error" steps = [ - "vite run task-a # task-a -> task-b -> task-a cycle", + "vp run task-a # task-a -> task-b -> task-a cycle", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots/cycle dependency error.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots/cycle dependency error.snap index 61b18b97..5bd8efc1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots/cycle dependency error.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots/cycle dependency error.snap @@ -1,10 +1,9 @@ --- 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/error_cycle_dependency --- -[1]> vite run task-a # task-a -> task-b -> task-a cycle +[1]> vp run task-a # task-a -> task-b -> task-a cycle ✗ Cycle dependencies detected: Cycle(NodeIndex(ExecutionIx(1))) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/package.json index bd72b0f4..d1a39b9b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/package.json @@ -1,6 +1,6 @@ { "name": "@test/exec-api", "scripts": { - "lint-task": "vite lint" + "lint-task": "vp lint" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots.toml index 884832c1..19a91a8b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots.toml @@ -1,13 +1,13 @@ [[e2e]] name = "exec not triggered from script" steps = [ - "FOO=bar vite run lint-task # no print-env FOO output", + "FOO=bar vp run lint-task # no print-env FOO output", ] [[e2e]] name = "exec caching" steps = [ - "FOO=bar vite lint # cache miss", - "FOO=bar vite lint # cache hit, silent", - "FOO=baz vite lint # env changed, cache miss", + "FOO=bar vp lint # cache miss", + "FOO=bar vp lint # cache hit, silent", + "FOO=baz vp lint # env changed, cache miss", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec caching.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec caching.snap index 98f77ba3..293599b7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec caching.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec caching.snap @@ -3,15 +3,15 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api --- -> FOO=bar vite lint # cache miss +> FOO=bar vp lint # cache miss bar Lint { args: [] } -> FOO=bar vite lint # cache hit, silent +> FOO=bar vp lint # cache hit, silent Lint { args: [] } -> FOO=baz vite lint # env changed, cache miss +> FOO=baz vp lint # env changed, cache miss baz Lint { args: [] } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap index 3a822a4b..60a584fa 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api/snapshots/exec not triggered from script.snap @@ -3,8 +3,8 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/exec-api --- -> FOO=bar vite run lint-task # no print-env FOO output -$ vite lint +> FOO=bar vp run lint-task # no print-env FOO output +$ vp lint Found 0 warnings and 0 errors. Finished in on 0 files with 90 rules using threads. @@ -18,6 +18,6 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] @test/exec-api#lint-task: $ vite lint ✓ + [1] @test/exec-api#lint-task: $ vp lint ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml index 2c124b69..5e7b5ccc 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml @@ -3,11 +3,11 @@ [[e2e]] name = "single task failure returns task exit code" steps = [ - "vite run pkg-a#fail # exits with code 42", + "vp run pkg-a#fail # exits with code 42", ] [[e2e]] name = "multiple task failures returns exit code 1" steps = [ - "vite run -r fail # multiple failures -> exit code 1", + "vp run -r fail # multiple failures -> exit code 1", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap index 27126371..648f2ceb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/multiple task failures returns exit code 1.snap @@ -1,10 +1,9 @@ --- 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/exit-codes --- -[1]> vite run -r fail # multiple failures -> exit code 1 +[1]> vp run -r fail # multiple failures -> exit code 1 ~/packages/pkg-b$ node -e "process.exit(7)" ~/packages/pkg-a$ node -e "process.exit(42)" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap index 97dde56a..d0980ac8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap @@ -1,10 +1,9 @@ --- 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/exit-codes --- -[42]> vite run pkg-a#fail # exits with code 42 +[42]> vp run pkg-a#fail # exits with code 42 ~/packages/pkg-a$ node -e "process.exit(42)" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml index f67ee553..d1b8f1d2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "individual cache for extra args" steps = [ - "vite run say a # cache miss", - "vite run say b # cache miss, different args", - "vite run say a # cache hit", - "vite run say b # cache hit", + "vp run say a # cache miss", + "vp run say b # cache miss, different args", + "vp run say a # cache hit", + "vp run say b # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap index 6d2bda66..77bea67d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots/individual cache for extra args.snap @@ -1,10 +1,9 @@ --- 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/individual-cache-for-adt-args --- -> vite run say a # cache miss +> vp run say a # cache miss $ print a a @@ -22,7 +21,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run say b # cache miss, different args +> vp run say b # cache miss, different args $ print b b @@ -40,7 +39,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run say a # cache hit +> vp run say a # cache hit $ print a ✓ cache hit, replaying a @@ -58,7 +57,7 @@ Task Details: → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run say b # cache hit +> vp run say b # cache hit $ print b ✓ cache hit, replaying b diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml index 9f37ef97..77193ea2 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots.toml @@ -3,8 +3,8 @@ [[e2e]] name = "individual cache for envs" steps = [ - "FOO=1 vite run hello # cache miss", - "FOO=2 vite run hello # cache miss, different env", - "FOO=1 vite run hello # cache hit", - "FOO=2 vite run hello # cache hit", + "FOO=1 vp run hello # cache miss", + "FOO=2 vp run hello # cache miss, different env", + "FOO=1 vp run hello # cache hit", + "FOO=2 vp run hello # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap index e4b1dab9..127548fb 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-envs/snapshots/individual cache for envs.snap @@ -1,10 +1,9 @@ --- 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/individual-cache-for-envs --- -> FOO=1 vite run hello # cache miss +> FOO=1 vp run hello # cache miss $ print-env FOO 1 @@ -22,7 +21,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=2 vite run hello # cache miss, different env +> FOO=2 vp run hello # cache miss, different env $ print-env FOO ✗ cache miss: envs changed, executing 2 @@ -40,7 +39,7 @@ Task Details: → Cache miss: env FOO value changed from '1' to '2' ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=1 vite run hello # cache hit +> FOO=1 vp run hello # cache hit $ print-env FOO ✓ cache hit, replaying 1 @@ -58,7 +57,7 @@ Task Details: → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> FOO=2 vite run hello # cache hit +> FOO=2 vp run hello # cache hit $ print-env FOO ✓ cache hit, replaying 2 diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/package.json index 3f45091c..168c0101 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/package.json @@ -1,5 +1,5 @@ { "scripts": { - "lint": "vite lint" + "lint": "vp lint" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml index 6d0d9103..6849eb0b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots.toml @@ -4,7 +4,7 @@ name = "lint dot git" steps = [ "mkdir .git", - "vite run lint # cache miss", + "vp run lint # cache miss", "echo hello > .git/foo.txt # add file inside .git", - "vite run lint # cache hit, .git is ignored", + "vp run lint # cache hit, .git is ignored", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap index 353eea7a..db2608a1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git/snapshots/lint dot git.snap @@ -5,8 +5,8 @@ input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/lint-dot-git --- > mkdir .git -> vite run lint # cache miss -$ vite lint +> vp run lint # cache miss +$ vp lint ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. ,-[a.js:1:1] @@ -28,14 +28,14 @@ Performance: 0% cache hit rate Task Details: ──────────────────────────────────────────────── - [1] lint: $ vite lint ✓ + [1] lint: $ vp lint ✓ → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ > echo hello > .git/foo.txt # add file inside .git -> vite run lint # cache hit, .git is ignored -$ vite lint ✓ cache hit, replaying +> vp run lint # cache hit, .git is ignored +$ vp lint ✓ cache hit, replaying ! eslint-plugin-unicorn(no-empty-file): Empty files are not allowed. ,-[a.js:1:1] @@ -57,6 +57,6 @@ Performance: 100% cache hit rate, saved in total Task Details: ──────────────────────────────────────────────── - [1] lint: $ vite lint ✓ + [1] lint: $ vp lint ✓ → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml index 99614af9..11ef616f 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml @@ -3,7 +3,7 @@ [[e2e]] name = "replay logs chronological order" steps = [ - "vite run build # cache miss", - "vite run build # cache hit", - "vite run build # cache hit", + "vp run build # cache miss", + "vp run build # cache hit", + "vp run build # cache hit", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap index 799bc7c5..dfa73153 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap @@ -1,10 +1,9 @@ --- 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/replay-logs-chronological-order --- -> vite run build # cache miss +> vp run build # cache miss $ node build.js [build.js] -------------------------------- [build.js] start @@ -114,7 +113,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run build # cache hit +> vp run build # cache hit $ node build.js ✓ cache hit, replaying [build.js] -------------------------------- [build.js] start @@ -224,7 +223,7 @@ Task Details: → Cache hit - output replayed - saved ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run build # cache hit +> vp run build # cache hit $ node build.js ✓ cache hit, replaying [build.js] -------------------------------- [build.js] start diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml index 33fc6cca..73abab94 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots.toml @@ -3,9 +3,9 @@ [[e2e]] name = "shared caching inputs" steps = [ - "vite run script1 # cache miss", - "vite run script2 # cache hit, same command as script1", + "vp run script1 # cache miss", + "vp run script2 # cache hit, same command as script1", "replace-file-content foo.txt initial modified # modify shared input", - "vite run script2 # cache miss, input changed", - "vite run script1 # cache hit, script2 already warmed cache", + "vp run script2 # cache miss, input changed", + "vp run script1 # cache hit, script2 already warmed cache", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap index 6045254e..1249be16 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-inputs/snapshots/shared caching inputs.snap @@ -1,10 +1,9 @@ --- 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/shared-caching-inputs --- -> vite run script1 # cache miss +> vp run script1 # cache miss $ print-file foo.txt initial content @@ -22,7 +21,7 @@ Task Details: → Cache miss: no previous cache entry found ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run script2 # cache hit, same command as script1 +> vp run script2 # cache hit, same command as script1 $ print-file foo.txt ✓ cache hit, replaying initial content @@ -42,7 +41,7 @@ Task Details: > replace-file-content foo.txt initial modified # modify shared input -> vite run script2 # cache miss, input changed +> vp run script2 # cache miss, input changed $ print-file foo.txt ✗ cache miss: content of input 'foo.txt' changed, executing modified content @@ -60,7 +59,7 @@ Task Details: → Cache miss: content of input 'foo.txt' changed ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -> vite run script1 # cache hit, script2 already warmed cache +> vp run script1 # cache hit, script2 already warmed cache $ print-file foo.txt ✓ cache hit, replaying modified content diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml index 19f26132..0548189b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml @@ -5,5 +5,5 @@ name = "signal terminated task returns non-zero exit code" platform = "unix" steps = [ - "vite run abort # SIGABRT -> exit code 134", + "vp run abort # SIGABRT -> exit code 134", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap index 47d608f2..20a9da9a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots/signal terminated task returns non-zero exit code.snap @@ -3,7 +3,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit --- -[134]> vite run abort # SIGABRT -> exit code 134 +[134]> vp run abort # SIGABRT -> exit code 134 $ node -e "process.kill(process.pid, 6)" 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 index a3e84b79..23c7f0ea 100644 --- 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 @@ -3,5 +3,5 @@ [[e2e]] name = "stdin passthrough to single task" steps = [ - { cmd = "vite run echo-stdin", stdin = "hello from stdin" }, + { cmd = "vp 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 index e7355cdb..f3b7b08f 100644 --- 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 @@ -1,10 +1,9 @@ --- 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 +> vp run echo-stdin $ node -e "process.stdin.pipe(process.stdout)" hello from stdin diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots.toml index f38b4537..8fc35b19 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots.toml @@ -3,5 +3,5 @@ [[e2e]] name = "no trailing newline" steps = [ - "vite run hello # runs echo -n hello", + "vp run hello # runs echo -n hello", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap index 2679290d..3f37a22a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots/no trailing newline.snap @@ -1,10 +1,9 @@ --- 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/task-no-trailing-newline --- -> vite run hello # runs echo -n hello +> vp run hello # runs echo -n hello $ echo -n foo ⊘ cache disabled: built-in command foo $ echo bar ⊘ cache disabled: built-in command diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml index ee750c39..c8530001 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml @@ -3,7 +3,7 @@ [[e2e]] name = "cache hit after file modification" steps = [ - "vite run test-task # cache miss", + "vp run test-task # cache miss", "replace-file-content main.js foo bar # modify input file", - "vite run test-task # cache miss, main.js changed", + "vp run test-task # cache miss, main.js changed", ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap index 7a3a6061..bde61e4a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots/cache hit after file modification.snap @@ -1,10 +1,9 @@ --- 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/vite-task-smoke --- -> vite run test-task # cache miss +> vp run test-task # cache miss $ echo hello ⊘ cache disabled: built-in command hello @@ -30,7 +29,7 @@ Task Details: > replace-file-content main.js foo bar # modify input file -> vite run test-task # cache miss, main.js changed +> vp run test-task # cache miss, main.js changed $ echo hello ⊘ cache disabled: built-in command hello diff --git a/crates/vite_task_bin/tests/e2e_snapshots/main.rs b/crates/vite_task_bin/tests/e2e_snapshots/main.rs index 53ce4010..3604c2a7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/main.rs +++ b/crates/vite_task_bin/tests/e2e_snapshots/main.rs @@ -148,11 +148,11 @@ async fn run_case_inner(tmpdir: &AbsolutePath, fixture_path: &Path, fixture_name // 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. + // Include vp binary path to PATH so that e2e tests can run "vp ..." 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() + let vp_path = AbsolutePath::new(env!("CARGO_BIN_EXE_vp")).unwrap(); + let vp_dir = vp_path.parent().unwrap(); + vp_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, diff --git a/crates/vite_task_graph/src/query/cli.rs b/crates/vite_task_graph/src/query/cli.rs index 6824a5f9..b4b575bc 100644 --- a/crates/vite_task_graph/src/query/cli.rs +++ b/crates/vite_task_graph/src/query/cli.rs @@ -7,7 +7,7 @@ use vite_str::Str; use super::TaskQueryKind; use crate::{query::TaskQuery, specifier::TaskSpecifier}; -/// Represents task query args of `vite run` +/// Represents task query args of `vp run` /// It will be converted to `TaskQuery`, but may be invalid (contains conflicting options), /// if so the error is returned early before loading the task graph. #[derive(Debug, clap::Parser)] diff --git a/crates/vite_task_graph/src/query/mod.rs b/crates/vite_task_graph/src/query/mod.rs index 89ca51aa..31d685b1 100644 --- a/crates/vite_task_graph/src/query/mod.rs +++ b/crates/vite_task_graph/src/query/mod.rs @@ -30,7 +30,7 @@ pub enum TaskQueryKind { Recursive { task_names: HashSet }, } -/// Represents a valid query for a task and its dependencies, usually issued from a CLI command `vite run ...`. +/// Represents a valid query for a task and its dependencies, usually issued from a CLI command `vp run ...`. /// A query represented by this struct is always valid, but still may result in no tasks found. #[derive(Debug)] pub struct TaskQuery { @@ -94,7 +94,7 @@ impl IndexedTaskGraph { execution_graph.add_node(starting_task); } // Task not found, but package located, and the query requests topological deps - // This happens when running `vite run --transitive taskName` in a package without `taskName`, but its dependencies have it. + // This happens when running `vp run --transitive taskName` in a package without `taskName`, but its dependencies have it. Err(err @ SpecifierLookupError::TaskNameNotFound { package_index, .. }) if include_topological_deps => { diff --git a/crates/vite_task_plan/README.md b/crates/vite_task_plan/README.md index 8416b174..64ce0645 100644 --- a/crates/vite_task_plan/README.md +++ b/crates/vite_task_plan/README.md @@ -27,11 +27,11 @@ plan.root_node() // Root execution node There are two types of execution requests: -1. **Query Request** - Execute tasks from the task graph (e.g., `vite run -r build`) +1. **Query Request** - Execute tasks from the task graph (e.g., `vp run -r build`) - Queries the task graph based on task patterns - Builds execution graph with dependency ordering -2. **Synthetic Request** - Execute on-the-fly tasks not in the graph (e.g., `vite lint` in a task script) +2. **Synthetic Request** - Execute on-the-fly tasks not in the graph (e.g., `vp lint` in a task script) - Generated dynamically by the TaskSynthesizer - Used for synthesized commands within task scripts @@ -48,8 +48,8 @@ Each task's command is parsed and split into execution items: - No process spawn overhead - **Expanded Execution** - Nested execution graph - - Commands like `vite run ...` expand into sub-graphs - - Enables composition of vite commands + - Commands like `vp run ...` expand into sub-graphs + - Enables composition of vp commands ### Command Parsing @@ -60,7 +60,7 @@ Commands are intelligently parsed: "tsc --noEmit" # Multiple commands -> Multiple execution items -"tsc --noEmit && vite run test && echo Done" +"tsc --noEmit && vp run test && echo Done" # ↓ ↓ ↓ # SpawnExecution Expanded InProcess ``` diff --git a/crates/vite_task_plan/src/cache_metadata.rs b/crates/vite_task_plan/src/cache_metadata.rs index 46690f21..13064cd3 100644 --- a/crates/vite_task_plan/src/cache_metadata.rs +++ b/crates/vite_task_plan/src/cache_metadata.rs @@ -17,7 +17,7 @@ pub enum ExecutionCacheKey { /// The index of the execution item in the task's command split by `&&`. /// This is to distinguish multiple execution items from the same task. and_item_index: usize, - /// Extra args provided when invoking the user-defined task (`vite [task_name] [extra_args...]`). + /// Extra args provided when invoking the user-defined task (`vp [task_name] [extra_args...]`). /// These args are appended to the last and_item. Non-last and_items don't get extra args. extra_args: Arc<[Str]>, /// The package path where the user-defined task is defined, relative to the workspace root. diff --git a/crates/vite_task_plan/src/context.rs b/crates/vite_task_plan/src/context.rs index 5fa02e70..89659183 100644 --- a/crates/vite_task_plan/src/context.rs +++ b/crates/vite_task_plan/src/context.rs @@ -35,7 +35,7 @@ pub struct PlanContext<'a> { /// The current call stack of task index nodes being planned. task_call_stack: Vec<(TaskNodeIndex, Range)>, - /// The extra args (`vite run task [extra_arg...]`). + /// The extra args (`vp run task [extra_arg...]`). /// It may come from real cli args, or commands in task scripts. extra_args: Arc<[Str]>, diff --git a/crates/vite_task_plan/src/lib.rs b/crates/vite_task_plan/src/lib.rs index d434ae14..52df2664 100644 --- a/crates/vite_task_plan/src/lib.rs +++ b/crates/vite_task_plan/src/lib.rs @@ -113,13 +113,13 @@ pub struct ExecutionItemDisplay { /// `SpawnExecution.cwd` contains the actual cwd for execution. /// These two may differ if the task synthesizer returns a task with a different cwd. /// - /// Hypothetically , if `vite lint-src` under cwd `packages/lib` synthesizes a task spawning `oxlint` under `packages/lib/src`. + /// Hypothetically , if `vp lint-src` under cwd `packages/lib` synthesizes a task spawning `oxlint` under `packages/lib/src`. /// The spawned process' cwd will be `packages/lib/src`, while this field will be `packages/lib`, - /// which will be displayed like `packages/lib$ vite lint-src` + /// which will be displayed like `packages/lib$ vp lint-src` pub cwd: Arc, } -/// An execution item, either expanded from a known vite subcommand, or a spawn execution. +/// An execution item, either expanded from a known vp subcommand, or a spawn execution. #[derive(Debug, Serialize)] pub struct ExecutionItem { /// Human-readable display for this execution item. @@ -141,7 +141,7 @@ pub enum LeafExecutionKind { /// An execution item, from a split subcommand in a task's command (`item1 && item2 && ...`). #[derive(Debug, Serialize)] pub enum ExecutionItemKind { - /// Expanded from a known vite subcommand, like `vite run ...` or a synthesized task. + /// Expanded from a known vp subcommand, like `vp run ...` or a synthesized task. Expanded(#[serde(serialize_with = "serialize_by_key")] ExecutionGraph), /// A normal execution that spawns a child process, like `tsc --noEmit`. Leaf(LeafExecutionKind), diff --git a/crates/vite_task_plan/src/plan.rs b/crates/vite_task_plan/src/plan.rs index bf5a2547..134b418a 100644 --- a/crates/vite_task_plan/src/plan.rs +++ b/crates/vite_task_plan/src/plan.rs @@ -176,7 +176,7 @@ async fn plan_task_as_execution_node( .with_plan_context(&context)?; let execution_item_kind: ExecutionItemKind = match plan_request { - // Expand task query like `vite run -r build` + // Expand task query like `vp run -r build` Some(PlanRequest::Query(query_plan_request)) => { // Add prefix envs to the context context.add_envs(and_item.envs.iter()); @@ -401,7 +401,7 @@ fn plan_spawn_execution( }) } -/// Expand the parsed task request (like `run -r build`/`exec tsc`/`lint`) into an execution graph. +/// Expand the parsed task request (like `run -r build`/`lint`) into an execution graph. pub async fn plan_query_request( query_plan_request: QueryPlanRequest, mut context: PlanContext<'_>, diff --git a/crates/vite_task_plan/src/plan_request.rs b/crates/vite_task_plan/src/plan_request.rs index d0c406a0..e7333a09 100644 --- a/crates/vite_task_plan/src/plan_request.rs +++ b/crates/vite_task_plan/src/plan_request.rs @@ -33,7 +33,7 @@ pub struct QueryPlanRequest { pub plan_options: PlanOptions, } -/// The request to run a synthetic task (e.g., one generated by TaskSynthesizer from `vite lint` in a script). +/// The request to run a synthetic task (e.g., one generated by TaskSynthesizer from `vp lint` in a script). /// Synthetic tasks are not defined in the task graph, but are generated on-the-fly. #[derive(Debug)] pub struct SyntheticPlanRequest { @@ -59,7 +59,7 @@ pub struct SyntheticPlanRequest { #[derive(Debug)] pub enum PlanRequest { - /// The request to run tasks queried from the task graph, like `vite run ...` or `vite run-many ...`. + /// The request to run tasks queried from the task graph, like `vp run ...`. Query(QueryPlanRequest), /// The request to run a synthetic task (not defined in the task graph), e.g., from TaskSynthesizer. Synthetic(SyntheticPlanRequest), diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/package.json index 670b1e46..58140e89 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/package.json @@ -3,6 +3,6 @@ "private": true, "scripts": { "hello": "echo hello", - "env-test": "vite env-test TEST_VAR hello_world" + "env-test": "vp env-test TEST_VAR hello_world" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/query - env-test synthetic task in user task.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/query - env-test synthetic task in user task.snap index 2087308b..763a1c1b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/query - env-test synthetic task in user task.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/query - env-test synthetic task in user task.snap @@ -25,7 +25,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs "task_name": "env-test", "package_path": "/" }, - "command": "vite env-test TEST_VAR hello_world", + "command": "vp env-test TEST_VAR hello_world", "and_item_index": null, "cwd": "/" }, diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap index 72be1051..65a1b8fd 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs/snapshots/task graph.snap @@ -16,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/additional-envs "package_path": "/" }, "resolved_config": { - "command": "vite env-test TEST_VAR hello_world", + "command": "vp env-test TEST_VAR hello_world", "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/package.json index 23932555..3a86ab77 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/package.json @@ -1,8 +1,8 @@ { "scripts": { - "lint": "vite lint", + "lint": "vp lint", "hello": "print-file", - "lint-and-echo": "vite lint && echo", - "echo-and-lint": "echo Linting && vite lint" + "lint-and-echo": "vp lint && echo", + "echo-and-lint": "echo Linting && vp lint" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots.toml index 610b3d59..a4f7588b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots.toml +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots.toml @@ -28,7 +28,7 @@ args = ["run", "echo-and-lint", "--fix"] [[e2e]] name = "direct lint" steps = [ - "vite run lint # cache miss", + "vp run lint # cache miss", "echo debugger > main.js # add lint error", - "vite run lint # cache miss, lint fails", + "vp run lint # cache miss, lint fails", ] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap index 10f6851e..8c407f5b 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - echo and lint with extra args.snap @@ -51,7 +51,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "echo-and-lint", "package_path": "/" }, - "command": "vite lint --fix", + "command": "vp lint --fix", "and_item_index": 1, "cwd": "/" }, diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap index e5116b63..96ef73af 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - lint and echo with extra args.snap @@ -25,7 +25,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "lint-and-echo", "package_path": "/" }, - "command": "vite lint", + "command": "vp lint", "and_item_index": 0, "cwd": "/" }, diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap index a71b87e3..157b5d59 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task with cwd.snap @@ -25,7 +25,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "lint", "package_path": "/" }, - "command": "vite lint", + "command": "vp lint", "and_item_index": null, "cwd": "/" }, diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap index a71b87e3..157b5d59 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task in user task.snap @@ -25,7 +25,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "lint", "package_path": "/" }, - "command": "vite lint", + "command": "vp lint", "and_item_index": null, "cwd": "/" }, diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap index 91b9a980..75011659 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/query - synthetic task with extra args in user task.snap @@ -25,7 +25,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "task_name": "lint", "package_path": "/" }, - "command": "vite lint --fix", + "command": "vp lint --fix", "and_item_index": null, "cwd": "/" }, diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/task graph.snap index 146b2bfd..563cf097 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys/snapshots/task graph.snap @@ -16,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "package_path": "/" }, "resolved_config": { - "command": "echo Linting && vite lint", + "command": "echo Linting && vp lint", "resolved_options": { "cwd": "/", "cache_config": { @@ -72,7 +72,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "package_path": "/" }, "resolved_config": { - "command": "vite lint", + "command": "vp lint", "resolved_options": { "cwd": "/", "cache_config": { @@ -100,7 +100,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-keys "package_path": "/" }, "resolved_config": { - "command": "vite lint && echo", + "command": "vp lint && echo", "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/node_modules/.bin/vite b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/node_modules/.bin/vp similarity index 100% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/node_modules/.bin/vite rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/node_modules/.bin/vp diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/node_modules/.bin/vite.cmd b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/node_modules/.bin/vp.cmd similarity index 100% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/node_modules/.bin/vite.cmd rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/node_modules/.bin/vp.cmd diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/package.json index 225cb648..0fe395f4 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/package.json @@ -1,6 +1,6 @@ { "name": "@test/cache-subcommand", "scripts": { - "clean-cache": "vite cache clean" + "clean-cache": "vp cache clean" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap index 184aaf14..916c5e05 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/query - cache clean in script.snap @@ -25,7 +25,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand "task_name": "clean-cache", "package_path": "/" }, - "command": "vite cache clean", + "command": "vp cache clean", "and_item_index": null, "cwd": "/" }, @@ -34,7 +34,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand "Spawn": { "cache_metadata": null, "spawn_command": { - "program_path": "/node_modules/.bin/vite", + "program_path": "/node_modules/.bin/vp", "args": [ "cache", "clean" diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/task graph.snap index 422476a8..34095de6 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand/snapshots/task graph.snap @@ -16,7 +16,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cache-subcommand "package_path": "/" }, "resolved_config": { - "command": "vite cache clean", + "command": "vp cache clean", "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/package.json new file mode 100644 index 00000000..1e0fa4aa --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/package.json @@ -0,0 +1,7 @@ +{ + "scripts": { + "build": "print-file package.json", + "cd-build": "cd src && vp run build", + "cd-lint": "cd src && vp lint" + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots.toml new file mode 100644 index 00000000..7110ec34 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots.toml @@ -0,0 +1,9 @@ +# Tests that `cd` in scripts interacts correctly with nested vp commands + +[[plan]] +name = "cd before vp run should not affect expanded task cwd" +args = ["run", "cd-build"] + +[[plan]] +name = "cd before vp lint should put synthetic task under cwd" +args = ["run", "cd-lint"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp lint should put synthetic task under cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp lint should put synthetic task under cwd.snap new file mode 100644 index 00000000..ee106cdb --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp lint should put synthetic task under cwd.snap @@ -0,0 +1,80 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts +--- +{ + "root_node": { + "Expanded": [ + { + "key": [ + "/", + "cd-lint" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "cd-lint", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "cd-lint", + "package_path": "/" + }, + "command": "vp lint", + "and_item_index": 1, + "cwd": "/src" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "src", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "oxlint" + } + }, + "args": [], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "cd-lint", + "and_item_index": 1, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/oxlint", + "args": [], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/src" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ] + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp run should not affect expanded task cwd.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp run should not affect expanded task cwd.snap new file mode 100644 index 00000000..16713272 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/query - cd before vp run should not affect expanded task cwd.snap @@ -0,0 +1,116 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: "&plan_json" +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts +--- +{ + "root_node": { + "Expanded": [ + { + "key": [ + "/", + "cd-build" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "cd-build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "cd-build", + "package_path": "/" + }, + "command": "vp run build", + "and_item_index": 1, + "cwd": "/src" + }, + "kind": { + "Expanded": [ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "build", + "package_path": "/" + }, + "items": [ + { + "execution_item_display": { + "task_display": { + "package_name": "", + "task_name": "build", + "package_path": "/" + }, + "command": "print-file package.json", + "and_item_index": null, + "cwd": "/" + }, + "kind": { + "Leaf": { + "Spawn": { + "cache_metadata": { + "spawn_fingerprint": { + "cwd": "", + "program_fingerprint": { + "OutsideWorkspace": { + "program_name": "print-file" + } + }, + "args": [ + "package.json" + ], + "env_fingerprints": { + "fingerprinted_envs": {}, + "pass_through_env_config": [ + "" + ] + }, + "fingerprint_ignores": null + }, + "execution_cache_key": { + "UserTask": { + "task_name": "build", + "and_item_index": 0, + "extra_args": [], + "package_path": "" + } + } + }, + "spawn_command": { + "program_path": "/node_modules/.bin/print-file", + "args": [ + "package.json" + ], + "all_envs": { + "NO_COLOR": "1", + "PATH": "/node_modules/.bin:/node_modules/.bin" + }, + "cwd": "/" + } + } + } + } + } + ] + }, + "neighbors": [] + } + ] + } + } + ] + }, + "neighbors": [] + } + ] + } +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/task graph.snap new file mode 100644 index 00000000..2d914518 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/snapshots/task graph.snap @@ -0,0 +1,91 @@ +--- +source: crates/vite_task_plan/tests/plan_snapshots/main.rs +expression: task_graph_json +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts +--- +[ + { + "key": [ + "/", + "build" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "build", + "package_path": "/" + }, + "resolved_config": { + "command": "print-file package.json", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + } + }, + "neighbors": [] + }, + { + "key": [ + "/", + "cd-build" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "cd-build", + "package_path": "/" + }, + "resolved_config": { + "command": "cd src && vp run build", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + } + }, + "neighbors": [] + }, + { + "key": [ + "/", + "cd-lint" + ], + "node": { + "task_display": { + "package_name": "", + "task_name": "cd-lint", + "package_path": "/" + }, + "resolved_config": { + "command": "cd src && vp lint", + "resolved_options": { + "cwd": "/", + "cache_config": { + "env_config": { + "fingerprinted_envs": [], + "pass_through_envs": [ + "" + ] + } + } + } + } + }, + "neighbors": [] + } +] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/vite-task.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/vite-task.json new file mode 100644 index 00000000..1d0fe9f2 --- /dev/null +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/cd-in-scripts/vite-task.json @@ -0,0 +1,3 @@ +{ + "cacheScripts": true +} diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/README.md b/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/README.md index 473f656f..c7c173fc 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/README.md +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/fingerprint-ignore-test/README.md @@ -36,20 +36,20 @@ This allows caching package installation tasks where only dependency manifests ( ```bash # First run - task executes -vite run create-files +vp run create-files # Second run - cache hit (all files tracked in fingerprint remain the same) -vite run create-files +vp run create-files # Modify node_modules/pkg-a/index.js echo 'modified' > node_modules/pkg-a/index.js # Third run - still cache hit (index.js is ignored) -vite run create-files +vp run create-files # Modify node_modules/pkg-a/package.json echo '{"name":"pkg-a","version":"2.0.0"}' > node_modules/pkg-a/package.json # Fourth run - cache miss (package.json is NOT ignored due to negation pattern) -vite run create-files +vp run create-files ``` diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/package.json index c61ceb5f..1ef14dfe 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/package.json @@ -1,6 +1,6 @@ { "scripts": { "script1": "echo hello", - "script2": "vite run script1" + "script2": "vp run script1" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots.toml index 98229c1b..022ce196 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots.toml +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots.toml @@ -1,5 +1,5 @@ -# Tests nested vite run resolution +# Tests nested vp run resolution [[plan]] -name = "nested vite run" +name = "nested vp run" args = ["run", "script2"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/query - nested vite run.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/query - nested vp run.snap similarity index 97% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/query - nested vite run.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/query - nested vp run.snap index b7635aeb..d892aaaa 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/query - nested vite run.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/query - nested vp run.snap @@ -1,6 +1,5 @@ --- source: crates/vite_task_plan/tests/plan_snapshots/main.rs -assertion_line: 139 expression: "&plan_json" input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks --- @@ -26,7 +25,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks "task_name": "script2", "package_path": "/" }, - "command": "vite run script1", + "command": "vp run script1", "and_item_index": null, "cwd": "/" }, diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/task graph.snap index 43cb206e..ead28462 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots/task graph.snap @@ -1,6 +1,5 @@ --- source: crates/vite_task_plan/tests/plan_snapshots/main.rs -assertion_line: 106 expression: task_graph_json input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks --- @@ -45,7 +44,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks "package_path": "/" }, "resolved_config": { - "command": "vite run script1", + "command": "vp run script1", "resolved_options": { "cwd": "/", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/package.json index 6b676d35..b75b4771 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/package.json @@ -1,5 +1,5 @@ { "scripts": { - "lint": "vite run a#lint" + "lint": "vp run a#lint" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/packages/a/package.json b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/packages/a/package.json index 6a08f0a8..abcf37e4 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/packages/a/package.json +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/packages/a/package.json @@ -1,6 +1,6 @@ { "name": "a", "scripts": { - "lint": "vite lint" + "lint": "vp lint" } } diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap index 83b85689..b714f2c5 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/query - synthetic-in-subpackage.snap @@ -25,7 +25,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-sub "task_name": "lint", "package_path": "/" }, - "command": "vite run a#lint", + "command": "vp run a#lint", "and_item_index": null, "cwd": "/" }, @@ -50,7 +50,7 @@ input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-sub "task_name": "lint", "package_path": "/packages/a" }, - "command": "vite lint", + "command": "vp lint", "and_item_index": null, "cwd": "/packages/a" }, diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/task graph.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/task graph.snap index ac2dba07..c94cb31e 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/task graph.snap +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage/snapshots/task graph.snap @@ -1,7 +1,7 @@ --- -source: crates/vite_task_bin/tests/test_snapshots/main.rs +source: crates/vite_task_plan/tests/plan_snapshots/main.rs expression: task_graph_json -input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subpackage +input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/synthetic-in-subpackage --- [ { @@ -16,7 +16,7 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subp "package_path": "/" }, "resolved_config": { - "command": "vite run a#lint", + "command": "vp run a#lint", "resolved_options": { "cwd": "/", "cache_config": { @@ -44,7 +44,7 @@ input_file: crates/vite_task_bin/tests/test_snapshots/fixtures/synthetic-in-subp "package_path": "/packages/a" }, "resolved_config": { - "command": "vite lint", + "command": "vp lint", "resolved_options": { "cwd": "/packages/a", "cache_config": { diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots.toml b/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots.toml index 7cb91d86..7ccda380 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots.toml +++ b/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots.toml @@ -1,3 +1,3 @@ [[plan]] -name = "vpr expands to vite run" +name = "vpr expands to vp run" args = ["run", "all"] diff --git a/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/query - vpr expands to vite run.snap b/crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/query - vpr expands to vp run.snap similarity index 100% rename from crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/query - vpr expands to vite run.snap rename to crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand/snapshots/query - vpr expands to vp run.snap diff --git a/crates/vite_task_plan/tests/plan_snapshots/main.rs b/crates/vite_task_plan/tests/plan_snapshots/main.rs index 77765162..6d1f720d 100644 --- a/crates/vite_task_plan/tests/plan_snapshots/main.rs +++ b/crates/vite_task_plan/tests/plan_snapshots/main.rs @@ -13,7 +13,7 @@ use vite_workspace::find_workspace_root; /// Local parser wrapper for BuiltInCommand #[derive(Parser)] -#[command(name = "vite")] +#[command(name = "vp")] enum Cli { #[clap(flatten)] Command(Command), diff --git a/package.json b/package.json index 2ee4c785..6096b09f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "scripts": { "prepare": "husky", "hello": "echo Hello, Vite Task Monorepo!", - "lint": "vite lint" + "lint": "vp lint" }, "devDependencies": { "@types/node": "catalog:",