Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
224 changes: 137 additions & 87 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ dunce = "1.0.5"
fast-glob = "1.0.0"
flate2 = { version = "=1.1.9", features = ["zlib-rs"] }
form_urlencoded = "1.2.1"
fspy = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "88bacaa770200ddab151dea252e04ba8cdcc4ade" }
fspy = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c63db22ff0258e4e45f03205104838ab795161ac" }
futures = "0.3.31"
futures-util = "0.3.31"
glob = "0.3.2"
Expand Down Expand Up @@ -150,7 +150,7 @@ reqwest = { version = "0.13", default-features = false }
rolldown-notify = "10.2.0"
rolldown-notify-debouncer-full = "0.7.5"
ropey = "1.6.1"
rusqlite = { version = "0.37.0", features = ["bundled"] }
rusqlite = { version = "0.39.0", features = ["bundled"] }
rustc-hash = "2.1.1"
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
schemars = "1.0.0"
Expand Down Expand Up @@ -194,18 +194,18 @@ vfs = "0.13.0"
vite_command = { path = "crates/vite_command" }
vite_error = { path = "crates/vite_error" }
vite_js_runtime = { path = "crates/vite_js_runtime" }
vite_glob = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "88bacaa770200ddab151dea252e04ba8cdcc4ade" }
vite_glob = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c63db22ff0258e4e45f03205104838ab795161ac" }
vite_install = { path = "crates/vite_install" }
vite_migration = { path = "crates/vite_migration" }
vite_pm_cli = { path = "crates/vite_pm_cli" }
vite_setup = { path = "crates/vite_setup" }
vite_shared = { path = "crates/vite_shared" }
vite_static_config = { path = "crates/vite_static_config" }
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "88bacaa770200ddab151dea252e04ba8cdcc4ade" }
vite_powershell = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "88bacaa770200ddab151dea252e04ba8cdcc4ade" }
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "88bacaa770200ddab151dea252e04ba8cdcc4ade" }
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "88bacaa770200ddab151dea252e04ba8cdcc4ade" }
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "88bacaa770200ddab151dea252e04ba8cdcc4ade" }
vite_path = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c63db22ff0258e4e45f03205104838ab795161ac" }
vite_powershell = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c63db22ff0258e4e45f03205104838ab795161ac" }
vite_str = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c63db22ff0258e4e45f03205104838ab795161ac" }
vite_task = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c63db22ff0258e4e45f03205104838ab795161ac" }
vite_workspace = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "c63db22ff0258e4e45f03205104838ab795161ac" }
walkdir = "2.5.0"
wax = "0.6.0"
which = "8.0.0"
Expand Down
32 changes: 31 additions & 1 deletion docs/config/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ A set of common environment variables are automatically passed through to all ta
- **System:** `HOME`, `USER`, `PATH`, `SHELL`, `LANG`, `TZ`
- **Node.js:** `NODE_OPTIONS`, `COREPACK_HOME`, `PNPM_HOME`
- **CI/CD:** `CI`, `VERCEL_*`, `NEXT_*`
- **Terminal:** `TERM`, `COLORTERM`, `FORCE_COLOR`, `NO_COLOR`
- **Terminal:** Color variables (`FORCE_COLOR`, `NO_COLOR`, `COLORTERM`, `TERM`, `TERM_PROGRAM`) aren't passed to tasks unless you list them under `env` (the value gets fingerprinted, so changing it invalidates the cache) or `untrackedEnv` (passed without fingerprinting). If `FORCE_COLOR` isn't in either list, the child gets `FORCE_COLOR=1` so cached logs stay colored. Colors get stripped on display when the terminal can't render them.

### `input`

