From 4daa379a0d67b97530f9200ca3dc3efd00b7a9ec Mon Sep 17 00:00:00 2001 From: Prithpal Sooriya Date: Tue, 13 Aug 2024 14:44:32 +0100 Subject: [PATCH] refactor: add multiple file exports for notification-services-controller --- .../package.json | 50 +++++++++++++++++++ .../NotificationServicesController/index.ts | 3 +- .../index.ts | 3 +- packages/profile-sync-controller/package.json | 12 ++--- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/packages/notification-services-controller/package.json b/packages/notification-services-controller/package.json index a4d85db5a1f..ef759455435 100644 --- a/packages/notification-services-controller/package.json +++ b/packages/notification-services-controller/package.json @@ -22,6 +22,56 @@ "require": "./dist/index.js", "types": "./dist/types/index.d.ts" }, + "./notification-services": { + "import": "./dist/NotificationServicesController/index.mjs", + "require": "./dist/NotificationServicesController/index.js", + "types": "./dist/types/NotificationServicesController/index.d.ts" + }, + "./notification-services/types": { + "import": "./dist/NotificationServicesController/types/index.mjs", + "require": "./dist/NotificationServicesController/types/index.js", + "types": "./dist/types/NotificationServicesController/types/index.d.ts" + }, + "./notification-services/processors": { + "import": "./dist/NotificationServicesController/processors/index.mjs", + "require": "./dist/NotificationServicesController/processors/index.js", + "types": "./dist/types/NotificationServicesController/processors/index.d.ts" + }, + "./notification-services/constants": { + "import": "./dist/NotificationServicesController/constants/index.mjs", + "require": "./dist/NotificationServicesController/constants/index.js", + "types": "./dist/types/NotificationServicesController/constants/index.d.ts" + }, + "./notification-services/ui": { + "import": "./dist/NotificationServicesController/ui/index.mjs", + "require": "./dist/NotificationServicesController/ui/index.js", + "types": "./dist/types/NotificationServicesController/ui/index.d.ts" + }, + "./notification-services/__mocks__": { + "import": "./dist/NotificationServicesController/__fixtures__/index.mjs", + "req__fixtures__re": "./dist/NotificationServicesController/__fixtures__/index.js", + "types": "./dist/types/NotificationServicesController/__fixtures__/index.d.ts" + }, + "./push-services": { + "import": "./dist/NotificationServicesPushController/index.mjs", + "require": "./dist/NotificationServicesPushController/index.js", + "types": "./dist/types/NotificationServicesPushController/index.d.ts" + }, + "./push-services/types": { + "import": "./dist/NotificationServicesPushController/types/index.mjs", + "require": "./dist/NotificationServicesPushController/types/index.js", + "types": "./dist/types/NotificationServicesPushController/types/index.d.ts" + }, + "./push-services/utils": { + "import": "./dist/NotificationServicesPushController/utils/index.mjs", + "require": "./dist/NotificationServicesPushController/utils/index.js", + "types": "./dist/types/NotificationServicesPushController/utils/index.d.ts" + }, + "./push-services/__mocks__": { + "import": "./dist/NotificationServicesPushController/__fixtures__/index.mjs", + "require": "./dist/NotificationServicesPushController/__fixtures__/index.js", + "types": "./dist/types/NotificationServicesPushController/__fixtures__/index.d.ts" + }, "./package.json": "./package.json" }, "main": "./dist/index.js", diff --git a/packages/notification-services-controller/src/NotificationServicesController/index.ts b/packages/notification-services-controller/src/NotificationServicesController/index.ts index f94a1255fcf..4a5de527bbc 100644 --- a/packages/notification-services-controller/src/NotificationServicesController/index.ts +++ b/packages/notification-services-controller/src/NotificationServicesController/index.ts @@ -1,9 +1,10 @@ import Controller from './NotificationServicesController'; +const NotificationServicesController = Controller; export { Controller }; +export default NotificationServicesController; export * from './NotificationServicesController'; export * as Types from './types'; -export * as Mocks from './__fixtures__'; export * as Processors from './processors'; export * as Constants from './constants'; export * as UI from './ui'; diff --git a/packages/notification-services-controller/src/NotificationServicesPushController/index.ts b/packages/notification-services-controller/src/NotificationServicesPushController/index.ts index 012dd290255..d1024c78d2a 100644 --- a/packages/notification-services-controller/src/NotificationServicesPushController/index.ts +++ b/packages/notification-services-controller/src/NotificationServicesPushController/index.ts @@ -1,7 +1,8 @@ import Controller from './NotificationServicesPushController'; +const NotificationServicesPushController = Controller; export { Controller }; +export default NotificationServicesPushController; export * from './NotificationServicesPushController'; export * as Types from './types'; export * as Utils from './utils'; -export * as Mocks from './__fixtures__'; diff --git a/packages/profile-sync-controller/package.json b/packages/profile-sync-controller/package.json index e6bb8d78380..539a5830c11 100644 --- a/packages/profile-sync-controller/package.json +++ b/packages/profile-sync-controller/package.json @@ -32,17 +32,17 @@ "require": "./dist/controllers/authentication/index.js", "types": "./dist/types/controllers/authentication/index.d.ts" }, + "./auth/__mocks__": { + "import": "./dist/controllers/authentication/__fixtures__/index.mjs", + "require": "./dist/controllers/authentication/__fixtures__/index.js", + "types": "./dist/types/controllers/authentication/__fixtures__/index.d.ts" + }, "./user-storage": { "import": "./dist/controllers/user-storage/index.mjs", "require": "./dist/controllers/user-storage/index.js", "types": "./dist/types/controllers/user-storage/index.d.ts" }, - "./dist/mocks/auth": { - "import": "./dist/controllers/authentication/__fixtures__/index.mjs", - "require": "./dist/controllers/authentication/__fixtures__/index.js", - "types": "./dist/types/controllers/authentication/__fixtures__/index.d.ts" - }, - "./dist/mocks/user-storage": { + "./user-storage/__mocks__": { "import": "./dist/controllers/user-storage/__fixtures__/index.mjs", "require": "./dist/controllers/user-storage/__fixtures__/index.js", "types": "./dist/types/controllers/user-storage/__fixtures__/index.d.ts"