docs: added examples page (#9587)

- Added an examples page with examples of all different concepts in Medusa. We'll probably add more examples with time as we see the need for them.
- Small fixes in different pages.

Preview: https://resources-docs-ocb5uyp0o-medusajs.vercel.app/v2/resources/examples
This commit is contained in:
Shahed Nasser
2024-10-16 10:07:39 +00:00
committed by GitHub
parent ddcb749bc4
commit 6e856d3156
15 changed files with 4301 additions and 546 deletions
@@ -55,7 +55,7 @@ For example:
```ts highlights={[["9"]]}
import {
LoaderOptions,
} from "@medusajs/framework/modules-sdk"
} from "@medusajs/framework/types"
import {
ContainerRegistrationKeys
} from "@medusajs/framework/utils"
@@ -28,8 +28,8 @@ So, to run database queries in a service:
For example, in your service, add the following methods:
export const methodsHighlight = [
["4", "getCount", "Retrieves the number of records in `my_custom` using the `count` method."],
["8", "getCountSql", "Retrieves the number of records in `my_custom` using the `execute` method."]
["11", "getCount", "Retrieves the number of records in `my_custom` using the `count` method."],
["18", "getCountSql", "Retrieves the number of records in `my_custom` using the `execute` method."]
]
```ts highlights={methodsHighlight}
@@ -81,7 +81,7 @@ For example:
```ts title="src/modules/hello/loaders/hello-world.ts" highlights={[["11"], ["12", "ModuleOptions", "The type of expected module options."], ["16"]]}
import {
LoaderOptions,
} from "@medusajs/framework/modules-sdk"
} from "@medusajs/framework/types"
// recommended to define type in another file
type ModuleOptions = {