Skip to content

Commit 4284494

Browse files
authored
chore: cleanup outdated docs and code (#211)
Updated documentation to reflect the current CLI interface and removed outdated implementation details and unused files.
1 parent c77d142 commit 4284494

File tree

18 files changed

+286
-2029
lines changed

18 files changed

+286
-2029
lines changed

CLAUDE.md

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,36 @@ vp run <task> # run task in current package
7878
vp run <package>#<task> # run task in specific package
7979
vp run <task> -r # run task in all packages (recursive)
8080
vp run <task> -t # run task in current package + transitive deps
81-
vp run <task> --extra --args # pass extra args to the task command
81+
vp run <task> -- --extra --args # pass extra args to the task command
82+
vp run # interactive task selector (fuzzy search)
8283

8384
# Built-in commands (run tools from node_modules/.bin)
8485
vp test [args...] # run vitest
8586
vp lint [args...] # run oxlint
8687

87-
# Flags
88-
-r, --recursive # run across all packages
89-
-t, --transitive # run in current package and its dependencies
88+
# Cache management
89+
vp cache clean # remove the cache database
90+
91+
# Package selection flags
92+
-r, --recursive # select all packages in the workspace
93+
-t, --transitive # select current package + transitive deps
94+
-w, --workspace-root # select the workspace root package
95+
-F, --filter <pattern> # pnpm-style filter (repeatable, see below)
96+
97+
# Run flags
9098
--ignore-depends-on # skip explicit dependsOn dependencies
99+
-v, --verbose # show full detailed summary after execution
100+
--cache # force caching on for all tasks and scripts
101+
--no-cache # force caching off for all tasks and scripts
102+
--last-details # show detailed summary of the last run
103+
104+
# Filter patterns (pnpm-style)
105+
-F <name> # select by package name
106+
-F '@scope/*' # select by glob pattern
107+
-F ./<dir> # select packages under a directory
108+
-F '<pattern>...' # select package and its dependencies
109+
-F '...<pattern>' # select package and its dependents
110+
-F '!<pattern>' # exclude packages matching pattern
91111
```
92112

93113
## Key Architecture
@@ -105,16 +125,30 @@ Tasks are defined in `vite-task.json`:
105125

106126
```json
107127
{
128+
"cache": true | false | { "scripts": bool, "tasks": bool },
108129
"tasks": {
109130
"test": {
110131
"command": "vitest run",
111-
"dependsOn": ["build", "lint"],
112-
"cache": true
132+
"cwd": "relative/path",
133+
"dependsOn": ["build", "package#task"],
134+
"cache": true,
135+
"envs": ["NODE_ENV"],
136+
"passThroughEnvs": ["CI"],
137+
"inputs": ["src/**", "!dist/**", { "auto": true }]
113138
}
114139
}
115140
}
116141
```
117142

143+
- `cache` (root): workspace-wide cache toggle. Default: `{ "scripts": false, "tasks": true }`
144+
- `command`: shell command to run (falls back to package.json script if omitted)
145+
- `cwd`: working directory relative to the package root
146+
- `dependsOn`: explicit task dependencies (`taskName` or `package#task`)
147+
- `cache` (task): enable/disable caching for this task (default: `true`)
148+
- `envs`: env var names to fingerprint and pass to the task
149+
- `passThroughEnvs`: env var names to pass without fingerprinting
150+
- `inputs`: files for cache fingerprinting (globs, `{ "auto": true }`, negation patterns)
151+
118152
## Task Dependencies
119153

120154
1. **Explicit**: Defined via `dependsOn` in `vite-task.json` (skip with `--ignore-depends-on`)

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

a.js

Whitespace-only changes.

crates/vite_task/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ bincode = { workspace = true, features = ["derive"] }
1818
bstr = { workspace = true }
1919
clap = { workspace = true, features = ["derive"] }
2020
derive_more = { workspace = true, features = ["from"] }
21-
diff-struct = { workspace = true }
2221
fspy = { workspace = true }
2322
futures-util = { workspace = true }
2423
once_cell = { workspace = true }
Lines changed: 30 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,54 @@
1-
# Boolean Flags in vite-plus
1+
# Boolean Flags in Vite Task
22

3-
This document describes how boolean flags work in vite-plus commands.
4-
5-
## Negation Pattern
6-
7-
All boolean flags in vite-plus support a negation pattern using the `--no-` prefix. When a `--no-*` flag is used, it explicitly sets the corresponding boolean option to `false`.
3+
This document describes how boolean flags work in `vp` commands.
84

95
## Available Boolean Flags
106

11-
### Global Flags
12-
13-
- `--debug` / `--no-debug` - Enable or disable cache debugging output
14-
- Short form: `-d` (only for positive form)
15-
167
### Run Command Flags
178

18-
- `--recursive` / `--no-recursive` - Enable or disable recursive task execution across all packages
19-
- Short form: `-r` (only for positive form)
20-
21-
- `--parallel` / `--no-parallel` - Enable or disable parallel task execution
22-
- Short form: `-p` (only for positive form)
9+
- `--recursive` / `-r` — Run task in all packages in the workspace
10+
- `--transitive` / `-t` — Run task in the current package and its transitive dependencies
11+
- `--workspace-root` / `-w` — Run task in the workspace root package
12+
- `--ignore-depends-on` — Skip explicit `dependsOn` dependencies
13+
- `--verbose` / `-v` — Show full detailed summary after execution
14+
- `--cache` / `--no-cache` — Force caching on or off for all tasks and scripts
2315

24-
- `--sequential` / `--no-sequential` - Enable or disable sequential task execution
25-
- Short form: `-s` (only for positive form)
16+
### Negation Pattern
2617

27-
- `--topological` / `--no-topological` - Enable or disable topological ordering based on package dependencies
28-
- Short form: `-t` (only for positive form)
29-
30-
## Behavior
31-
32-
### Conflicts
33-
34-
The positive and negative forms of a flag are mutually exclusive. You cannot use both `--flag` and `--no-flag` in the same command:
18+
The `--cache` flag supports a `--no-cache` negation form. When `--no-cache` is used, caching is explicitly disabled for all tasks in that run:
3519

3620
```bash
37-
# This will result in an error
38-
vp run --recursive --no-recursive build
39-
```
21+
# Force caching off
22+
vp run build --no-cache
4023

41-
### Precedence
42-
43-
When only the negative form is used, it takes precedence and explicitly sets the value to `false`:
44-
45-
```bash
46-
# Explicitly disable topological ordering
47-
vp run build -r --no-topological
24+
# Force caching on (even for scripts that default to uncached)
25+
vp run build --cache
4826
```
4927

50-
### Default Values
51-
52-
The negative flags are particularly useful for overriding default behaviors:
53-
54-
- `--recursive` with `--no-topological`: By default, recursive runs enable topological ordering. Use `--no-topological` to disable it:
55-
```bash
56-
# Recursive run WITHOUT topological ordering
57-
vp run build -r --no-topological
58-
```
28+
The positive and negative forms are mutually exclusive — you cannot use both `--cache` and `--no-cache` in the same command.
5929

6030
## Examples
6131

6232
```bash
63-
# Run with debugging disabled (useful if debug is enabled by default in config)
64-
vp --no-debug build
33+
# Recursive build (all packages in dependency order)
34+
vp run build -r
35+
36+
# Current package + transitive dependencies
37+
vp run build -t
6538

66-
# Recursive build without topological ordering
67-
vp run build --recursive --no-topological
39+
# Run in workspace root
40+
vp run build -w
6841

69-
# Explicitly disable parallel execution
70-
vp run build --no-parallel
42+
# Skip explicit dependsOn edges
43+
vp run build --ignore-depends-on
7144

72-
# Run tests sequentially, not in parallel
73-
vp run test --no-parallel
45+
# Verbose output
46+
vp run build -v
47+
48+
# Force caching off for this run
49+
vp run build --no-cache
7450
```
7551

7652
## Implementation Details
7753

78-
The `--no-*` flags use clap's `conflicts_with` attribute to ensure they cannot be used together with their positive counterparts. When processing flags, vite-plus uses a `resolve_bool_flag` function that gives precedence to the negative form when present.
79-
80-
This pattern provides a consistent and intuitive way to explicitly disable features that might be enabled by default or through configuration files.
54+
The flags use clap's argument parsing. The `--cache`/`--no-cache` pair uses clap's `conflicts_with` attribute to ensure they cannot be used together.

0 commit comments

Comments
 (0)