Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the package to an ESM-only distribution, switches the build pipeline to plain tsc, and updates dependencies + adapter wiring for the newer domhandler/domutils ecosystem.
Changes:
- Convert package publishing/runtime to ESM-only (
type: module, simplifiedexports, Node engine bump) and switch build output todist/viatsc. - Bump core DOM/CSS parsing dependencies and update code/tests to use
domhandler.isTag(no longer re-exported bydomutils) andhtmlparser2.parseDocument. - Add a tag-based publish workflow (npm + JSR) and update CI matrix / remove coverage steps.
Reviewed changes
Copilot reviewed 10 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tsconfig.json |
Updates TS target/output directory and limits compilation to src/ (excludes specs/tests). |
tsconfig.eslint.json |
Ensures ESLint TS project can include test/ without emit and with a root dir that won’t error. |
src/index.ts |
Updates default adapter to include isTag and removes deprecated public exports / token compiler wrapper. |
src/helpers/cache.spec.ts |
Updates test adapter to include isTag explicitly. |
test/tools/helper.ts |
Switches tag checks to domhandler.isTag. |
test/qwery.ts |
Migrates from parseDOM to parseDocument and switches tag checks to isTag. |
test/api.ts |
Migrates from parseDOM to parseDocument and updates adapter construction for isTag. |
package.json |
ESM-only packaging metadata, dependency bumps, build script switch to tsc, Node engine constraint, publish files tweaks. |
package-lock.json |
Lockfile updates reflecting dependency/tooling changes and removals (eg tshy, coverage deps). |
biome.json |
Bumps Biome schema reference. |
.gitignore |
Removes lib/ + tshy artifacts, adds jsr.json. |
.github/workflows/publish.yml |
Adds tag-triggered publish pipeline for JSR + npm. |
.github/workflows/nodejs-test.yml |
Updates CI matrix and removes coverage/coveralls steps. |
💡 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.
| const finalOptions: Options<Node, ElementNode> = options ?? defaultOptions; | ||
| // @ts-expect-error Same as above. | ||
| finalOptions.adapter ??= DomUtils; | ||
| finalOptions.adapter ??= defaultOptions.adapter as typeof DomUtils; |
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.