Expand Down Expand Up @@ -233,6 +233,36 @@ tasks: {
String glob patterns are resolved relative to the package directory by default. Use the object form with `base: "workspace"` to resolve relative to the workspace root.
:::

### `output`

- **Type:** `Array<string | { pattern: string, base: "workspace" | "package" }>`
- **Default:** `[]` (nothing is archived)

Files the task produces. They get archived after a successful run and restored on a cache hit, so you don't have to rebuild them. Leave it empty (or omit it) and nothing is archived.

```ts [vite.config.ts]
tasks: {
build: {
command: 'vp build',
output: ['dist/**', '!dist/cache/**'],
},
}
```

If a task writes outside its own package, use the object form with `base: "workspace"`:

```ts [vite.config.ts]
tasks: {
build: {
command: 'vp build',
output: [
'dist/**',
{ pattern: 'shared-artifacts/**', base: 'workspace' },
],
},
}
```

### `cwd`

- **Type:** `string`
Expand Down
1 change: 1 addition & 0 deletions packages/cli/binding/src/cli/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ impl CommandHandler for VitePlusCommandHandler {
env: Some(Box::new([Str::from("OXLINT_TSGOLINT_PATH")])),
untracked_env: None,
input: Some(check_cache_inputs()),
output: None,
}),
)))
}
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/binding/src/cli/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ impl SubcommandResolver {
env: Some(Box::new([Str::from("OXLINT_TSGOLINT_PATH")])),
untracked_env: None,
input: None,
output: None,
}),
envs: merge_resolved_envs_with_version(envs, resolved.envs),
})
Expand Down Expand Up @@ -151,6 +152,7 @@ impl SubcommandResolver {
env: None,
untracked_env: None,
input: None,
output: None,
}),
envs: merge_resolved_envs_with_version(envs, resolved.envs),
})
Expand All @@ -173,6 +175,7 @@ impl SubcommandResolver {
env: Some(Box::new([Str::from("VITE_*")])),
untracked_env: None,
input: Some(build_pack_cache_inputs()),
output: None,
}),
envs: merge_resolved_envs_with_version(envs, resolved.envs),
})
Expand Down Expand Up @@ -205,6 +208,7 @@ impl SubcommandResolver {
InputBase::Package,
),
]),
output: None,
}),
envs: merge_resolved_envs_with_version(envs, resolved.envs),
})
Expand All @@ -226,6 +230,7 @@ impl SubcommandResolver {
env: None,
untracked_env: None,
input: Some(build_pack_cache_inputs()),
output: None,
}),
envs: merge_resolved_envs(envs, resolved.envs),
})
Expand Down Expand Up @@ -283,6 +288,7 @@ impl SubcommandResolver {
env: None,
untracked_env: None,
input: None,
output: None,
}),
envs: merge_resolved_envs(envs, resolved.envs),
})
Expand Down
1 change: 0 additions & 1 deletion packages/cli/snap-tests/pass-no-color-env/check.js

This file was deleted.

5 changes: 0 additions & 5 deletions packages/cli/snap-tests/pass-no-color-env/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions packages/cli/snap-tests/pass-no-color-env/snap.txt

This file was deleted.

6 changes: 0 additions & 6 deletions packages/cli/snap-tests/pass-no-color-env/steps.json

This file was deleted.

5 changes: 0 additions & 5 deletions packages/cli/snap-tests/pass-no-color-env/vite.config.ts

This file was deleted.

13 changes: 11 additions & 2 deletions packages/cli/src/run-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ untrackedEnv?: Array<string>,
* - `{auto: true}` enables automatic file tracking
* - Negative patterns (e.g. `"!dist/**"`) exclude matched files
*/
input?: Array<string | GlobWithBase | AutoInput>, } | {
input?: Array<string | GlobWithBase | AutoInput>,
/**
* Output files to archive after a successful run and restore on cache hit.
*
* - Omitted or `[]` (empty): no output archiving (default)
* - Glob patterns (e.g. `"dist/**"`) select specific output files, relative to the package directory
* - `{pattern: "...", base: "workspace" | "package"}` specifies a glob with an explicit base directory
* - Negative patterns (e.g. `"!dist/cache/**"`) exclude matched files
*/
output?: Array<string | GlobWithBase>, } | {
/**
* Whether to cache the task
*/
Expand Down Expand Up @@ -91,7 +100,7 @@ cache?: UserGlobalCacheConfig,
/**
* Task definitions
*/
tasks?: { [key in string]?: Task },
tasks?: { [key in string]: Task },
/**
* Whether to automatically run `preX`/`postX` package.json scripts as
* lifecycle hooks when script `X` is executed.
Expand Down
Loading