Skip to content

Commit f7e4a80

Browse files
authored
docs: remove usages of ts-ignore in examples (medusajs#12839)
1 parent 7d95eb7 commit f7e4a80

File tree

25 files changed

+17689
-169
lines changed

25 files changed

+17689
-169
lines changed

www/apps/book/app/learn/customization/integrate-systems/handle-event/page.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ Learn more about compensation functions in [this chapter](../../../fundamentals/
157157
You can now create the workflow that uses the above step. Add the workflow to the same `src/workflows/sync-brands-to-cms.ts` file:
158158

159159
export const syncWorkflowHighlights = [
160-
["19", "useQueryGraphStep", "Retrieve the brand's details."],
161-
["23", "id", "Filter by the brand's ID."],
162-
["26", "throwIfKeyNotFound", "Throw an error if a brand with the specified ID doesn't exist."],
163-
["30", "syncBrandToCmsStep", "Create the brand in the third-party CMS."]
160+
["18", "useQueryGraphStep", "Retrieve the brand's details."],
161+
["22", "id", "Filter by the brand's ID."],
162+
["25", "throwIfKeyNotFound", "Throw an error if a brand with the specified ID doesn't exist."],
163+
["29", "syncBrandToCmsStep", "Create the brand in the third-party CMS."]
164164
]
165165

166166
```ts title="src/workflows/sync-brands-to-cms.ts" highlights={syncWorkflowHighlights}
@@ -181,7 +181,6 @@ type SyncBrandToCmsWorkflowInput = {
181181
export const syncBrandToCmsWorkflow = createWorkflow(
182182
"sync-brand-to-cms",
183183
(input: SyncBrandToCmsWorkflowInput) => {
184-
// @ts-ignore
185184
const { data: brands } = useQueryGraphStep({
186185
entity: "brand",
187186
fields: ["*"],

www/apps/book/app/learn/fundamentals/framework/page.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,6 @@ type WorkflowInput = {
903903
export const sendOrderConfirmationWorkflow = createWorkflow(
904904
"send-order-confirmation",
905905
({ id }: WorkflowInput) => {
906-
// @ts-ignore
907906
const { data: orders } = useQueryGraphStep({
908907
entity: "order",
909908
fields: [

www/apps/book/generated/edit-dates.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const generatedEditDates = {
8484
"app/learn/customization/extend-features/define-link/page.mdx": "2025-04-17T08:50:17.036Z",
8585
"app/learn/customization/extend-features/page.mdx": "2024-12-09T11:02:39.244Z",
8686
"app/learn/customization/extend-features/query-linked-records/page.mdx": "2025-04-18T07:41:05.912Z",
87-
"app/learn/customization/integrate-systems/handle-event/page.mdx": "2024-12-24T15:09:24.653Z",
87+
"app/learn/customization/integrate-systems/handle-event/page.mdx": "2025-06-26T14:26:15.310Z",
8888
"app/learn/customization/integrate-systems/page.mdx": "2024-12-09T10:40:08.528Z",
8989
"app/learn/customization/integrate-systems/schedule-task/page.mdx": "2025-01-28T16:42:42.071Z",
9090
"app/learn/customization/integrate-systems/service/page.mdx": "2024-12-09T11:02:39.594Z",
@@ -117,7 +117,7 @@ export const generatedEditDates = {
117117
"app/learn/production/worker-mode/page.mdx": "2025-03-11T15:21:50.906Z",
118118
"app/learn/fundamentals/module-links/read-only/page.mdx": "2025-05-13T15:04:12.107Z",
119119
"app/learn/fundamentals/data-models/properties/page.mdx": "2025-03-18T07:57:17.826Z",
120-
"app/learn/fundamentals/framework/page.mdx": "2025-04-25T14:26:25.000Z",
120+
"app/learn/fundamentals/framework/page.mdx": "2025-06-26T14:26:22.120Z",
121121
"app/learn/fundamentals/api-routes/retrieve-custom-links/page.mdx": "2025-04-25T14:26:25.000Z",
122122
"app/learn/fundamentals/workflows/errors/page.mdx": "2025-04-25T14:26:25.000Z",
123123
"app/learn/fundamentals/api-routes/override/page.mdx": "2025-05-09T08:01:24.493Z",

www/apps/book/public/llms-full.txt

Lines changed: 17570 additions & 35 deletions
Large diffs are not rendered by default.

www/apps/book/scripts/prepare.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ async function main() {
284284
},
285285
allowedFilesPatterns: [/^(?!.*\/(colors|icons|hooks)\/).*$/],
286286
},
287+
{
288+
dir: path.join(process.cwd(), "..", "resources", "app", "recipes"),
289+
},
287290
],
288291
})
289292
}

www/apps/resources/app/examples/guides/custom-item-price/page.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,8 @@ Create the file `src/workflows/add-custom-to-cart.ts` with the following content
518518
![The directory structure after adding the workflow file.](https://res.cloudinary.com/dza7lstvk/image/upload/v1738251380/Medusa%20Resources/custom-item-price-5_zorahv.jpg)
519519

520520
export const workflowHighlights = [
521-
["18", "useQueryGraphStep", "Retrieve the cart's details."],
522-
["24", "useQueryGraphStep", "Retrieve the variant's details."],
521+
["17", "useQueryGraphStep", "Retrieve the cart's details."],
522+
["23", "useQueryGraphStep", "Retrieve the variant's details."],
523523
]
524524

525525
```ts title="src/workflows/add-custom-to-cart.ts" highlights={workflowHighlights}
@@ -539,7 +539,6 @@ type AddCustomToCartWorkflowInput = {
539539
export const addCustomToCartWorkflow = createWorkflow(
540540
"add-custom-to-cart",
541541
({ cart_id, item }: AddCustomToCartWorkflowInput) => {
542-
// @ts-ignore
543542
const { data: carts } = useQueryGraphStep({
544543
entity: "cart",
545544
filters: { id: cart_id },
@@ -651,7 +650,6 @@ import { WorkflowResponse } from "@medusajs/framework/workflows-sdk"
651650
And replace the last `TODO` in the workflow with the following:
652651

653652
```ts title="src/workflows/add-custom-to-cart.ts"
654-
// @ts-ignore
655653
const { data: updatedCarts } = useQueryGraphStep({
656654
entity: "cart",
657655
filters: { id: cart_id },

www/apps/resources/app/examples/guides/quote-management/page.mdx

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ You can now create the workflow using the steps provided by Medusa and your cust
635635
To create the workflow, create the file `src/workflows/create-request-for-quote.ts` with the following content:
636636

637637
export const createRequestForQuoteHighlights = [
638-
["25", "useQueryGraphStep", "Retrieve the cart's details."],
639-
["46", "useQueryGraphStep", "Retrieve the customer's details."]
638+
["24", "useQueryGraphStep", "Retrieve the cart's details."],
639+
["45", "useQueryGraphStep", "Retrieve the customer's details."]
640640
]
641641

642642
```ts title="src/workflows/create-request-for-quote.ts" highlights={createRequestForQuoteHighlights} collapsibleLines="1-20" expandButtonLabel="Show Imports"
@@ -663,7 +663,6 @@ type WorkflowInput = {
663663
export const createRequestForQuoteWorkflow = createWorkflow(
664664
"create-request-for-quote",
665665
(input: WorkflowInput) => {
666-
// @ts-ignore
667666
const { data: carts } = useQueryGraphStep({
668667
entity: "cart",
669668
fields: [
@@ -2584,9 +2583,9 @@ You can now implement the merchant-rejection workflow. Create the file `src/work
25842583
![Diagram showcasing the directory structure after adding the merchant reject quote workflow file](https://res.cloudinary.com/dza7lstvk/image/upload/v1741159969/Medusa%20Resources/quote-36_l1ffxm.jpg)
25852584

25862585
export const merchantRejectionWorkflowHighlights = [
2587-
["15", "useQueryGraphStep", "Retrieve the quote's details."],
2588-
["24", "validateQuoteNotAccepted", "Validate that the quote isn't already accepted by the customer."],
2589-
["29", "updateQuotesStep", "Update the quote's status to `merchant_rejected`."]
2586+
["14", "useQueryGraphStep", "Retrieve the quote's details."],
2587+
["23", "validateQuoteNotAccepted", "Validate that the quote isn't already accepted by the customer."],
2588+
["28", "updateQuotesStep", "Update the quote's status to `merchant_rejected`."]
25902589
]
25912590

25922591
```ts title="src/workflows/merchant-reject-quote.ts" highlights={merchantRejectionWorkflowHighlights}
@@ -2603,7 +2602,6 @@ type WorkflowInput = {
26032602
export const merchantRejectQuoteWorkflow = createWorkflow(
26042603
"merchant-reject-quote-workflow",
26052604
(input: WorkflowInput) => {
2606-
// @ts-ignore
26072605
const { data: quotes } = useQueryGraphStep({
26082606
entity: "quote",
26092607
fields: ["id", "status"],
@@ -2905,7 +2903,6 @@ type WorkflowInput = {
29052903
export const merchantSendQuoteWorkflow = createWorkflow(
29062904
"merchant-send-quote-workflow",
29072905
(input: WorkflowInput) => {
2908-
// @ts-ignore
29092906
const { data: quotes } = useQueryGraphStep({
29102907
entity: "quote",
29112908
fields: ["id", "status"],
@@ -3282,9 +3279,9 @@ Create the file `src/workflows/customer-reject-quote.ts` with the following cont
32823279
![Directory structure after adding the customer reject quote workflow file](https://res.cloudinary.com/dza7lstvk/image/upload/v1741164371/Medusa%20Resources/quote-41_fgpqhz.jpg)
32833280

32843281
export const customerRejectQuoteHighlights = [
3285-
["16", "useQueryGraphStep", "Retrieve the quote's details."],
3286-
["25", "validateQuoteNotAccepted", "Validate that the quote isn't already accepted by the customer."],
3287-
["30", "updateQuotesStep", "Update the quote's status to `customer_rejected`."]
3282+
["15", "useQueryGraphStep", "Retrieve the quote's details."],
3283+
["24", "validateQuoteNotAccepted", "Validate that the quote isn't already accepted by the customer."],
3284+
["29", "updateQuotesStep", "Update the quote's status to `customer_rejected`."]
32883285
]
32893286

32903287
```ts title="src/workflows/customer-reject-quote.ts" highlights={customerRejectQuoteHighlights}
@@ -3302,7 +3299,6 @@ type WorkflowInput = {
33023299
export const customerRejectQuoteWorkflow = createWorkflow(
33033300
"customer-reject-quote-workflow",
33043301
(input: WorkflowInput) => {
3305-
// @ts-ignore
33063302
const { data: quotes } = useQueryGraphStep({
33073303
entity: "quote",
33083304
fields: ["id", "status"],
@@ -3511,11 +3507,11 @@ You can now implement the workflow that accepts a quote for a customer. Create t
35113507
![Directory structure after adding the customer accept quote workflow file](https://res.cloudinary.com/dza7lstvk/image/upload/v1741166025/Medusa%20Resources/quote-44_c09ts9.jpg)
35123508

35133509
export const customerAcceptQuoteHighlights = [
3514-
["21", "useQueryGraphStep", "Retrieve the quote's details."],
3515-
["30", "validateQuoteCanAcceptStep", "Validate that the quote can be accepted."],
3516-
["35", "updateQuotesStep", "Update the quote's status to `accepted`."],
3517-
["40", "confirmOrderEditRequestWorkflow", "Confirm the changes made on the draft order, such as changes to item quantities and prices."],
3518-
["47", "updateOrderWorkflow", "Update the draft order to change its status and convert it into an order."]
3510+
["20", "useQueryGraphStep", "Retrieve the quote's details."],
3511+
["29", "validateQuoteCanAcceptStep", "Validate that the quote can be accepted."],
3512+
["34", "updateQuotesStep", "Update the quote's status to `accepted`."],
3513+
["39", "confirmOrderEditRequestWorkflow", "Confirm the changes made on the draft order, such as changes to item quantities and prices."],
3514+
["46", "updateOrderWorkflow", "Update the draft order to change its status and convert it into an order."]
35193515
]
35203516

35213517
```ts title="src/workflows/customer-accept-quote.ts" highlights={customerAcceptQuoteHighlights}
@@ -3538,7 +3534,6 @@ type WorkflowInput = {
35383534
export const customerAcceptQuoteWorkflow = createWorkflow(
35393535
"customer-accept-quote-workflow",
35403536
(input: WorkflowInput) => {
3541-
// @ts-ignore
35423537
const { data: quotes } = useQueryGraphStep({
35433538
entity: "quote",
35443539
fields: ["id", "draft_order_id", "status"],

www/apps/resources/app/how-to-tutorials/tutorials/abandoned-cart/page.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,9 @@ const {
558558
updated_at: {
559559
$lt: oneDayAgo,
560560
},
561-
// @ts-ignore
562561
email: {
563562
$ne: null,
564563
},
565-
// @ts-ignore
566564
completed_at: null,
567565
},
568566
pagination: {

www/apps/resources/app/how-to-tutorials/tutorials/first-purchase-discounts/page.mdx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ To create the workflow, create the file `src/workflows/apply-first-purchase-prom
202202

203203
export const workflowHighlights = [
204204
["7", "cart_id", "Receive cart ID as input."],
205-
["14", "carts", "Retrieve the cart's details."],
206-
["23", "promotions", "Retrieve the first-purchase promotion's details."],
207-
["32", "when", "Check if the first-purchase promotion can be applied."],
208-
["42", "updateCartPromotionsStep", "Add the first-purchase promotion to the cart."],
209-
["51", "updatedCarts", "Retrieve the updated cart's details."],
210-
["59", "WorkflowResponse", "Return the updated cart's details."]
205+
["13", "carts", "Retrieve the cart's details."],
206+
["21", "promotions", "Retrieve the first-purchase promotion's details."],
207+
["29", "when", "Check if the first-purchase promotion can be applied."],
208+
["39", "updateCartPromotionsStep", "Add the first-purchase promotion to the cart."],
209+
["47", "updatedCarts", "Retrieve the updated cart's details."],
210+
["55", "WorkflowResponse", "Return the updated cart's details."]
211211
]
212212

213213
```ts title="src/workflows/apply-first-purchase-promo.ts" highlights={workflowHighlights}
@@ -223,7 +223,6 @@ type WorkflowInput = {
223223
export const applyFirstPurchasePromoWorkflow = createWorkflow(
224224
"apply-first-purchase-promo",
225225
(input: WorkflowInput) => {
226-
// @ts-ignore
227226
const { data: carts } = useQueryGraphStep({
228227
entity: "cart",
229228
fields: ["promotions.*", "customer.*", "customer.orders.*"],
@@ -232,12 +231,10 @@ export const applyFirstPurchasePromoWorkflow = createWorkflow(
232231
}
233232
})
234233

235-
// @ts-ignore
236234
const { data: promotions } = useQueryGraphStep({
237235
entity: "promotion",
238236
fields: ["code"],
239237
filters: {
240-
// @ts-ignore
241238
code: FIRST_PURCHASE_PROMOTION_CODE
242239
}
243240
}).config({ name: "retrieve-promotions" })
@@ -260,7 +257,6 @@ export const applyFirstPurchasePromoWorkflow = createWorkflow(
260257
})
261258

262259
// retrieve updated cart
263-
// @ts-ignore
264260
const { data: updatedCarts } = useQueryGraphStep({
265261
entity: "cart",
266262
fields: ["*", "promotions.*"],

www/apps/resources/app/how-to-tutorials/tutorials/loyalty-points/page.mdx

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -835,14 +835,14 @@ Now that you have all the steps, you can create the workflow that uses them.
835835
To create the workflow, create the file `src/workflows/handle-order-points.ts` with the following content:
836836

837837
export const handleOrderPointsHighlights = [
838-
["18", "useQueryGraphStep", "Retrieve the order's details."],
839-
["38", "validateCustomerExistsStep", "Validate that the customer is registered."],
840-
["42", "getCartLoyaltyPromoStep", "Retrieve the cart's loyalty promotion."],
841-
["46", "when", "Check whether the order's cart has a loyalty promotion."],
842-
["51", "deductPurchasePointsStep", "Deduct points from the customer's loyalty points."],
843-
["56", "updatePromotionsStep", "Deactivate the cart's loyalty promotion."],
844-
["65", "when", "Check whether the order's cart doesn't have a loyalty promotion."],
845-
["70", "addPurchaseAsPointsStep", "Add points to the customer's loyalty points."],
838+
["17", "useQueryGraphStep", "Retrieve the order's details."],
839+
["37", "validateCustomerExistsStep", "Validate that the customer is registered."],
840+
["41", "getCartLoyaltyPromoStep", "Retrieve the cart's loyalty promotion."],
841+
["45", "when", "Check whether the order's cart has a loyalty promotion."],
842+
["50", "deductPurchasePointsStep", "Deduct points from the customer's loyalty points."],
843+
["55", "updatePromotionsStep", "Deactivate the cart's loyalty promotion."],
844+
["64", "when", "Check whether the order's cart doesn't have a loyalty promotion."],
845+
["69", "addPurchaseAsPointsStep", "Add points to the customer's loyalty points."],
846846
]
847847

848848
```ts title="src/workflows/handle-order-points.ts" highlights={handleOrderPointsHighlights} collapsibleLines="1-9" expandButtonLabel="Show Imports"
@@ -862,7 +862,6 @@ type WorkflowInput = {
862862
export const handleOrderPointsWorkflow = createWorkflow(
863863
"handle-order-points",
864864
({ order_id }: WorkflowInput) => {
865-
// @ts-ignore
866865
const { data: orders } = useQueryGraphStep({
867866
entity: "order",
868867
fields: [
@@ -1394,10 +1393,10 @@ You can now create the workflow that applies a loyalty promotion to the cart.
13941393
To create the workflow, create the file `src/workflows/apply-loyalty-on-cart.ts` with the following content:
13951394

13961395
export const applyLoyaltyOnCartWorkflowHighlights = [
1397-
["45", "useQueryGraphStep", "Retrieve the cart's details."],
1398-
["56", "validateCustomerExistsStep", "Validate that the customer is registered."],
1399-
["60", "getCartLoyaltyPromoStep", "Retrieve the cart's loyalty promotion."],
1400-
["65", "getCartLoyaltyPromoAmountStep", "Get the amount to be discounted based on the loyalty points."],
1396+
["44", "useQueryGraphStep", "Retrieve the cart's details."],
1397+
["55", "validateCustomerExistsStep", "Validate that the customer is registered."],
1398+
["59", "getCartLoyaltyPromoStep", "Retrieve the cart's loyalty promotion."],
1399+
["64", "getCartLoyaltyPromoAmountStep", "Get the amount to be discounted based on the loyalty points."],
14011400
]
14021401

14031402
```ts title="src/workflows/apply-loyalty-on-cart.ts" highlights={applyLoyaltyOnCartWorkflowHighlights} collapsibleLines="1-24" expandButtonLabel="Show Imports"
@@ -1444,7 +1443,6 @@ const fields = [
14441443
export const applyLoyaltyOnCartWorkflow = createWorkflow(
14451444
"apply-loyalty-on-cart",
14461445
(input: WorkflowInput) => {
1447-
// @ts-ignore
14481446
const { data: carts } = useQueryGraphStep({
14491447
entity: "cart",
14501448
fields,
@@ -1559,7 +1557,7 @@ export const createLoyaltyPromoStepHighlights = [
15591557
["5", "transform", "Prepare the data to update the cart's promotions."],
15601558
["25", "updateCartPromotionsWorkflow", "Update the cart's promotions with the new loyalty promotion."],
15611559
["29", "updateCartsStep", "Update the cart to store the ID of the loyalty promotion in the metadata."],
1562-
["38", "useQueryGraphStep", "Retrieve the cart's details again."],
1560+
["37", "useQueryGraphStep", "Retrieve the cart's details again."],
15631561
]
15641562

15651563
```ts title="src/workflows/apply-loyalty-on-cart.ts" highlights={createLoyaltyPromoStepHighlights}
@@ -1599,7 +1597,6 @@ updateCartsStep([
15991597
])
16001598

16011599
// retrieve cart with updated promotions
1602-
// @ts-ignore
16031600
const { data: updatedCarts } = useQueryGraphStep({
16041601
entity: "cart",
16051602
fields,
@@ -1800,13 +1797,13 @@ Since you already have all the steps, you can create the workflow.
18001797
To create the workflow, create the file `src/workflows/remove-loyalty-from-cart.ts` with the following content:
18011798

18021799
export const removeLoyaltyFromCartWorkflowHighlights = [
1803-
["36", "useQueryGraphStep", "Retrieve the cart's details."],
1804-
["44", "getCartLoyaltyPromoStep", "Retrieve the cart's loyalty promotion."],
1805-
["49", "updateCartPromotionsWorkflow", "Update the cart's promotions to remove the loyalty promotion."],
1806-
["57", "transform", "Prepare the new metadata to remove the loyalty promotion ID."],
1807-
["68", "updateCartsStep", "Update the cart to remove the loyalty promotion ID from the metadata."],
1808-
["75", "updatePromotionsStep", "Deactivate the loyalty promotion."],
1809-
["84", "useQueryGraphStep", "Retrieve the cart's details again."],
1800+
["35", "useQueryGraphStep", "Retrieve the cart's details."],
1801+
["43", "getCartLoyaltyPromoStep", "Retrieve the cart's loyalty promotion."],
1802+
["48", "updateCartPromotionsWorkflow", "Update the cart's promotions to remove the loyalty promotion."],
1803+
["56", "transform", "Prepare the new metadata to remove the loyalty promotion ID."],
1804+
["67", "updateCartsStep", "Update the cart to remove the loyalty promotion ID from the metadata."],
1805+
["74", "updatePromotionsStep", "Deactivate the loyalty promotion."],
1806+
["82", "useQueryGraphStep", "Retrieve the cart's details again."],
18101807
]
18111808

18121809
```ts title="src/workflows/remove-loyalty-from-cart.ts" collapsibleLines="1-15" expandButtonLabel="Show Imports" highlights={removeLoyaltyFromCartWorkflowHighlights}
@@ -1844,7 +1841,6 @@ const fields = [
18441841
export const removeLoyaltyFromCartWorkflow = createWorkflow(
18451842
"remove-loyalty-from-cart",
18461843
(input: WorkflowInput) => {
1847-
// @ts-ignore
18481844
const { data: carts } = useQueryGraphStep({
18491845
entity: "cart",
18501846
fields,
@@ -1892,7 +1888,6 @@ export const removeLoyaltyFromCartWorkflow = createWorkflow(
18921888
])
18931889

18941890
// retrieve cart with updated promotions
1895-
// @ts-ignore
18961891
const { data: updatedCarts } = useQueryGraphStep({
18971892
entity: "cart",
18981893
fields,

0 commit comments

Comments
 (0)