From 71ebcd1bd06de864e44171863604348e01175c83 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Thu, 18 Jul 2024 19:59:53 +0300 Subject: [PATCH] docs: fix module definition for providers (#8180) --- .../src/constants/merger-custom-options/auth-provider.ts | 9 ++++----- .../src/constants/merger-custom-options/file.ts | 9 ++++----- .../merger-custom-options/fulfillment-provider.ts | 9 ++++----- .../src/constants/merger-custom-options/notification.ts | 9 ++++----- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/auth-provider.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/auth-provider.ts index e8b98ffb1e..c9ab88957f 100644 --- a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/auth-provider.ts +++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/auth-provider.ts @@ -39,14 +39,13 @@ Create the file \`src/modules/my-auth/index.ts\` with the following content: \`\`\`ts title="src/modules/my-auth/index.ts" import MyAuthProviderService from "./service" -import { Module } from "@medusajs/utils" -export default Module("my-auth", { - service: MyAuthProviderService, -}) +export default { + services: [MyAuthProviderService], +} \`\`\` -This exports the module's definition, indicating that the \`MyAuthProviderService\` is the main service of the module.`, +This exports the module's definition, indicating that the \`MyAuthProviderService\` is the module's service.`, `## 4. Use Module To use your Auth Provider Module, add it to the \`providers\` array of the Auth Module: diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/file.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/file.ts index 541ed83f74..31f4b6f149 100644 --- a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/file.ts +++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/file.ts @@ -39,14 +39,13 @@ Create the file \`src/modules/my-file/index.ts\` with the following content: \`\`\`ts title="src/modules/my-file/index.ts" import MyFileProviderService from "./service" -import { Module } from "@medusajs/utils" -export default Module("my-file", { - service: MyFileProviderService, -}) +export default { + services: [MyFileProviderService], +} \`\`\` -This exports the module's definition, indicating that the \`MyFileProviderService\` is the main service of the module.`, +This exports the module's definition, indicating that the \`MyFileProviderService\` is the module's service.`, `## 4. Use Module To use your File Provider Module, add it to the \`providers\` array of the File Module: diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/fulfillment-provider.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/fulfillment-provider.ts index 54b8475ace..1bc3f75bd7 100644 --- a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/fulfillment-provider.ts +++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/fulfillment-provider.ts @@ -39,14 +39,13 @@ Create the file \`src/modules/my-fulfillment/index.ts\` with the following conte \`\`\`ts title="src/modules/my-fulfillment/index.ts" import MyFulfillmentProviderService from "./service" -import { Module } from "@medusajs/utils" -export default Module("my-fulfillment", { - service: MyFulfillmentProviderService, -}) +export default { + services: [MyFulfillmentProviderService], +} \`\`\` -This exports the module's definition, indicating that the \`MyFulfillmentProviderService\` is the main service of the module.`, +This exports the module's definition, indicating that the \`MyFulfillmentProviderService\` is the module's service.`, `## 4. Use Module To use your Fulfillment Provider Module, add it to the \`providers\` array of the Fulfillment Module: diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/notification.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/notification.ts index 18c35ba19b..4bd8d83401 100644 --- a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/notification.ts +++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/notification.ts @@ -43,14 +43,13 @@ Create the file \`src/modules/my-notification/index.ts\` with the following cont \`\`\`ts title="src/modules/my-notification/index.ts" import MyNotificationProviderService from "./service" -import { Module } from "@medusajs/utils" -export default Module("my-notification", { - service: MyNotificationProviderService, -}) +export default { + services: [MyNotificationProviderService], +} \`\`\` -This exports the module's definition, indicating that the \`MyNotificationProviderService\` is the main service of the module.`, +This exports the module's definition, indicating that the \`MyNotificationProviderService\` is the module's service.`, `## 4. Use Module To use your Notification Provider Module, add it to the \`providers\` array of the Notification Module: