Files
zeekayandHanzo Dev fba217fa78 A require() consumer gets CommonJS types
Every `require` branch pointed at the same .d.ts as `import`, and
"type": "module" makes TypeScript read that as an ES module. A .cts consumer
on module node16 got TS1479 on all 17 subpaths, for a .cjs file that loads
fine.

scripts/cts.mjs copies each .d.ts to a .d.cts whose relative imports name
.cjs. The exports map drops its `types` conditions: TypeScript types a .js by
the .d.ts beside it and a .cjs by the .d.cts.

The new test installs the package into a throwaway consumer and typechecks
a .cts and a .mts that import every subpath, with skipLibCheck off. On the
old build it fails with 17 TS1479.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-19 04:29:01 -07:00
..