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
4 changes: 1 addition & 3 deletions .clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ disallowed-types = [
{ path = "std::string::String", reason = "Use `vite_str::Str` for small strings. For large strings, prefer `Box/Rc/Arc<str>` if mutation is not needed." },
]

disallowed-macros = [
{ path = "std::format", reason = "Use `vite_str::format` for small strings." },
]
disallowed-macros = [{ path = "std::format", reason = "Use `vite_str::format` for small strings." }]
6 changes: 1 addition & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"fill-labs.dependi"
],
"extensions": ["rust-lang.rust-analyzer", "tamasfe.even-better-toml", "fill-labs.dependi"],
"settings": {
"terminal.integrated.defaultProfile.linux": "fish",
"terminal.integrated.profiles.linux": {
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ jobs:
with:
save-cache: ${{ github.ref_name == 'main' }}
cache-key: fmt
tools: dprint,cargo-shear
tools: cargo-shear
components: clippy rust-docs rustfmt

- run: dprint check
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
- run: pnpm oxfmt --check
- run: cargo shear
- run: cargo fmt --check
- run: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --document-private-items
Expand All @@ -141,8 +142,6 @@ jobs:
with:
files: .

- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4

- name: Deduplicate dependencies
run: pnpm dedupe --check

Expand Down
5 changes: 5 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 120,
"singleQuote": true,
"ignorePatterns": ["crates/fspy_detours_sys/detours", "crates/vite_task_graph/run-config.ts"]
}
4 changes: 1 addition & 3 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ group_imports = "StdExternalCrate"
imports_granularity = "Crate"

# Skip generated files
ignore = [
"crates/fspy_detours_sys/src/generated_bindings.rs",
]
ignore = ["crates/fspy_detours_sys/src/generated_bindings.rs"]
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ A monorepo task runner (like Nx/Turbo) with intelligent caching and dependency r
```bash
just init # Install build tools and dependencies
just ready # Full quality check (fmt, check, test, lint, doc)
just fmt # Format code (cargo fmt, cargo shear, dprint)
just fmt # Format code (cargo fmt, cargo shear, oxfmt)
just check # Check compilation with all features
just test # Run all tests
just lint # Clippy linting
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
just init
```

This installs all required Rust tools (`cargo-insta`, `typos-cli`, `cargo-shear`, `dprint`, `taplo-cli`) and bootstraps the Node.js tooling.
This installs all required Rust tools (`cargo-insta`, `typos-cli`, `cargo-shear`, `taplo-cli`) and bootstraps the Node.js tooling.

## Development Workflow

Expand All @@ -29,7 +29,7 @@ Officially, Vite Task is distributed as part of Vite+ and invoked via `vp run`.

```bash
just ready # Full quality check: typos, fmt, check, test, lint, doc
just fmt # Format code (cargo fmt + cargo shear + dprint)
just fmt # Format code (cargo fmt + cargo shear + oxfmt)
just check # Check compilation with all features
just test # Run all tests
just lint # Clippy linting
Expand Down
4 changes: 2 additions & 2 deletions crates/vite_task/docs/task-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ For tasks defined as below:
{
"scripts": {
"build": "echo $foo",
"test": "echo $foo && echo $bar"
}
"test": "echo $foo && echo $bar",
},
}
```

Expand Down
18 changes: 9 additions & 9 deletions crates/vite_task/docs/task-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ The task graph contains a node for every task in every package, and edges only f
"tasks": {
"build": {
"command": "vite build",
"dependsOn": ["@shared/lib#build"] // ← this becomes an edge
}
}
"dependsOn": ["@shared/lib#build"], // ← this becomes an edge
},
},
}
```

Expand Down Expand Up @@ -178,9 +178,9 @@ After mapping the package subgraph to tasks, we follow explicit `dependsOn` edge
{
"tasks": {
"build": {
"dependsOn": ["codegen#generate"]
}
}
"dependsOn": ["codegen#generate"],
},
},
}
```

Expand All @@ -198,9 +198,9 @@ A task script can contain `vp run` calls:
{
"tasks": {
"ci": {
"command": "vp run -r build && vp run -r test"
}
}
"command": "vp run -r build && vp run -r test",
},
},
}
```

Expand Down
4 changes: 2 additions & 2 deletions crates/vite_task/docs/terminologies.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{
"name": "app",
"scripts": {
"build": "echo build1 && echo build2"
}
"build": "echo build1 && echo build2",
},
}
```

