Conversation
- Added tests for isInstalled() and schemaVersion() methods
Feat: Migrate codebase to ESM and TypeScript
|
@davbrito and @bcomnes, this PR contains the ESM rewrite PR + Typescript tests. Asking for your opinions on the index.cjs pattern I used here (and anything else). This pattern seems to be unpopular, but I was wanting a more clean way to require(esm) than what typescript is currently producing during transpile where |
|
I can take a peek tomorrow. |
It seems it could be achieved with a single default export: https://tsdown.dev/options/cjs-default
And had this cjs output thanks to A different approach would be to get rid of the default export and just use named exports. This way it can be published as esm only, cjs users will just need a node version compatible with
|
|
Here is an example how would it be with esm only & named exports only: |
|
Thanks for the feedback. I'm leaning towards consolidating to named exports and abandoning default |
|
I’m plus one on not supporting default exports and avoiding a cjs wrapper. In theory it works well in modern node but things get murky in tortured environments like next.js or deno/bun node comparability layers. |




No description provided.