docs: document module providers in plugins (#11360)
* docs: document module providers in plugins * small fixes * add missing title
This commit is contained in:
+12
-2
@@ -10,9 +10,18 @@ In this document, you’ll learn how to create an auth provider module and the m
|
||||
|
||||
---
|
||||
|
||||
## 1. Create Module Directory
|
||||
## 1. Create Module Provider Directory
|
||||
|
||||
Start by creating a new directory for your module. For example, `src/modules/my-auth`.
|
||||
Start by creating a new directory for your module provider.
|
||||
|
||||
If you're creating the module provider in a Medusa application, create it under the `src/modules` directory. For example, `src/modules/my-auth`.
|
||||
If you're creating the module provider in a plugin, create it under the `src/providers` directory. For example, `src/providers/my-auth`.
|
||||
|
||||
<Note>
|
||||
|
||||
The rest of this guide always uses the `src/modules/my-auth` directory as an example.
|
||||
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
@@ -479,6 +488,7 @@ module.exports = defineConfig({
|
||||
id: "emailpass",
|
||||
},
|
||||
{
|
||||
// if module provider is in a plugin, use `plugin-name/providers/my-auth`
|
||||
resolve: "./src/modules/my-auth",
|
||||
id: "my-auth",
|
||||
dependencies: [Modules.CACHE, ContainerRegistrationKeys.LOGGER],
|
||||
|
||||
+12
-2
@@ -10,9 +10,18 @@ In this document, you’ll learn how to create a file provider module and the me
|
||||
|
||||
---
|
||||
|
||||
## 1. Create Module Directory
|
||||
## Create Module Provider Directory
|
||||
|
||||
Start by creating a new directory for your module. For example, `src/modules/my-file`.
|
||||
Start by creating a new directory for your module provider.
|
||||
|
||||
If you're creating the module provider in a Medusa application, create it under the `src/modules` directory. For example, `src/modules/my-file`.
|
||||
If you're creating the module provider in a plugin, create it under the `src/providers` directory. For example, `src/providers/my-file`.
|
||||
|
||||
<Note>
|
||||
|
||||
The rest of this guide always uses the `src/modules/my-file` directory as an example.
|
||||
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
@@ -251,6 +260,7 @@ module.exports = defineConfig({
|
||||
id: "local",
|
||||
},
|
||||
{
|
||||
// if module provider is in a plugin, use `plugin-name/providers/my-file`
|
||||
resolve: "./src/modules/my-file",
|
||||
id: "my-file",
|
||||
options: {
|
||||
|
||||
+12
-2
@@ -10,9 +10,18 @@ In this document, you’ll learn how to create a fulfillment provider module and
|
||||
|
||||
---
|
||||
|
||||
## 1. Create Module Directory
|
||||
## 1. Create Module Provider Directory
|
||||
|
||||
Start by creating a new directory for your module. For example, `src/modules/my-fulfillment`.
|
||||
Start by creating a new directory for your module provider.
|
||||
|
||||
If you're creating the module provider in a Medusa application, create it under the `src/modules` directory. For example, `src/modules/my-fulfillment`.
|
||||
If you're creating the module provider in a plugin, create it under the `src/providers` directory. For example, `src/providers/my-fulfillment`.
|
||||
|
||||
<Note>
|
||||
|
||||
The rest of this guide always uses the `src/modules/my-fulfillment` directory as an example.
|
||||
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
@@ -534,6 +543,7 @@ module.exports = defineConfig({
|
||||
id: "manual",
|
||||
},
|
||||
{
|
||||
// if module provider is in a plugin, use `plugin-name/providers/my-fulfillment`
|
||||
resolve: "./src/modules/my-fulfillment",
|
||||
id: "my-fulfillment",
|
||||
options: {
|
||||
|
||||
+12
-2
@@ -10,9 +10,18 @@ In this document, you’ll learn how to create a notification provider module an
|
||||
|
||||
---
|
||||
|
||||
## 1. Create Module Directory
|
||||
## 1. Create Module Provider Directory
|
||||
|
||||
Start by creating a new directory for your module. For example, `src/modules/my-notification`.
|
||||
Start by creating a new directory for your module provider.
|
||||
|
||||
If you're creating the module provider in a Medusa application, create it under the `src/modules` directory. For example, `src/modules/my-notification`.
|
||||
If you're creating the module provider in a plugin, create it under the `src/providers` directory. For example, `src/providers/my-notification`.
|
||||
|
||||
<Note>
|
||||
|
||||
The rest of this guide always uses the `src/modules/my-notification` directory as an example.
|
||||
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
@@ -192,6 +201,7 @@ module.exports = defineConfig({
|
||||
},
|
||||
},
|
||||
{
|
||||
// if module provider is in a plugin, use `plugin-name/providers/my-notification`
|
||||
resolve: "./src/modules/my-notification",
|
||||
id: "my-notification",
|
||||
options: {
|
||||
|
||||
+12
-2
@@ -10,9 +10,18 @@ In this document, you’ll learn how to create a Payment Provider to be used wit
|
||||
|
||||
---
|
||||
|
||||
## 1. Create Module Directory
|
||||
## 1. Create Module Provider Directory
|
||||
|
||||
Start by creating a new directory for your module. For example, `src/modules/my-payment`.
|
||||
Start by creating a new directory for your module provider.
|
||||
|
||||
If you're creating the module provider in a Medusa application, create it under the `src/modules` directory. For example, `src/modules/my-payment`.
|
||||
If you're creating the module provider in a plugin, create it under the `src/providers` directory. For example, `src/providers/my-payment`.
|
||||
|
||||
<Note>
|
||||
|
||||
The rest of this guide always uses the `src/modules/my-payment` directory as an example.
|
||||
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
@@ -742,6 +751,7 @@ module.exports = defineConfig({
|
||||
options: {
|
||||
providers: [
|
||||
{
|
||||
// if module provider is in a plugin, use `plugin-name/providers/my-payment`
|
||||
resolve: "./src/modules/my-payment",
|
||||
id: "my-payment",
|
||||
options: {
|
||||
|
||||
Reference in New Issue
Block a user