chore: remove obsolete dist export entries - #430
Open
ZayanKhan-12 wants to merge 2 commits into
Open
Conversation
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>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
package.jsonexportsmap contained obsolete./dist/StreamProviderand./dist/initializeInpageProviderentries. These are redundant with the canonical top-level subpath exports (./stream-providerand./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 intodist/, which are not subject to theexportsmap.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— passesrequire.resolveand ESMimport.meta.resolvevia package self-reference):@metamask/providers,@metamask/providers/stream-provider,@metamask/providers/initializeInpageProvider, and@metamask/providers/package.jsonall resolve correctly for bothrequireandimportconditions@metamask/providers/dist/StreamProviderand@metamask/providers/dist/initializeInpageProvidernow correctly fail withERR_PACKAGE_PATH_NOT_EXPORTEDyarn jest— all 8 suites / 130 tests passyarn lint:eslintandyarn 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.jsonexport subpaths@metamask/providers/dist/StreamProviderand@metamask/providers/dist/initializeInpageProvider. Imports through those paths now fail withERR_PACKAGE_PATH_NOT_EXPORTED.Consumers should use
@metamask/providers/stream-providerand@metamask/providers/initializeInpageProviderinstead; 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.