Skip to content

build: use vite and vitest#130

Merged
techniq merged 8 commits into
techniq:mainfrom
ch-stuart:build-use-vite
May 9, 2025
Merged

build: use vite and vitest#130
techniq merged 8 commits into
techniq:mainfrom
ch-stuart:build-use-vite

Conversation

@ch-stuart
Copy link
Copy Markdown

  • replace browserify with Vite
  • replace jest with Vitest
  • remove rimraf dependency
  • did not update Typescript because of errors upon updating locally
  • remove typescript CJS config

This PR fixes #106.

I have this published to my personal scope on npm and imported into a dependent and it's working as expected.

Tests are passing with Vitest:
image

@ch-stuart ch-stuart changed the title (build): use vite and vitest build: use vite and vitest May 7, 2025
@techniq
Copy link
Copy Markdown
Owner

techniq commented May 8, 2025

This is a great improvement, thanks @enure!

Just to clarify, this drops CommonJS support making the library ESM-only? Because of this breaking change, I've bumped the major to 8.0.0. For future reference, the versions are managed by changesets (run pnpm changeset to specify patch/minor/major along a description). This maintains the CHANGELOG.md as well as triggers workflows to deploy the package to npm (and created a github release).

Thanks again for this PR. After confirming, I'll merge and release.

@ch-stuart
Copy link
Copy Markdown
Author

Just to clarify, this drops CommonJS support making the library ESM-only?

That's correct. It'd be very easy to keep CJS support by adjustingbuild.lib.formats in vite.config.ts. Thanks for the info re: changesets.

@techniq
Copy link
Copy Markdown
Owner

techniq commented May 9, 2025

@enure I'm good with dropping CJS support (unless too many people complain but at this point it's best to push the needle harder towards ESM). Thanks again for the PR! Merging and releasing now.

@techniq techniq merged commit 5c51e37 into techniq:main May 9, 2025
1 check passed
@github-actions github-actions Bot mentioned this pull request May 9, 2025
@techniq
Copy link
Copy Markdown
Owner

techniq commented May 9, 2025

Published as v8.0.0

@techniq
Copy link
Copy Markdown
Owner

techniq commented May 12, 2025

@enure FYI: looks like there is an issue with publishing types - #132

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.

ESM default export is not properly defined

2 participants