Skip to content

feat: publish ESM only, drop the CommonJS build - #112

Merged
TimoGlastra merged 3 commits into
mainfrom
TimoGlastra/esm-only
Oct 28, 2026
Merged

TimoGlastra merged 3 commits into
mainfrom
TimoGlastra/esm-only

Conversation

@TimoGlastra

Copy link
Copy Markdown
Contributor

Build the packages with tsdown, like identity-common, into a single build/index.mjs with index.d.mts types per package. The exports maps only have types and default conditions, plus askar-shared/installBinary for the install scripts. The Node.js package finds its native directory through its own package.json instead of __dirname.

@TimoGlastra
TimoGlastra added this pull request to stack #113 October 27, 2026 16:04
@TimoGlastra
TimoGlastra requested a review from a team as a code owner October 27, 2026 16:04
@changeset-bot

changeset-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d837631

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@openwallet-foundation/askar-nodejs Minor
@openwallet-foundation/askar-react-native Minor
@openwallet-foundation/askar-shared Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@TimoGlastra
TimoGlastra requested a review from genaris October 27, 2026 16:04

@genaris genaris left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Node.js tests and the React Native tests both load the packages from src/ (the Vitest alias and the Metro config of the example). So no test loads build/index.mjs, the exports maps, or the package root lookup in register.ts. Can you add a CI step after pnpm build that imports the built Node.js package with import() and with require(), and calls version()?

The changeset says that require() works on Node.js 22.12 and later. Should engines be >= 22.12?

Please add a link to the tsdown issue in the comment on the tsdown: 0.23.1 pin, so that we can remove the pin later.

Nit: no script uses clean now, because tsdown cleans outDir.

@TimoGlastra
TimoGlastra enabled stacked auto-merge (squash) October 28, 2026 10:55
stacked auto-merge was automatically disabled October 28, 2026 11:24

Auto-merge was disabled for another pull request in the stack

Base automatically changed from TimoGlastra/koffi-3-deps to main October 28, 2026 11:24
Build the packages with tsdown, like identity-common, into a single
build/index.mjs with index.d.mts types per package. The exports maps
only have types and default conditions, plus askar-shared/installBinary
for the install scripts. The Node.js package finds its native directory
through its own package.json instead of __dirname.

Signed-off-by: TimoGlastra <timo@animo.id>
Signed-off-by: TimoGlastra <timo@animo.id>
Signed-off-by: TimoGlastra <timo@animo.id>
@TimoGlastra
TimoGlastra merged commit 97808ff into main Oct 28, 2026
12 checks passed
@TimoGlastra
TimoGlastra deleted the TimoGlastra/esm-only branch October 28, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants