Skip to content

chore: remove obsolete dist export entries - #430

Open
ZayanKhan-12 wants to merge 2 commits into
MetaMask:mainfrom
ZayanKhan-12:fix/393-remove-dist-exports
Open

chore: remove obsolete dist export entries#430
ZayanKhan-12 wants to merge 2 commits into
MetaMask:mainfrom
ZayanKhan-12:fix/393-remove-dist-exports

Conversation

@ZayanKhan-12

@ZayanKhan-12 ZayanKhan-12 commented Aug 4, 2026

Copy link
Copy Markdown

Description

The package.json exports map contained obsolete ./dist/StreamProvider and ./dist/initializeInpageProvider entries. These are redundant with the canonical top-level subpath exports (./stream-provider and ./initializeInpageProvider), which also have JavaScript redirect files (stream-provider.js, initializeInpageProvider.js) for build systems that don't support export maps, so they have strictly better support.

This PR removes the two ./dist/* entries and keeps everything else unchanged. The legacy redirect files are unaffected since they use relative requires into dist/, which are not subject to the exports map.

Note for reviewers: consumers importing via the removed ./dist/* subpaths will need to switch to ./stream-provider / ./initializeInpageProvider, so this may warrant a major version bump.

Fixes #393

Testing

  • yarn build — passes
  • Spot-checked resolution with Node (CJS require.resolve and ESM import.meta.resolve via package self-reference):
    • @metamask/providers, @metamask/providers/stream-provider, @metamask/providers/initializeInpageProvider, and @metamask/providers/package.json all resolve correctly for both require and import conditions
    • @metamask/providers/dist/StreamProvider and @metamask/providers/dist/initializeInpageProvider now correctly fail with ERR_PACKAGE_PATH_NOT_EXPORTED
  • yarn jest — all 8 suites / 130 tests pass
  • yarn lint:eslint and yarn lint:misc --check — pass

🤖 Generated with Claude Code


Note

Medium Risk
Breaking public API surface for any consumer still on the ./dist/* import paths; runtime behavior of supported exports is unchanged.

Overview
BREAKING: Drops the redundant package.json export subpaths @metamask/providers/dist/StreamProvider and @metamask/providers/dist/initializeInpageProvider. Imports through those paths now fail with ERR_PACKAGE_PATH_NOT_EXPORTED.

Consumers should use @metamask/providers/stream-provider and @metamask/providers/initializeInpageProvider instead; those entries and the root redirect files (stream-provider.js, initializeInpageProvider.js) are unchanged. The unreleased changelog records the removal under Removed.

Reviewed by Cursor Bugbot for commit 6e3064f. Bugbot is set up for automated code reviews on this repo. Configure here.

The package.json exports map contained "./dist/StreamProvider" and
"./dist/initializeInpageProvider" entries that are redundant with the
top-level "./stream-provider" and "./initializeInpageProvider"
subpath exports. The top-level entries also have JavaScript redirect
files for build systems that don't support export maps, so they are
strictly better supported.

Fixes MetaMask#393

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ZayanKhan-12
ZayanKhan-12 requested a review from a team as a code owner August 4, 2026 00:34
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Remove unnecessary export entries

1 participant