Skip to content

Migrate the toolchain to Vite+ - #2305

Draft
kmcginnes wants to merge 3 commits into
mainfrom
vite-plus
Draft

kmcginnes wants to merge 3 commits into
mainfrom
vite-plus

Conversation

@kmcginnes

@kmcginnes kmcginnes commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Migrates the toolchain to Vite+ 1.1 using vp migrate, then finishes by hand what it left. The app, the proxy server, and the Docker image behave the same. Only contributor tooling changes.

- .oxlintrc.json
- .oxfmtrc.jsonc
- .husky/pre-commit              # lint-staged
+ .vite-hooks/pre-commit         # vp staged
+ vite.config.ts                 # lint, fmt, and staged blocks
 pnpm lint / check:lint      -oxlint    +vp lint
 pnpm format / check:format  -oxfmt     +vp fmt
 pnpm test                   -vitest    +vp test
 pnpm dev / build            -vite      +vp dev / vp build

What vp migrate did (first commit):

  • Merged the oxlint and oxfmt configs into the root vite.config.ts
  • Replaced standalone oxlint, oxfmt, and oxlint-tsgolint with vite-plus, pinned through a pnpm catalog. vite now points at @voidzero-dev/vite-plus-core
  • Rewrote vitest imports to vite-plus/test and dropped vitest from every manifest

What I finished by hand (second commit):

  • Supply chain: removed the minimumReleaseAgeExclude list the migrator added. It exempted vite-plus, vitest, and the oxc packages from our 24h release-age gate.
  • Hooks: the migrator leaves Husky untouched, and lint-staged still called the removed binaries. I replaced both with the staged block and .vite-hooks/pre-commit.
  • Stale hooks path: vp config won't replace a core.hooksPath it doesn't own. So prepare first unsets it when it points at Husky, which means existing clones pick up the new hooks on their next pnpm install:
    (git config --unset core.hooksPath husky || cd .) && vp config --no-agent
    
    The unset only matches values containing husky, and || cd . keeps it portable to cmd. It can go after a release or two.
  • Docker: ENV VP_GIT_HOOKS=0, because the image has no git, and vp config fails the install where Husky skipped quietly.
  • Editors: VS Code and Zed settings follow the Vite+ recommendations.
  • Dependabot: one vite-plus group, because the catalog aliases vite to @voidzero-dev/vite-plus-core at the vite-plus version.
  • AGENTS.md: allows running vp subcommands directly.

Review follow-ups (third commit):

  • One config file per directory, as the Vite+ guide recommends: root test.projects moved into vite.config.ts, and the proxy-server and shared vitest.config.ts files are now vite.config.ts
  • Dropped the typeCheck lint option the migrator added. tsc in pnpm check:types stays the one type check, so pnpm checks doesn't type-check twice and the pre-commit hook doesn't start blocking on type errors
  • Comments in .github/dependabot.yml and pnpm-workspace.yaml: vite-plus bumps carry Vite, Vitest, oxlint, and oxfmt fixes, and vp migrate re-adds the release-age exclusions on every upgrade
  • docs/agents/testing.md imports from vite-plus/test. docs/development.md gains a Tooling section and drops a pnpm add -D vitest example. REVIEW.md names vp lint and vp fmt

Tool versions: vite-plus 1.1.0 bundles vitest 5.0.3, oxlint 1.87.0, and oxfmt 0.72.0, each at or ahead of what main pins today.

vitest is no longer a direct dependency anywhere. Vite+ bundles it and re-exports it as vite-plus/test, so it moves in lockstep with vite-plus.

Evidence

  • pnpm checks passes. Test files with deliberate violations still trip type-aware rules (switch-exhaustiveness-check) and JS plugins (react-compiler/set-state-in-render), so the merged lint config has parity.
  • pnpm test passes: 251 files, 3343 tests
  • pnpm build passes
  • docker build passes, and the running container returns 200 on /explorer/
  • pnpm dev serves the app with the React Compiler transform applied
  • A commit through .vite-hooks/pre-commit runs vp lint --fix and vp fmt on the staged files
  • pnpm install from a git archive extract (no .git) passes
  • A clone with core.hooksPath=.husky/_ gets .vite-hooks/_ after pnpm install

Merge Danger

Door: two-way

A revert restores the old tooling. Contributors then need one pnpm install so Husky resets the hooks path.

Blast Radius: contributors

Release notes for contributors:

  • Run pnpm install after pulling. It moves your git hooks from Husky to Vite+.
  • Install the Vite+ extension pack for VS Code (VoidZero.vite-plus-extension-pack), or oxc-zed for Zed.
  • vp subcommands (vp test, vp lint, vp fmt, vp check) now work directly.

core.hooksPath is shared by every worktree of a clone. While some worktrees are still on older branches, installing on this branch and on an older branch will flip the path back and forth, and the hook only runs in worktrees that match the current value. It settles once every worktree is on main.

The shipped bundle is now built by vite-plus-core instead of vite 8.3. The build and Docker smoke tests above cover that swap.

@kmcginnes
kmcginnes added this pull request to stack #2306 September 29, 2026 21:08
@kmcginnes kmcginnes changed the title vite plus Migrate the toolchain to Vite+ Sep 29, 2026
@kmcginnes
kmcginnes removed this pull request from stack #2306 September 29, 2026 22:52
@kmcginnes
kmcginnes force-pushed the vite-plus branch 2 times, most recently from 3b0105d to 17a6a55 Compare September 29, 2026 23:04
@kmcginnes
kmcginnes changed the base branch from explicit-vitest-imports to remove-coverage September 29, 2026 23:05
@kmcginnes
kmcginnes added this pull request to stack #2310 September 29, 2026 23:05
@kmcginnes
kmcginnes force-pushed the vite-plus branch 2 times, most recently from b74946b to c791fbc Compare September 30, 2026 19:14
Base automatically changed from remove-coverage to main September 30, 2026 19:14
@kmcginnes
kmcginnes force-pushed the vite-plus branch 2 times, most recently from 3c2e77c to 11e1ef5 Compare October 1, 2026 19:31

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant