Skip to content

Comments

feat(npm/runtime): convert to ES modules#13874

Merged
Boshen merged 1 commit intomainfrom
feat/runtime-esm
Sep 22, 2025
Merged

feat(npm/runtime): convert to ES modules#13874
Boshen merged 1 commit intomainfrom
feat/runtime-esm

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Sep 18, 2025

Summary

  • Convert npm/runtime package to ES modules by setting "type": "module" in package.json

Test plan

  • Verify existing exports continue to work
  • Test both CommonJS and ESM consumers can import helpers correctly
  • Run existing test suites

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings September 18, 2025 08:01
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 18, 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.

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Sep 18, 2025
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

Converts the npm/runtime package from CommonJS to ES modules by updating the module type configuration in package.json.

  • Change package type from "commonjs" to "module"
  • Move type declaration to standard location after homepage field
  • Remove redundant type specification at end of file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Boshen
Copy link
Member Author

Boshen commented Sep 18, 2025

@Dunqing do you think we should remove cjs files from the helpers?

@Dunqing
Copy link
Member

Dunqing commented Sep 18, 2025

@Dunqing do you think we should remove cjs files from the helpers?

Yes!

@overlookmotel
Copy link
Member

overlookmotel commented Sep 18, 2025

If we definitely never intend to support ESM to CommonJS transform (#4050). If we might in future, I think we should probably keep the CJS versions.

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Sep 22, 2025
Copy link
Member Author

Boshen commented Sep 22, 2025

Merge activity

  • Sep 22, 5:07 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 22, 5:07 AM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
  • Sep 22, 5:07 AM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..
  • Sep 22, 5:07 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

Change package.json type from "commonjs" to "module" to enable ES module support.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Boshen Boshen merged commit 36bbba8 into main Sep 22, 2025
15 of 17 checks passed
@Boshen Boshen deleted the feat/runtime-esm branch September 22, 2025 06:04
@sapphi-red
Copy link
Member

It seems this PR broke the transformer conformance tests.
https://github.com/oxc-project/oxc/actions/runs/17910377111/job/50920959493?pr=13995#step:7:216
The cjs files in npm/runtime/src/helpers should end with .cjs.

Boshen added a commit that referenced this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants