You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A monorepo task runner (like nx/turbo) with intelligent caching and dependency resolution.
6
-
7
-
## Build Commands
1
+
# Vite Task
2
+
3
+
A monorepo task runner (like Nx/Turbo) with intelligent caching and dependency resolution, distributed as the `vp run` command in [Vite+](https://github.com/voidzero-dev/vite-plus).
4
+
5
+
## Repository Structure
6
+
7
+
-`crates/vite_task` — Task execution engine with caching and session management
8
+
-`crates/vite_task_bin` — Internal dev CLI binary (`vt`) and task synthesizer
9
+
-`crates/vite_task_graph` — Task dependency graph construction and config loading
10
+
-`crates/vite_task_plan` — Execution planning (resolves env vars, working dirs, commands)
11
+
-`crates/vite_workspace` — Workspace detection and package dependency graph
@@ -30,96 +48,37 @@ INSTA_UPDATE=always cargo test # Update snapshots
30
48
31
49
Integration tests (e2e, plan, fspy) require `pnpm install` in `packages/tools` first. You don't need `pnpm install` in test fixture directories.
32
50
33
-
Test fixtures and snapshots:
51
+
### Test Fixtures
34
52
35
-
-**Plan**: `crates/vite_task_plan/tests/plan_snapshots/fixtures/` - quicker, sufficient for testing behaviour before actual execution:
36
-
- task graph
37
-
- resolved configurations
38
-
- resolved program paths, cwd, and env vars
39
-
-**E2E**: `crates/vite_task_bin/tests/e2e_snapshots/fixtures/` - needed for testing execution and beyond: caching, output styling
53
+
-**Plan**: `crates/vite_task_plan/tests/plan_snapshots/fixtures/` — quicker, sufficient for testing task graph, resolved configs, program paths, cwd, and env vars
54
+
-**E2E**: `crates/vite_task_bin/tests/e2e_snapshots/fixtures/` — needed for testing execution, caching, output styling
40
55
41
56
### Cross-Platform Testing
42
57
43
-
**CRITICAL**: This project must work on both Unix (macOS/Linux) and Windows. For any cross-platform features:
44
-
45
-
1.**No Platform Skipping**: Skipping tests on either platform is **UNACCEPTABLE**
46
-
- Use `#[cfg(unix)]` and `#[cfg(windows)]` for platform-specific code within tests
47
-
- Both platforms must execute the test and verify the feature works correctly
48
-
- If a feature can't work on a platform, it shouldn't be added
58
+
**CRITICAL**: This project must work on both Unix (macOS/Linux) and Windows. Skipping tests on either platform is **UNACCEPTABLE**.
49
59
50
-
2.**Windows Cross-Testing from macOS**:
51
-
`cargo xtest` cross-compiles the test binary and runs it on a real remote Windows environment (not emulation). The filesystem is bridged so the test can access local fixture files.
-[just](https://just.systems/) — task runner for build commands
9
+
-[cargo-binstall](https://github.com/cargo-bins/cargo-binstall) — for installing Rust tools
10
+
11
+
## Initial Setup
12
+
13
+
```bash
14
+
just init
15
+
```
16
+
17
+
This installs all required Rust tools (`cargo-insta`, `typos-cli`, `cargo-shear`, `dprint`, `taplo-cli`) and bootstraps the Node.js tooling.
18
+
19
+
## Development Workflow
20
+
21
+
Officially, Vite Task is distributed as part of Vite+ and invoked via `vp run`. The `vt` binary (`vite_task_bin` crate) is an internal development CLI for working on this repo in pure Rust without building the full Vite+ stack. Use `cargo run --bin vt` to build and run locally during development. Don't reference `vt` in user-facing documentation — it's not a public interface.
| Distribution | Bundled in Vite+ |`cargo run --bin vt`|
28
+
| Scope | Full toolchain (dev, build, test, lint, ...) | Task runner only |
29
+
30
+
```bash
31
+
just ready # Full quality check: typos, fmt, check, test, lint, doc
32
+
just fmt # Format code (cargo fmt + cargo shear + dprint)
33
+
just check # Check compilation with all features
34
+
just test# Run all tests
35
+
just lint # Clippy linting
36
+
just doc # Generate documentation
37
+
```
38
+
39
+
### Running Specific Tests
40
+
41
+
```bash
42
+
cargo test# All tests
43
+
cargo test -p vite_task_bin --test e2e_snapshots # E2E snapshot tests
44
+
cargo test -p vite_task_plan --test plan_snapshots # Plan snapshot tests
45
+
cargo test --test e2e_snapshots -- stdin # Filter by test name
46
+
INSTA_UPDATE=always cargo test# Update snapshots
47
+
```
48
+
49
+
Integration tests (e2e, plan, fspy) require `pnpm install` in `packages/tools` first. You don't need `pnpm install` in test fixture directories.
50
+
51
+
### Test Fixtures
52
+
53
+
-**Plan snapshots** — `crates/vite_task_plan/tests/plan_snapshots/fixtures/` — quicker, sufficient for testing task graph, resolved configs, program paths, cwd, and env vars
54
+
-**E2E snapshots** — `crates/vite_task_bin/tests/e2e_snapshots/fixtures/` — needed for testing actual execution, caching behavior, and output styling
55
+
56
+
See individual crate READMEs for crate-specific testing details.
57
+
58
+
## Cross-Platform Development
59
+
60
+
This project must work on macOS, Linux, and Windows. Skipping tests on any platform is not acceptable.
61
+
62
+
- Use `#[cfg(unix)]` / `#[cfg(windows)]` for platform-specific code
63
+
- Use cross-platform libraries where possible (e.g., `terminal_size` instead of raw ioctl/ConPTY)
64
+
65
+
### Cross-Platform Linting
66
+
67
+
After changes to `fspy*` or platform-specific crates, run cross-platform clippy:
-**`AbsolutePath` / `AbsolutePathBuf`** — for internal data flow
95
+
-**`RelativePath` / `RelativePathBuf`** — for cache storage and display
96
+
97
+
Use `vite_path` methods (`strip_prefix`, `join`, etc.) instead of converting to `std::path`. Only convert to std paths when interfacing with std library functions. Add necessary methods to `vite_path` rather than falling back.
98
+
99
+
## macOS Performance Tip
100
+
101
+
Add your terminal app to the approved "Developer Tools" in System Settings > Privacy & Security. Your Rust builds will be ~30% faster.
Monorepo task runner with intelligent caching and dependency-aware scheduling, powering [`vp run`](https://github.com/voidzero-dev/vite-plus) in [Vite+](https://viteplus.dev).
4
+
5
+
## Getting Started
6
+
7
+
Install [Vite+](https://viteplus.dev), then run tasks from your workspace. See the [documentation](https://viteplus.dev/guide/run) for full usage.
8
+
9
+
```bash
10
+
vp run build # run a task in the current package
11
+
vp run build -r # run across all packages in dependency order
12
+
vp run @my/app#build -t # run in a package and its transitive dependencies
0 commit comments