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

Build: Make Migrate properly recognized as a CommonJS module in Node.js #525

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

mgol
Copy link
Member

@mgol mgol commented Jul 15, 2024

PR gh-512 added the "type": "module" field to the top-level package.json, making Node-based workflows fail when trying to require Migrate as it's not exposed as ESM. To fix this, add a small package.json with just "type": "commonjs". Also, add Node.js smoke tests as the simplest way to verify this change.

Fixes gh-523
Ref gh-512

Actions run from the base branch version, so to verify this PR I changed the base branch on my fork & I submitted a draft PR at mgol#1. The first commit with small changes passed:
https://github.com/mgol/jquery-migrate/actions/runs/9947009305/job/27478759025?pr=1
while the second one removing the dist/package.json that this PR adds failed as expected:
https://github.com/mgol/jquery-migrate/actions/runs/9947022296/job/27478796641?pr=1

PR jquerygh-512 added the `"type": "module"` field to the top-level `package.json`,
making Node-based workflows fail when trying to require Migrate as it's not
exposed as ESM. To fix this, add a small `package.json` with just
`"type": "commonjs"`. Also, add Node.js smoke tests as the simplest way to
verify this change.

Fixes jquerygh-523
Ref jquerygh-512
@mgol mgol added this to the 3.5.1 milestone Jul 15, 2024
@mgol mgol requested a review from timmywil July 15, 2024 21:49
@mgol mgol self-assigned this Jul 15, 2024
@mgol mgol removed the Needs review label Jul 16, 2024
@mgol mgol merged commit 785943d into jquery:main Jul 16, 2024
11 checks passed
@mgol mgol deleted the type-module-fix branch July 16, 2024 22:43
@mgol
Copy link
Member Author

mgol commented Jul 17, 2024

Released in jQuery Migrate 3.5.2.

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.

type: module breaking webpack compilation
2 participants