Conversation
- 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]>
There was a problem hiding this comment.
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
tshybuild setup withtsc(rootDir: src,outDir: dist) and update TS target toes2022. - 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.
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.
BREAKING CHANGE: This package is now ESM-only.
Closes #2118