From c2d6e5abe28087a26b8724b9182cbf0f0abd4b9d Mon Sep 17 00:00:00 2001 From: Akash P Date: Tue, 28 Jul 2026 13:26:58 +0530 Subject: [PATCH 1/2] fix: publish the ESM build of @metamask/mobile-wallet-protocol-core `packages/core` builds both CJS and ESM but declares only `main` and `types`, so the published `dist/index.mjs` and `dist/index.d.mts` are unreachable and every bundler resolves the CommonJS build. Add `module` and `exports`, mirroring the block `dapp-client` and `wallet-client` already carry. Co-Authored-By: Claude Opus 5 --- packages/core/CHANGELOG.md | 4 ++++ packages/core/package.json | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 9b79b01..59b0f91 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Publish the ESM build by adding `module` and `exports` to the manifest, so `dist/index.mjs` is reachable instead of always resolving to the CommonJS build + ## [0.4.0] ### Added diff --git a/packages/core/package.json b/packages/core/package.json index b2f4dec..f92cccd 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -11,7 +11,20 @@ }, "license": "MIT", "main": "./dist/index.js", + "module": "./dist/index.mjs", "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, "files": [ "dist" ], From 144461c21e147de9a062c8d53efd4287e083c1f2 Mon Sep 17 00:00:00 2001 From: Akash P Date: Tue, 28 Jul 2026 13:27:34 +0530 Subject: [PATCH 2/2] chore: link changelog entry to #85 Co-Authored-By: Claude Opus 5 --- packages/core/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 59b0f91..5083288 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Publish the ESM build by adding `module` and `exports` to the manifest, so `dist/index.mjs` is reachable instead of always resolving to the CommonJS build +- Publish the ESM build by adding `module` and `exports` to the manifest, so `dist/index.mjs` is reachable instead of always resolving to the CommonJS build ([#85](https://github.com/MetaMask/mobile-wallet-protocol/pull/85)) ## [0.4.0]