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 authored and GitHub committed 2024-10-14 10:40:30 +00:00
1 parent 2a9fc0e514
commit b6df24463d
53 files changed
+319 -324

No files matched your search

@@ -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,
},
},
},
]
})
```
@@ -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({
],
},
},
},
]
})
```
@@ -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,
},
},
},
]
})
```
@@ -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",
},
// ...
},
]
})
```
@@ -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",
},
},
]
})
```
@@ -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",
},
},
]
})
```