Skip to content

Commit a429a26

Browse files
authored
docs: add Sanity integration guide (medusajs#10152)
* docs: add integrate to Sanity guide * address PR feedback * added more screenshots * edit introduction * added meta images + changes
1 parent 6680f69 commit a429a26

File tree

19 files changed

+2150
-92
lines changed

19 files changed

+2150
-92
lines changed

www/apps/resources/.content.eslintrc.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export default [
154154
"@typescript-eslint/ban-ts-comment": "off",
155155
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
156156
"@typescript-eslint/ban-types": "off",
157+
"@typescript-eslint/no-unused-expressions": "warn",
157158
},
158159
},
159160
]

www/apps/resources/app/architectural-modules/event/create/page.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ Create the file `src/modules/my-event/service.ts` that holds the implementation
2121
The Event Module's main service must extend the `AbstractEventBusModuleService` class imported from `@medusajs/framework/utils`:
2222

2323
```ts title="src/modules/my-event/service.ts"
24-
import { AbstractEventBusModuleService } from "@medusajs/framework/utils";
25-
import { Message } from "@medusajs/types";
24+
import { AbstractEventBusModuleService } from "@medusajs/framework/utils"
25+
import { Message } from "@medusajs/types"
2626

2727
class MyEventService extends AbstractEventBusModuleService {
2828
async emit<T>(data: Message<T> | Message<T>[], options: Record<string, unknown>): Promise<void> {
29-
throw new Error("Method not implemented.");
29+
throw new Error("Method not implemented.")
3030
}
3131
async releaseGroupedEvents(eventGroupId: string): Promise<void> {
32-
throw new Error("Method not implemented.");
32+
throw new Error("Method not implemented.")
3333
}
3434
async clearGroupedEvents(eventGroupId: string): Promise<void> {
35-
throw new Error("Method not implemented.");
35+
throw new Error("Method not implemented.")
3636
}
3737
}
3838

www/apps/resources/app/commerce-modules/auth/create-actor-type/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ export const deleteManagerWorkflow = createWorkflow(
382382
app_metadata: {
383383
// the ID is of the format `{actor_type}_id`.
384384
manager_id: input.id,
385-
}
386-
}
385+
},
386+
},
387387
})
388388

389389
const authIdentity = transform(

www/apps/resources/app/commerce-modules/cart/extend/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,8 @@ export const updateCustomFromCartWorkflow = createWorkflow(
513513
entity: "cart",
514514
fields: ["custom.*"],
515515
filters: {
516-
id: input.cart.id
517-
}
516+
id: input.cart.id,
517+
},
518518
})
519519

520520
// TODO create, update, or delete Custom record

www/apps/resources/app/commerce-modules/customer/extend/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ export const updateCustomFromCustomerWorkflow = createWorkflow(
526526
fields: ["custom.*"],
527527
filters: {
528528
id: input.customer.id,
529-
}
529+
},
530530
})
531531

532532
// TODO create, update, or delete Custom record

www/apps/resources/app/commerce-modules/product/extend/page.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ export const updateCustomFromProductWorkflow = createWorkflow(
532532
fields: ["custom.*"],
533533
filters: {
534534
id: input.product.id,
535-
}
535+
},
536536
})
537537

538538
// TODO create, update, or delete Custom record
@@ -549,7 +549,7 @@ Next, replace the `TODO` with the following:
549549
```ts title="src/workflows/update-custom-from-product/index.ts"
550550
const created = when({
551551
input,
552-
products
552+
products,
553553
}, (data) =>
554554
!data.products[0].custom &&
555555
data.input.additional_data?.custom_name?.length > 0
@@ -583,7 +583,7 @@ Next, replace the new `TODO` with the following:
583583
```ts title="src/workflows/update-custom-from-product/index.ts"
584584
const deleted = when({
585585
input,
586-
products
586+
products,
587587
}, (data) =>
588588
data.products[0].custom && (
589589
data.input.additional_data?.custom_name === null ||
@@ -592,13 +592,13 @@ const deleted = when({
592592
)
593593
.then(() => {
594594
deleteCustomStep({
595-
custom: products[0].custom
595+
custom: products[0].custom,
596596
})
597597

598598
dismissRemoteLinkStep({
599599
[HELLO_MODULE]: {
600-
custom_id: products[0].custom.id
601-
}
600+
custom_id: products[0].custom.id,
601+
},
602602
})
603603

604604
return products[0].custom.id
@@ -614,12 +614,12 @@ Finally, replace the new `TODO` with the following:
614614
```ts title="src/workflows/update-custom-from-product/index.ts"
615615
const updated = when({
616616
input,
617-
products
617+
products,
618618
}, (data) => data.products[0].custom && data.input.additional_data?.custom_name?.length > 0)
619619
.then(() => {
620620
const custom = updateCustomStep({
621621
id: products[0].custom.id,
622-
custom_name: input.additional_data.custom_name
622+
custom_name: input.additional_data.custom_name,
623623
})
624624

625625
return custom

www/apps/resources/app/commerce-modules/promotion/extend/page.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ export const updateCustomFromPromotionWorkflow = createWorkflow(
538538
fields: ["custom.*"],
539539
filters: {
540540
id: input.promotion.id,
541-
}
541+
},
542542
})
543543

544544
// TODO create, update, or delete Custom record
@@ -555,7 +555,7 @@ Next, replace the `TODO` with the following:
555555
```ts title="src/workflows/update-custom-from-promotion/index.ts"
556556
const created = when({
557557
input,
558-
promotions
558+
promotions,
559559
}, (data) =>
560560
!data.promotions[0].custom &&
561561
data.input.additional_data?.custom_name?.length > 0
@@ -589,7 +589,7 @@ Next, replace the new `TODO` with the following:
589589
```ts title="src/workflows/update-custom-from-promotion/index.ts"
590590
const deleted = when({
591591
input,
592-
promotions
592+
promotions,
593593
}, (data) =>
594594
data.promotions[0].custom && (
595595
data.input.additional_data?.custom_name === null ||
@@ -598,13 +598,13 @@ const deleted = when({
598598
)
599599
.then(() => {
600600
deleteCustomStep({
601-
custom: promotions[0].custom
601+
custom: promotions[0].custom,
602602
})
603603

604604
dismissRemoteLinkStep({
605605
[HELLO_MODULE]: {
606-
custom_id: promotions[0].custom.id
607-
}
606+
custom_id: promotions[0].custom.id,
607+
},
608608
})
609609

610610
return promotions[0].custom.id
@@ -620,12 +620,12 @@ Finally, replace the new `TODO` with the following:
620620
```ts title="src/workflows/update-custom-from-promotion/index.ts"
621621
const updated = when({
622622
input,
623-
promotions
623+
promotions,
624624
}, (data) => data.promotions[0].custom && data.input.additional_data?.custom_name?.length > 0)
625625
.then(() => {
626626
const custom = updateCustomStep({
627627
id: promotions[0].custom.id,
628-
custom_name: input.additional_data.custom_name
628+
custom_name: input.additional_data.custom_name,
629629
})
630630

631631
return custom

www/apps/resources/app/contribution-guidelines/admin-translations/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ export const languages: Language[] = [
9090
code: "da",
9191
display_name: "Danish",
9292
ltr: true,
93-
date_locale: da
94-
}
93+
date_locale: da,
94+
},
9595
]
9696
```
9797

3.68 MB
Loading

0 commit comments

Comments
 (0)