Skip to content

Conversation

@thomasballinger
Copy link
Contributor

Compile ESM and CJS builds and types and use exports to point to them.

This resolves the warnings here and makes ts-jest work in https://github.com/get-convex/convex-chess/pull/19/files without adding the exception not to compile these files.

I'm not sure this needs to be a dual package though. If we could get away with ESM-only the build would be simpler. That's the way we should recommend developers build things in Convex.

Wildcard exports might be being used, but since exports: doesn't point to the right files for now this seems low-risk (see https://arethetypeswrong.github.io/?p=convex-helpers%400.1.27)
Dual build ESM/CJS
}
}

checkPackageJsonExports();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supposed to also write the exports? I only see the verification

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah just verification, to avoid the checked in package.json differing from what's used, e.g. accidentally publishing changes not checked in to the repo

@ianmacartney
Copy link
Collaborator

Closing, since esm seems fine for us for now

@ianmacartney ianmacartney deleted the dual-package branch July 9, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants