docs: use tooling convention across docs (#10512)

This commit is contained in:
Shahed Nasser
2024-12-09 19:15:29 +02:00
committed by GitHub
parent 7c76ee24cb
commit 3409953c4f
76 changed files with 283 additions and 265 deletions
@@ -287,7 +287,7 @@ class ResendNotificationProviderService extends AbstractNotificationProviderServ
}
```
In the `validateOptions` method, you throw an error if the `api_key` or `from` options aren't passed to the module. To throw errors, you use Medusa's `MedusaError` utility imported from `@medusajs/framework/utils`. This ensures errors follow Medusa's conventions and are displayed similar to Medusa's errors.
In the `validateOptions` method, you throw an error if the `api_key` or `from` options aren't passed to the module. To throw errors, you use `MedusaError` from the Modules SDK. This ensures errors follow Medusa's conventions and are displayed similar to Medusa's errors.
#### Implement Template Methods
@@ -449,7 +449,7 @@ export default ModuleProvider(Modules.NOTIFICATION, {
})
```
You export the module provider's definition using the `ModuleProvider` utility function. It accepts as a first parameter the name of the module that this provider belongs to, which is the Notification Module. It also accepts as a second parameter an object having a `service` property indicating the provider's service.
You export the module provider's definition using `ModuleProvider` from the Modules SDK. It accepts as a first parameter the name of the module that this provider belongs to, which is the Notification Module. It also accepts as a second parameter an object having a `service` property indicating the provider's service.
### Add Module to Configurations
@@ -737,7 +737,7 @@ export const sendOrderConfirmationWorkflow = createWorkflow(
)
```
You create a workflow using the `createWorkflow` function imported from `@medusajs/framework/workflows-sdk`. It accepts the workflow's unique name as a first parameter.
You create a workflow using `createWorkflow` from the Workflows SDK. It accepts the workflow's unique name as a first parameter.
It accepts as a second parameter a constructor function, which is the workflow's implementation. The workflow has the following steps:
@@ -511,7 +511,7 @@ export default Module(SANITY_MODULE, {
In the file, you export the `SANITY_MODULE` which is the Module's name. You'll use it later when you resolve the module from the Medusa container.
You also export the module definition using the `Module` utility function, which accepts as a first parameter the module's name, and as a second parameter an object having a `service` property, indicating the module's service.
You also export the module definition using `Module` from the Modueles SDK, which accepts as a first parameter the module's name, and as a second parameter an object having a `service` property, indicating the module's service.
### Add Module to Configurations
@@ -634,7 +634,7 @@ defineLink(
)
```
You define a link using the `defineLink` utility. It accepts three parameters:
You define a link using `defineLink` from the Modules SDK. It accepts three parameters:
1. The first data model part of the link. In this case, it's the Product Module's `product` data model. A module has a special `linkable` property that contain link configurations for its data models.
2. The second data model part of the link. Since the Sanity Module doesn't have a Medusa data model, you specify the configurations in a `linkable` object that has the following properties:
@@ -887,7 +887,7 @@ export const sanitySyncProductsWorkflow = createWorkflow(
)
```
You create a workflow using the `createWorkflow` function imported from `@medusajs/framework/workflows-sdk`. It accepts an object of options as a first parameter, where the `name` property is required and indicates the workflow's unique name.
You create a workflow using the `createWorkflow` from the Workflows SDK. It accepts an object of options as a first parameter, where the `name` property is required and indicates the workflow's unique name.
The `retentionTime` property indicates how long should the workflow's progress be saved in the database. This is useful if you later want to track whether the workflow is successfully executing.
@@ -1638,7 +1638,7 @@ export const config = defineWidgetConfig({
export default ProductWidget
```
The file exports a `ProductWidget` component and a `config` object created with the `defineWidgetConfig` utility function. In the `config` object, you specify the zone to inject the widget into in the `zone` property.
The file exports a `ProductWidget` component and a `config` object created with `defineWidgetConfig` from the Admin Extension SDK. In the `config` object, you specify the zone to inject the widget into in the `zone` property.
<Note title="Tip">
@@ -1910,7 +1910,7 @@ export default SanityRoute
The file's path relative to the `src/admin/routes` directory indicates its path in the admin dashboard. So, this adds a new route at the path `http://localhost:9000/app/sanity`.
The file must export the UI route's component. Also, to add an item in the sidebar for the UI route, you export a configuration object, created with the `defineRouteConfig` utility function. The function accepts the following properties:
The file must export the UI route's component. Also, to add an item in the sidebar for the UI route, you export a configuration object, created with `defineRouteConfig` from the Admin Extension SDK. The function accepts the following properties:
- `label`: The sidebar item's label.
- `icon`: The icon to the show in the sidebar.