Skip to content

refactor!: ESM-only#2183

Merged
fb55 merged 10 commits intomainfrom
esm
Mar 17, 2026
Merged

refactor!: ESM-only#2183
fb55 merged 10 commits intomainfrom
esm

Conversation

@fb55
Copy link
Copy Markdown
Owner

@fb55 fb55 commented Mar 17, 2026

  • Drop tshy, use plain tsc build
  • Update tsconfig: target es2022
  • Simplify exports to ESM-only (keep ./decode, ./escape subpaths)
  • Remove pre-ESM CJS placeholder files
  • Update engines to >= 20.19.0
  • Remove deprecated fns
  • Remove polyfills not needed with Node >= 20.19.0
  • Fix publish workflow
  • Remove esModuleInterop

BREAKING CHANGE: This package is now ESM-only.

Closes #2118

fb55 and others added 4 commits March 17, 2026 09:19
- Drop tshy, use plain tsc build
- Update tsconfig: target es2022, add rootDir/outDir
- Simplify exports to ESM-only (keep ./decode, ./escape subpaths)
- Remove pre-ESM CJS placeholder files
- Update engines to >= 20.19.0
- Remove @vitest/coverage-v8
- Update publish.yml for ESM
- Fix lint issues, migrate biome config

BREAKING CHANGE: This package is now ESM-only.

Co-Authored-By: hyperz111 <[email protected]>
Copilot AI review requested due to automatic review settings March 17, 2026 09:58
Copy link
Copy Markdown

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 PR completes the package’s transition to an ESM-only distribution by switching to a plain tsc build, updating TypeScript/ESLint config to emit into dist/, simplifying package.json exports to ESM-only entrypoints, and removing legacy CommonJS shims/polyfills. It also adjusts the Node engine requirement and updates the publish workflow to generate jsr.json without relying on tshy.

Changes:

  • Replace tshy build setup with tsc (rootDir: src, outDir: dist) and update TS target to es2022.
  • Make exports ESM-only and remove legacy CJS placeholder files and polyfills.
  • Update tooling/configuration (ESLint project tsconfig, publish workflow, engines floor).

Reviewed changes

Copilot reviewed 10 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tsconfig.json Updates compilation target and defines rootDir/outDir, plus include/exclude for build output.
tsconfig.eslint.json Adds ESLint-specific TS project config to support type-aware linting across src/scripts.
src/internal/decode-shared.ts Removes legacy base64 decoding fallbacks, assuming modern runtime APIs.
src/decode.ts Removes fromCodePoint usage and switches to String.fromCodePoint; adjusts re-exports.
src/decode-codepoint.ts Removes fromCodePoint polyfill and uses String.fromCodePoint directly.
package.json Switches to ESM-only exports, drops tshy, adds tsc build, updates Node engine floor.
package-lock.json Reflects dependency removals/updates from dropping tshy and related tooling.
eslint.config.mjs Points type-aware linting at tsconfig.eslint.json and removes CJS-only overrides.
escape.js Removes legacy CommonJS shim entrypoint.
escape.d.ts Removes legacy type shim for the CommonJS shim entrypoint.
decode.js Removes legacy CommonJS shim entrypoint.
decode.d.ts Removes legacy type shim for the CommonJS shim entrypoint.
biome.json Updates Biome schema reference.
.gitignore Removes tshy build artifact ignores.
.github/workflows/publish.yml Pins action SHAs and updates jsr.json generation for the new build/export setup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@fb55 fb55 merged commit 601b001 into main Mar 17, 2026
10 checks passed
@fb55 fb55 deleted the esm branch March 17, 2026 11:44
@fb55 fb55 mentioned this pull request Mar 17, 2026
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