Conversation
- 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.
There was a problem hiding this comment.
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 todist/with simplifiedexports) - 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.
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.