Skip to content

Adopt Vite+ development tooling - #19

Merged
biw merged 5 commits into
mainfrom
biw/migrate-to-vite-plus
Aug 8, 2026
Merged

Adopt Vite+ development tooling#19
biw merged 5 commits into
mainfrom
biw/migrate-to-vite-plus

Conversation

@biw

@biw biw commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary

Adopt Vite+ for dependency installation, formatting, lint/type checks, and package builds while preserving the package's existing Vite 6/Vitest 2 test runtime. The plugin's Vite peer range and source behavior remain unchanged; the full native-module test suite continues to exercise the regular Vite dependency.

What This PR Does

  • Replaces tsup and ESLint configuration with Vite+ pack, Oxfmt, and Oxlint configuration.
  • Adds the pnpm Vite+ catalog and updates scripts, lockfile, README, CI, and npm publishing to use vp install, vp check, and vp pack.
  • Keeps vite@6.2.1 and vitest@2 as direct development dependencies; the test scripts and standalone Vitest config continue to run the original test environment.
  • Applies Oxfmt formatting to source and tests, and rewrites four equivalent virtual-ID assertions to avoid control-character-regex lint warnings.
  • Ignores the complete .vscode/ directory and removes the previously tracked workspace settings file.

What This Improves

  • Provides one Vite+ configuration for formatting, lint/type checking, and dual ESM/CJS package output.
  • Uses the official pinned Vite+ setup action in CI and publishing while retaining frozen, explicit dependency installation.
  • Keeps the published ESM (dist/index.js), CommonJS (dist/index.cjs), and declaration output paths unchanged.

What This Does Not Do

  • Does not migrate the plugin's runtime or test suite to Vite+ bundled Vite/Rolldown.
  • Does not change the public Vite peer-dependency range or the plugin's native-module behavior.

Important Context

  • Vite+ bundles a Vite 8/Rolldown core, which exposes different behavior for this package's virtual native-module wrappers. Tests therefore deliberately continue using the package's normal Vite 6/Vitest 2 development dependencies.
  • vp pack replaces tsup, with fixedExtension: false preserving the existing .js ESM and .cjs CommonJS package entrypoints.

Code To Review Closely

vite.config.ts:7

Verify that the pack configuration preserves the package's current distribution contract while Vite+ takes over packaging and checks.

pack: {
  entry: ["src/index.ts"],
  dts: true,
  format: ["esm", "cjs"],
  fixedExtension: false,
  sourcemap: true,
  target: "node18",
  platform: "node",
  treeshake: true,
  deps: {
    neverBundle: ["vite"],
  },
},

Gotchas, Risks, And Edge Cases

  • pnpm install emits an advisory peer-dependency warning because Vite+ bundles browser helpers that peer-depend on Vitest 4, while this package intentionally retains Vitest 2 for its standard Vite 6 integration tests. vp test is intentionally not used.
  • Oxfmt changes source and test formatting only; the native virtual-ID assertions are semantically equivalent prefix checks.

Tests And Regression Coverage

Validation Run

  • vp run test: passed (10 files, 195 tests) on Vite 6/Vitest 2.
  • vp lint: passed with no warnings or errors.
  • vp check: passed with formatting, lint, and type checks clean.
  • vp pack: passed and emitted dist/index.js, dist/index.cjs, dist/index.d.ts, and dist/index.d.cts.
  • git diff --check: passed.

Coverage Assessment

Sufficient for this tooling migration: the complete existing native-module suite passed in its intended Vite 6/Vitest 2 environment, and Vite+ validates the formatting, lint/type, and package output paths it now owns.

Regressions These Tests Should Catch

  • Native-file discovery and hashing across bindings, node-gyp-build, NAPI-RS, and prebuild loader patterns.
  • ESM/CJS output-format detection, synthetic exports, and tree-shaking behavior.
  • Missing ESM, CJS, or declaration output from the Vite+ pack configuration.

Gaps And Recommended Follow-Up Tests

  • A future Vite 8/Rolldown compatibility effort should be scoped separately, with source changes and integration coverage for virtual native-module wrappers before adopting vp test.

Follow-Up Work

  • Consider upgrading the test stack to Vite 8/Vitest 4 only after the plugin's Rolldown compatibility is implemented and validated.

@biw
biw force-pushed the biw/migrate-to-vite-plus branch from 0262241 to 7114126 Compare August 8, 2026 00:03
@biw
biw merged commit 4ce2922 into main Aug 8, 2026
4 checks passed
@biw
biw deleted the biw/migrate-to-vite-plus branch August 8, 2026 00:16
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