From 79d90fadc4f336abc0513890d09921e44a11fd5e Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 24 Jun 2024 17:47:40 +0300 Subject: [PATCH] feat(utils): configure notification module by default (#7814) Add the notification module to `defineConfig` and configure the local notification module. --- .../common/__tests__/define-config.spec.ts | 60 +++++++++++++++++++ .../core/utils/src/common/define-config.ts | 15 +++++ 2 files changed, 75 insertions(+) diff --git a/packages/core/utils/src/common/__tests__/define-config.spec.ts b/packages/core/utils/src/common/__tests__/define-config.spec.ts index c57e54a9ce..53a3ad94b2 100644 --- a/packages/core/utils/src/common/__tests__/define-config.spec.ts +++ b/packages/core/utils/src/common/__tests__/define-config.spec.ts @@ -48,6 +48,21 @@ describe("defineConfig", function () { "resolve": "@medusajs/fulfillment", }, "inventoryService": true, + "notification": { + "options": { + "providers": [ + { + "options": { + "config": { + "local": {}, + }, + }, + "resolve": "@medusajs/notification-local", + }, + ], + }, + "resolve": "@medusajs/notification", + }, "order": true, "payment": true, "pricingService": true, @@ -138,6 +153,21 @@ describe("defineConfig", function () { "resolve": "./modules/github", }, "inventoryService": true, + "notification": { + "options": { + "providers": [ + { + "options": { + "config": { + "local": {}, + }, + }, + "resolve": "@medusajs/notification-local", + }, + ], + }, + "resolve": "@medusajs/notification", + }, "order": true, "payment": true, "pricingService": true, @@ -225,6 +255,21 @@ describe("defineConfig", function () { "resolve": "@medusajs/fulfillment", }, "inventoryService": true, + "notification": { + "options": { + "providers": [ + { + "options": { + "config": { + "local": {}, + }, + }, + "resolve": "@medusajs/notification-local", + }, + ], + }, + "resolve": "@medusajs/notification", + }, "order": true, "payment": true, "pricingService": true, @@ -314,6 +359,21 @@ describe("defineConfig", function () { "resolve": "@medusajs/fulfillment", }, "inventoryService": true, + "notification": { + "options": { + "providers": [ + { + "options": { + "config": { + "local": {}, + }, + }, + "resolve": "@medusajs/notification-local", + }, + ], + }, + "resolve": "@medusajs/notification", + }, "order": true, "payment": true, "pricingService": true, diff --git a/packages/core/utils/src/common/define-config.ts b/packages/core/utils/src/common/define-config.ts index 54f7d851af..55b9524ad8 100644 --- a/packages/core/utils/src/common/define-config.ts +++ b/packages/core/utils/src/common/define-config.ts @@ -114,6 +114,21 @@ export function defineConfig(config: Partial = {}): ConfigModule { ], }, }, + [Modules.NOTIFICATION]: { + resolve: "@medusajs/notification", + options: { + providers: [ + { + resolve: "@medusajs/notification-local", + options: { + config: { + local: {}, + }, + }, + }, + ], + }, + }, ...config.modules, }