Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Sep 23, 2025

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.

@github-actions github-actions bot added A-parser Area - Parser C-enhancement Category - New feature or request labels Sep 23, 2025
Copy link
Member Author

overlookmotel commented Sep 23, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@overlookmotel overlookmotel marked this pull request as ready for review September 23, 2025 13:06
Copilot AI review requested due to automatic review settings September 23, 2025 13:06
Copy link
Contributor

Copilot AI left a 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.

@overlookmotel
Copy link
Member Author

@camc314 Asking for your review, just because I know you're awake!

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Sep 23, 2025
Copy link
Contributor

camc314 commented Sep 23, 2025

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.
@graphite-app graphite-app bot force-pushed the 09-23-feat_napi_parser_change_oxc-parser_to_esm branch from 894166f to b1da5d5 Compare September 23, 2025 14:28
@graphite-app graphite-app bot merged commit b1da5d5 into main Sep 23, 2025
17 checks passed
@graphite-app graphite-app bot deleted the 09-23-feat_napi_parser_change_oxc-parser_to_esm branch September 23, 2025 14:33
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 23, 2025
graphite-app bot pushed a commit that referenced this pull request Sep 23, 2025
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`??).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants