Skip to content

feat: migrate to Vite+ - #103

Merged
fengmk2 merged 11 commits into
mainfrom
migrate-vite-plus
Aug 16, 2026
Merged

feat: migrate to Vite+#103
fengmk2 merged 11 commits into
mainfrom
migrate-vite-plus

Conversation

@fengmk2

@fengmk2 fengmk2 commented Aug 16, 2026

Copy link
Copy Markdown
Member

Migrates the toolchain to Vite+ via vp migrate, with follow-ups so every check is green.

  • Scripts call vp (vp dev / vp build / vp test / vp check); prepare runs vp config before void prepare. vite, vitest and vite-plus resolve through the pnpm catalog, with overrides pinning vite to @voidzero-dev/vite-plus-core@0.2.9.
  • Imports rewritten to vite-plus / vite-plus/test; the cloudflareTest workers-pool setup is unchanged. vite.config.ts gains fmt, lint (type-aware + type-check) and staged blocks, with fmt set to the repo's single-quote, no-semicolon style, then one vp check --fix pass over the tree.
  • Nested tsconfig.json shims in .github/actions/publish-preview/ and test/action/ let vp check's type-aware pass resolve Node types there (tsgolint only discovers tsconfig.json, not the custom-named tsconfig.action.json they extend).
  • The tsc-based typecheck script is replaced by vp check: tsgolint runs the same TypeScript 7 generation as the repo's typescript@^7.0.0 and covers both projects, so CI now gates formatting and linting too. tsconfig.action.json stays as the shared config the shims extend.
  • All four workflows set up the toolchain with voidzero-dev/setup-vp (pinned to v1.17.0) instead of pnpm/action-setup + setup-node + pnpm install: it installs vp at the catalog-resolved version, the devEngines-pinned Node.js (24.19.0, via vp env pin, tracked in the lockfile) and pnpm, and dependencies, with lockfile-keyed caching. Steps invoke vp check / vp test / vp run <script> directly.
  • renovate.json extends the shared github>Boshen/renovate preset (Actions digest pinning, weekly schedule with automerge, 3-day release age for npm and Actions, immediate vite+ bumps); the redundant top-level minimumReleaseAge is dropped and the vite+ packages are excluded from pnpm's release-age cooldown so fast-lane bumps pass the frozen install.
  • Caught errors interpolate via String(err) and the test fetch mocks narrow RequestInfo | URL precisely, clearing the type-aware lint warnings. The committed publish-action bundle is rebuilt from the changed source.
  • One behavior note: the Vitest bundled in vite-plus 0.2.9 no longer treats a Uint8Array as toEqual a plain array, while standalone vitest@4.1.10 does; the gzip-MTIME assertion now compares via Array.from.

Validated with vp check (clean), vp test (215 passing), vp build and pnpm build:action; re-running vp migrate produces no diff. CI (check + test, staging deploy + smoke) is green on the setup-vp path.

Closes #16

Run `vp migrate` and follow up so the whole toolchain is green:

- scripts now call vp (vp dev / vp build / vp test run); prepare runs
  vp config before void prepare
- vite, vitest and vite-plus resolve through the pnpm catalog with
  overrides pinning vite to @voidzero-dev/vite-plus-core
- config and test imports rewritten to vite-plus / vite-plus/test;
  vite.config.ts gains fmt, lint (type-aware + type-check) and staged
  blocks, with fmt set to the repo's single-quote, no-semicolon style
- nested tsconfig.json shims for .github/actions/publish-preview and
  test/action so vp check's type-aware pass resolves Node types there
  (tsgolint only discovers tsconfig.json, not tsconfig.action.json;
  the tsc-based typecheck script is unchanged)
- interpolate caught errors via String(err) and narrow fetch-mock URL
  arguments, fixing the restrict-template-expressions and
  no-base-to-string warnings
- compare the gzip MTIME bytes as a plain array: the Vitest bundled in
  vite-plus no longer treats a Uint8Array as toEqual a plain array
  (standalone vitest 4.1.10 still does)
- rebuild the committed publish-action bundle from the changed source
- oxfmt formatting pass across the tree; pre-commit hook runs vp staged

Validated with vp check, vp test run (215 passing), vp build,
pnpm typecheck and pnpm build:action.

Closes #16
@socket-security

socket-security Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​voidzero-dev/​vite-plus-core@​0.2.9801007699100
Addedvite-plus@​0.2.979100100100100

View full report

vp check's type-aware pass (tsgolint on TypeScript 7, the same compiler
generation as the repo's typescript ^7.0.0) already covers both tsconfig
projects through the nested shims, so the separate tsc pass is redundant.
Add a check script wrapping vp check, point CI and the docs at it, and
drop typecheck. CI now also gates formatting and linting, which it never
did before. tsconfig.action.json stays: the shims extend it.
Replace pnpm/action-setup + setup-node + pnpm install in all four
workflows with voidzero-dev/setup-vp (pinned to v1.17.0), which installs
vp at the version resolved from the pnpm catalog, Node.js 24, the pnpm
pinned in devEngines, and the project dependencies, with lockfile-keyed
caching. Steps invoke vp directly: vp check, vp test run, and vp run for
package.json scripts (build:action, deploy:staging, deploy:only), since
pnpm is no longer put on PATH by an action. The pnpm version previously
duplicated in the workflows now has devEngines as its single source.
CI calls vp check directly since the setup-vp switch, and vp check is a
built-in that scripts cannot shadow, so the pnpm bridge script has no
callers left. Point the README and self-hosting commands at vp.
The preset brings GitHub Actions digest pinning, weekly scheduling with
automerge, a 3-day minimumReleaseAge for npm and Actions updates, and a
vite+ fast lane that proposes vite-plus and @voidzero-dev/vite-plus-*
bumps immediately. Drop the now-redundant top-level minimumReleaseAge
and exclude the fast-lane packages from pnpm's release-age cooldown so
their bumps pass the frozen-lockfile install in CI. The repo-specific
needs-bundle-rebuild rule stays.
vitest already picks the mode from the environment: watch in a local
terminal, single run in CI and non-interactive shells. With scripts.test
on plain vp test, test:watch duplicated it, so it is removed.
vp resolves the runtime from devEngines.runtime (vp env pin wrote it),
so the workflows no longer pass node-version to setup-vp and package.json
is the single source for both the runtime and the package manager.
pnpm 11 tracks devEngines.runtime as a lockfile entry, so the frozen
install in CI rejects the pin without it.
Comment thread pnpm-workspace.yaml Outdated
Per review: vite@8 and vitest@4 keep the catalog alias from applying to
a future major pulled in transitively.
Per review: alias every version, not only the current major.
Apply the outstanding dedupe (peer-suffix duplicates of
@cloudflare/vitest-pool-workers, void and better-auth) so the gate
starts green. Renovate PRs stay deduped through the shared preset's
pnpmDedupe post-update option.
@fengmk2
fengmk2 marked this pull request as ready for review August 16, 2026 09:25
@fengmk2
fengmk2 merged commit 24b9a4f into main Aug 16, 2026
4 checks passed
@fengmk2
fengmk2 deleted the migrate-vite-plus branch August 16, 2026 09:28
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.

Migrate this project to the published Vite+ package

1 participant