-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(notifications): cleanup notification subpath exports #4650
Conversation
Made it so that the critical subpaths are added (mocks and UI), the rest are inside the barrel file.
even thought this does not effect CI and testing, these errors were annoying and were fixed. These subpath package.json files do not require names
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@metamask/notification-services-controller", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internal subpath exports are using a package.json so this "file path" exists. This is so JS projects are able to resolve the subpath export path (TS projects correctly use the root package.json exports). This pattern was copied from redux-toolkit.
See this comment for more details:
#4604 (comment)
"version": "1.0.0", | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this to explicitly set these internal subpath exports to be private.
This shouldn't cause issues with publishing as these are not specified on root of the workspaces file.
If this does cause issues with publishing, I can revert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Explanation
This cleans up the notification team packages subpath exports (
@metamask/profile-sync-controller
&@metamask/notification-services-controller
).Packages will now only export:
/mocks
for accessing mock data (also available as a named export in root)/ui
for some UI/framework files for specific platforms (web vs mobile). This is subject to change (we may have a clearer distinction for platforms, such as a React folder vs ReactNative folder).We also fix a
jest-haste-map
silent error that was introduced due to subpath modules.**jest haste map silent error**
This was a silent error (CI still passes)
References
Changelog
@metamask/profile-sync-controller
jest-haste-map
errors.@metamask/notification-services-controller
jest-haste-map
errors./types
,/processors
,/constants
subpath exports. These are still accessible through root export.Checklist