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
+8 -16
View File
@@ -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 Medusas 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 modules main service. It will be registered in the Medusa container with that name.
<Note>
The key must be the same value passed as the first parameter to the `Module` function in the module's definition.
</Note>
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` packages 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` packages name.
### 5. Generate Migrations