#15

Provide a CJS build

OpenAndrewIngramopened 9mo ago

I hate to even raise this one, but we have a large codebase that even with LLMs will take quite a bit of effort to move onto the esm ecosystem. I've had some success getting bash-tool to work with dynamic imports, but getting it fully working (tests and all) is a bit of a challenge.

It'd make it much easier to experiment with this (and just-bash) if it wasn't blocked on overhauling our monorepo 😅

Totally understand if you don't want to do this, it might make maintenance more trouble than it's worth for you.

(there's a similar ask for just-bash, but asking in one place first)

Activity

2
cramforce9mo ago

Here I'd be happy to do it. For just-bash it seems exceedingly difficult.

just-bash is very large and quite slow without code-splitting which esbuild doesn't support for CJS.

obs-gh-trevorColby5mo ago

Opened #27 for this — it adds a dual ESM+CJS build using tsup.

  • exports uses the canonical per-condition layout with separate types for import (.d.ts) and require (.d.cts).
  • Verified green across node10, node16 (CJS + ESM), and bundler with @arethetypeswrong/cli, and the full pnpm validate (lint, knip, typecheck, build, 152 tests) passes.

Happy to adjust the approach if you'd prefer raw esbuild to match the just-bash build setup rather than introducing tsup.