fix: add types for the require entry under node16/nodenext #951
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.37) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 212 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.321
Real PR Conversation Timeline
1 comments
"Review active on #951"
general
weight: 0.35
UziTech
Fixes #941.
Problem
exports["."].requireresolves to./lib/index.cjs, but nolib/index.d.ctsis published. Since TypeScript ignores the top-level"types"field when anexportsmap is present, a CommonJS consumer under--module nodenext/node16gets TS7016 (Could not find a declaration file ... 'lib/index.cjs' implicitly has an 'any' type), whileimportconsumers resolvesrc/index.d.tsfine.Fix
Mirrors the layout already used in the sibling package
marked-custom-heading-id:rollup.config.js: the cjs build now copiessrc/index.d.tstolib/index.d.ctsviarollup-plugin-copy. All exports are named (no default export), so the declaration file transfers verbatim; noexport default->export =transform is needed.package.json: per-conditiontypesin the exports map (import->./src/index.d.ts,require->./lib/index.d.cts) and top-leveltypes->./lib/index.d.cts.test:typesnow runsnpm run build && tsd && attw -Pso every resolution mode is covered in CI.lib/index.d.ctsis committed, matching the repo's convention of trackinglib/index.cjsandlib/index.umd.js.Verification
attw -Pbefore the change:node16 (from CJS)-> "No types"; all other modes green. After: "No problems found" across node10, node16 from CJS, node16 from ESM, and bundler..ctsfile withimport { gfmHeadingId } from 'marked-gfm-heading-id'andimport m = require('marked-gfm-heading-id')) compiles cleanly undertsc --strict --module nodenext --moduleResolution nodenexton TypeScript 5.9.3 and 7.0.2.npm test: 7 tests, 11 snapshots pass.tsdtype tests pass.npm run lint: clean.