Repository navigation
chore: replace the toolchain with Vite+ - #167
Merged
Merged
Conversation
The repo stitched together turbo, oxlint, oxfmt, vitest, unbuild, lefthook and mise, each with its own config file, version pin and CI setup step. Vite+ ships the same Oxc tools plus Vitest, tsdown and a task runner behind one `vp` binary and one `vite.config.ts`, so a single dependency and a single setup action now cover what seven tools did. Decisions that are not obvious from the diff: - `tsc --noEmit` is replaced by `lint.options.typeCheck` (tsgolint on TypeScript 7). Turning on `typeAware` for it also switched on category rules that had never run; the ones flagging established patterns are turned off to keep this a toolchain swap, and the two trivial hits are fixed instead. - The shared `vi.clearAllMocks()` setup file is gone because Vitest 5 makes `clearMocks` the default. `@repo/test-utils` drops its vitest peer dependency: pnpm's auto-installed peer gave it a second vite-plus instance, so the runner could not clear the consola mocks it created. - unbuild needed a hook to bundle `@repo/*` while keeping `dependencies` external; that is tsdown's default, so the hook and the typescript 6 override it forced are removed. The `BodyInit` shim for hey-api is removed too: nothing references it and tsgolint rejects the duplicate. - Vite+ cannot run on Node 20, so the test matrix drops it. `engines.node` still promises Node 20, so CI now packs the CLI and installs it globally on Node 20/22/24 as the smoke test, which also exercises the published dependency list rather than the workspace. - apps/docs stays outside lint and type check, as it was in CI before: Astro's virtual module types only exist after `astro sync`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`.node-version` and `packageManager` split the dev environment across two places, and `packageManager` is Corepack's field while `vp` now manages both tools. `devEngines` is the standard field for development-time requirements, and `vp` and setup-vp both read it, so CI no longer needs `node-version-file`. The runtime range is `^22.18.0 || ^24.11.0` rather than just 24: the CI test matrix still runs Node 22, and `onFail: "error"` would otherwise reject it. Both bounds are Vite+'s own minimums, and `vp` resolves the range to the newest 24.x for local work. apps/cli repeats `devEngines.runtime` because `vp` resolves the nearest package.json first, and there `engines.node` (`>=20.18`, the published support range) would pick the dev runtime -- on a fresh machine, the newest Node overall. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the split toolchain (turbo, oxlint, oxfmt, vitest, unbuild, lefthook, mise) with Vite+ 1.0.0: one
vpbinary, one rootvite.config.ts, and one CI setup action (voidzero-dev/setup-vp).vp run -r.oxlintrc.json, oxfmtvp lint/vp fmt(config invite.config.ts)tsc --noEmitlint.options.typeCheck(tsgolint / TS 7), part ofvp check/vp lintvp test(Vitest 5, imports fromvite-plus/test)vp pack(tsdown).vite-hooks/pre-commit→vp staged(vp check --fix).node-version,packageManagerdevEnginesinpackage.json, managed byvpBehavior changes worth reviewing
^22.18 || ^24.11 || >=26.engines.node: ">=20.18"is unchanged; instead, a newsmokejob packs the CLI and installs it globally with npm on Node 20/22/24, then runs--version/--help. This also exercises the published dependency list rather than the workspace.typeCheckrequirestypeAware, which enabled category rules that had never run (no-unsafe-type-assertion,prefer-regexp-exec,restrict-template-expressions). Adopting them is left for a separate change; the two trivial hits were fixed instead.@repo/test-utilssetup file removed. Vitest 5 enablesclearMocksby default. The package also drops its vitest peer dependency — pnpm's auto-installed peer created a second vite-plus instance, so the runner could not clear mocks created inmock-consola.BodyInitshim (hey-api workaround) removed. Nothing references it anymore and tsgolint rejects the duplicate declaration.apps/docsstays outside lint / type check, as it already was in CI.apps/cli/package.jsonrepeatsdevEngines.runtimeso thatvpdoes not pick the dev runtime fromengines.nodethere.Follow-ups (not in this PR)
vite-plus,vite(alias to@voidzero-dev/vite-plus-core), andvitestare exact-pinned in the catalog and must be bumped together.engineswould also unblock the commander / undici majors held back in the catalog..git/confighavecore.hooksPathpointing at.vite-hooks/_, which does not exist onmain.Test plan
rm -rf node_modules→pnpm install --frozen-lockfile)vp fmt --checkandvp lint --max-warnings 0pass (includes type check)vp test --coverage.enabled: 792/792 passed, same count and coverage (92.73% lines) as before migrationvp run -r build: CLI and docs (Astro on Vite+ core) build; CLI externals unchanged (backlog-js, commander, consola, open, valibot)bee --version/--help/issue --helprunvp run --filter @nulab/bee generate:skill:checkpassesvp staged) ran on both commitsvp env currentresolves Node 24 and pnpm 10.30.3 fromdevEnginesat the root and inapps/clisetup-vp)🤖 Generated with Claude Code