Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(compiler): migration to rollup + vitest (prep work for CJS/ESM dual bundles) #8826

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

mmaietta
Copy link
Collaborator

@mmaietta mmaietta commented Jan 31, 2025

The end goal here is to see if we can enable dual publishing of the package for esm+cjs. This PR is the initial setup/migration to the new bundler + testing framework.

Overall, vitest was a simple setup but rollup was encountering cyclical dependency issues, so a minor extraction of various functions to separate files was needed. Note: All moved functions that were originally exposed via API to end-user developers have remained the same.

Additional changes:

  • require is now await import which required createTargets to be migrated to async. This was fine as the caller of createTargets is already an async function, so this simply was a matter of adding await to createTargets invocation
  • ifAll test helper function was removed. It would be triggered via env var ALL_TESTS, but we haven't used that env var in years.
  • Added ts-node to run checkDeps and generate-schema since we don't compile the test dir with rollup, vitest automatically is able to run it as-is.

Copy link

changeset-bot bot commented Jan 31, 2025

🦋 Changeset detected

Latest commit: 77b6700

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
app-builder-lib Patch
builder-util Patch
dmg-builder Patch
electron-builder Patch
electron-builder-squirrel-windows Patch
electron-updater Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch
electron-publish Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mmaietta mmaietta changed the title explore(compiler): testing out migration to rollup + vitest chore(compiler): testing out migration to rollup + vitest Jan 31, 2025
@mmaietta mmaietta changed the title chore(compiler): testing out migration to rollup + vitest feat(compiler): testing out migration to rollup + vitest Jan 31, 2025
@mmaietta mmaietta force-pushed the explore/vitest-rollup-2 branch from 0db5c46 to 3af1fcc Compare February 1, 2025 04:16
@mmaietta mmaietta changed the title feat(compiler): testing out migration to rollup + vitest chore(compiler): migration to rollup + vitest (prep work for CJS/ESM dual bundles) Feb 3, 2025
…ackage for esm+cjs. This PR is the initial setup/migration to the new bundler + testing framework.

Overall, vitest was a simple setup but rollup was encountering cyclical dependency issues, so a minor extraction of various functions to separate files was needed. _Note: All moved functions that were originally exposed via API to end-user developers have remained the same._

Additional changes:
- `require` is now `await import` which required `createTargets` to be migrated to `async`. This was fine as the caller of `createTargets` is already an async function, so this simply was a matter of adding `await` to `createTargets` invocation
- `ifAll` test helper function was removed. It would be triggered via env var ALL_TESTS, but we haven't used that env var in years.
- Added ts-node to run `checkDeps` and `generate-schema` since we don't compile the `test` dir with rollup, vitest automatically is able to run it as-is.
@mmaietta mmaietta force-pushed the explore/vitest-rollup-2 branch from 28f0381 to 144b241 Compare February 4, 2025 03:43
packages/dmg-builder/src/dmgHelpers.ts Dismissed Show dismissed Hide dismissed
packages/dmg-builder/src/dmgHelpers.ts Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant