Skip to content

Support publishing of both ESM and CJS#536

Merged
colincasey merged 8 commits into
masterfrom
dual_publishing
Aug 1, 2025
Merged

Support publishing of both ESM and CJS#536
colincasey merged 8 commits into
masterfrom
dual_publishing

Conversation

@colincasey
Copy link
Copy Markdown
Contributor

The ESM supported backported to Node 20.19.0 is nice but not sufficient for supporting users on earlier versions of Node v20 which is still in active maintenance until 2026-04-30. This PR adds in dual-publishing of both ESM and CJS and ensures that entrypoints and types are correctly declared.

The [ESM supported backported to Node 20.19.0](https://github.com/nodejs/node/releases/tag/v20.19.0) is nice but not sufficient for supporting users on earlier versions of Node v20 which is still in active maintenance until 2026-04-30. This PR adds in dual-publishing of both ESM and CJS and ensures that entrypoints and types are correctly declared.
@colincasey colincasey self-assigned this Jul 31, 2025
wjhsf
wjhsf previously approved these changes Jul 31, 2025
Copy link
Copy Markdown
Contributor

@wjhsf wjhsf left a comment

Choose a reason for hiding this comment

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

Can you add tests that require('tough-cookie') and await import('tough-cookie') both work?

Comment thread package.json Outdated
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
@colincasey
Copy link
Copy Markdown
Contributor Author

@wjhsf added tests for verifying ESM and CJS in 337440f and 4d98f2c. See https://github.com/salesforce/tough-cookie/actions/runs/16656635134/job/47143177365?pr=536

Also verified locally that require('tough-cookie') and await import('tough-cookie') work.

wjhsf
wjhsf previously approved these changes Jul 31, 2025
Comment thread .github/workflows/ci.yaml Outdated
Comment thread .github/workflows/ci.yaml Outdated
Comment thread .github/workflows/ci.yaml Outdated
wjhsf
wjhsf previously approved these changes Aug 1, 2025
* master:
  Bump the dev-dependencies group with 8 updates (#537)

# Conflicts:
#	package-lock.json
@colincasey colincasey merged commit 5e2cf1c into master Aug 1, 2025
9 of 11 checks passed
@colincasey colincasey deleted the dual_publishing branch August 1, 2025 18:19
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.

2 participants