Skip to content

Commit dfeea9d

Browse files
fengmk2claudewan9chi
authored
chore: adopt Vite+ (vp) for the JS toolchain (#417)
## Summary Adopt Vite+ (`vp`) as this repo's JavaScript toolchain, so the project behind `vp run` dogfoods Vite+ for its own formatting and git hooks. This replaces the root `oxfmt` + `husky` + `lint-staged` setup with `vp` and consolidates tool config into `vite.config.ts`. ## Changes - **Formatting**: remove the root `oxfmt` dependency and `.oxfmtrc.json`; format with `vp fmt` (config moved into the `fmt` block of `vite.config.ts`). CI now runs `pnpm exec vp fmt --check`. - **Git hooks**: replace `husky` + `lint-staged` with `vp config` (`.vite-hooks/`) and a `staged` block that runs `vp check --fix` (plus `cargo fmt` for Rust files). - **Lint**: add a `lint` block with `ignorePatterns` for `playground/**` and `**/fixtures/**`, so type-aware checks skip the nested playground workspace and the intentionally-incomplete test fixtures. - **Catalog**: route `vite`/`vitest` to the Vite+ forks (`@voidzero-dev/vite-plus-core` / `-test`), pinned to `^0.1.23`. ## Notable decisions - **`packages/tools` stays on standalone `oxlint`/`oxfmt`/`oxlint-tsgolint`.** The `fspy` suite (`crates/fspy/tests/oxlint.rs`) traces those real binaries' filesystem access; the Vite+ `oxlint`/`oxfmt` bins are IDE/LSP wrappers and would break the tests. - **Root gains direct `vite`/`vitest` devDeps** so the catalog override has a dependency to bind to. Otherwise the only `vite` reference is a peer that pnpm satisfies with upstream vite, leaving the override a no-op. ## Verification `vp check`, `vp fmt --check`, and `pnpm dedupe --check` pass locally; full CI is green (format, clippy, and all test shards including the `fspy` oxlint tests). --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Charles Wang <3612422+wan9chi@users.noreply.github.com>
1 parent 8bf5df2 commit dfeea9d

12 files changed

Lines changed: 987 additions & 308 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ jobs:
262262
components: clippy rust-docs rustfmt
263263

264264
- uses: oxc-project/setup-node@ab97f03642370d79a7e96dd286bd02a1be40e0ba # v1.3.0
265-
- run: pnpm oxfmt --check
265+
- run: pnpm exec vp fmt --check
266266
- run: cargo autoinherit && git diff --exit-code
267267
- run: cargo shear --deny-warnings
268268
- run: cargo fmt --check

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
This file was deleted.

.oxfmtrc.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

.vite-hooks/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vp staged

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ A monorepo task runner (like Nx/Turbo) with intelligent caching and dependency r
2727
```bash
2828
just init # Install build tools and dependencies
2929
just ready # Full quality check (fmt, check, test, lint, doc)
30-
just fmt # Format code (cargo fmt, cargo shear, oxfmt)
30+
just fmt # Format code (cargo fmt, cargo shear, vp fmt)
3131
just check # Check compilation with all features
3232
just test # Run all tests
3333
just lint # Clippy linting

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Officially, Vite Task is distributed as part of Vite+ and invoked via `vp run`.
2929

3030
```bash
3131
just ready # Full quality check: typos, fmt, check, test, lint, doc
32-
just fmt # Format code (cargo fmt + cargo shear + oxfmt)
32+
just fmt # Format code (cargo fmt + cargo shear + vp fmt)
3333
just check # Check compilation with all features
3434
just test # Run all tests
3535
just lint # Clippy linting

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fmt:
2727
cargo autoinherit
2828
cargo shear --fix
2929
cargo fmt --all
30-
pnpm oxfmt
30+
pnpm exec vp fmt
3131

3232
check:
3333
cargo check --workspace --all-features --all-targets --locked

package.json

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,16 @@
44
"license": "MIT",
55
"type": "module",
66
"scripts": {
7-
"prepare": "husky",
7+
"prepare": "vp config",
88
"build-vite-task-client-types": "tsc -p packages/vite-task-client/tsconfig.json"
99
},
1010
"devDependencies": {
1111
"@tsconfig/strictest": "catalog:",
1212
"@types/node": "catalog:",
13-
"husky": "catalog:",
14-
"lint-staged": "catalog:",
15-
"oxfmt": "catalog:",
16-
"oxlint": "catalog:",
17-
"oxlint-tsgolint": "catalog:",
18-
"typescript": "catalog:"
19-
},
20-
"lint-staged": {
21-
"*": "oxfmt --no-error-on-unmatched-pattern",
22-
"*.@(js|ts|tsx)": "oxlint -- --fix",
23-
"*.rs": "cargo fmt --"
13+
"typescript": "catalog:",
14+
"vite": "catalog:",
15+
"vite-plus": "catalog:",
16+
"vitest": "catalog:"
2417
},
2518
"engines": {
2619
"node": "^20.19.0 || >=22.12.0"

packages/tools/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"private": true,
44
"type": "module",
55
"dependencies": {
6-
"cross-env": "^10.1.0",
7-
"oxfmt": "0.42.0",
6+
"cross-env": "catalog:",
7+
"oxfmt": "catalog:",
88
"oxlint": "catalog:",
99
"oxlint-tsgolint": "catalog:"
1010
}

0 commit comments

Comments
 (0)