Skip to content

Commit ede7c19

Browse files
authored
chore: migrate toolchain to Vite+ (#664)
Migrates the JavaScript toolchain to [Vite+](https://viteplus.dev) (`vp`) via `vp migrate`, unifying formatting, linting, testing, and git hooks under a single CLI. The Rust/napi build (`@napi-rs/cli` + `rolldown`) and the `lerna` publish flow are untouched. ## Changes | File | Change | |------|--------| | `package.json` | `fmt`→`vp fmt && cargo fmt`, `lint`→`vp lint`, `prepare`→`vp config`; drop `oxfmt`/`oxlint`/`oxlint-tsgolint`/`husky`/`lint-staged` deps + the `lint-staged` block; add `vite`/`vite-plus` (catalog) | | `pnpm-workspace.yaml` | catalog `vite` (→ `@voidzero-dev/vite-plus-core@0.2.2`) and `vite-plus`, plus `overrides`/`peerDependencyRules` so all `vite` resolves to Vite+ | | `vite.config.ts` *(new)* | folds in `.oxlintrc.json` (`lint` block) and `lint-staged` (`staged` block); adds the `prefer-vite-plus-imports` rule | | `.oxlintrc.json`, `.husky/pre-commit` | removed (folded into `vite.config.ts` / replaced by `.vite-hooks/`) | | `.vite-hooks/pre-commit` *(new)* | runs `vp staged`; `core.hooksPath` → `.vite-hooks/_` | | `AGENTS.md` *(new)* | Vite+ agent instructions | | `packages/integrate-vitest/*` | `test`→`vp test run`; `vitest` → `vite-plus` / `vite-plus/test` imports rewritten (config + 4 specs) | The tools themselves are still provided by the `vite-plus` package, so `node_modules/.bin/{vp,oxfmt,oxlint}` remain available and CI (`pnpm lint`, `node --run fmt`, `prepare: vp config`) resolves them the same way the old node_modules binaries did. ## Verification - `vp check` — 95 files formatted, 51 files lint + type-check clean, 0 errors - `vp run test` — integrate-module (21), integrate-module-bundler (22, incl. NestJS), integrate-vitest (9, via vitest 4.1.9 through `vite-plus/test`) - `node --run fmt` (autofix-CI command) — exit 0, no drift - pre-commit hook (`vp staged`) exercised by this branch's commit
1 parent dbf2a14 commit ede7c19

8 files changed

Lines changed: 448 additions & 256 deletions

File tree

.husky/pre-commit

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

.oxlintrc.json

Lines changed: 0 additions & 8 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

AGENTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!--VITE PLUS START-->
2+
3+
# Using Vite+, the Unified Toolchain for the Web
4+
5+
This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, and it invokes Vite through `vp dev` and `vp build`. Run `vp help` to print a list of commands and `vp <command> --help` for information about a specific command.
6+
7+
Docs are local at `node_modules/vite-plus/docs` or online at https://viteplus.dev/guide/.
8+
9+
## Review Checklist
10+
11+
- [ ] Run `vp install` after pulling remote changes and before getting started.
12+
- [ ] Run `vp check` and `vp test` to format, lint, type check and test changes.
13+
- [ ] Check if there are `vite.config.ts` tasks or `package.json` scripts necessary for validation, run via `vp run <script>`.
14+
- [ ] If setup, runtime, or package-manager behavior looks wrong, run `vp env doctor` and include its output when asking for help.
15+
16+
<!--VITE PLUS END-->

package.json

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"private": true,
55
"scripts": {
66
"bench": "pnpm --filter=bench bench",
7-
"fmt": "oxfmt && cargo fmt",
8-
"lint": "oxlint",
7+
"fmt": "vp fmt && cargo fmt",
8+
"lint": "vp lint",
99
"test": "pnpm --sequential --filter=integrate* run test",
10-
"prepare": "husky"
10+
"prepare": "vp config || exit 0"
1111
},
1212
"devDependencies": {
1313
"@napi-rs/cli": "catalog:",
@@ -17,21 +17,9 @@
1717
"@oxc-project/runtime": "^0.132.0",
1818
"@types/node": "^25.0.0",
1919
"emnapi": "^1.4.5",
20-
"husky": "^9.1.7",
2120
"lerna": "^9.0.0",
22-
"lint-staged": "^17.0.0",
23-
"oxfmt": "^0.57.0",
24-
"oxlint": "^1.51.0",
25-
"oxlint-tsgolint": "^0.24.0",
26-
"typescript": "^6.0.0"
27-
},
28-
"lint-staged": {
29-
"*": [
30-
"oxfmt --no-error-on-unmatched-pattern"
31-
],
32-
"*.@(js|ts|tsx)": [
33-
"oxlint --fix"
34-
]
21+
"typescript": "^6.0.0",
22+
"vite-plus": "catalog:"
3523
},
3624
"packageManager": "pnpm@11.9.0"
3725
}

0 commit comments

Comments
 (0)