Skip to content

Commit

Permalink
docs: added examples page (#9587)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
shahednasser authored Oct 16, 2024
1 parent ddcb749 commit 6e856d3
Show file tree
Hide file tree
Showing 15 changed files with 4,301 additions and 546 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion www/apps/book/app/basics/modules/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ The last step is to add the module in Medusa’s configurations.

In `medusa-config.ts`, add a `modules` property and pass in it your custom module:

```ts title="medusa-config.ts" highlights={[["6", "helloModuleService", "The key of the main service to be registered in the Medusa container."]]}
```ts title="medusa-config.ts" highlights={[["7"]]}
module.exports = defineConfig({
projectConfig: {
// ...
Expand Down
151 changes: 0 additions & 151 deletions www/apps/book/app/more-resources/examples/page.mdx

This file was deleted.

1 change: 0 additions & 1 deletion www/apps/book/generated/edit-dates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export const generatedEditDates = {
"app/customization/next-steps/page.mdx": "2024-09-12T10:50:04.873Z",
"app/customization/page.mdx": "2024-09-12T11:16:18.504Z",
"app/more-resources/cheatsheet/page.mdx": "2024-07-11T16:11:26.480Z",
"app/more-resources/examples/page.mdx": "2024-10-03T11:12:50.956Z",
"app/architecture/architectural-modules/page.mdx": "2024-09-23T12:51:04.520Z",
"app/architecture/overview/page.mdx": "2024-09-23T12:55:01.339Z",
"app/advanced-development/data-models/infer-type/page.mdx": "2024-09-30T08:43:53.123Z",
Expand Down
11 changes: 8 additions & 3 deletions www/apps/book/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,18 @@ const nextConfig = {
{
source: "/basics/modules-and-services",
destination: "/basics/modules",
permanent: true
permanent: true,
},
{
source: "/basics/data-models",
destination: "/basics/modules",
permanent: true
}
permanent: true,
},
{
source: "/more-resources/examples",
destination: "/resources/examples",
permanent: true,
},
]
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChildDocs } from "docs-ui"
import { CardList } from "docs-ui"

export const metadata = {
title: `Payment Module Provider`,
Expand All @@ -18,7 +18,15 @@ After the payment session is authorized, the payment provider is associated with

### List of Payment Module Providers

<ChildDocs type="item" />
<CardList
items={[
{
href: "/commerce-modules/payment/payment-provider/stripe",
title: "Stripe"
}
]}
/>


---

Expand Down
Loading

0 comments on commit 6e856d3

Please sign in to comment.