Skip to content

Fix published v12 declaration compatibility - #300

Merged
bcomnes merged 3 commits into
masterfrom
bret/fix-v12-declaration-consumer
Sep 8, 2026
Merged

bcomnes merged 3 commits into
masterfrom
bret/fix-v12-declaration-consumer

Conversation

@bcomnes

@bcomnes bcomnes commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Emit valid concrete HTML and Markdown builder declarations without an undeclared generic.
  • Require cpx2@^9.0.1, which fixes the upstream declaration re-export collisions, and retain the dependency-derived copy/static report types.
  • Keep Pino's full Logger contract for callers and internal logging; do not introduce a structural logger abstraction or constructor cast.
  • Ship a temporary, type-only compatibility alias for the removed worker_threads.TransferListItem export used by thread-stream@4.2.0, referenced by both public declaration entry points.
  • Add packed-tarball consumer checks using DOMStack's configured devDependencies.typescript with Node 22, 24, and 26 declarations, NodeNext resolution, and skipLibCheck: false.
  • Check root and public type imports independently, accept real Pino/child loggers, and verify that the logger and transferable-item types are not weakened.
  • Clean generated declaration artifacts after the packed-consumer test.

Temporary thread-stream compatibility

The upstream fix is pinojs/thread-stream#233, tracked by pinojs/thread-stream#228. Until a compatible dependency release contains it, types/thread-stream.d.ts restores the missing alias using WorkerOptions['transferList'] as the source of truth. One targeted @ts-ignore handles older Node declarations that already export the equivalent alias; the strict packed-consumer checks checks both the missing-alias and duplicate-alias cases.

The shim is included in the npm tarball and preserved in both public entry-point declaration references. It does not change runtime behavior, patch installed dependencies, require install scripts, or ask consumers to enable skipLibCheck. The file documents the upstream PR and removal condition: remove the shim, its entry-point references, and its packaging entry once the supported Pino dependency tree requires the upstream correction.

Validation

  • Full npm test passed with Chokidar polling enabled and Chromium installed in a temporary browser directory.
  • Installed dependency checks, ESLint, the Node suite, Playwright, and source TypeScript checks passed.
  • All 6 packed-consumer checks passed using DOMStack's configured TypeScript dependency: 3 Node declaration versions × 2 independently checked public entry points. No separate TypeScript support matrix is maintained.
  • The packed consumer uses published cpx2@9.0.1, Pino, and unmodified thread-stream@4.2.0, with install scripts disabled.
  • Before adding the compatibility alias, the packed consumer failed only on the upstream TransferListItem reference; the cpx2 errors were resolved by 9.0.1.

Fixes #291.

@coveralls

coveralls commented Sep 6, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 34172801784

Coverage increased (+0.002%) to 95.489%

Details

  • Coverage increased (+0.002%) from the base build.
  • Patch coverage: 5 of 5 lines across 4 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 7909
Covered Lines: 7724
Line Coverage: 97.66%
Relevant Branches: 1956
Covered Branches: 1696
Branch Coverage: 86.71%
Branches in Coverage %: Yes
Coverage Strength: 280.96 hits per line

💛 - Coveralls

@bcomnes
bcomnes marked this pull request as ready for review September 6, 2026 04:39
Comment thread lib/build-copy/index.js Outdated
@bcomnes
bcomnes force-pushed the bret/fix-v12-declaration-consumer branch from 26a8adb to 5708bd7 Compare September 8, 2026 00:16
@bcomnes
bcomnes merged commit 7783a35 into master Sep 8, 2026
10 checks passed
@bcomnes
bcomnes deleted the bret/fix-v12-declaration-consumer branch September 8, 2026 00:21
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.

Published v12 declarations fail strict consumer type-checking

2 participants