Skip to content

build: modernize renderer tooling and preserve Node 12 support - #77

Merged
voischev merged 3 commits into
masterfrom
build/modernize-toolchain
Oct 31, 2026
Merged

voischev merged 3 commits into
masterfrom
build/modernize-toolchain

Conversation

@voischev

Copy link
Copy Markdown
Member

Summary

  • Replace tsup, AVA, XO and Clinton with tsc, native Node.js tests/assertions, c8 and ESLint.
  • Remove Git hooks, commit-message tooling and generated changelog updates; reduce direct development dependencies from 20 to 7 and installed packages from 1352 to 175.
  • Preserve all 49 existing tests in a shared synchronous suite and add coverage for closeAs on void tags. Run that suite against isolated production tarball installs on the runtime matrix.
  • Make public declarations self-contained, including mixed nested content arrays, and add standalone CommonJS/ESM TypeScript consumers.
  • Update README examples, contributor/release instructions, agent guidance and issue/PR templates.

This includes and updates the agent workflow guide from #76. Replacing the legacy repository linter also removes the external SchemaStore resolution failure that blocked that PR's CI.

Compatibility

  • The published runtime requirement remains Node.js >=12; development and build tooling use Node.js 24.
  • Runtime dependencies remain is-json ^2.0.1. The renderer does not load or depend on the parser at runtime, and standalone declaration consumers no longer need parser types installed.
  • Keep parser 0.9 as a development-only round-trip fixture so the complete shared suite can run on Node.js 12. Validate current parser 0.13 separately through the core packed-package integration.
  • Preserve the named CommonJS API, native ESM interop, enums and rendering behavior. Emit ES2019 CommonJS rather than a minified bundle.
  • Keep TypeScript 4.3.5 consumer compatibility. No version bump is included; release notes are recorded under Unreleased.

Verification

  • npm ci and npm run check passed on Node.js 24.22.1.
  • 50 renderer tests passed; coverage is 100% statements/functions/lines and 96% branches, with enforced thresholds of 100%/100%/100%/95%.
  • npm audit: 0 vulnerabilities (the original installation reported 66).
  • Built with npm pack --ignore-scripts --pack-destination artifacts and tested the same tarball using npm run test:packed -- artifacts/posthtml-render-3.0.0.tgz --node <node-executable> on:
    • Node.js 12.0.0, 12.22.12, 14.21.3, 16.20.2, 18.20.8, 20.19.0, 22.12.0, 22.23.4, 24.22.1 and 26.12.1.
    • Each run executes the complete renderer suite, CommonJS/native ESM consumers, and a standalone TypeScript consumer with no parser installed. Node.js 12.0 uses the historical experimental ESM flag.
  • Consumer declarations passed on TypeScript 4.3.5 and 6.0.3. Isolated CJS/ESM consumers combining the candidate renderer, parser 0.13.0 and core 0.16.7 also passed TypeScript 5.3.3 and 6.0.3, including mixed content and source-location ASTs.
  • Core integration used its candidate tarball with parser 0.13 and this renderer override:
    npm run test:packed -- artifacts/posthtml-0.16.7.tgz --render ../posthtml-render/artifacts/posthtml-render-3.0.0.tgz
    58 core tests + 10 consumer tests passed on Node.js 20.19.0, 22.12.0, 22.23.4, 24.22.1 and 26.12.1; the existing skipped core test remains skipped.
  • Workflow YAML parsed successfully; git diff --check passed.

CI now checks on Node.js 24, packs the checked build once, then tests that artifact on Node.js 12.0/12/14/16/18/20/22/24/26. npm and TypeScript run on development Node while the full JavaScript suite runs with the selected consumer executable.

@voischev
voischev merged commit 280b2d3 into master Oct 31, 2026
10 checks passed
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