Skip to content

refactor: run natively on node type stripping, modernize tooling#222

Merged
DylanPiercey merged 1 commit into
mainfrom
update-tooling
Jun 12, 2026
Merged

refactor: run natively on node type stripping, modernize tooling#222
DylanPiercey merged 1 commit into
mainfrom
update-tooling

Conversation

@DylanPiercey

Copy link
Copy Markdown
Contributor

No description provided.

Replaces enums with erasable const modules (inlined by esbuild via
minifySyntax), adds explicit .ts import extensions, and drops
mocha/c8/mocha-snap/tsx in favor of node:test with built-in coverage.
Updates all dependencies to latest, including eslint 10 flat config
and TypeScript 6.
@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 174ec6e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
htmljs-parser Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.97%. Comparing base (83d0f84) to head (174ec6e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #222      +/-   ##
==========================================
+ Coverage   99.33%   99.97%   +0.64%     
==========================================
  Files          28       34       +6     
  Lines        4209     4204       -5     
  Branches      773      776       +3     
==========================================
+ Hits         4181     4203      +22     
+ Misses         14        1      -13     
+ Partials       14        0      -14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DylanPiercey DylanPiercey merged commit 221d3b7 into main Jun 12, 2026
11 checks passed
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9e4f4406-a7ab-4751-80d5-0cb1d5ab39be

📥 Commits

Reviewing files that changed from the base of the PR and between 83d0f84 and 174ec6e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json and included by **
📒 Files selected for processing (57)
  • .c8rc.json
  • .changeset/shiny-llamas-search.md
  • .eslintignore
  • .eslintrc.json
  • .fixpackrc
  • .github/workflows/ci.yml
  • .gitignore
  • .lintstagedrc.json
  • .mocharc.json
  • .nycrc.json
  • .prettierignore
  • .prettierrc.json
  • bench.ts
  • build.mts
  • build.ts
  • eslint.config.js
  • package.json
  • src/__tests__/api.test.ts
  • src/__tests__/main.test.ts
  • src/__tests__/util/snap.ts
  • src/__tests__/validate.test.ts
  • src/core/Parser.ts
  • src/index.ts
  • src/internal.ts
  • src/states/ATTRIBUTE.ts
  • src/states/BEGIN_DELIMITED_HTML_BLOCK.ts
  • src/states/CDATA.ts
  • src/states/CLOSE_TAG.ts
  • src/states/CONCISE_HTML_CONTENT.ts
  • src/states/DECLARATION.ts
  • src/states/DTD.ts
  • src/states/EXPRESSION.ts
  • src/states/HTML_COMMENT.ts
  • src/states/HTML_CONTENT.ts
  • src/states/INLINE_SCRIPT.ts
  • src/states/JS_COMMENT_BLOCK.ts
  • src/states/JS_COMMENT_LINE.ts
  • src/states/OPEN_TAG.ts
  • src/states/PARSED_STRING.ts
  • src/states/PARSED_TEXT_CONTENT.ts
  • src/states/PLACEHOLDER.ts
  • src/states/REGULAR_EXPRESSION.ts
  • src/states/STRING.ts
  • src/states/TAG_NAME.ts
  • src/states/TEMPLATE_STRING.ts
  • src/states/attr-stage.ts
  • src/states/index.ts
  • src/states/tag-stage.ts
  • src/util/codes.ts
  • src/util/constants.ts
  • src/util/error-code.ts
  • src/util/tag-type.ts
  • src/util/util.ts
  • src/util/validators.ts
  • src/util/validity.ts
  • tsconfig.build.json
  • tsconfig.json

Walkthrough

This PR modernizes the htmljs-parser package by replacing TypeScript enums with erasable const modules for Node.js type-stripping compatibility, migrating from Mocha to Node's built-in test runner, and overhauling the build system. All module imports are standardized to use explicit .ts extensions for proper ESM resolution. Coverage directives are updated from c8 syntax to node:coverage, and project tooling is upgraded with new ESLint flat config, esbuild-based build system, and updated TypeScript configuration. The public API surface (exported values and types) remains compatible while enabling runtime type-stripping.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-tooling

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed due to a network error.


Comment @coderabbitai help to get the list of available commands and usage tips.

@DylanPiercey DylanPiercey deleted the update-tooling branch June 12, 2026 19:28
@github-actions github-actions Bot mentioned this pull request Jun 12, 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.

1 participant