-
-
Notifications
You must be signed in to change notification settings - Fork 722
feat(napi/parser)!: change oxc-parser to ESM
#14042
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
feat(napi/parser)!: change oxc-parser to ESM
#14042
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request completes the transition of oxc-parser package to fully ESM by changing the package type from CommonJS to ESM. The only file extension change required is renaming the webcontainer fallback file to use the .cjs extension for proper CommonJS identification.
- Changed package.json type field from "commonjs" to "module"
- Renamed webcontainer-fallback.js to webcontainer-fallback.cjs to maintain CommonJS compatibility
- Updated file references to point to the renamed fallback file
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| napi/parser/package.json | Changed type to "module" and updated files array to reference renamed fallback file |
| napi/parser/src-js/bindings.mjs | Updated require path to reference renamed webcontainer-fallback.cjs |
| napi/parser/scripts/patch.mjs | Updated string replacement pattern to reference renamed webcontainer-fallback.cjs |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
a8238ba to
894166f
Compare
|
@camc314 Asking for your review, just because I know you're awake! |
Merge activity
|
Completion of the work begun in #13432. Make `oxc-parser` package fully ESM. Aside from adding `"type": "module"` to `package.json`, only other change required is renaming `webcontainer-fallback.js` -> `webcontainer-fallback.cjs`. All other files already have the extension matching their ESM/CommonJS content.
894166f to
b1da5d5
Compare
Now that `apps/oxlint` and `napi/parser` are both ESM packages (#13723 and #14042), we can use `.js` file extensions for all ESM files, rather than the mix of `.js` and `.mjs` file we had previously. It's less confusing having to remember what's `.js` and what's `.mjs`, and avoids ugly workarounds like #14038 (`.d.mts`??).

Completion of the work begun in #13432. Make
oxc-parserpackage fully ESM.Aside from adding
"type": "module"topackage.json, only other change required is renamingwebcontainer-fallback.js->webcontainer-fallback.cjs. All other files already have the extension matching their ESM/CommonJS content.