docs: updates for breaking changes (#9558)

- Update modules registration
- Update `medusa-config.js` to `medusa-config.ts`
- Update the out directory in the admin deployment guide
- Update logger imports
- Other fixes

Note: will need to re-generate references afterwards

Closes #9548
This commit is contained in:
Shahed Nasser
2024-10-14 10:40:30 +00:00
committed by GitHub
parent 2a9fc0e514
commit b6df24463d
53 changed files with 319 additions and 324 deletions
@@ -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
},
},
},
]
})
```
@@ -20,18 +20,20 @@ The Local Event Bus Module is registered by default in your application.
</Note>
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"
}
]
})
```
@@ -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,
},
},
},
}
]
})
```