docs: add missing details related to links and migrations (#11809)
* docs: add missing details related to links and migrations * reorder content * small changes * last changes * improve examples * fix lint error
This commit is contained in:
@@ -12,7 +12,7 @@ A module is a reusable package of functionalities related to a single domain or
|
||||
|
||||
When building a commerce application, you often need to introduce custom behavior specific to your products, tech stack, or your general ways of working. In other commerce platforms, introducing custom business logic and data models requires setting up separate applications to manage these customizations.
|
||||
|
||||
Medusa removes this overhead by allowing you to easily write custom modules that integrate into the Medusa application without implications on the existing setup. You can also re-use your modules across Medusa projects.
|
||||
Medusa removes this overhead by allowing you to easily write custom modules that integrate into the Medusa application without affecting the existing setup. You can also re-use your modules across Medusa projects.
|
||||
|
||||
As you learn more about Medusa, you will see that modules are central to customizations and integrations. With modules, your Medusa application can turn into a middleware solution for your commerce ecosystem.
|
||||
|
||||
@@ -34,7 +34,7 @@ As you learn more about Medusa, you will see that modules are central to customi
|
||||
|
||||
In a module, you define data models that represent new tables in the database, and you manage these models in a class called a service. Then, the Medusa application registers the module's service in the [Medusa container](../../fundamentals/medusa-container/page.mdx) so that you can build commerce flows and features around the functionalities provided by the module.
|
||||
|
||||
In this section, you'll build a Blog Module that has a `Post` data model and a service to manage that data model, you'll expose an API endpoint to create a blog post.
|
||||
In this section, you'll build a Blog Module that has a `Post` data model and a service to manage that data model. You'll also expose an API endpoint to create a blog post.
|
||||
|
||||
Modules are created in a sub-directory of `src/modules`. So, start by creating the directory `src/modules/blog`.
|
||||
|
||||
@@ -96,7 +96,7 @@ class BlogModuleService extends MedusaService({
|
||||
export default BlogModuleService
|
||||
```
|
||||
|
||||
Your module's service extends a class generated by `MedusaService` from the Modules SDK. This class comes with generated methods for data-management Create, Read, Update, and Delete (CRUD) operations on each of your modules, saving your time that can be spent on building custom business logic.
|
||||
Your module's service extends a class generated by `MedusaService` from the Modules SDK. This class comes with generated methods for data-management Create, Read, Update, and Delete (CRUD) operations on each of your modules, saving you time that can be spent on building custom business logic.
|
||||
|
||||
The `MedusaService` function accepts an object of data models to generate methods for. You can pass all data models in your module in this object.
|
||||
|
||||
@@ -137,7 +137,7 @@ export default Module(BLOG_MODULE, {
|
||||
|
||||
You use `Module` from the Modules SDK to create the module's definition. It accepts two parameters:
|
||||
|
||||
1. The name that the module's main service is registered under (`blog`).
|
||||
1. The name that the module's main service is registered under (`blog`). The module name can contain only alphanumeric characters and underscores.
|
||||
2. An object with a required property `service` indicating the module's main service.
|
||||
|
||||
<Note title="Tip">
|
||||
|
||||
Reference in New Issue
Block a user