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:
@@ -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!")
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user