Skip to content

Comments

feat(npm/runtime): revert back to CJS#13999

Merged
Boshen merged 1 commit intomainfrom
revert-esm
Sep 22, 2025
Merged

feat(npm/runtime): revert back to CJS#13999
Boshen merged 1 commit intomainfrom
revert-esm

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Sep 22, 2025

This package was originally designed for dual export with cjs entry. Keep it this way.

This package original designed for dual export with cjs entry.
Keep it this way.
@Boshen Boshen marked this pull request as ready for review September 22, 2025 10:00
Copilot AI review requested due to automatic review settings September 22, 2025 10:00
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 22, 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 22, 2025
@Boshen Boshen merged commit d74568f into main Sep 22, 2025
17 checks passed
@Boshen Boshen deleted the revert-esm branch September 22, 2025 10:01
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

Revert npm/runtime package to CommonJS default while keeping dual-export support.

  • Switch package.json "type" from "module" to "commonjs"
  • Aim to maintain dual export (CJS entry) behavior via exports map

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

"node": "^20.19.0 || >=22.12.0"
},
"type": "module",
"type": "commonjs",
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the package type from module to commonjs alters how Node treats .js files and can break ESM consumers that relied on the package being ESM by default; this should be treated as a breaking change. Please bump the package with a semver-major release and note the change in the changelog.

Copilot uses AI. Check for mistakes.
"node": "^20.19.0 || >=22.12.0"
},
"type": "module",
"type": "commonjs",
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Update the package README/CHANGELOG to document that the package defaults to CommonJS and provide clear import/require examples for both ESM and CJS consumers. This helps users adapt to the change and reduces integration friction.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant