-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add multiple file exports for notifications controllers (#4604
) ## Explanation This adds multiple exports to the `@metamask/profile-sync-controller` and `@metamask/notification-services-controller`. This will allow classes, functions, variables to be imported more naturally compared to the named exports. This will _potentially_ help with tree shaking. List of all imports: ```ts // Profile Sync Controller import {} from '@metamask/profile-sync-controller' import {} from '@metamask/profile-sync-controller/auth' import {} from '@metamask/profile-sync-controller/auth/mocks' import {} from '@metamask/profile-sync-controller/user-storage' import {} from '@metamask/profile-sync-controller/user-storage/mocks' import {} from '@metamask/profile-sync-controller/sdk' // Notification Services import {} from '@metamask/notification-services-controller' import {} from '@metamask/notification-services-controller/notification-services' import {} from '@metamask/notification-services-controller/notification-services/types' import {} from '@metamask/notification-services-controller/notification-services/processors' import {} from '@metamask/notification-services-controller/notification-services/constants' import {} from '@metamask/notification-services-controller/notification-services/ui' import {} from '@metamask/notification-services-controller/notification-services/mocks' import {} from '@metamask/notification-services-controller/push-services' import {} from '@metamask/notification-services-controller/push-services/types' import {} from '@metamask/notification-services-controller/push-services/utils' import {} from '@metamask/notification-services-controller/push-services/mocks' ``` NOTE - we will keep backwards compatibility with named exports. I think we'll also probably export all (e.g `export * ...`) to flatten the named exports structure. ## References N/A ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/package-a` - **<CATEGORY>**: Your change here - **<CATEGORY>**: Your change here ### `@metamask/package-b` - **<CATEGORY>**: Your change here - **<CATEGORY>**: Your change here ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate
- Loading branch information
1 parent
b43ae02
commit ecb96d6
Showing
24 changed files
with
231 additions
and
10 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/notification-services-controller/notification-services/constants/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/notification-services-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../../dist/NotificationServicesController/constants/index.js", | ||
"types": "../../dist/types/NotificationServicesController/constants/index.d.ts" | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/notification-services-controller/notification-services/mocks/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/notification-services-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../../dist/NotificationServicesController/__fixtures__/index.js", | ||
"types": "../../dist/types/NotificationServicesController/__fixtures__/index.d.ts" | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/notification-services-controller/notification-services/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/notification-services-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../dist/NotificationServicesController/index.js", | ||
"types": "../dist/types/NotificationServicesController/index.d.ts" | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/notification-services-controller/notification-services/processors/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/notification-services-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../../dist/NotificationServicesController/processors/index.js", | ||
"types": "../../dist/types/NotificationServicesController/processors/index.d.ts" | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/notification-services-controller/notification-services/types/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/notification-services-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../../dist/NotificationServicesController/types/index.js", | ||
"types": "../../dist/types/NotificationServicesController/types/index.d.ts" | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/notification-services-controller/notification-services/ui/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/notification-services-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../../dist/NotificationServicesController/ui/index.js", | ||
"types": "../../dist/types/NotificationServicesController/ui/index.d.ts" | ||
} |
This file contains 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
9 changes: 9 additions & 0 deletions
9
packages/notification-services-controller/push-services/mocks/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/notification-services-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../../dist/NotificationServicesPushController/__fixtures__/index.js", | ||
"types": "../../dist/types/NotificationServicesPushController/__fixtures__/index.d.ts" | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/notification-services-controller/push-services/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/notification-services-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../dist/NotificationServicesPushController/index.js", | ||
"types": "../dist/types/NotificationServicesPushController/index.d.ts" | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/notification-services-controller/push-services/types/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/notification-services-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../../dist/NotificationServicesPushController/types/index.js", | ||
"types": "../../dist/types/NotificationServicesPushController/types/index.d.ts" | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/notification-services-controller/push-services/utils/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/notification-services-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../../dist/NotificationServicesPushController/utils/index.js", | ||
"types": "../../dist/types/NotificationServicesPushController/utils/index.d.ts" | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/notification-services-controller/src/NotificationServicesController/index.ts
This file contains 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
2 changes: 2 additions & 0 deletions
2
packages/notification-services-controller/src/NotificationServicesPushController/index.ts
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/profile-sync-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../../dist/controllers/authentication/__fixtures__/index.js", | ||
"types": "../../dist/types/controllers/authentication/__fixtures__/index.d.ts" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/profile-sync-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../dist/controllers/authentication/index.js", | ||
"types": "../dist/types/controllers/authentication/index.d.ts" | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/profile-sync-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../dist/sdk/index.js", | ||
"types": "../dist/types/sdk/index.d.ts" | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/profile-sync-controller/src/controllers/authentication/index.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import Controller from './AuthenticationController'; | ||
|
||
const AuthenticationController = Controller; | ||
export { Controller }; | ||
export default AuthenticationController; | ||
export * from './AuthenticationController'; | ||
export * as Mocks from './__fixtures__'; |
2 changes: 1 addition & 1 deletion
2
packages/profile-sync-controller/src/controllers/authentication/services.ts
This file contains 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
2 changes: 2 additions & 0 deletions
2
packages/profile-sync-controller/src/controllers/user-storage/index.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import Controller from './UserStorageController'; | ||
|
||
const UserStorageController = Controller; | ||
export { Controller }; | ||
export default UserStorageController; | ||
export * from './UserStorageController'; | ||
export * from './encryption'; | ||
export * as Mocks from './__fixtures__'; |
2 changes: 1 addition & 1 deletion
2
packages/profile-sync-controller/src/controllers/user-storage/services.ts
This file contains 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
9 changes: 9 additions & 0 deletions
9
packages/profile-sync-controller/user-storage/mocks/package.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/profile-sync-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../../dist/controllers/user-storage/__fixtures__/index.js", | ||
"types": "../../dist/types/controllers/user-storage/__fixtures__/index.d.ts" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@metamask/profile-sync-controller", | ||
"version": "1.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "../dist/controllers/user-storage/index.js", | ||
"types": "../dist/types/controllers/user-storage/index.d.ts" | ||
} |