diff --git a/www/apps/book/app/advanced-development/api-routes/cors/page.mdx b/www/apps/book/app/advanced-development/api-routes/cors/page.mdx
index 02e359dce3..98f935959a 100644
--- a/www/apps/book/app/advanced-development/api-routes/cors/page.mdx
+++ b/www/apps/book/app/advanced-development/api-routes/cors/page.mdx
@@ -20,7 +20,7 @@ These configurations accept a URL pattern to identify allowed origins.
For example:
-```js title="medusa-config.js"
+```js title="medusa-config.ts"
module.exports = defineConfig({
projectConfig: {
http: {
@@ -78,7 +78,7 @@ You can do that in the exported middlewares configurations in `src/api/middlewar
For example:
-export const highlights = [["25", "parseCorsOrigins", "A utility function that parses the CORS configurations in `medusa-config.js`"]]
+export const highlights = [["25", "parseCorsOrigins", "A utility function that parses the CORS configurations in `medusa-config.ts`"]]
```ts title="src/api/middlewares.ts" highlights={highlights} collapsibleLines="1-10" expandButtonLabel="Show Imports"
import { defineMiddlewares } from "@medusajs/medusa"
@@ -117,4 +117,4 @@ export default defineMiddlewares({
})
```
-This retrieves the configurations exported from `medusa-config.js` and applies the `storeCors` to routes starting with `/custom`.
+This retrieves the configurations exported from `medusa-config.ts` and applies the `storeCors` to routes starting with `/custom`.
diff --git a/www/apps/book/app/advanced-development/modules/container/page.mdx b/www/apps/book/app/advanced-development/modules/container/page.mdx
index e87f30f385..e4a11530bc 100644
--- a/www/apps/book/app/advanced-development/modules/container/page.mdx
+++ b/www/apps/book/app/advanced-development/modules/container/page.mdx
@@ -27,7 +27,7 @@ A service's constructor accepts as a first parameter an object used to resolve r
For example:
```ts highlights={[["4"], ["10"]]}
-import { Logger } from "@medusajs/medusa"
+import { Logger } from "@medusajs/framework/types"
type InjectedDependencies = {
logger: Logger
@@ -56,12 +56,14 @@ For example:
import {
LoaderOptions,
} from "@medusajs/framework/modules-sdk"
-import { Logger } from "@medusajs/medusa"
+import {
+ ContainerRegistrationKeys
+} from "@medusajs/framework/utils"
export default async function helloWorldLoader({
container,
}: LoaderOptions) {
- const logger: Logger = container.resolve("logger")
+ const logger = container.resolve(ContainerRegistrationKeys.LOGGER)
logger.info("[helloWorldLoader]: Hello, World!")
}
diff --git a/www/apps/book/app/advanced-development/modules/multiple-services/page.mdx b/www/apps/book/app/advanced-development/modules/multiple-services/page.mdx
index ed4cf770f0..23d1dc5701 100644
--- a/www/apps/book/app/advanced-development/modules/multiple-services/page.mdx
+++ b/www/apps/book/app/advanced-development/modules/multiple-services/page.mdx
@@ -100,7 +100,7 @@ export class ClientService {
Your internal service can't access the module's options.
-To retrieve the module's options, use the `configModule` registered in the module's container, which is the configurations in `medusa-config.js`.
+To retrieve the module's options, use the `configModule` registered in the module's container, which is the configurations in `medusa-config.ts`.
For example:
diff --git a/www/apps/book/app/advanced-development/modules/options/page.mdx b/www/apps/book/app/advanced-development/modules/options/page.mdx
index 85131ff9b0..78289eb80d 100644
--- a/www/apps/book/app/advanced-development/modules/options/page.mdx
+++ b/www/apps/book/app/advanced-development/modules/options/page.mdx
@@ -16,21 +16,21 @@ For example, if you’re creating a module that integrates a third-party service
## How to Pass Options to a Module?
-To pass options to a module, add an `options` property to the module’s configuration in `medusa-config.js`.
+To pass options to a module, add an `options` property to the module’s configuration in `medusa-config.ts`.
For example:
-```js title="medusa-config.js"
+```js title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
- helloModuleService: {
+ modules: [
+ {
resolve: "./modules/hello",
options: {
capitalize: true,
},
},
- },
+ ]
})
```
diff --git a/www/apps/book/app/basics/modules/page.mdx b/www/apps/book/app/basics/modules/page.mdx
index 6cfaafe458..2dca6f60a1 100644
--- a/www/apps/book/app/basics/modules/page.mdx
+++ b/www/apps/book/app/basics/modules/page.mdx
@@ -118,37 +118,29 @@ export default Module(HELLO_MODULE, {
You use the `Module` function imported from `@medusajs/framework/utils` to create the module's definition. It accepts two parameters:
-1. The module's name.
+1. The name that the module's main service is registered under (`helloModuleService`).
2. An object with a required property `service` indicating the module's main service.
### 4. Add Module to Configurations
The last step is to add the module in Medusa’s configurations.
-In `medusa-config.js`, add a `modules` property and pass to it your custom module:
+In `medusa-config.ts`, add a `modules` property and pass in it your custom module:
-```js title="medusa-config.js" highlights={[["6", "helloModuleService", "The key of the main service to be registered in the Medusa container."]]}
+```ts title="medusa-config.ts" highlights={[["6", "helloModuleService", "The key of the main service to be registered in the Medusa container."]]}
module.exports = defineConfig({
projectConfig: {
// ...
},
- modules: {
- helloModuleService: {
+ modules: [
+ {
resolve: "./modules/hello",
- },
- },
+ }
+ ]
})
```
-The key `helloModuleService` is the name of the module’s main service. It will be registered in the Medusa container with that name.
-
-
-
-The key must be the same value passed as the first parameter to the `Module` function in the module's definition.
-
-
-
-Its value is an object having the `resolve` property, whose value is either a path to module's directory relative to `src` (it shouldn't include `src` in the path), or an `npm` package’s name.
+Its value is an array of objects, each having a `resolve` property, whose value is either a path to module's directory relative to `src` (it shouldn't include `src` in the path), or an `npm` package’s name.
### 5. Generate Migrations
diff --git a/www/apps/book/app/basics/project-directories-files/page.mdx b/www/apps/book/app/basics/project-directories-files/page.mdx
index d5d930c4c9..10fb80714b 100644
--- a/www/apps/book/app/basics/project-directories-files/page.mdx
+++ b/www/apps/book/app/basics/project-directories-files/page.mdx
@@ -18,6 +18,6 @@ This directory is the central place for your custom development. It includes the
- `subscribers`: Holds your event listeners that are executed asynchronously whenever an event is emitted.
- `workflows`: Holds your custom flows that can be executed from anywhere in your application.
-## medusa-config.js
+## medusa-config.ts
This file holds your Medusa configurations, such as your PostgreSQL database configurations.
diff --git a/www/apps/book/app/customization/custom-features/module/page.mdx b/www/apps/book/app/customization/custom-features/module/page.mdx
index 2b22ef4e55..ae3927d764 100644
--- a/www/apps/book/app/customization/custom-features/module/page.mdx
+++ b/www/apps/book/app/customization/custom-features/module/page.mdx
@@ -97,16 +97,16 @@ Learn more about modules and services [in this guide](../../../basics/modules/pa
## 5. Register Module in Config
-Finally, add the module to Medusa's configurations in `medusa-config.js`:
+Finally, add the module to Medusa's configurations in `medusa-config.ts`:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
- brandModuleService: {
+ modules: [
+ {
resolve: "./modules/brand",
- },
- },
+ }
+ ]
})
```
diff --git a/www/apps/book/app/customization/integrate-systems/service/page.mdx b/www/apps/book/app/customization/integrate-systems/service/page.mdx
index 260d5d5224..0cbb8a5877 100644
--- a/www/apps/book/app/customization/integrate-systems/service/page.mdx
+++ b/www/apps/book/app/customization/integrate-systems/service/page.mdx
@@ -61,7 +61,7 @@ export class BrandClient {
This creates a `BrandClient` service. Using dependency injection, you resolve the `logger` and `configModule` from the Module's container.
-`logger` is useful to log messages, and `configModule` has configurations exported in `medusa-config.js`.
+`logger` is useful to log messages, and `configModule` has configurations exported in `medusa-config.ts`.
You also define an `options_` property in your service to store the module's options.
@@ -180,19 +180,19 @@ In the main module service, you first resolve through dependency injection the `
## 4. Pass Options to the Module
-To pass options in the module, change its configurations in `medusa-config.js`:
+To pass options in the module, change its configurations in `medusa-config.ts`:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
- brandModuleService: {
+ modules: [
+ {
resolve: "./modules/brand",
options: {
apiKey: process.env.BRAND_API_KEY || "temp",
},
},
- },
+ ]
})
```
diff --git a/www/apps/book/app/debugging-and-testing/instrumentation/page.mdx b/www/apps/book/app/debugging-and-testing/instrumentation/page.mdx
index d34c03140d..e853f0fcd4 100644
--- a/www/apps/book/app/debugging-and-testing/instrumentation/page.mdx
+++ b/www/apps/book/app/debugging-and-testing/instrumentation/page.mdx
@@ -44,14 +44,13 @@ Also, install the dependencies relevant for the exporter you use. If you're usin
npm install @opentelemetry/exporter-zipkin
```
-### Add instrumentation.js
+### Add instrumentation.ts
-Next, create the file `instrumentation.js` with the following content:
+Next, create the file `instrumentation.ts` with the following content:
-```js title="instrumentation.js"
-const { registerOtel } = require("@medusajs/medusa")
-// If using an exporter other than Zipkin, require it here.
-const { ZipkinExporter } = require("@opentelemetry/exporter-zipkin")
+```ts title="instrumentation.ts"
+import { registerOtel } from "@medusajs/medusa"
+import { ZipkinExporter } from "@opentelemetry/exporter-zipkin"
// If using an exporter other than Zipkin, initialize it here.
const exporter = new ZipkinExporter({
@@ -72,7 +71,7 @@ export function register() {
}
```
-In the `instrumentation.js` file, you export a `register` function that uses Medusa's `registerOtel` utility function.
+In the `instrumentation.ts` file, you export a `register` function that uses Medusa's `registerOtel` utility function.
You also initialize an instance of the exporter, such as Zipkin, and pass it to the `registerOtel` function.
diff --git a/www/apps/book/app/debugging-and-testing/logging/page.mdx b/www/apps/book/app/debugging-and-testing/logging/page.mdx
index 7cc54c5d9a..e76963d57b 100644
--- a/www/apps/book/app/debugging-and-testing/logging/page.mdx
+++ b/www/apps/book/app/debugging-and-testing/logging/page.mdx
@@ -26,13 +26,13 @@ export const highlights = [
]
```ts title="src/jobs/log-message.ts" highlights={highlights}
-import { Logger } from "@medusajs/medusa"
import { MedusaContainer } from "@medusajs/framework/types"
+import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
export default async function myCustomJob(
container: MedusaContainer
) {
- const logger: Logger = container.resolve("logger")
+ const logger = container.resolve(ContainerRegistrationKeys.LOGGER)
logger.info("I'm using the logger!")
}
@@ -129,11 +129,14 @@ The `Logger` class has an `activity` method used to log a message of level `info
For example:
-```ts title="src/loaders/log-message.ts"
-import { Logger, MedusaContainer } from "@medusajs/medusa"
+```ts title="src/jobs/log-message.ts"
+import { MedusaContainer } from "@medusajs/framework/types"
+import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
-export default async (container: MedusaContainer) => {
- const logger = container.resolve("logger")
+export default async function myCustomJob(
+ container: MedusaContainer
+) {
+ const logger = container.resolve(ContainerRegistrationKeys.LOGGER)
const activityId = logger.activity("First log message")
@@ -141,7 +144,6 @@ export default async (container: MedusaContainer) => {
logger.success(activityId, "Last log message")
}
-
```
The `activity` method returns the ID of the started activity. This ID can then be passed to one of the following methods of the `Logger` class:
diff --git a/www/apps/resources/app/architectural-modules/cache/create/page.mdx b/www/apps/resources/app/architectural-modules/cache/create/page.mdx
index 4c9d1e83c4..73bb0d10d3 100644
--- a/www/apps/resources/app/architectural-modules/cache/create/page.mdx
+++ b/www/apps/resources/app/architectural-modules/cache/create/page.mdx
@@ -148,25 +148,25 @@ This exports the module's definition, indicating that the `MyCacheService` is th
## 4. Use Module
-To use your Cache Module, add it to the `modules` object exported as part of the configurations in `medusa-config.js`. A Cache Module is added under the `cacheService` key.
+To use your Cache Module, add it to the `modules` object exported as part of the configurations in `medusa-config.ts`. A Cache Module is added under the `cacheService` key.
For example:
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.CACHE]: {
+ modules: [
+ {
resolve: "./modules/my-cache",
options: {
// any options
ttl: 30,
},
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/architectural-modules/cache/in-memory/page.mdx b/www/apps/resources/app/architectural-modules/cache/in-memory/page.mdx
index d6a11dcd33..47ff9e87da 100644
--- a/www/apps/resources/app/architectural-modules/cache/in-memory/page.mdx
+++ b/www/apps/resources/app/architectural-modules/cache/in-memory/page.mdx
@@ -22,23 +22,22 @@ The In-Memory Cache Module is registered by default in your application.
-Add the module into the `modules` property of the exported object in `medusa-config.js`:
-
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+Add the module into the `modules` property of the exported object in `medusa-config.ts`:
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.CACHE]: {
- resolve: "@medusajs/medusa/cache-inmemory",
+ modules: [
+ {
+ resolve: "@medusajs/cache-inmemory",
options: {
// optional options
},
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/architectural-modules/cache/redis/page.mdx b/www/apps/resources/app/architectural-modules/cache/redis/page.mdx
index fb7dc2adc9..d82de35781 100644
--- a/www/apps/resources/app/architectural-modules/cache/redis/page.mdx
+++ b/www/apps/resources/app/architectural-modules/cache/redis/page.mdx
@@ -19,27 +19,27 @@ The Redis Cache Module uses Redis to cache data in your store. In production, it
}
]} />
-Add the module into the `modules` property of the exported object in `medusa-config.js`:
+Add the module into the `modules` property of the exported object in `medusa-config.ts`:
export const highlights = [
["11", "redisUrl", "The Redis connection URL."]
]
-```js title="medusa-config.js" highlights={highlights}
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts" highlights={highlights}
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.CACHE]: {
- resolve: "@medusajs/medusa/cache-redis",
+ modules: [
+ {
+ resolve: "@medusajs/cache-redis",
options: {
redisUrl: process.env.CACHE_REDIS_URL,
},
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/architectural-modules/event/create/page.mdx b/www/apps/resources/app/architectural-modules/event/create/page.mdx
index 474a8a0310..c34b9e1e83 100644
--- a/www/apps/resources/app/architectural-modules/event/create/page.mdx
+++ b/www/apps/resources/app/architectural-modules/event/create/page.mdx
@@ -103,24 +103,24 @@ This exports the module's definition, indicating that the `MyEventService` is th
## 4. Use Module
-To use your Event Module, add it to the `modules` object exported as part of the configurations in `medusa-config.js`. An Event Module is added under the `eventBus` key.
+To use your Event Module, add it to the `modules` object exported as part of the configurations in `medusa-config.ts`. An Event Module is added under the `eventBus` key.
For example:
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.EVENT_BUS]: {
+ modules: [
+ {
resolve: "./modules/my-event",
options: {
// any options
},
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/architectural-modules/event/local/page.mdx b/www/apps/resources/app/architectural-modules/event/local/page.mdx
index 5666d240ab..9cf554a96a 100644
--- a/www/apps/resources/app/architectural-modules/event/local/page.mdx
+++ b/www/apps/resources/app/architectural-modules/event/local/page.mdx
@@ -20,18 +20,20 @@ The Local Event Bus Module is registered by default in your application.
-Add the module into the `modules` property of the exported object in `medusa-config.js`:
+Add the module into the `modules` property of the exported object in `medusa-config.ts`:
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.EVENT_BUS]: true,
- },
+ modules: [
+ {
+ resolve: "@medusajs/event-bus-local"
+ }
+ ]
})
```
diff --git a/www/apps/resources/app/architectural-modules/event/redis/page.mdx b/www/apps/resources/app/architectural-modules/event/redis/page.mdx
index 98f42af3ce..45feabb361 100644
--- a/www/apps/resources/app/architectural-modules/event/redis/page.mdx
+++ b/www/apps/resources/app/architectural-modules/event/redis/page.mdx
@@ -23,27 +23,27 @@ In production, it's recommended to use this module.
}
]} />
-Add the module into the `modules` property of the exported object in `medusa-config.js`:
+Add the module into the `modules` property of the exported object in `medusa-config.ts`:
export const highlights = [
["11", "redisUrl", "The Redis connection URL."]
]
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.EVENT_BUS]: {
- resolve: "@medusajs/medusa/event-bus-redis",
+ modules: [
+ {
+ resolve: "@medusajs/event-bus-redis",
options: {
redisUrl: process.env.EVENTS_REDIS_URL,
},
- },
- },
+ }
+ ]
})
```
diff --git a/www/apps/resources/app/architectural-modules/file/local/page.mdx b/www/apps/resources/app/architectural-modules/file/local/page.mdx
index fddb557622..33d4a9e25c 100644
--- a/www/apps/resources/app/architectural-modules/file/local/page.mdx
+++ b/www/apps/resources/app/architectural-modules/file/local/page.mdx
@@ -32,20 +32,20 @@ The File Module accepts one provider only.
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = {
// ...
- modules: {
- [Modules.FILE]: {
- resolve: "@medusajs/medusa/file",
+ modules: [
+ {
+ resolve: "@medusajs/file",
options: {
providers: [
{
- resolve: "@medusajs/medusa/file-local-next",
+ resolve: "@medusajs/file-local-next",
id: "local",
options: {
// provider options...
@@ -54,7 +54,7 @@ module.exports = {
],
},
},
- },
+ ]
}
```
diff --git a/www/apps/resources/app/architectural-modules/file/s3/page.mdx b/www/apps/resources/app/architectural-modules/file/s3/page.mdx
index 359c0a145e..c0b51c6c9f 100644
--- a/www/apps/resources/app/architectural-modules/file/s3/page.mdx
+++ b/www/apps/resources/app/architectural-modules/file/s3/page.mdx
@@ -112,21 +112,21 @@ The File Module accepts one provider only.
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = {
// ...
- modules: {
+ modules: [
// ...
- [Modules.FILE]: {
- resolve: "@medusajs/medusa/file",
+ {
+ resolve: "@medusajs/file",
options: {
providers: [
{
- resolve: "@medusajs/medusa/file-s3",
+ resolve: "@medusajs/file-s3",
id: "s3",
options: {
file_url: process.env.S3_FILE_URL,
@@ -141,7 +141,7 @@ module.exports = {
],
},
},
- },
+ ]
}
```
@@ -349,16 +349,16 @@ If you're using MinIO or Supabase, set `forcePathStyle` to `true` in the `additi
For example:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
- [Modules.FILE]: {
- resolve: "@medusajs/medusa/file",
+ modules: [
+ {
+ resolve: "@medusajs/file",
options: {
providers: [
{
- resolve: "@medusajs/medusa/file-s3",
+ resolve: "@medusajs/file-s3",
id: "s3",
options: {
// ...
@@ -370,7 +370,7 @@ module.exports = defineConfig({
],
},
},
- },
+ ]
})
```
---
diff --git a/www/apps/resources/app/architectural-modules/notification/local/page.mdx b/www/apps/resources/app/architectural-modules/notification/local/page.mdx
index 33d3a51efa..36029c6250 100644
--- a/www/apps/resources/app/architectural-modules/notification/local/page.mdx
+++ b/www/apps/resources/app/architectural-modules/notification/local/page.mdx
@@ -26,21 +26,21 @@ Only one provider can be defined for a channel.
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.NOTIFICATION]: {
- resolve: "@medusajs/medusa/notification",
+ modules: [
+ {
+ resolve: "@medusajs/notification",
options: {
providers: [
// ...
{
- resolve: "@medusajs/medusa/notification-local",
+ resolve: "@medusajs/notification-local",
id: "local",
options: {
channels: ["email"],
@@ -49,7 +49,7 @@ module.exports = defineConfig({
],
},
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/architectural-modules/notification/page.mdx b/www/apps/resources/app/architectural-modules/notification/page.mdx
index 2f1436ed6b..d3e84cce83 100644
--- a/www/apps/resources/app/architectural-modules/notification/page.mdx
+++ b/www/apps/resources/app/architectural-modules/notification/page.mdx
@@ -30,22 +30,22 @@ When you send a notification, you specify the channel to send it through, such a
For example:
-```js title="medusa-config.js" highlights={[["19"]]}
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts" highlights={[["19"]]}
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = {
// ...
- modules: {
+ modules: [
// ...
- [Modules.NOTIFICATION]: {
- resolve: "@medusajs/medusa/notification",
+ {
+ resolve: "@medusajs/notification",
options: {
providers: [
// ...
{
- resolve: "@medusajs/medusa/notification-local",
+ resolve: "@medusajs/notification-local",
id: "notification",
options: {
channels: ["email"],
@@ -54,7 +54,7 @@ module.exports = {
],
},
},
- },
+ ]
}
```
diff --git a/www/apps/resources/app/architectural-modules/notification/sendgrid/page.mdx b/www/apps/resources/app/architectural-modules/notification/sendgrid/page.mdx
index 47b80bb946..e668d218be 100644
--- a/www/apps/resources/app/architectural-modules/notification/sendgrid/page.mdx
+++ b/www/apps/resources/app/architectural-modules/notification/sendgrid/page.mdx
@@ -37,21 +37,21 @@ Only one provider can be defined for a channel.
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.NOTIFICATION]: {
- resolve: "@medusajs/medusa/notification",
+ modules: [
+ {
+ resolve: "@medusajs/notification",
options: {
providers: [
// ...
{
- resolve: "@medusajs/medusa/notification-sendgrid",
+ resolve: "@medusajs/notification-sendgrid",
id: "sendgrid",
options: {
channels: ["email"],
@@ -62,7 +62,7 @@ module.exports = defineConfig({
],
},
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/architectural-modules/workflow-engine/in-memory/page.mdx b/www/apps/resources/app/architectural-modules/workflow-engine/in-memory/page.mdx
index dc25afe86a..b1c616767c 100644
--- a/www/apps/resources/app/architectural-modules/workflow-engine/in-memory/page.mdx
+++ b/www/apps/resources/app/architectural-modules/workflow-engine/in-memory/page.mdx
@@ -22,17 +22,19 @@ The In-Memory Workflow Engine Module is registered by default in your applicatio
-Add the module into the `modules` property of the exported object in `medusa-config.js`:
+Add the module into the `modules` property of the exported object in `medusa-config.ts`:
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.WORKFLOW_ENGINE]: true,
- },
+ modules: [
+ {
+ resolve: "@medusajs/workflow-engine-inmemory"
+ }
+ ],
})
```
diff --git a/www/apps/resources/app/architectural-modules/workflow-engine/redis/page.mdx b/www/apps/resources/app/architectural-modules/workflow-engine/redis/page.mdx
index a13295a7f2..9334e26719 100644
--- a/www/apps/resources/app/architectural-modules/workflow-engine/redis/page.mdx
+++ b/www/apps/resources/app/architectural-modules/workflow-engine/redis/page.mdx
@@ -19,21 +19,21 @@ The Redis Workflow Engine Module uses Redis to track workflow executions and han
}
]} />
-Add the module into the `modules` property of the exported object in `medusa-config.js`:
+Add the module into the `modules` property of the exported object in `medusa-config.ts`:
export const highlights = [
["12", "url", "The Redis connection URL."]
]
-```js title="medusa-config.js" highlights={highlights}
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts" highlights={highlights}
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.WORKFLOW_ENGINE]: {
+ modules: [
+ {
resolve: "@medusajs/workflow-engine-redis",
options: {
redis: {
@@ -41,7 +41,7 @@ module.exports = defineConfig({
},
},
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/commerce-modules/auth/auth-providers/emailpass/page.mdx b/www/apps/resources/app/commerce-modules/auth/auth-providers/emailpass/page.mdx
index 1eba284ab0..b1a4041932 100644
--- a/www/apps/resources/app/commerce-modules/auth/auth-providers/emailpass/page.mdx
+++ b/www/apps/resources/app/commerce-modules/auth/auth-providers/emailpass/page.mdx
@@ -18,8 +18,8 @@ The Emailpass auth provider is registered by default with the Auth Module.
If you want to pass options to the provider, add the provider to the `providers` option of the Auth Module:
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
diff --git a/www/apps/resources/app/commerce-modules/auth/auth-providers/github/page.mdx b/www/apps/resources/app/commerce-modules/auth/auth-providers/github/page.mdx
index 26350fde8b..4b42203f19 100644
--- a/www/apps/resources/app/commerce-modules/auth/auth-providers/github/page.mdx
+++ b/www/apps/resources/app/commerce-modules/auth/auth-providers/github/page.mdx
@@ -35,8 +35,8 @@ Learn about the authentication flow in [this guide](../../authentication-route/p
Add the module to the array of providers passed to the Auth Module:
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
diff --git a/www/apps/resources/app/commerce-modules/auth/auth-providers/google/page.mdx b/www/apps/resources/app/commerce-modules/auth/auth-providers/google/page.mdx
index 4c689c4fcd..d583e96b84 100644
--- a/www/apps/resources/app/commerce-modules/auth/auth-providers/google/page.mdx
+++ b/www/apps/resources/app/commerce-modules/auth/auth-providers/google/page.mdx
@@ -35,8 +35,8 @@ Learn about the authentication flow for third-party providers in [this guide](..
Add the module to the array of providers passed to the Auth Module:
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
diff --git a/www/apps/resources/app/commerce-modules/auth/auth-providers/page.mdx b/www/apps/resources/app/commerce-modules/auth/auth-providers/page.mdx
index 5551b6b2da..e7d27e26b5 100644
--- a/www/apps/resources/app/commerce-modules/auth/auth-providers/page.mdx
+++ b/www/apps/resources/app/commerce-modules/auth/auth-providers/page.mdx
@@ -41,7 +41,7 @@ By default, users of all actor types can authenticate with all installed auth mo
To restrict the auth providers used for actor types, use the [authMethodsPerActor option](/references/medusa-config#http-authMethodsPerActor-1-3) in Medusa's configurations:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
projectConfig: {
http: {
diff --git a/www/apps/resources/app/commerce-modules/auth/module-options/page.mdx b/www/apps/resources/app/commerce-modules/auth/module-options/page.mdx
index 8d408ef084..ca0e7c310b 100644
--- a/www/apps/resources/app/commerce-modules/auth/module-options/page.mdx
+++ b/www/apps/resources/app/commerce-modules/auth/module-options/page.mdx
@@ -26,27 +26,29 @@ By default, the `emailpass` provider is registered to authenticate customers and
For example:
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- resolve: "@medusajs/medusa/auth",
- options: {
- providers: [
- {
- resolve: "@medusajs/medusa/auth-emailpass",
- id: "emailpass",
- options: {
- // provider options...
+ modules: [
+ {
+ resolve: "@medusajs/auth",
+ options: {
+ providers: [
+ {
+ resolve: "@medusajs/auth-emailpass",
+ id: "emailpass",
+ options: {
+ // provider options...
+ },
},
- },
- ],
+ ],
+ },
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/commerce-modules/cart/extend/page.mdx b/www/apps/resources/app/commerce-modules/cart/extend/page.mdx
index 72c9c9ee59..e80fad2108 100644
--- a/www/apps/resources/app/commerce-modules/cart/extend/page.mdx
+++ b/www/apps/resources/app/commerce-modules/cart/extend/page.mdx
@@ -81,7 +81,7 @@ This defines a link between the `Cart` and `Custom` data models. Using this link
-Add the following configuration in `medusa-config.js`:
+Add the following configuration in `medusa-config.ts`:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
admin: {
@@ -89,9 +89,9 @@ Later, you’ll set different values of the `DISABLE_MEDUSA_ADMIN` environment v
### Configure Redis URL
-Add the following configuration in `medusa-config.js` :
+Add the following configuration in `medusa-config.ts` :
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
projectConfig: {
// ...
@@ -134,34 +134,33 @@ For example, add the following dependencies in `package.json` for the Cache, Eve
```json
"dependencies": {
// ...
- "@medusajs/medusa/cache-redis": "rc",
- "@medusajs/medusa/event-bus-redis": "rc",
+ "@medusajs/cache-redis": "rc",
+ "@medusajs/event-bus-redis": "rc",
"@medusajs/workflow-engine-redis": "rc"
}
```
-Then, add these modules in `medusa-config.js`:
+Then, add these modules in `medusa-config.ts`:
-```js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+```ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
module.exports = defineConfig({
// ...
- modules: {
- // ...
- [Modules.CACHE]: {
- resolve: "@medusajs/medusa/cache-redis",
+ modules: [
+ {
+ resolve: "@medusajs/cache-redis",
options: {
redisUrl: process.env.REDIS_URL,
},
},
- [Modules.EVENT_BUS]: {
- resolve: "@medusajs/medusa/event-bus-redis",
+ {
+ resolve: "@medusajs/event-bus-redis",
options: {
redisUrl: process.env.REDIS_URL,
},
},
- [Modules.WORKFLOW_ENGINE]: {
+ {
resolve: "@medusajs/workflow-engine-redis",
options: {
redis: {
@@ -169,7 +168,7 @@ module.exports = defineConfig({
},
},
},
- },
+ ]
})
```
@@ -286,9 +285,9 @@ You can either generate a random domain name or set a custom one. To do that:
If you’re deploying the Medusa application in server mode with the admin, you have to make some changes now that you’ve obtained the application’s URL.
-First, add the following configuration to `medusa-config.js`:
+First, add the following configuration to `medusa-config.ts`:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
admin: {
diff --git a/www/apps/resources/app/medusa-container-resources/page.mdx b/www/apps/resources/app/medusa-container-resources/page.mdx
index e3f4161cf1..fb23a7d320 100644
--- a/www/apps/resources/app/medusa-container-resources/page.mdx
+++ b/www/apps/resources/app/medusa-container-resources/page.mdx
@@ -48,7 +48,7 @@ Use the `ContainerRegistrationKeys` enum imported from `@medusajs/framework/util
- The configurations that are exported from `medusa-config.js`.
+ The configurations that are exported from `medusa-config.ts`.
@@ -120,12 +120,12 @@ Use the `ContainerRegistrationKeys` enum imported from `@medusajs/framework/util
- The main service of every module added in `medusa-config.js`.
+ The main service of every module added in `medusa-config.ts`.
- - For custom modules, the registration name is the key of the module in the `modules` configuration in `medusa-config.js`.
+ - For custom modules, the registration name is the key of the module in the `modules` configuration in `medusa-config.ts`.
- For Medusa's commerce modules, use the `Modules` enum imported from `@medusajs/framework/utils`.
@@ -229,7 +229,7 @@ Use the `ContainerRegistrationKeys` enum imported from `@medusajs/framework/util
- The configurations exported from `medusa-config.js`.
+ The configurations exported from `medusa-config.ts`.
diff --git a/www/apps/resources/app/recipes/commerce-automation/page.mdx b/www/apps/resources/app/recipes/commerce-automation/page.mdx
index 544c08121d..5315107652 100644
--- a/www/apps/resources/app/recipes/commerce-automation/page.mdx
+++ b/www/apps/resources/app/recipes/commerce-automation/page.mdx
@@ -150,19 +150,16 @@ export const restockModelHighlights = [
})
```
- Finally, add the module to the `modules` object in `medusa-config.js`:
+ Finally, add the module to the `modules` object in `medusa-config.ts`:
- ```js title="medusa-config.js"
+ ```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
- "restockNotificationModuleService": {
+ modules: [
+ {
resolve: "./modules/restock-notification",
- definition: {
- isQueryable: true,
- },
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/recipes/digital-products/examples/standard/page.mdx b/www/apps/resources/app/recipes/digital-products/examples/standard/page.mdx
index c8a126860b..2f0c229e23 100644
--- a/www/apps/resources/app/recipes/digital-products/examples/standard/page.mdx
+++ b/www/apps/resources/app/recipes/digital-products/examples/standard/page.mdx
@@ -189,16 +189,16 @@ export default Module(DIGITAL_PRODUCT_MODULE, {
### Add Module to Medusa Configuration
-Finally, add the module to the list of modules in `medusa-config.js`:
+Finally, add the module to the list of modules in `medusa-config.ts`:
-```tsx title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
- digitalProductModuleService: {
+ modules: [
+ {
resolve: "./modules/digital-product",
},
- },
+ ]
})
```
@@ -1502,21 +1502,21 @@ export default providerExport
### Register Module Provider in Medusa's Configurations
-Finally, register the module provider in `medusa-config.js`:
+Finally, register the module provider in `medusa-config.ts`:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
// other imports...
-const { Modules } = require("@medusajs/framework/utils")
+import { Modules } from "@medusajs/framework/utils"
module.exports = defineConfig({
- modules: {
+ modules: [
// ...
- [Modules.FULFILLMENT]: {
- resolve: "@medusajs/medusa/fulfillment",
+ {
+ resolve: "@medusajs/fulfillment",
options: {
providers: [
{
- resolve: "@medusajs/medusa/fulfillment-manual",
+ resolve: "@medusajs/fulfillment-manual",
id: "manual",
},
{
@@ -1526,7 +1526,7 @@ module.exports = defineConfig({
],
},
},
- },
+ ]
})
```
@@ -2000,19 +2000,19 @@ In the `sendDigitalOrderNotificationStep`, you use a notification provider confi
Check out the [Integrations page](../../../../integrations/page.mdx) to find Notification Module Providers.
-For testing purposes, add to `medusa-config.js` the following to use the Local Notification Module Provider:
+For testing purposes, add to `medusa-config.ts` the following to use the Local Notification Module Provider:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
+ modules: [
// ...
- [Modules.NOTIFICATION]: {
- resolve: "@medusajs/medusa/notification",
+ {
+ resolve: "@medusajs/notification",
options: {
providers: [
{
- resolve: "@medusajs/medusa/notification-local",
+ resolve: "@medusajs/notification-local",
id: "local",
options: {
name: "Local Notification Provider",
@@ -2022,7 +2022,7 @@ module.exports = defineConfig({
],
},
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/recipes/integrate-ecommerce-stack/page.mdx b/www/apps/resources/app/recipes/integrate-ecommerce-stack/page.mdx
index 2d477618a4..bb1f1c36a9 100644
--- a/www/apps/resources/app/recipes/integrate-ecommerce-stack/page.mdx
+++ b/www/apps/resources/app/recipes/integrate-ecommerce-stack/page.mdx
@@ -116,19 +116,19 @@ export const serviceHighlights = [
})
```
- Finally, add the module to the `modules` object in `medusa-config.js`:
+ Finally, add the module to the `modules` object in `medusa-config.ts`:
- ```js title="medusa-config.js" highlights={[["7", "ERP_API_KEY", "The environment variable holding the API key of the ERP system."]]}
+ ```ts title="medusa-config.ts" highlights={[["7", "ERP_API_KEY", "The environment variable holding the API key of the ERP system."]]}
module.exports = defineConfig({
// ...
- modules: {
- erpModuleService: {
+ modules: [
+ {
resolve: "./modules/erp",
options: {
apiKey: process.env.ERP_API_KEY,
},
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/recipes/marketplace/examples/restaurant-delivery/page.mdx b/www/apps/resources/app/recipes/marketplace/examples/restaurant-delivery/page.mdx
index d4173a26d8..12c8b2de8c 100644
--- a/www/apps/resources/app/recipes/marketplace/examples/restaurant-delivery/page.mdx
+++ b/www/apps/resources/app/recipes/marketplace/examples/restaurant-delivery/page.mdx
@@ -155,16 +155,16 @@ export default Module(RESTAURANT_MODULE, {
### Add Restaurant Module to Medusa Configuration
-Finally, add the module to the list of modules in `medusa-config.js`:
+Finally, add the module to the list of modules in `medusa-config.ts`:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
- restaurantModuleService: {
+ modules: [
+ {
resolve: "./modules/restaurant",
},
- },
+ ]
})
```
@@ -299,17 +299,16 @@ export default Module(DELIVERY_MODULE, {
### Add Delivery Module to Medusa Configuration
-Finally, add the module to the list of modules in `medusa-config.js`:
+Finally, add the module to the list of modules in `medusa-config.ts`:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
- deliveryModuleService: {
+ modules: [
+ {
resolve: "./modules/delivery",
},
- // ...
- },
+ ]
})
```
diff --git a/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx b/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx
index 4a63fca79b..5ca0a32cdc 100644
--- a/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx
+++ b/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx
@@ -135,16 +135,16 @@ export default Module(MARKETPLACE_MODULE, {
### Add Module to Medusa Configuration
-Finally, add the module to the list of modules in `medusa-config.js`:
+Finally, add the module to the list of modules in `medusa-config.ts`:
-```ts title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
- marketplaceModuleService: {
+ modules: [
+ {
resolve: "./modules/marketplace",
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/recipes/subscriptions/examples/standard/page.mdx b/www/apps/resources/app/recipes/subscriptions/examples/standard/page.mdx
index 4c05aa6abf..7c85b22b8d 100644
--- a/www/apps/resources/app/recipes/subscriptions/examples/standard/page.mdx
+++ b/www/apps/resources/app/recipes/subscriptions/examples/standard/page.mdx
@@ -153,16 +153,16 @@ This sets the module’s name to `subscriptionModuleService` and its main servic
### Register Module in Medusa’s Configuration
-Finally, add the module into `medusa-config.js`:
+Finally, add the module into `medusa-config.ts`:
-```ts title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
// ...
- modules: {
- subscriptionModuleService: {
+ modules: [
+ {
resolve: "./modules/subscription",
},
- },
+ ]
})
```
diff --git a/www/apps/resources/app/storefront-development/tips/page.mdx b/www/apps/resources/app/storefront-development/tips/page.mdx
index 9a7f78a488..2128f877a1 100644
--- a/www/apps/resources/app/storefront-development/tips/page.mdx
+++ b/www/apps/resources/app/storefront-development/tips/page.mdx
@@ -36,11 +36,11 @@ npm install @medusajs/types@rc
## Configure CORS
-The Medusa application’s API routes are guarded by a CORS middleware. Make sure to set the `storeCors` property of the `http` configuration in `medusa-config.js` to the storefront’s URL.
+The Medusa application’s API routes are guarded by a CORS middleware. Make sure to set the `storeCors` property of the `http` configuration in `medusa-config.ts` to the storefront’s URL.
For example:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
projectConfig: {
http: {
diff --git a/www/apps/resources/app/troubleshooting/_sections/other/cors-errors.mdx b/www/apps/resources/app/troubleshooting/_sections/other/cors-errors.mdx
index 2f886826de..274e7d445d 100644
--- a/www/apps/resources/app/troubleshooting/_sections/other/cors-errors.mdx
+++ b/www/apps/resources/app/troubleshooting/_sections/other/cors-errors.mdx
@@ -4,9 +4,9 @@ You might see a log in your browser console, that looks like this:

-In your `medusa-config.js` , you should ensure that you've configured your CORS settings correctly:
+In your `medusa-config.ts` , you should ensure that you've configured your CORS settings correctly:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
projectConfig: {
http: {
diff --git a/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx b/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx
index dbc971e63d..ed288ac27d 100644
--- a/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx
+++ b/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx
@@ -42,9 +42,9 @@ Refer to the [Admin Development Constraints](!docs!/advanced-development/admin/c
If you're using a Docker image to host your Medusa application, make sure that the image's root path is different than the Medusa Admin's `path` configuration.
-For example, if your Docker image's root path is `/app`, make sure to change the `path` configuration in `medusa-config.js`, as it's `/app` by default:
+For example, if your Docker image's root path is `/app`, make sure to change the `path` configuration in `medusa-config.ts`, as it's `/app` by default:
-```js title="medusa-config.js"
+```ts title="medusa-config.ts"
module.exports = defineConfig({
admin: {
path: `/dashboard`,
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 67cd8f8fa3..949a2171fd 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
@@ -48,17 +48,17 @@ export default {
This exports the module's definition, indicating that the \`MyAuthProviderService\` is the module's service.`,
`## 4. Use Module
-To use your Auth Module Provider, add it to the \`providers\` array of the Auth Module:
+To use your Auth Module Provider, add it to the \`providers\` array of the Auth Module in \`medusa-config.ts\`:
-\`\`\`js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+\`\`\`ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.AUTH]: {
+ modules: [
+ {
resolve: "@medusajs/framework/auth",
options: {
providers: [
@@ -72,7 +72,7 @@ module.exports = defineConfig({
],
},
},
- }
+ ]
})
\`\`\`
`,
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 816810e6dc..001bb6485e 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
@@ -48,7 +48,7 @@ export default {
This exports the module's definition, indicating that the \`MyFileProviderService\` is the module's service.`,
`## 4. Use Module
-To use your File Module Provider, add it to the \`providers\` array of the File Module:
+To use your File Module Provider, add it to the \`providers\` array of the File Module in \`medusa-config.ts\`:
@@ -56,15 +56,15 @@ The File Module accepts one provider only.
-\`\`\`js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+\`\`\`ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.FILE]: {
+ modules: [
+ {
resolve: "@medusajs/framework/file",
options: {
providers: [
@@ -78,7 +78,7 @@ module.exports = defineConfig({
],
},
},
- }
+ ]
})
\`\`\`
`,
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 2e4e09e6ae..f5639d112c 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
@@ -48,17 +48,17 @@ export default {
This exports the module's definition, indicating that the \`MyFulfillmentProviderService\` is the module's service.`,
`## 4. Use Module
-To use your Fulfillment Module Provider, add it to the \`providers\` array of the Fulfillment Module:
+To use your Fulfillment Module Provider, add it to the \`providers\` array of the Fulfillment Module in \`medusa-config.ts\`:
-\`\`\`js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+\`\`\`ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.FULFILLMENT]: {
+ modules: [
+ {
resolve: "@medusajs/framework/fulfillment",
options: {
providers: [
@@ -72,7 +72,7 @@ module.exports = defineConfig({
],
},
},
- }
+ ]
})
\`\`\`
`,
diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/medusa-config.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/medusa-config.ts
index abec1d5aa5..191741c133 100644
--- a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/medusa-config.ts
+++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/medusa-config.ts
@@ -9,7 +9,7 @@ const medusaConfigOptions: FormattingOptionsType = {
frontmatterData: {
slug: "/references/medusa-config",
},
- reflectionDescription: `In this document, you’ll learn how to create a file service in the Medusa backend and the methods you must implement in it.`,
+ reflectionDescription: `In this document, you’ll learn how to create a file service in the Medusa application and the methods you must implement in it.`,
reflectionTitle: {
fullReplacement: "Configure Medusa Backend",
},
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 e4053c9411..96736761bc 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
@@ -52,7 +52,7 @@ export default {
This exports the module's definition, indicating that the \`MyNotificationProviderService\` is the module's service.`,
`## 4. Use Module
-To use your Notification Module Provider, add it to the \`providers\` array of the Notification Module:
+To use your Notification Module Provider, add it to the \`providers\` array of the Notification Module in \`medusa-config.ts\`:
@@ -60,15 +60,15 @@ The Notification Module accepts one provider per channel.
-\`\`\`js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+\`\`\`ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.NOTIFICATION]: {
+ modules: [
+ {
resolve: "@medusajs/framework/notification",
options: {
providers: [
@@ -83,7 +83,7 @@ module.exports = defineConfig({
],
},
},
- }
+ ]
})
\`\`\`
diff --git a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/payment-provider.ts b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/payment-provider.ts
index 214cfbce55..fff1511015 100644
--- a/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/payment-provider.ts
+++ b/www/utils/packages/typedoc-generate-references/src/constants/merger-custom-options/payment-provider.ts
@@ -57,17 +57,17 @@ export default {
This exports the module's definition, indicating that the \`MyPaymentProviderService\` is the module's service.`,
`## 4. Use Module
-To use your Payment Module Provider, add it to the \`providers\` array of the Payment Module:
+To use your Payment Module Provider, add it to the \`providers\` array of the Payment Module in \`medusa-config.ts\`:
-\`\`\`js title="medusa-config.js"
-const { Modules } = require("@medusajs/framework/utils")
+\`\`\`ts title="medusa-config.ts"
+import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = defineConfig({
// ...
- modules: {
- [Modules.PAYMENT]: {
+ modules: [
+ {
resolve: "@medusajs/framework/payment",
options: {
providers: [
@@ -82,7 +82,7 @@ module.exports = defineConfig({
]
}
}
- }
+ ]
})
\`\`\`
`,