[codex] Expose CLJS agencies from root entrypoint#27
Conversation
meekmachine
left a comment
There was a problem hiding this comment.
I found two concrete issues here.
-
test:cljsno longer validates the new root-entrypoint contract. The smoke scripts now import from../dist/index.js, butpackage.jsonstill runsnpm run build:cljsbefore those tests.build:cljsonly emits the CLJS bundle; it does not runtsuporscripts/expose-cljs-main-exports.mjs, so the rootdist/index.jsexport surface can be stale or missing and the test won’t catch it reliably. This should build the full package (or at least runtsupplus the expose script) before the smoke tests. -
The package still advertises a CommonJS root entrypoint via
exports["."].require = "./dist/index.cjs", but the new root CLJS exports are implemented there as stubs that always throw. So the PR’s new “import from the normal package entrypoint” contract only works for ESM consumers and fails at runtime forrequire()consumers. That is a compatibility risk unless the docs/package metadata explicitly scope the feature to ESM-only consumers.
Summary
../dist/index.jsrather than../dist/cljs/index.js./cljsfor existing experimentsPart of meekmachine/LoomLarge#693.
Why
Polyester can use CLJS internally, but LoomLarge should consume a compiled JavaScript package API. This gives LoomLarge
@lovelace_lol/polyester/ compatibility imports without needing/cljspaths.Validation
npm ci --ignore-scriptsnpm run typechecknpm testnode scripts/expose-cljs-main-exports.mjsBlocked locally:
npm ci/ fullnpm run buildreachesshadow-cljsand fails because this machine only has Java 11. The failure isUnsupportedClassVersionErrorfor class file version 65. CI/package builds with Java 21 should cover the full CLJS build.