Expand Down
24 changes: 9 additions & 15 deletions crates/vite_task/docs/wildcard-env-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl TaskEnvs {
/// Create a secure fingerprint for environment variables
pub fn create_fingerprint(&self) -> HashMap<Str, Str> {
let mut fingerprint = HashMap::new();

for (name, value) in &self.envs_without_pass_through {
let fingerprint_value = if is_sensitive_env_name(name) {
// Hash sensitive values - never store them in plaintext
Expand All @@ -128,10 +128,10 @@ impl TaskEnvs {
// Or stored as-is if needed for debugging
value.clone()
};

fingerprint.insert(name.clone(), fingerprint_value);
}

fingerprint
}
}
Expand Down Expand Up @@ -164,14 +164,7 @@ pub struct CommandFingerprint {
"tasks": {
"build": {
"command": "vite build",
"env": [
"NODE_ENV",
"NODE_OPTIONS",
"VITE_API_URL",
"VITE_APP_TITLE",
"VITE_PUBLIC_PATH",
"VITE_BASE_URL"
]
"env": ["NODE_ENV", "NODE_OPTIONS", "VITE_API_URL", "VITE_APP_TITLE", "VITE_PUBLIC_PATH", "VITE_BASE_URL"]
}
}
}
Expand Down Expand Up @@ -251,7 +244,7 @@ fn is_sensitive_env_name(name: &str) -> bool {
"REDIS_URL",
"*_CERT*",
];

// Exact matches for known sensitive names
const SENSITIVE_EXACT: &[&str] = &[
"PASSWORD",
Expand All @@ -260,17 +253,17 @@ fn is_sensitive_env_name(name: &str) -> bool {
"PRIVATE_KEY",
"PUBLIC_KEY",
];

if SENSITIVE_EXACT.contains(&name) {
return true;
}

for pattern in SENSITIVE_PATTERNS {
if Glob::new(pattern).is_match(name) {
return true;
}
}

false
}

Expand All @@ -288,6 +281,7 @@ fn display_env_value(name: &str, value: &str) -> String {
**Principles for Secure Cache Storage:**

1. **Never Store Sensitive Values in Cache**:

```rust
// BAD - Never do this
cache_entry.envs = task.envs_without_pass_through.clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ vt lint
help: Delete this file or add some code to it.

Found 2 warnings and 0 errors.
Finished in <duration> on 2 files with 90 rules using <n> threads.
Finished in <duration> on 2 files with 93 rules using <n> threads.
> cd folder2 && vt run lint # cache miss in folder2
$ vt lint ✓ cache hit, replaying

Expand All @@ -39,7 +39,7 @@ $ vt lint ✓ cache hit, replaying
help: Delete this file or add some code to it.

Found 2 warnings and 0 errors.
Finished in <duration> on 2 files with 90 rules using <n> threads.
Finished in <duration> on 2 files with 93 rules using <n> threads.

---
vt run: cache hit, <duration> saved.
Expand All @@ -56,7 +56,7 @@ $ vt lint ✗ cache miss: 'folder2/a.js' modified, executing
help: Delete this file or add some code to it.

Found 1 warning and 0 errors.
Finished in <duration> on 2 files with 90 rules using <n> threads.
Finished in <duration> on 2 files with 93 rules using <n> threads.
> cd folder2 && vt run lint # cache miss
$ vt lint ✓ cache hit, replaying

Expand All @@ -68,7 +68,7 @@ $ vt lint ✓ cache hit, replaying
help: Delete this file or add some code to it.

Found 1 warning and 0 errors.
Finished in <duration> on 2 files with 90 rules using <n> threads.
Finished in <duration> on 2 files with 93 rules using <n> threads.

---
vt run: cache hit, <duration> saved.
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[[e2e]]
name = "builtin command with non-zero exit does not show cache not updated"
steps = [
"vt run lint -- -D no-debugger",
"vt run lint -- -D no-debugger",
]
steps = ["vt run lint -- -D no-debugger", "vt run lint -- -D no-debugger"]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $ vt lint -D no-debugger
help: Remove the debugger statement

Found 0 warnings and 1 error.
Finished in <duration> on 1 file with 90 rules using <n> threads.
Finished in <duration> on 1 file with 93 rules using <n> threads.
[1]> vt run lint -- -D no-debugger
$ vt lint -D no-debugger

Expand All @@ -25,4 +25,4 @@ $ vt lint -D no-debugger
help: Remove the debugger statement

Found 0 warnings and 1 error.
Finished in <duration> on 1 file with 90 rules using <n> threads.
Finished in <duration> on 1 file with 93 rules using <n> threads.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@

[[e2e]]
name = "task with cache disabled"
steps = [
"vt run no-cache-task # cache miss",
"vt run no-cache-task # cache disabled, runs again",
]
steps = ["vt run no-cache-task # cache miss", "vt run no-cache-task # cache disabled, runs again"]

[[e2e]]
name = "task with cache enabled"
steps = [
"vt run cached-task # cache miss",
"vt run cached-task # cache hit",
]
steps = ["vt run cached-task # cache miss", "vt run cached-task # cache hit"]
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,11 @@ steps = [

[[e2e]]
name = "env added"
steps = [
"vt run test # cache miss",
"cross-env MY_ENV=1 vt run test # cache miss: env added",
]
steps = ["vt run test # cache miss", "cross-env MY_ENV=1 vt run test # cache miss: env added"]

[[e2e]]
name = "env removed"
steps = [
"cross-env MY_ENV=1 vt run test # cache miss",
"vt run test # cache miss: env removed",
]
steps = ["cross-env MY_ENV=1 vt run test # cache miss", "vt run test # cache miss: env removed"]

[[e2e]]
name = "untracked env added"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@

[[e2e]]
name = "read file with colon in name"
steps = [
"vt run read_colon_in_name # cache miss",
"vt run read_colon_in_name # cache hit",
]
steps = ["vt run read_colon_in_name # cache miss", "vt run read_colon_in_name # cache hit"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@

[[e2e]]
name = "env-test prints value from additional_envs"
steps = [
"vt run env-test -- SYNTHETIC_ENV_VAR test_value_from_synthesizer # prints env value",
]
steps = ["vt run env-test -- SYNTHETIC_ENV_VAR test_value_from_synthesizer # prints env value"]

[[e2e]]
name = "env-test with different values"
steps = [
"vt run env-test -- FOO bar # sets FOO=bar",
"vt run env-test -- BAZ qux # sets BAZ=qux",
]
steps = ["vt run env-test -- FOO bar # sets FOO=bar", "vt run env-test -- BAZ qux # sets BAZ=qux"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@

[[e2e]]
name = "direct lint"
steps = [
"vt run lint # cache miss",
"echo debugger > main.js # add lint error",
"vt run lint # cache miss, lint fails",
]
steps = ["vt run lint # cache miss", "echo debugger > main.js # add lint error", "vt run lint # cache miss, lint fails"]
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ expression: e2e_outputs
> vt run lint # cache miss
$ vt lint
Found 0 warnings and 0 errors.
Finished in <duration> on 0 files with 90 rules using <n> threads.
Finished in <duration> on 0 files with 93 rules using <n> threads.
> echo debugger > main.js # add lint error

> vt run lint # cache miss, lint fails
Expand All @@ -19,4 +19,4 @@ $ vt lint ✗ cache miss: 'main.js' added in workspace root, executing
help: Remove the debugger statement

Found 1 warning and 0 errors.
Finished in <duration> on 1 file with 90 rules using <n> threads.
Finished in <duration> on 1 file with 93 rules using <n> threads.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

[[e2e]]
name = "cycle dependency error"
steps = [
"vt run task-a # task-a -> task-b -> task-a cycle",
]
steps = ["vt run task-a # task-a -> task-b -> task-a cycle"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[[e2e]]
name = "exec not triggered from script"
steps = [
"FOO=bar vt run lint-task # no print-env FOO output",
]
steps = ["FOO=bar vt run lint-task # no print-env FOO output"]

[[e2e]]
name = "exec caching"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ expression: e2e_outputs
> FOO=bar vt run lint-task # no print-env FOO output
$ vt lint
Found 0 warnings and 0 errors.
Finished in <duration> on 0 files with 90 rules using <n> threads.
Finished in <duration> on 0 files with 93 rules using <n> threads.
Loading
Loading