Conversation
There was a problem hiding this comment.
Pull request overview
This PR converts the package from a dual ESM/CommonJS distribution to an ESM-only package, leveraging Node.js's require(esm) feature introduced in recent LTS versions (20.19.0+ and 22.12.0+).
Changes:
- Removed CommonJS build output and configuration, keeping only ESM distribution
- Updated all TypeScript source files to use explicit
.tsextensions in import statements - Separated type-only imports using
import typesyntax for better ESM compatibility - Updated TypeScript compiler configurations to use
nodenextmodule resolution and modern ESM features
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated Node.js engine requirements to require modern LTS versions; removed CJS exports and main entry point; simplified build script |
| tsconfig.json | Added ESM-specific compiler options including allowImportingTsExtensions, rewriteRelativeImportExtensions, and verbatimModuleSyntax; updated to use nodenext module resolution |
| tsconfig-esm.json | Updated module and target to use lowercase nodenext and esnext for consistency |
| tsconfig-cjs.json | Deleted as CJS builds are no longer generated |
| tests/ts/tsconfig.json | Updated target to es2023 and module casing to lowercase |
| src/**/*.ts | Added .ts extensions to all relative imports; separated type-only imports using import type; removed obsolete eslint disable comments |
| src/tests/**/*.test.ts | Updated imports to use .ts extensions and separated type-only imports |
| example/**/*.ts | Updated all example imports to use .ts extensions |
| build.sh | Removed as the build process is now a simple TypeScript compilation without post-processing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nunomarks
reviewed
Jan 23, 2026
e6fc4e0 to
ca47f8d
Compare
BREAKING CHANGE: Published as an ESM package. Requires node.js >=22.12.0.
ca47f8d to
4fbb048
Compare
nunomarks
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since 2024 the
require(esm)feature has been enabled by default in the most recent node.js LTS versions. We can now safely ship only ESM sources in our NPM package without breaking any consumers.