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

@@ -18,8 +18,8 @@ The Emailpass auth provider is registered by default with the Auth Module.
If you want to pass options to the provider, add the provider to the `providers` option of the Auth Module:
```js title="medusa-config.js"
const { Modules } = require("@medusajs/framework/utils")
```ts title="medusa-config.ts"
import { Modules } from "@medusajs/framework/utils"
// ...
@@ -35,8 +35,8 @@ Learn about the authentication flow in [this guide](../../authentication-route/p
Add the module to the array of providers passed to the Auth Module:
```js title="medusa-config.js"
const { Modules } = require("@medusajs/framework/utils")
```ts title="medusa-config.ts"
import { Modules } from "@medusajs/framework/utils"
// ...
@@ -35,8 +35,8 @@ Learn about the authentication flow for third-party providers in [this guide](..
Add the module to the array of providers passed to the Auth Module:
```js title="medusa-config.js"
const { Modules } = require("@medusajs/framework/utils")
```ts title="medusa-config.ts"
import { Modules } from "@medusajs/framework/utils"
// ...
@@ -41,7 +41,7 @@ By default, users of all actor types can authenticate with all installed auth mo
To restrict the auth providers used for actor types, use the [authMethodsPerActor option](/references/medusa-config#http-authMethodsPerActor-1-3) in Medusa's configurations:
```js title="medusa-config.js"
```ts title="medusa-config.ts"
module.exports = defineConfig({
projectConfig: {
http: {
@@ -26,27 +26,29 @@ By default, the `emailpass` provider is registered to authenticate customers and
For example:
```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: {
resolve: "@medusajs/medusa/auth",
options: {
providers: [
{
resolve: "@medusajs/medusa/auth-emailpass",
id: "emailpass",
options: {
// provider options...
modules: [
{
resolve: "@medusajs/auth",
options: {
providers: [
{
resolve: "@medusajs/auth-emailpass",
id: "emailpass",
options: {
// provider options...
},
},
},
],
],
},
},
},
]
})
```
@@ -81,7 +81,7 @@ This defines a link between the `Cart` and `Custom` data models. Using this link
<Prerequisites
items={[
{
text: "Module must be registered in medusa-config.js",
text: "Module must be registered in medusa-config.ts",
link: "!docs!/basics/modules#4-add-module-to-configurations"
}
]}
@@ -87,7 +87,7 @@ This defines a link between the `Customer` and `Custom` data models. Using this
<Prerequisites
items={[
{
text: "Module must be registered in medusa-config.js",
text: "Module must be registered in medusa-config.ts",
link: "!docs!/basics/modules#4-add-module-to-configurations"
}
]}
@@ -20,20 +20,20 @@ When the Medusa application starts, these providers are registered and can be us
For example:
```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.FULFILLMENT]: {
resolve: "@medusajs/medusa/fulfillment",
modules: [
{
resolve: "@medusajs/fulfillment",
options: {
providers: [
{
resolve: `@medusajs/medusa/fulfillment-manual`,
resolve: `@medusajs/fulfillment-manual`,
id: "manual",
options: {
// provider options...
@@ -42,7 +42,7 @@ module.exports = defineConfig({
],
},
},
},
]
})
```
@@ -103,20 +103,20 @@ When the Medusa application starts, these providers are registered and can be us
For example:
```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.PAYMENT]: {
resolve: "@medusajs/medusa/payment",
modules: [
{
resolve: "@medusajs/payment",
options: {
providers: [
{
resolve: "@medusajs/medusa/payment-stripe",
resolve: "@medusajs/payment-stripe",
id: "stripe",
options: {
// ...
@@ -125,7 +125,7 @@ module.exports = defineConfig({
],
},
},
},
]
})
```
@@ -31,20 +31,20 @@ In this document, you’ll learn about the Stripe Module Provider and how to ins
Add the module to the array of providers passed to the Payment Module:
```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.PAYMENT]: {
resolve: "@medusajs/medusa/payment",
modules: [
{
resolve: "@medusajs/payment",
options: {
providers: [
{
resolve: "@medusajs/medusa/payment-stripe",
resolve: "@medusajs/payment-stripe",
id: "stripe",
options: {
apiKey: process.env.STRIPE_API_KEY,
@@ -53,7 +53,7 @@ module.exports = defineConfig({
],
},
},
},
]
})
```
@@ -18,16 +18,16 @@ The `providers` option is an array of either tax module providers, tax plugins,
When the Medusa application starts, these providers are registered and can be used to retrieve tax lines.
```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.TAX]: {
resolve: "@medusajs/medusa/tax",
modules: [
{
resolve: "@medusajs/tax",
options: {
providers: [
{
@@ -40,7 +40,7 @@ module.exports = defineConfig({
],
},
},
},
]
})
```
@@ -14,21 +14,21 @@ In this document, you'll learn about the options of the User Module.
## Module Options
```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.USER]: {
resolve: "@medusajs/medusa/user",
modules: [
{
resolve: "@medusajs/user",
options: {
jwt_secret: process.env.JWT_SECRET,
},
},
},
]
})
```