Skip to content

chore: upgrade major dependencies - #281

Closed
pchuri wants to merge 3 commits into
mainfrom
feature/major-deps-upgrade
Closed

pchuri wants to merge 3 commits into
mainfrom
feature/major-deps-upgrade

Conversation

@pchuri

@pchuri pchuri commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Summary

Upgrades the major-version-lagging dependencies (ESM-only chalk/inquirer intentionally excluded — separate PR).

Package Before After
jest ^29.7.0 ^30.5.2
eslint ^9.39.2 ^10.13.0
commander ^11.1.0 ^15.0.0
html-to-text ^9.0.5 ^10.0.1
htmlparser2 ^9.1.0 ^12.0.0
js-yaml ^4.3.2 ^5.5.0
markdown-it ^14.3.2 ^15.0.3
entities ^4.5.0 ^8.1.0
form-data ^4.0.5 ^4.0.6

All target versions were verified against the npm registry (/<pkg>/latest) at the time of the upgrade; they match the versions above.

Breaking-change handling

  • commander 15 / htmlparser2 12 / entities 8 are ESM-only. They load from this CommonJS codebase via Node's require(esm), which requires Node >= 22.12. engines bumped from >=18 to >=22.12.0; CI matrix updated from 18/20/22 to 22/24 and the publish job from Node 18 to 22.
  • Jest sandbox: Jest cannot require() ESM-only packages without VM modules, so the test script now runs NODE_OPTIONS=--experimental-vm-modules jest. Plain node bin/confluence.js needs no flag.
  • ESLint 10 no longer bundles @eslint/js / globals for this config — added as explicit devDependencies (@eslint/js ^10.0.1, globals ^17.13.0). Flat-config format is unchanged. New recommended rules (no-useless-assignment, preserve-caught-error) flagged 6 pre-existing sites; fixed in code (removed dead initializers, added { cause } to rethrown errors).
  • js-yaml 5 throws on empty input instead of returning undefined: empty front-matter blocks are now treated as empty before calling load(). CORE_SCHEMA, load/dump options used here are unchanged. The overrides block still resolves correctly: top-level js-yaml is 5.5.0 ($js-yaml self-reference) and @istanbuljs/load-nyc-config keeps its nested ^3.15.2 pin (verified with npm ls js-yaml).
  • markdown-it 15 / html-to-text 10 still ship CJS entry points; public APIs used here are unchanged. markdown-it 15 pulls entities ^8, matching the direct upgrade.

Tests

  • npm test: 1934 passed, 1 failed (48 suites: 47 passed).
  • The single failure is the known pre-existing, environment-dependent tests/mtls-errors.test.js case — it fails identically on unmodified main (verified before upgrading), and was not touched.
  • npx eslint . passes.

Follow-up (not in this PR)

  • chalk 4→6 and inquirer 8→14: both are ESM-only. After this PR the runtime already requires Node >=22.12 and Jest already runs with VM modules, so the module-system hurdle is mostly paid. chalk's API surface used here (chalk.red etc.) is unchanged, so it is low-risk as its own PR. inquirer 14 has larger API changes around prompts, so it should be a separate, stepwise PR with interactive prompt testing.

pchuri and others added 3 commits October 18, 2026 15:35
- jest 29->30, eslint 9->10, commander 11->15, html-to-text 9->10,
  htmlparser2 9->12, js-yaml 4->5, markdown-it 14->15, entities 4->8,
  form-data 4.0.5->4.0.6
- add @eslint/js and globals as explicit devDependencies (no longer
  bundled with eslint 10) and fix new recommended-rule findings
  (no-useless-assignment, preserve-caught-error)
- js-yaml 5 throws on empty input: treat empty front matter as empty
- commander/htmlparser2/entities are now ESM-only: Node >=22.12 is
  required for require(esm); bump engines and CI matrix accordingly
- jest needs --experimental-vm-modules to require() ESM-only deps
  inside its sandbox; enable it in the test script

chalk and inquirer are intentionally left for a separate ESM PR.
commander 15, htmlparser2 12, entities 8 are ESM-only and cannot be
require()'d inside jest's sandbox on Node 22 (only Node 24.9+ supports
require(esm) in jest). Downgrade to last CJS versions:
- commander ^15.0.0 -> ^14.0.3
- htmlparser2 ^12.0.0 -> ^9.1.0
- entities ^8.1.0 -> ^4.5.0

Also revert the now-unneeded changes:
- test script back to plain 'jest' (--experimental-vm-modules no longer needed)
- engines back to >=18.0.0 and CI matrix to [18.x, 20.x, 22.x]
- revert mtls-errors.test.js NODE_OPTIONS stripping (no longer needed)
@pchuri pchuri closed this Oct 18, 2026
@pchuri

pchuri commented Oct 18, 2026

Copy link
Copy Markdown
Owner Author

Squash-merged to main as 9784e89.

@pchuri
pchuri deleted the feature/major-deps-upgrade branch October 18, 2026 22:39
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