docs: update providers to use ModuleProvider (#9579)

Document change introduced by #9544

> Note: fine to merge now as it requires generating references, which will only happen after the next release.
This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-10-16 11:37:14 +00:00
1 parent 3610d58f49
commit ea5bff9034
6 files changed
+31 -11

No files matched your search

@@ -62,7 +62,7 @@ const customOptions: Record<string, Partial<TypeDocOptions>> = {
], ],
}), }),
"medusa-config": getOptions({ "medusa-config": getOptions({
entryPointPath: "packages/frameworksrc/config/types.ts", entryPointPath: "packages/framework/src/config/types.ts",
tsConfigName: "framework.json", tsConfigName: "framework.json",
name: "medusa-config", name: "medusa-config",
}), }),
@@ -39,10 +39,14 @@ Create the file \`src/modules/my-auth/index.ts\` with the following content:
\`\`\`ts title="src/modules/my-auth/index.ts" \`\`\`ts title="src/modules/my-auth/index.ts"
import MyAuthProviderService from "./service" import MyAuthProviderService from "./service"
import {
ModuleProvider,
Modules
} from "@medusajs/framework/utils"
export default { export default ModuleProvider(Modules.AUTH, {
services: [MyAuthProviderService], services: [MyAuthProviderService],
} })
\`\`\` \`\`\`
This exports the module's definition, indicating that the \`MyAuthProviderService\` is the module's service.`, This exports the module's definition, indicating that the \`MyAuthProviderService\` is the module's service.`,
@@ -39,10 +39,14 @@ Create the file \`src/modules/my-file/index.ts\` with the following content:
\`\`\`ts title="src/modules/my-file/index.ts" \`\`\`ts title="src/modules/my-file/index.ts"
import MyFileProviderService from "./service" import MyFileProviderService from "./service"
import {
ModuleProvider,
Modules
} from "@medusajs/framework/utils"
export default { export default ModuleProvider(Modules.FILE, {
services: [MyFileProviderService], services: [MyFileProviderService],
} })
\`\`\` \`\`\`
This exports the module's definition, indicating that the \`MyFileProviderService\` is the module's service.`, This exports the module's definition, indicating that the \`MyFileProviderService\` is the module's service.`,
@@ -39,10 +39,14 @@ Create the file \`src/modules/my-fulfillment/index.ts\` with the following conte
\`\`\`ts title="src/modules/my-fulfillment/index.ts" \`\`\`ts title="src/modules/my-fulfillment/index.ts"
import MyFulfillmentProviderService from "./service" import MyFulfillmentProviderService from "./service"
import {
ModuleProvider,
Modules
} from "@medusajs/framework/utils"
export default { export default ModuleProvider(Modules.FULFILLMENT, {
services: [MyFulfillmentProviderService], services: [MyFulfillmentProviderService],
} })
\`\`\` \`\`\`
This exports the module's definition, indicating that the \`MyFulfillmentProviderService\` is the module's service.`, This exports the module's definition, indicating that the \`MyFulfillmentProviderService\` is the module's service.`,
@@ -43,10 +43,14 @@ Create the file \`src/modules/my-notification/index.ts\` with the following cont
\`\`\`ts title="src/modules/my-notification/index.ts" \`\`\`ts title="src/modules/my-notification/index.ts"
import MyNotificationProviderService from "./service" import MyNotificationProviderService from "./service"
import {
ModuleProvider,
Modules
} from "@medusajs/framework/utils"
export default { export default ModuleProvider(Modules.NOTIFICATION, {
services: [MyNotificationProviderService], services: [MyNotificationProviderService],
} })
\`\`\` \`\`\`
This exports the module's definition, indicating that the \`MyNotificationProviderService\` is the module's service.`, This exports the module's definition, indicating that the \`MyNotificationProviderService\` is the module's service.`,
@@ -48,10 +48,14 @@ Create the file \`src/modules/my-payment/index.ts\` with the following content:
\`\`\`ts title="src/modules/my-payment/index.ts" \`\`\`ts title="src/modules/my-payment/index.ts"
import MyPaymentProviderService from "./service" import MyPaymentProviderService from "./service"
import {
ModuleProvider,
Modules
} from "@medusajs/framework/utils"
export default { export default ModuleProvider(Modules.PAYMENT, {
services: [MyPaymentProviderService], services: [MyPaymentProviderService],
} })
\`\`\` \`\`\`
This exports the module's definition, indicating that the \`MyPaymentProviderService\` is the module's service.`, This exports the module's definition, indicating that the \`MyPaymentProviderService\` is the module's service.`,