docs: prep for v2 documentation (#6710)

This PR includes documentation that preps for v2 docs (but doesn't introduce new docs).

_Note: The number of file changes in the PR is due to find-and-replace within the `references` which is unavoidable. Let me know if I should move it to another PR._

## Changes

- Change Medusa version in base OAS used for v2.
- Fix to docblock generator related to not catching all path parameters.
- Added typedoc plugin that generates ER Diagrams, which will be used specifically for data model references in commerce modules.
- Changed OAS tool to output references in `www/apps/api-reference/specs-v2` directory when the `--v2` option is used.
- Added a version switcher to the API reference to switch between V1 and V2. This switcher is enabled by an environment variable, so it won't be visible/usable at the moment.
- Upgraded docusaurus to v3.0.1
- Added new Vale rules to ensure correct spelling of Medusa Admin and module names.
- Added new components to the `docs-ui` package that will be used in future documentation changes.
This commit is contained in:
Shahed Nasser
2024-03-18 09:47:35 +02:00
committed by GitHub
parent 56a6ec0227
commit bb87db8342
2008 changed files with 15716 additions and 10536 deletions
@@ -111,7 +111,7 @@ You can also create endpoints that don't reside under these two prefixes, simila
## CORS Configuration
If youre adding a storefront or admin endpoint and you want to access these endpoints from the storefront or Medusa admin, you need to pass your endpoints Cross-Origin Resource Origin (CORS) options using the `cors` package.
If youre adding a storefront or admin endpoint and you want to access these endpoints from the storefront or Medusa Admin, you need to pass your endpoints Cross-Origin Resource Origin (CORS) options using the `cors` package.
First, import the necessary utility functions and types from Medusa's packages with the `cors` package:
@@ -85,11 +85,11 @@ These are the directories present at the root of your Medusa backend.
### .cache
This directory will only be available if you have the Medusa admin installed and youve already started your Medusa backend at least once before. It holds all cached files related to building the Medusa admin assets.
This directory will only be available if you have the Medusa Admin installed and youve already started your Medusa backend at least once before. It holds all cached files related to building the Medusa Admin assets.
### build
This directory will only be available if you have the Medusa admin installed and youve either built your admin files or ran the Medusa backend at least once before. It holds the built files that are used to serve the admin in your browser.
This directory will only be available if you have the Medusa Admin installed and youve either built your admin files or ran the Medusa backend at least once before. It holds the built files that are used to serve the admin in your browser.
### data
@@ -129,10 +129,10 @@ If any of these directories are not available, you can create them yourself.
### admin
This directory holds all Medusa admin customizations. The main subdirectories of this directory are:
This directory holds all Medusa Admin customizations. The main subdirectories of this directory are:
- `widgets`: Holds all [Medusa admin widgets](../../admin/widgets.md).
- `routes`: Holds all [Medusa admin UI routes](../../admin/routes.md).
- `widgets`: Holds all [Medusa Admin widgets](../../admin/widgets.md).
- `routes`: Holds all [Medusa Admin UI routes](../../admin/routes.md).
### api
+2 -2
View File
@@ -10,7 +10,7 @@ In this document, you will learn how to build your own Medusa cache module.
Medusa provides ready-made modules for cache, including in-memory and Redis modules. If you prefer another technology used for caching in your commerce application, you can build a module locally and use it in your Medusa backend. You can also publish to NPM and reuse it across multiple Medusa backend instances.
In this document, you will learn how to build your own Medusa cache module based on Memcached as an example. This gives you a real-life example of creating the cache module. You can follow the general steps with any other caching system or service.
In this document, you will learn how to build your own Medusa cache module based on Memcached as an example. This gives you a real-life example of creating the Cache Module. You can follow the general steps with any other caching system or service.
---
@@ -250,7 +250,7 @@ module.exports = {
Make sure to replace the `path/to/custom-module` with a relative path from your Medusa backend to your module. You can learn more about module reference in the [Create Module documentation](../modules/create.mdx#module-reference).
You can also add any necessary options to the module. The options added in the example above are relevant to the memcached module and you can replace them with your own options.
You can also add any necessary options to the module. The options added in the example above are relevant to the Memcached Module and you can replace them with your own options.
Then, to test the module, run the Medusa backend which also runs your module:
+1 -1
View File
@@ -10,7 +10,7 @@ In this document, youll learn about the Redis cache module and how you can in
Medusas modular architecture allows developers to extend or replace the logic used for [caching](../overview.mdx). You can create a custom module, or you can use the modules Medusa provides.
One of these modules is the Redis module. This module allows you to utilize Redis for the caching functionality. This document will you guide you through installing the Redis module.
One of these modules is the Redis Module. This module allows you to utilize Redis for the caching functionality. This document will you guide you through installing the Redis Module.
---
@@ -11,9 +11,9 @@ In this document, youll learn about the Redis events module and how you can i
Medusas modular architecture allows developers to extend or completely replace the logic used for events. You can create a custom module, or you can use the modules Medusa provides.
One of these modules is the Redis module. This module allows you to utilize Redis for the event bus functionality. When installed, the Medusas events system is powered by BullMQ and `io-redis`. BullMQ is responsible for the message queue and worker, and `io-redis` is the underlying Redis client that BullMQ connects to for events storage.
One of these modules is the Redis Module. This module allows you to utilize Redis for the event bus functionality. When installed, the Medusas events system is powered by BullMQ and `io-redis`. BullMQ is responsible for the message queue and worker, and `io-redis` is the underlying Redis client that BullMQ connects to for events storage.
This document will you guide you through installing the Redis module.
This document will you guide you through installing the Redis Module.
---
@@ -13,7 +13,7 @@ In this document, youll learn what Modules are and how can you use them durin
Modules are self-contained, reusable pieces of code that encapsulate specific functionality or features within an ecommerce application. They foster separation of concerns, maintainability, and reusability by organizing code into smaller, independent units that can be easily managed, tested, and integrated with other modules.
Modules further increase Medusas extensibility. commerce modules, such as the cart engine, can be extended or entirely replaced with your own custom logic. They can also run independently of the core Medusa package, allowing you to utilize the commerce module within a larger commerce ecosystem. For example, you can use the Order module as an Order Management System (OMS) without using Medusas core.
Modules further increase Medusas extensibility. commerce modules, such as the cart engine, can be extended or entirely replaced with your own custom logic. They can also run independently of the core Medusa package, allowing you to utilize the commerce module within a larger commerce ecosystem. For example, you can use the Order Module as an Order Management System (OMS) without using Medusas core.
This also applies to core logic such as caching or events systems. You can use modules to integrate any logic or third-party service to handle this logic. This gives you greater flexibility in how you choose your tech stack.
@@ -199,7 +199,7 @@ By installing a Module in your project and expose its APIs based on the framewor
### Full-Fledged Ecommerce System
Developers can use Medusas toolkit to create their ecommerce system. With the use of the [create-medusa-app](../create-medusa-app.mdx) command, developers can set up a Medusa Backend, Medusa admin, and a storefront.
Developers can use Medusas toolkit to create their ecommerce system. With the use of the [create-medusa-app](../create-medusa-app.mdx) command, developers can set up a Medusa Backend, Medusa Admin, and a storefront.
![Full-Fledged Ecommerce System](https://res.cloudinary.com/dza7lstvk/image/upload/v1697707368/Medusa%20Docs/Diagrams/Social_Media_Graphics_vosikk.jpg)