docs: update imports and package names across docs (#9375)

* docs: update imports and package names across docs
+ reference configs

* generate files

* fix import

* change preview to rc
This commit is contained in:
Shahed Nasser
2024-10-01 11:03:42 +02:00
committed by GitHub
parent c726ed54f5
commit 2e16949979
196 changed files with 1379 additions and 1491 deletions
@@ -10,27 +10,15 @@ The Local Notification Module Provider simulates sending a notification, but onl
---
## Install the Local Notification Module
## Register the Local Notification Module
<Note>
The Local Notification Module Provider is installed by default in your application.
The Local Notification Module Provider is registered by default in your application. It's configured to run on the `feed` channel.
</Note>
To install the Local Notification Module Provider, run the following command in the directory of your Medusa application:
```bash npm2yarn
npm install @medusajs/notification-local@preview
```
<Note>
Make sure that the version added in `package.json` is `preview` to avoid errors with installation and updates in the future.
</Note>
Next, add the module into the `providers` array of the Notification Module:
Add the module into the `providers` array of the Notification Module:
<Note>
@@ -39,7 +27,7 @@ Only one provider can be defined for a channel.
</Note>
```js title="medusa-config.js"
const { Modules } = require("@medusajs/utils")
const { Modules } = require("@medusajs/framework/utils")
// ...
@@ -47,12 +35,12 @@ module.exports = defineConfig({
// ...
modules: {
[Modules.NOTIFICATION]: {
resolve: "@medusajs/notification",
resolve: "@medusajs/medusa/notification",
options: {
providers: [
// ...
{
resolve: "@medusajs/notification-local",
resolve: "@medusajs/medusa/notification-local",
id: "local",
options: {
channels: ["email"],
@@ -31,7 +31,7 @@ When you send a notification, you specify the channel to send it through, such a
For example:
```js title="medusa-config.js" highlights={[["19"]]}
const { Modules } = require("@medusajs/utils")
const { Modules } = require("@medusajs/framework/utils")
// ...
@@ -40,12 +40,12 @@ module.exports = {
modules: {
// ...
[Modules.NOTIFICATION]: {
resolve: "@medusajs/notification",
resolve: "@medusajs/medusa/notification",
options: {
providers: [
// ...
{
resolve: "@medusajs/notification-local",
resolve: "@medusajs/medusa/notification-local",
id: "notification",
options: {
channels: ["email"],
@@ -37,8 +37,8 @@ import type {
SubscriberArgs,
SubscriberConfig,
} from "@medusajs/medusa"
import { Modules } from "@medusajs/utils"
import { INotificationModuleService } from "@medusajs/types"
import { Modules } from "@medusajs/framework/utils"
import { INotificationModuleService } from "@medusajs/framework/types"
export default async function productCreateHandler({
event: { data },
@@ -10,7 +10,7 @@ The SendGrid Notification Module Provider integrates [SendGrid](https://sendgrid
---
## Install the SendGrid Notification Module
## Register the SendGrid Notification Module
<Prerequisites
items={[
@@ -29,19 +29,7 @@ The SendGrid Notification Module Provider integrates [SendGrid](https://sendgrid
]}
/>
To install the SendGrid Notification Module Provider, run the following command in the directory of your Medusa application:
```bash npm2yarn
npm install @medusajs/notification-sendgrid@preview
```
<Note>
Make sure that the version added in `package.json` is `preview` to avoid errors with installation and updates in the future.
</Note>
Next, add the module into the `providers` array of the Notification Module:
Add the module into the `providers` array of the Notification Module:
<Note>
@@ -50,7 +38,7 @@ Only one provider can be defined for a channel.
</Note>
```js title="medusa-config.js"
const { Modules } = require("@medusajs/utils")
const { Modules } = require("@medusajs/framework/utils")
// ...
@@ -58,12 +46,12 @@ module.exports = defineConfig({
// ...
modules: {
[Modules.NOTIFICATION]: {
resolve: "@medusajs/notification",
resolve: "@medusajs/medusa/notification",
options: {
providers: [
// ...
{
resolve: "@medusajs/notification-sendgrid",
resolve: "@medusajs/medusa/notification-sendgrid",
id: "sendgrid",
options: {
channels: ["email"],
@@ -144,8 +132,8 @@ import type {
SubscriberArgs,
SubscriberConfig,
} from "@medusajs/medusa"
import { Modules } from "@medusajs/utils"
import { INotificationModuleService } from "@medusajs/types"
import { Modules } from "@medusajs/framework/utils"
import { INotificationModuleService } from "@medusajs/framework/types"
export default async function productCreateHandler({
event: { data },