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:
@@ -33,9 +33,9 @@ As Medusa v2 is still in active development, it's highly recommended not to depl
|
||||
|
||||
## 1. Configure Admin in Medusa
|
||||
|
||||
In `medusa-config.js`, set the following admin configuration:
|
||||
In `medusa-config.ts`, set the following admin configuration:
|
||||
|
||||
```js title="medusa-config.js"
|
||||
```ts title="medusa-config.ts"
|
||||
module.exports = defineConfig({
|
||||
// ...
|
||||
admin: {
|
||||
@@ -89,7 +89,7 @@ To create a Vercel project, on your Vercel dashboard:
|
||||
npm run build
|
||||
```
|
||||
|
||||
- Set the Output Directory field to `build`.
|
||||
- Set the Output Directory field to `.medusa/admin`.
|
||||
- Set the Install Command field to the following:
|
||||
|
||||
```bash npm2yarn
|
||||
|
||||
@@ -48,9 +48,9 @@ The same Medusa project is used to deploy the server and worker modes. Learn mor
|
||||
|
||||
The `workerMode` configuration determines which mode the Medusa application runs in. As mentioned at the beginning of this guide, you’ll deploy two Medusa applications: one in server mode, and one in worker mode.
|
||||
|
||||
So, add the following configuration in `medusa-config.js`:
|
||||
So, add the following configuration in `medusa-config.ts`:
|
||||
|
||||
```js title="medusa-config.js"
|
||||
```ts title="medusa-config.ts"
|
||||
module.exports = defineConfig({
|
||||
projectConfig: {
|
||||
// ...
|
||||
@@ -74,9 +74,9 @@ To host the admin with the Medusa application, the hosting provider and plan sho
|
||||
|
||||
</Note>
|
||||
|
||||
Add the following configuration in `medusa-config.js`:
|
||||
Add the following configuration in `medusa-config.ts`:
|
||||
|
||||
```js title="medusa-config.js"
|
||||
```ts title="medusa-config.ts"
|
||||
module.exports = defineConfig({
|
||||
// ...
|
||||
admin: {
|
||||
@@ -89,9 +89,9 @@ Later, you’ll set different values of the `DISABLE_MEDUSA_ADMIN` environment v
|
||||
|
||||
### Configure Redis URL
|
||||
|
||||
Add the following configuration in `medusa-config.js` :
|
||||
Add the following configuration in `medusa-config.ts` :
|
||||
|
||||
```js title="medusa-config.js"
|
||||
```ts title="medusa-config.ts"
|
||||
module.exports = defineConfig({
|
||||
projectConfig: {
|
||||
// ...
|
||||
@@ -134,34 +134,33 @@ For example, add the following dependencies in `package.json` for the Cache, Eve
|
||||
```json
|
||||
"dependencies": {
|
||||
// ...
|
||||
"@medusajs/medusa/cache-redis": "rc",
|
||||
"@medusajs/medusa/event-bus-redis": "rc",
|
||||
"@medusajs/cache-redis": "rc",
|
||||
"@medusajs/event-bus-redis": "rc",
|
||||
"@medusajs/workflow-engine-redis": "rc"
|
||||
}
|
||||
```
|
||||
|
||||
Then, add these modules in `medusa-config.js`:
|
||||
Then, add these modules 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.CACHE]: {
|
||||
resolve: "@medusajs/medusa/cache-redis",
|
||||
modules: [
|
||||
{
|
||||
resolve: "@medusajs/cache-redis",
|
||||
options: {
|
||||
redisUrl: process.env.REDIS_URL,
|
||||
},
|
||||
},
|
||||
[Modules.EVENT_BUS]: {
|
||||
resolve: "@medusajs/medusa/event-bus-redis",
|
||||
{
|
||||
resolve: "@medusajs/event-bus-redis",
|
||||
options: {
|
||||
redisUrl: process.env.REDIS_URL,
|
||||
},
|
||||
},
|
||||
[Modules.WORKFLOW_ENGINE]: {
|
||||
{
|
||||
resolve: "@medusajs/workflow-engine-redis",
|
||||
options: {
|
||||
redis: {
|
||||
@@ -169,7 +168,7 @@ module.exports = defineConfig({
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
})
|
||||
```
|
||||
|
||||
@@ -286,9 +285,9 @@ You can either generate a random domain name or set a custom one. To do that:
|
||||
|
||||
If you’re deploying the Medusa application in server mode with the admin, you have to make some changes now that you’ve obtained the application’s URL.
|
||||
|
||||
First, add the following configuration to `medusa-config.js`:
|
||||
First, add the following configuration to `medusa-config.ts`:
|
||||
|
||||
```js title="medusa-config.js"
|
||||
```ts title="medusa-config.ts"
|
||||
module.exports = defineConfig({
|
||||
// ...
|
||||
admin: {
|
||||
|
||||
Reference in New Issue
Block a user