Skip to content

fix(package): every entry point loads with require() - #29

Merged
Makisuo merged 1 commit into
mainfrom
fix/exports-default-condition
Oct 14, 2026
Merged

Makisuo merged 1 commit into
mainfrom
fix/exports-default-condition

fix(package): every entry point loads with require()

5bb8bb2
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Oct 14, 2026 in 2m 0s

Confidence 8/10 · No issues found

🟢 Confidence 8/10 · likely safe to merge
Verified Node's condition matching and require(esm) on a synthetic export map; the CJS consumer's require("effect") line is the one thing I could not exercise here.
quality 100/100 · no findings · tests covered · risk high

Adds a default condition beside import on all 12 export entries so CommonJS callers can require() the ESM entries, and extends the tarball check with a CommonJS consumer. Contained and safe to merge.

  • All 12 exports entries gain default pointing at the same .mjs as import
  • tests/package-consumer.cjs requires every entry from the installed export map
  • check-package.ts runs the CommonJS consumer against the packed tarball
  • README and getting-started document the Node 20.19+/22.12+ floor
What was checked
  • require() skips import and matches default; ran a synthetic package with the same map and it resolved dist/clickhouse.mjs
  • All 12 entries list default last; no entry and no types entry was missed (package.json:36-95)
  • The CJS consumer fails with the old map, so the new check catches the regression

5bb8bb2 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.