Skip to content

refactor!: ESM-only#1867

Merged
fb55 merged 1 commit intomasterfrom
esm
Mar 17, 2026
Merged

refactor!: ESM-only#1867
fb55 merged 1 commit intomasterfrom
esm

Conversation

@fb55
Copy link
Owner

@fb55 fb55 commented Mar 17, 2026

  • Set type: module, update tsconfig to nodenext
  • Output to dist/ instead of lib/, remove dual CJS/ESM build
  • Simplify exports to ESM-only
  • Migrate Jest to Vitest
  • Bump domelementtype to ^3.0.0
  • Add engines >= 20.19.0
  • Add publish workflow (npm + JSR)

BREAKING CHANGE: This package is now ESM-only.

- Set type: module, update tsconfig to nodenext
- Output to dist/ instead of lib/, remove dual CJS/ESM build
- Simplify exports to ESM-only
- Migrate Jest to Vitest
- Bump domelementtype to ^3.0.0
- Add engines >= 20.19.0
- Update CI workflows, add publish workflow (npm + JSR)
- Remove esModuleInterop

BREAKING CHANGE: This package is now ESM-only.
Copilot AI review requested due to automatic review settings March 17, 2026 15:48
Copy link

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 converts the package to ESM-only by switching the TypeScript build to NodeNext ESM output in dist/, updating package exports accordingly, and migrating the test runner from Jest to Vitest. It also modernizes CI/publishing workflows and updates runtime constraints/dependencies to match the new ESM + Node 20+ baseline.

Changes:

  • Switch TS + package config to ESM-only (type: module, moduleResolution: nodenext, build output to dist/ with simplified exports)
  • Migrate tests from Jest to Vitest and update ESM-incompatible test patterns (__dirname, require, import specifiers)
  • Update CI/publish workflows and bump Node engine + dependency versions

Reviewed changes

Copilot reviewed 7 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.json Switch to NodeNext module settings and emit to dist/ for ESM-only output.
src/node.spec.ts Update test imports for Vitest + ESM .js specifiers.
src/index.spec.ts Replace CJS-only patterns (__dirname, require) with ESM equivalents and use Vitest APIs.
package.json Set type: module, update build/test scripts, simplify exports to ESM-only, bump engines/deps, add Vitest.
biome.json Update Biome schema reference.
.gitignore Replace lib/ with dist/ and ignore generated jsr.json.
.github/workflows/publish.yml Add tag-based publish workflow for npm + JSR (generates jsr.json).
.github/workflows/nodejs-test.yml Update Node matrix and switch CI test execution to Vitest.
.github/workflows/codeql-analysis.yml Minor workflow cleanup (comment removal).
Comments suppressed due to low confidence (1)

src/node.spec.ts:12

  • The test name still references Jest ("Jest snapshot") after migrating to Vitest. Updating the wording will avoid confusion when reading test output or failures.
describe("Nodes", () => {
    it("should serialize to a Jest snapshot", () => {
        const result = parse(

💡 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 4a790c7 into master Mar 17, 2026
17 checks passed
@fb55 fb55 deleted the esm branch March 17, 2026 15:54
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