docs: add documentation for migration generate cli tool (#8128)
* docs: add documentation for migration generate cli tool * changed migrations details in marketplace recipe * added generated oas files to action * vale + lint fixes * don't import from src in medusa-config.js * fix generate command in recipe * fix module name
This commit is contained in:
@@ -70,21 +70,18 @@ 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:
|
||||
|
||||
```js title="medusa-config.js" highlights={[["7", "HELLO_MODULE", "The key of the main service to be registered in the Medusa container."]]}
|
||||
import { HELLO_MODULE } from "./src/modules/hello"
|
||||
// ...
|
||||
|
||||
```js title="medusa-config.js" highlights={[["4", "helloModuleService", "The key of the main service to be registered in the Medusa container."]]}
|
||||
module.exports = defineConfig({
|
||||
// ...
|
||||
modules: {
|
||||
[HELLO_MODULE]: {
|
||||
"helloModuleService": {
|
||||
resolve: "./modules/hello",
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
Its key (`helloModuleService` or `HELLO_MODULE`) is the name of the module’s main service. It will be registered in the Medusa container with that name. It should also be the same name passed as the first parameter to the `Module` function in the module's definition.
|
||||
Its key (`helloModuleService`) is the name of the module’s main service. It will be registered in the Medusa container with that name. It should also be the same name 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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user