Skip to content

chore: migrate toolchain to Vite+#134

Closed
jonkoops wants to merge 8 commits into
react-dropzone:mainfrom
jonkoops:feat/unified-toolchain
Closed

chore: migrate toolchain to Vite+#134
jonkoops wants to merge 8 commits into
react-dropzone:mainfrom
jonkoops:feat/unified-toolchain

Conversation

@jonkoops

Copy link
Copy Markdown
Collaborator

Replaces the existing Rollup + tsc + Jest + TSLint toolchain with Vite+, giving the project a single CLI (vp) for building, testing, linting, formatting, and dependency management.

The migration was done incrementally: scaffold a Vite+ library template, port source and tests into it, adapt for the new toolchain (explicit .ts extensions, Vitest imports, async/await instead of done() callbacks, jsdom test environment), resolve lint warnings and strip dead TSLint directives, then consolidate everything back into the project root. No runtime behaviour was changed — the ESM build output was compared against the old one to verify.

CI workflows now use voidzero-dev/setup-vp@v1 instead of actions/setup-node, which handles Node.js, dependency installation, and caching in one step. Action versions were bumped (actions/checkout v7, actions/stale v10, semantic-release ^25). The test matrix was narrowed to Node 22 and 24 (active LTS), and engines was set to >= 22. Coverage reporting uses @vitest/coverage-v8 with an lcov reporter for Coveralls. Dependabot was extended to track GitHub Actions with conventional commit prefixes.

A pre-commit hook runs vp check --fix on staged files via the staged config block. bumpp was removed since the repo already uses semantic-release.

Not in scope: Vitest Browser Mode (replacing jsdom with real Chromium via Playwright).

Breaking changes

  • CJS and UMD output formats are dropped. The package now ships ESM-only with bundled type declarations.
  • Minimum supported Node.js version is 22 (from 14).

jonkoops added 8 commits July 11, 2026 12:44
Staging area for the toolchain migration. Will be merged
into the project root once the existing files are ported.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Move source files into file-selector/src/ and test files into
file-selector/tests/, adjusting imports for the new layout.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Signed-off-by: Jon Koops <jonkoops@gmail.com>
Add DOM types to tsconfig and explicit .ts import extensions for
nodenext resolution. Migrate test files to use vite-plus/test imports
and replace deprecated done() callbacks with async/await. Configure
jsdom as the test environment.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Remove dead tslint directive comments, drop unused Proxy handler
parameter, fix floating promise, and silence template expression
warnings with type casts. Mark the redundant `any` parameter type
and unhelpful error messages for future improvement.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Drop Jest, TSLint, Rollup configs, all tsconfig variants, the old
package-lock.json, .editorconfig, and root .gitignore. Merge package
metadata into the Vite+ package.json. Move LICENSE, README, and all
scaffold contents from file-selector/ to the project root.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Add staged config to run vp check --fix on commit and generate
the .vite-hooks/pre-commit hook file.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Replace setup-node with voidzero-dev/setup-vp@v1 which handles
Node.js, dependency install, and caching in one step. Bump
actions/checkout to v7, actions/stale to v10, and semantic-release
to ^25. Drop EOL Node 20 from test matrix (now 22/24) and set
engines to >= 22. Add coverage-v8 provider and lcov reporter for
coveralls. Add github-actions ecosystem to dependabot config.

Signed-off-by: Jon Koops <jonkoops@gmail.com>
@jonkoops jonkoops requested a review from rolandjitsu July 11, 2026 22:40
@rolandjitsu

rolandjitsu commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

I'll go with #133 for now. The reasoning is:

  1. Do not adopt vp just yet; wait for GA, then flip the switch.
  2. Same underlaying oxc; more (direct) control (no need to wait for vp to make whatever changes when we need them).
  3. Keep ESM + CJS; don't need to drop CJS just yet.
  4. Keeps type resolution for old consumers.
  5. Use stable ts7.

Once vp is out of beta, we can transition to it - it'll be a nice cleanup.

@rolandjitsu

Copy link
Copy Markdown
Collaborator

Closing in favor of #133 .

@jonkoops

jonkoops commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

Few thoughts now that #133 is merged.

  1. Do not adopt vp just yet; wait for GA, then flip the switch.

From the beta announcement:

Vite+ is stable, but not yet complete. We recommend adopting Vite+ if it covers the features you are looking for in a unified toolchain.

Build, test, lint, format — that's all we need; vp has it.

  1. Same underlaying oxc; more (direct) control (no need to wait for vp to make whatever changes when we need them).

Sure, same tools underneath. But "direct control" here means 6 config files (tsdown.config.ts, vitest.config.ts, .oxfmtrc.json, .oxlintrc.json, .npmrc, tsconfig.build.json) vs 2 with vp (vite.config.ts, tsconfig.json). No custom build plugins, no transforms — there's nothing to control that vp doesn't already expose.

  1. Keep ESM + CJS; don't need to drop CJS just yet.

vp can do CJS, but I'd argue it should be dropped regardless of tooling choice. Every stable Node version supports ESM, and bundlers default to it. Shipping CJS alongside just bloats the package for no real benefit.

  1. Keeps type resolution for old consumers.

Same — vp/tsdown can emit .d.ts with an explicit types condition. Going .d.mts-only was my choice.

  1. Use stable ts7.

Fair. The dep tree issue you hit in #132 is the TS 7 peer dep conflict — vite-plus and its bundled tsdown still declare ^5 || ^6. Didn't bite us since we stayed on TS 6, but the root cause is tracked (voidzero-dev/vite-plus#2148) with a fix in review.

Anyway — the hard part is done now that the old toolchain is gone. Going from raw oxc to vp is just config consolidation once TS 7 support lands. Happy to put that PR up when it does.

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.

2 participants