@mercurjs/docs 2.2.1 → 2.3.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/content/home.mdx +107 -0
- package/content/learn/architecture.mdx +168 -83
- package/content/learn/introduction.mdx +161 -56
- package/content/learn/migration-to-2-0.mdx +187 -0
- package/content/learn/why-mercur.mdx +91 -0
- package/content/platform/attribute/concepts/attribute-types.mdx +59 -0
- package/content/platform/attribute/concepts/global-vs-inline.mdx +50 -0
- package/content/platform/attribute/concepts/variant-axes.mdx +61 -0
- package/content/platform/attribute/guides/attach-attributes-to-a-product.mdx +69 -0
- package/content/platform/attribute/guides/create-a-variant-axis.mdx +83 -0
- package/content/platform/attribute/guides/create-an-attribute.mdx +81 -0
- package/content/platform/attribute/overview.mdx +87 -0
- package/content/platform/attribute/reference/data-models.mdx +56 -0
- package/content/platform/attribute/reference/events.mdx +41 -0
- package/content/platform/attribute/reference/links.mdx +45 -0
- package/content/platform/attribute/reference/service.mdx +49 -0
- package/content/platform/attribute/reference/workflows.mdx +45 -0
- package/content/platform/catalog/concepts/master-products.mdx +54 -0
- package/content/platform/catalog/concepts/product-seller-allowlist.mdx +48 -0
- package/content/platform/catalog/concepts/status-lifecycle.mdx +58 -0
- package/content/platform/catalog/concepts/variants-categories-collections.mdx +49 -0
- package/content/platform/catalog/guides/allowlist-stores.mdx +59 -0
- package/content/platform/catalog/guides/create-a-master-product.mdx +70 -0
- package/content/platform/catalog/guides/publish-or-reject-a-product.mdx +79 -0
- package/content/platform/catalog/overview.mdx +90 -0
- package/content/platform/catalog/reference/data-models.mdx +66 -0
- package/content/platform/catalog/reference/events.mdx +41 -0
- package/content/platform/catalog/reference/links.mdx +44 -0
- package/content/platform/catalog/reference/service.mdx +52 -0
- package/content/platform/catalog/reference/workflows.mdx +40 -0
- package/content/platform/commission/concepts/order-commission-lines.mdx +65 -0
- package/content/platform/commission/concepts/rule-matching.mdx +86 -0
- package/content/platform/commission/concepts/rules-and-rates.mdx +84 -0
- package/content/platform/commission/guides/batch-update-rules.mdx +58 -0
- package/content/platform/commission/guides/create-a-rate.mdx +72 -0
- package/content/platform/commission/guides/refresh-order-commission-lines.mdx +55 -0
- package/content/platform/commission/overview.mdx +86 -0
- package/content/platform/commission/reference/data-models.mdx +75 -0
- package/content/platform/commission/reference/events.mdx +58 -0
- package/content/platform/commission/reference/links.mdx +45 -0
- package/content/platform/commission/reference/service.mdx +51 -0
- package/content/platform/commission/reference/workflows.mdx +40 -0
- package/content/platform/offer/concepts/pricing-and-inventory.mdx +72 -0
- package/content/platform/offer/concepts/shipping.mdx +48 -0
- package/content/platform/offer/concepts/what-is-an-offer.mdx +65 -0
- package/content/platform/offer/guides/bulk-create-offers.mdx +84 -0
- package/content/platform/offer/guides/create-an-offer.mdx +83 -0
- package/content/platform/offer/guides/manage-offer-inventory.mdx +53 -0
- package/content/platform/offer/overview.mdx +84 -0
- package/content/platform/offer/reference/data-models.mdx +56 -0
- package/content/platform/offer/reference/events.mdx +39 -0
- package/content/platform/offer/reference/links.mdx +60 -0
- package/content/platform/offer/reference/service.mdx +53 -0
- package/content/platform/offer/reference/workflows.mdx +38 -0
- package/content/platform/order-group/concepts/computed-totals.mdx +59 -0
- package/content/platform/order-group/concepts/order-splitting.mdx +61 -0
- package/content/platform/order-group/concepts/the-order-group.mdx +64 -0
- package/content/platform/order-group/guides/list-order-groups.mdx +67 -0
- package/content/platform/order-group/guides/retrieve-an-order-group.mdx +63 -0
- package/content/platform/order-group/guides/split-a-cart.mdx +58 -0
- package/content/platform/order-group/overview.mdx +83 -0
- package/content/platform/order-group/reference/data-models.mdx +40 -0
- package/content/platform/order-group/reference/events.mdx +37 -0
- package/content/platform/order-group/reference/links.mdx +45 -0
- package/content/platform/order-group/reference/service.mdx +50 -0
- package/content/platform/order-group/reference/workflows.mdx +39 -0
- package/content/platform/payout/concepts/account-lifecycle.mdx +75 -0
- package/content/platform/payout/concepts/accounts-and-onboarding.mdx +70 -0
- package/content/platform/payout/concepts/payout-pipeline.mdx +99 -0
- package/content/platform/payout/guides/create-a-payout-account.mdx +59 -0
- package/content/platform/payout/guides/process-a-provider-webhook.mdx +74 -0
- package/content/platform/payout/guides/start-provider-onboarding.mdx +50 -0
- package/content/platform/payout/overview.mdx +86 -0
- package/content/platform/payout/reference/data-models.mdx +61 -0
- package/content/platform/payout/reference/events.mdx +48 -0
- package/content/platform/payout/reference/links.mdx +36 -0
- package/content/platform/payout/reference/service.mdx +53 -0
- package/content/platform/payout/reference/workflows.mdx +32 -0
- package/content/platform/product-edit/concepts/change-actions.mdx +66 -0
- package/content/platform/product-edit/concepts/change-pipeline.mdx +69 -0
- package/content/platform/product-edit/concepts/status-and-auto-confirm.mdx +66 -0
- package/content/platform/product-edit/guides/confirm-or-decline-a-change.mdx +76 -0
- package/content/platform/product-edit/guides/edit-a-product.mdx +74 -0
- package/content/platform/product-edit/guides/request-a-revision.mdx +54 -0
- package/content/platform/product-edit/overview.mdx +85 -0
- package/content/platform/product-edit/reference/data-models.mdx +65 -0
- package/content/platform/product-edit/reference/events.mdx +47 -0
- package/content/platform/product-edit/reference/links.mdx +39 -0
- package/content/platform/product-edit/reference/service.mdx +43 -0
- package/content/platform/product-edit/reference/workflows.mdx +49 -0
- package/content/platform/review/concepts/product-vs-seller-reviews.mdx +63 -0
- package/content/platform/review/concepts/ratings-and-moderation.mdx +64 -0
- package/content/platform/review/concepts/the-review-model.mdx +56 -0
- package/content/platform/review/guides/compute-aggregate-ratings.mdx +57 -0
- package/content/platform/review/guides/create-a-review.mdx +55 -0
- package/content/platform/review/guides/moderate-a-review.mdx +58 -0
- package/content/platform/review/guides/respond-to-a-review.mdx +61 -0
- package/content/platform/review/overview.mdx +87 -0
- package/content/platform/review/reference/data-models.mdx +36 -0
- package/content/platform/review/reference/events.mdx +61 -0
- package/content/platform/review/reference/links.mdx +43 -0
- package/content/platform/review/reference/service.mdx +54 -0
- package/content/platform/review/reference/workflows.mdx +31 -0
- package/content/platform/store/concepts/lifecycle.mdx +62 -0
- package/content/platform/store/concepts/store-entity.mdx +53 -0
- package/content/platform/store/concepts/team.mdx +50 -0
- package/content/platform/store/guides/create-a-store.mdx +55 -0
- package/content/platform/store/guides/manage-the-team.mdx +55 -0
- package/content/platform/store/guides/moderate-a-store.mdx +59 -0
- package/content/platform/store/overview.mdx +86 -0
- package/content/platform/store/reference/data-models.mdx +89 -0
- package/content/platform/store/reference/events.mdx +43 -0
- package/content/platform/store/reference/links.mdx +71 -0
- package/content/platform/store/reference/service.mdx +51 -0
- package/content/platform/store/reference/workflows.mdx +35 -0
- package/content/references/api/admin/commission-rates/create-commission-rate.mdx +1 -1
- package/content/references/api/admin/commission-rates/list-commission-rates.mdx +2 -2
- package/content/references/api/admin/commission-rates/update-commission-rate.mdx +1 -1
- package/content/references/api/admin/offers/batch-create-offers.mdx +3 -3
- package/content/references/api/admin/order-groups/list-order-groups.mdx +1 -1
- package/content/references/api/admin/product-attributes/create-attribute-value.mdx +2 -2
- package/content/references/api/admin/product-attributes/create-product-attribute.mdx +1 -1
- package/content/references/api/admin/product-attributes/update-product-attribute.mdx +1 -1
- package/content/references/api/admin/product-changes/confirm-product-change.mdx +1 -1
- package/content/references/api/admin/products/batch-product-attributes.mdx +1 -1
- package/content/references/api/admin/products/create-product.mdx +1 -1
- package/content/references/api/admin/products/preview-product.mdx +1 -1
- package/content/references/api/admin.mdx +4 -5
- package/content/references/api/conventions.mdx +9 -7
- package/content/references/api/store/carts/add-line-item.mdx +1 -1
- package/content/references/api/store/offers/list-offers.mdx +1 -1
- package/content/references/api/store/order-groups/list-order-groups.mdx +1 -1
- package/content/references/api/store.mdx +4 -13
- package/content/references/api/vendor/members/accept-member-invite.mdx +1 -1
- package/content/references/api/vendor/offers/batch-create-offers.mdx +4 -0
- package/content/references/api/vendor/offers/batch-offer-inventory-items.mdx +2 -0
- package/content/references/api/vendor/offers/create-offer.mdx +13 -1
- package/content/references/api/vendor/offers/list-offers.mdx +4 -0
- package/content/references/api/vendor/offers/retrieve-offer.mdx +4 -0
- package/content/references/api/vendor/offers/update-offer.mdx +12 -0
- package/content/references/api/vendor/payout-accounts/create-onboarding.mdx +1 -1
- package/content/references/api/vendor/products/batch-product-attributes.mdx +1 -1
- package/content/references/api/vendor/products/create-product-variant.mdx +1 -1
- package/content/references/api/vendor/products/create-product.mdx +1 -1
- package/content/references/api/vendor/products/delete-product.mdx +1 -1
- package/content/references/api/vendor/products/update-product.mdx +1 -1
- package/content/references/api/vendor/sellers/create-seller.mdx +2 -2
- package/content/references/api/vendor/sellers/list-sellers.mdx +1 -1
- package/content/references/api/vendor.mdx +6 -5
- package/content/references/configuration.mdx +16 -33
- package/content/references/overview.mdx +34 -52
- package/content/references/panel-extensions/create-page.mdx +194 -0
- package/content/references/panel-extensions/custom-fields.mdx +256 -0
- package/content/references/panel-extensions/overview.mdx +102 -0
- package/content/references/panel-extensions/widgets.mdx +212 -0
- package/content/resources/ai/mcp.mdx +2 -2
- package/content/resources/ai/overview.mdx +21 -16
- package/content/resources/ai/skills.mdx +67 -0
- package/content/resources/best-practices/api-routes.mdx +55 -43
- package/content/resources/best-practices/custom-fields.mdx +116 -92
- package/content/resources/best-practices/frontend.mdx +62 -50
- package/content/resources/best-practices/module-links.mdx +48 -34
- package/content/resources/best-practices/modules.mdx +53 -27
- package/content/resources/best-practices/overview.mdx +45 -17
- package/content/resources/best-practices/subscribers-and-jobs.mdx +37 -24
- package/content/resources/best-practices/types.mdx +38 -23
- package/content/resources/best-practices/workflows.mdx +33 -21
- package/content/resources/customization/custom-fields.mdx +15 -15
- package/content/resources/customization/extend-a-workflow.mdx +7 -4
- package/content/resources/customization/extending-panels.mdx +55 -52
- package/content/resources/deployment/medusa-cloud.mdx +21 -20
- package/content/resources/deployment/self-host.mdx +123 -0
- package/content/resources/integrations/overview.mdx +38 -0
- package/content/resources/integrations/stripe-connect.mdx +39 -38
- package/content/resources/tutorials/add-a-block.mdx +25 -18
- package/content/resources/tutorials/add-a-widget.mdx +32 -23
- package/content/resources/tutorials/add-order-detail-button.mdx +33 -20
- package/content/resources/tutorials/attributes-and-variant-axes.mdx +28 -27
- package/content/resources/tutorials/build-a-block.mdx +26 -15
- package/content/resources/tutorials/custom-api-route.mdx +32 -20
- package/content/resources/tutorials/custom-panel-page.mdx +21 -12
- package/content/resources/tutorials/customize-navigation.mdx +30 -23
- package/content/resources/tutorials/extend-forms-and-tables.mdx +36 -28
- package/content/resources/tutorials/extend-onboarding.mdx +38 -35
- package/content/resources/tutorials/master-products-and-offers.mdx +28 -23
- package/content/telemetry.mdx +3 -3
- package/content/user-guide/admin/attributes/how-tos/create-an-attribute.mdx +64 -0
- package/content/user-guide/admin/attributes/how-tos/manage-possible-values.mdx +40 -0
- package/content/user-guide/admin/attributes/overview.mdx +22 -0
- package/content/user-guide/admin/commissions/how-tos/create-a-commission-rule.mdx +63 -0
- package/content/user-guide/admin/commissions/how-tos/edit-the-global-commission.mdx +48 -0
- package/content/user-guide/admin/commissions/how-tos/manage-a-commission-rule.mdx +45 -0
- package/content/user-guide/admin/commissions/overview.mdx +25 -0
- package/content/user-guide/admin/overview.mdx +20 -12
- package/content/user-guide/admin/product-requests/how-tos/review-a-new-product.mdx +58 -0
- package/content/user-guide/admin/product-requests/how-tos/review-a-product-edit.mdx +48 -0
- package/content/user-guide/admin/product-requests/overview.mdx +25 -0
- package/content/user-guide/vendor/offers/how-tos/create-an-offer.mdx +59 -0
- package/content/user-guide/vendor/offers/how-tos/update-prices-and-stock.mdx +40 -0
- package/content/user-guide/vendor/offers/overview.mdx +22 -0
- package/content/user-guide/vendor/onboarding.mdx +79 -0
- package/content/user-guide/vendor/orders/how-tos/fulfill-an-order.mdx +49 -0
- package/content/user-guide/vendor/orders/how-tos/mark-an-order-as-delivered.mdx +33 -0
- package/content/user-guide/vendor/orders/how-tos/process-a-return.mdx +42 -0
- package/content/user-guide/vendor/orders/how-tos/refund-an-order.mdx +38 -0
- package/content/user-guide/vendor/orders/how-tos/ship-an-order.mdx +40 -0
- package/content/user-guide/vendor/orders/overview.mdx +31 -0
- package/content/user-guide/vendor/overview.mdx +23 -12
- package/content/user-guide/vendor/products/how-tos/edit-a-product.mdx +44 -0
- package/content/user-guide/vendor/products/how-tos/submit-a-product.mdx +63 -0
- package/content/user-guide/vendor/products/overview.mdx +22 -0
- package/llms.txt +176 -142
- package/package.json +1 -1
- package/content/learn/concepts.mdx +0 -84
- package/content/learn/installation.mdx +0 -117
- package/content/learn/mirakl-alternative.mdx +0 -86
- package/content/migration/from-1-x-to-2-0.mdx +0 -152
- package/content/migration/from-2-0-to-2-1.mdx +0 -105
- package/content/migration/overview.mdx +0 -58
- package/content/references/api/store/search/search.mdx +0 -136
- package/content/references/modules/commission.mdx +0 -106
- package/content/references/modules/custom-fields.mdx +0 -45
- package/content/references/modules/media.mdx +0 -55
- package/content/references/modules/offer.mdx +0 -64
- package/content/references/modules/payout.mdx +0 -121
- package/content/references/modules/product-attribute.mdx +0 -111
- package/content/references/modules/product-edit.mdx +0 -80
- package/content/references/modules/search.mdx +0 -112
- package/content/references/modules/seller.mdx +0 -175
- package/content/references/panel-extension-api.mdx +0 -337
- package/content/references/workflows/cart/add-seller-shipping-method-to-cart.mdx +0 -48
- package/content/references/workflows/cart/complete-cart-with-split-orders.mdx +0 -36
- package/content/references/workflows/cart/list-seller-shipping-options-for-cart.mdx +0 -39
- package/content/references/workflows/cart/update-cart-seller-promotions.mdx +0 -42
- package/content/references/workflows/commission/batch-commission-rules.mdx +0 -49
- package/content/references/workflows/commission/create-commission-rates.mdx +0 -41
- package/content/references/workflows/commission/delete-commission-rates.mdx +0 -34
- package/content/references/workflows/commission/refresh-order-commission-lines.mdx +0 -30
- package/content/references/workflows/commission/update-commission-rates.mdx +0 -35
- package/content/references/workflows/media/set-category-images.mdx +0 -41
- package/content/references/workflows/media/set-collection-images.mdx +0 -41
- package/content/references/workflows/member/accept-member-invite.mdx +0 -33
- package/content/references/workflows/member/add-seller-member.mdx +0 -30
- package/content/references/workflows/member/create-member-invites.mdx +0 -34
- package/content/references/workflows/member/delete-member-invite.mdx +0 -24
- package/content/references/workflows/member/remove-seller-member.mdx +0 -28
- package/content/references/workflows/member/resend-member-invite.mdx +0 -28
- package/content/references/workflows/member/update-member-role.mdx +0 -28
- package/content/references/workflows/member/update-member.mdx +0 -35
- package/content/references/workflows/offer/batch-offer-inventory-items.mdx +0 -62
- package/content/references/workflows/offer/create-offers.mdx +0 -65
- package/content/references/workflows/offer/delete-offers.mdx +0 -35
- package/content/references/workflows/offer/update-offers.mdx +0 -53
- package/content/references/workflows/order/cancel-order-fulfillment.mdx +0 -34
- package/content/references/workflows/order/confirm-claim-request.mdx +0 -25
- package/content/references/workflows/order/confirm-exchange-request.mdx +0 -25
- package/content/references/workflows/order/confirm-order-edit-request.mdx +0 -25
- package/content/references/workflows/order/confirm-return-receive.mdx +0 -25
- package/content/references/workflows/order/create-order-fulfillment.mdx +0 -45
- package/content/references/workflows/order-group/get-order-group-detail.mdx +0 -29
- package/content/references/workflows/order-group/get-order-groups-list.mdx +0 -38
- package/content/references/workflows/overview.mdx +0 -72
- package/content/references/workflows/payout/create-onboarding.mdx +0 -36
- package/content/references/workflows/payout/create-payout-account.mdx +0 -33
- package/content/references/workflows/payout/create-payout.mdx +0 -30
- package/content/references/workflows/payout/process-payout-for-webhook.mdx +0 -34
- package/content/references/workflows/product/confirm-products.mdx +0 -48
- package/content/references/workflows/product/create-products.mdx +0 -63
- package/content/references/workflows/product/link-sellers-to-product-category.mdx +0 -40
- package/content/references/workflows/product/link-sellers-to-product.mdx +0 -40
- package/content/references/workflows/product/reject-product.mdx +0 -48
- package/content/references/workflows/product/request-product-change.mdx +0 -48
- package/content/references/workflows/product-attribute/add-product-attributes-to-product.mdx +0 -49
- package/content/references/workflows/product-attribute/create-and-link-product-attributes-to-product.mdx +0 -46
- package/content/references/workflows/product-attribute/create-product-attribute-values.mdx +0 -43
- package/content/references/workflows/product-attribute/create-product-attributes.mdx +0 -56
- package/content/references/workflows/product-attribute/delete-product-attribute-values.mdx +0 -30
- package/content/references/workflows/product-attribute/delete-product-attributes.mdx +0 -30
- package/content/references/workflows/product-attribute/remove-product-attributes-from-product.mdx +0 -29
- package/content/references/workflows/product-attribute/update-product-attribute-values.mdx +0 -44
- package/content/references/workflows/product-attribute/update-product-attributes-on-product.mdx +0 -41
- package/content/references/workflows/product-attribute/update-product-attributes.mdx +0 -48
- package/content/references/workflows/product-attribute/upsert-product-attribute-values.mdx +0 -43
- package/content/references/workflows/product-edit/auto-confirm-product-change.mdx +0 -39
- package/content/references/workflows/product-edit/cancel-product-change.mdx +0 -49
- package/content/references/workflows/product-edit/confirm-product-change.mdx +0 -57
- package/content/references/workflows/product-edit/create-product-change.mdx +0 -72
- package/content/references/workflows/product-edit/reject-product-change.mdx +0 -54
- package/content/references/workflows/product-edit/stage-product-change.mdx +0 -75
- package/content/references/workflows/seller/approve-seller.mdx +0 -36
- package/content/references/workflows/seller/create-seller-account.mdx +0 -59
- package/content/references/workflows/seller/create-seller-defaults.mdx +0 -22
- package/content/references/workflows/seller/create-sellers.mdx +0 -65
- package/content/references/workflows/seller/delete-seller-professional-details.mdx +0 -37
- package/content/references/workflows/seller/delete-sellers.mdx +0 -24
- package/content/references/workflows/seller/invite-seller.mdx +0 -28
- package/content/references/workflows/seller/suspend-seller.mdx +0 -37
- package/content/references/workflows/seller/terminate-seller.mdx +0 -37
- package/content/references/workflows/seller/unsuspend-seller.mdx +0 -36
- package/content/references/workflows/seller/unterminate-seller.mdx +0 -36
- package/content/references/workflows/seller/update-seller-address.mdx +0 -55
- package/content/references/workflows/seller/update-seller-payment-details.mdx +0 -52
- package/content/references/workflows/seller/update-seller-professional-details.mdx +0 -48
- package/content/references/workflows/seller/update-sellers.mdx +0 -57
- package/content/resources/ai/llms.mdx +0 -74
- package/content/resources/integrations/notifications.mdx +0 -39
- package/content/resources/integrations/search.mdx +0 -122
- package/content/resources/tutorials/configure-commissions.mdx +0 -127
- package/content/resources/tutorials/first-marketplace.mdx +0 -45
- package/content/resources/tutorials/handle-product-requests.mdx +0 -80
- package/content/resources/tutorials/import-export-products.mdx +0 -96
- package/content/resources/tutorials/seller-payouts-stripe.mdx +0 -89
- package/content/resources/tutorials/store-setup-checklist.mdx +0 -214
- package/content/tools/api-client.mdx +0 -155
- package/content/tools/cli.mdx +0 -196
- package/content/tools/dashboard-sdk.mdx +0 -35
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Build a store-setup checklist"
|
|
3
|
-
description: "Render an onboarding progress checklist on the vendor store-setup surface with a seller.setup widget — the seller is handed to you as data, no fetching required."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
The vendor **store-setup / onboarding** surface is a widget zone (`seller.setup`)
|
|
7
|
-
that renders the full `seller` object as its `data`. That makes it the perfect
|
|
8
|
-
seam for an onboarding **checklist**: derive completion from the seller you're
|
|
9
|
-
handed, show what's left, and link each step to the page that completes it — all
|
|
10
|
-
from a single widget file, with nothing fetched and nothing forked.
|
|
11
|
-
|
|
12
|
-
<Info>
|
|
13
|
-
**This is the pattern the built-in store-setup card uses.** The shipped
|
|
14
|
-
"Complete store profile" card is itself a `seller.setup` widget that reads the
|
|
15
|
-
`seller` and renders a progress list. This tutorial rebuilds it so you can
|
|
16
|
-
shape your own onboarding steps.
|
|
17
|
-
</Info>
|
|
18
|
-
|
|
19
|
-
## What you'll build
|
|
20
|
-
|
|
21
|
-
A collapsible progress card on the store-setup surface that checks four parts of
|
|
22
|
-
the seller profile (details, address, company, payment), draws a progress bar,
|
|
23
|
-
and routes the vendor to the settings page for each incomplete step. When every
|
|
24
|
-
step is done, the card removes itself.
|
|
25
|
-
|
|
26
|
-
## Register the typed targets (once)
|
|
27
|
-
|
|
28
|
-
Widget zones are typed ids the vendor panel generates from its own pages and
|
|
29
|
-
ships as `@mercurjs/vendor/extension-targets`. Reference them once so `seller.setup`
|
|
30
|
-
autocompletes and a wrong zone fails `tsc`:
|
|
31
|
-
|
|
32
|
-
```typescript apps/vendor/src/extension-targets.d.ts
|
|
33
|
-
/// <reference types="@mercurjs/vendor/extension-targets" />
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Build the checklist widget
|
|
37
|
-
|
|
38
|
-
<Steps>
|
|
39
|
-
<Step title="Derive the steps from the seller">
|
|
40
|
-
The `data` prop is the full `SellerDTO`. Compute each step's `completed` flag
|
|
41
|
-
from it — no request needed. Give every step a `path` to the settings page
|
|
42
|
-
that finishes it:
|
|
43
|
-
|
|
44
|
-
```tsx apps/vendor/src/widgets/store-setup-checklist.tsx
|
|
45
|
-
import "@mercurjs/vendor/extension-targets"
|
|
46
|
-
import { SellerDTO } from "@mercurjs/types"
|
|
47
|
-
|
|
48
|
-
type ProfileStep = {
|
|
49
|
-
key: string
|
|
50
|
-
label: string
|
|
51
|
-
completed: boolean
|
|
52
|
-
path: string
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function getProfileSteps(seller: SellerDTO): ProfileStep[] {
|
|
56
|
-
const hasStoreDetails = !!(seller.name && seller.email && seller.description)
|
|
57
|
-
const hasAddress = !!(
|
|
58
|
-
seller.address?.address_1 &&
|
|
59
|
-
seller.address?.city &&
|
|
60
|
-
seller.address?.country_code
|
|
61
|
-
)
|
|
62
|
-
const hasCompanyDetails = !!seller.professional_details?.corporate_name
|
|
63
|
-
const hasPaymentDetails = !!(
|
|
64
|
-
seller.payment_details?.holder_name &&
|
|
65
|
-
seller.payment_details?.country_code
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
return [
|
|
69
|
-
{ key: "store_details", label: "Add store details", completed: hasStoreDetails, path: "/settings/store/edit" },
|
|
70
|
-
{ key: "address", label: "Add address", completed: hasAddress, path: "/settings/store/address" },
|
|
71
|
-
{ key: "company_details", label: "Add company details", completed: hasCompanyDetails, path: "/settings/store/professional-details" },
|
|
72
|
-
{ key: "payment_details", label: "Add payment details", completed: hasPaymentDetails, path: "/settings/store/payment-details" },
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
</Step>
|
|
78
|
-
<Step title="Render the collapsible progress card">
|
|
79
|
-
Use `@medusajs/ui` primitives and `@medusajs/icons` only. Draw a progress bar
|
|
80
|
-
from the completed ratio, list each step with a status icon, and navigate on
|
|
81
|
-
click. Return `null` when everything is done so the card disappears:
|
|
82
|
-
|
|
83
|
-
```tsx apps/vendor/src/widgets/store-setup-checklist.tsx
|
|
84
|
-
import { useMemo, useState } from "react"
|
|
85
|
-
import { useNavigate } from "react-router-dom"
|
|
86
|
-
import { Container, Text, clx } from "@medusajs/ui"
|
|
87
|
-
import { CheckCircleSolid, TriangleDownMini, CircleDottedLine } from "@medusajs/icons"
|
|
88
|
-
import { Collapsible as RadixCollapsible } from "radix-ui"
|
|
89
|
-
|
|
90
|
-
const StoreSetupChecklist = ({ data: seller }: { data?: SellerDTO }) => {
|
|
91
|
-
const navigate = useNavigate()
|
|
92
|
-
const [open, setOpen] = useState(true)
|
|
93
|
-
|
|
94
|
-
const steps = useMemo(
|
|
95
|
-
() => (seller ? getProfileSteps(seller) : []),
|
|
96
|
-
[seller]
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
if (!seller) {
|
|
100
|
-
return null
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const completedCount = steps.filter((s) => s.completed).length
|
|
104
|
-
const totalCount = steps.length
|
|
105
|
-
const progressPercent = (completedCount / totalCount) * 100
|
|
106
|
-
|
|
107
|
-
if (completedCount === totalCount) {
|
|
108
|
-
return null
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return (
|
|
112
|
-
<RadixCollapsible.Root open={open} onOpenChange={setOpen}>
|
|
113
|
-
<Container className="overflow-hidden p-0">
|
|
114
|
-
<div
|
|
115
|
-
className="h-1 bg-ui-tag-green-icon transition-all duration-500"
|
|
116
|
-
style={{ width: `${progressPercent}%` }}
|
|
117
|
-
/>
|
|
118
|
-
<div className="p-6">
|
|
119
|
-
<RadixCollapsible.Trigger asChild>
|
|
120
|
-
<button className="flex w-full items-center justify-between">
|
|
121
|
-
<Text size="large" weight="plus" leading="compact">
|
|
122
|
-
Complete store profile
|
|
123
|
-
</Text>
|
|
124
|
-
<TriangleDownMini
|
|
125
|
-
className={clx(
|
|
126
|
-
"text-ui-fg-muted transition-transform duration-200",
|
|
127
|
-
!open && "-rotate-90"
|
|
128
|
-
)}
|
|
129
|
-
/>
|
|
130
|
-
</button>
|
|
131
|
-
</RadixCollapsible.Trigger>
|
|
132
|
-
|
|
133
|
-
<RadixCollapsible.Content>
|
|
134
|
-
<div className="mt-4 flex flex-col gap-y-3">
|
|
135
|
-
{steps.map((step) => (
|
|
136
|
-
<button
|
|
137
|
-
key={step.key}
|
|
138
|
-
className="flex items-center gap-x-3 text-left"
|
|
139
|
-
onClick={() => !step.completed && navigate(step.path)}
|
|
140
|
-
disabled={step.completed}
|
|
141
|
-
>
|
|
142
|
-
{step.completed ? (
|
|
143
|
-
<CheckCircleSolid className="text-ui-tag-green-icon shrink-0" />
|
|
144
|
-
) : (
|
|
145
|
-
<CircleDottedLine className="text-ui-fg-muted shrink-0" />
|
|
146
|
-
)}
|
|
147
|
-
<Text size="small" leading="compact" className="text-ui-fg-base">
|
|
148
|
-
{step.label}
|
|
149
|
-
</Text>
|
|
150
|
-
</button>
|
|
151
|
-
))}
|
|
152
|
-
</div>
|
|
153
|
-
</RadixCollapsible.Content>
|
|
154
|
-
</div>
|
|
155
|
-
</Container>
|
|
156
|
-
</RadixCollapsible.Root>
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
</Step>
|
|
162
|
-
<Step title="Attach it to the store-setup zone">
|
|
163
|
-
Export the component as the **default** and a `config` with a `seller.setup`
|
|
164
|
-
zone. `before` renders it above the built-in card; use `after` to place it
|
|
165
|
-
below:
|
|
166
|
-
|
|
167
|
-
```tsx apps/vendor/src/widgets/store-setup-checklist.tsx
|
|
168
|
-
import { defineWidgetConfig } from "@mercurjs/dashboard-sdk"
|
|
169
|
-
|
|
170
|
-
export const config = defineWidgetConfig({
|
|
171
|
-
zone: "seller.setup.before",
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
export default StoreSetupChecklist
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
</Step>
|
|
178
|
-
</Steps>
|
|
179
|
-
|
|
180
|
-
## Where it renders
|
|
181
|
-
|
|
182
|
-
`seller.setup` is hosted in two places, both passing the same `seller` as `data`:
|
|
183
|
-
|
|
184
|
-
| Host | When it shows |
|
|
185
|
-
| ---------------------------------------- | ------------------------------------------------------------ |
|
|
186
|
-
| The vendor shell (above the page outlet) | On top-level routes — the dashboard "home" onboarding banner |
|
|
187
|
-
| The store settings detail page | Always, above the store status banner |
|
|
188
|
-
|
|
189
|
-
A single widget file covers both. Multiple `seller.setup.before` / `.after`
|
|
190
|
-
widgets stack in registration order, so your checklist and the built-in card can
|
|
191
|
-
coexist — or hide the built-in one by rendering your own and letting theirs
|
|
192
|
-
complete.
|
|
193
|
-
|
|
194
|
-
<Note>
|
|
195
|
-
**No data fetching.** Because the zone hands you the resolved `seller`, the
|
|
196
|
-
widget is pure render — you never call the SDK. To *collect and persist* a new
|
|
197
|
-
onboarding value (e.g. a Tax ID) rather than just link to existing pages, see
|
|
198
|
-
[Extend the onboarding flow](/rc/resources/tutorials/extend-onboarding), which
|
|
199
|
-
carries a value through `additional_data` to a workflow hook.
|
|
200
|
-
</Note>
|
|
201
|
-
|
|
202
|
-
## Next steps
|
|
203
|
-
|
|
204
|
-
<CardGroup cols={2}>
|
|
205
|
-
<Card
|
|
206
|
-
title="Extend the onboarding flow"
|
|
207
|
-
href="/rc/resources/tutorials/extend-onboarding"
|
|
208
|
-
>
|
|
209
|
-
Collect a new value and persist it through a workflow hook.
|
|
210
|
-
</Card>
|
|
211
|
-
<Card title="Add a widget" href="/rc/resources/tutorials/add-a-widget">
|
|
212
|
-
The full widget model and the published zone registry.
|
|
213
|
-
</Card>
|
|
214
|
-
</CardGroup>
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "API Client"
|
|
3
|
-
description: "Type-safe client for consuming Mercur APIs."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
`@mercurjs/client` provides a type-safe way to interact with your Mercur backend. Every endpoint, request input, and response is fully typed — inferred directly from your backend routes.
|
|
7
|
-
|
|
8
|
-
## Installation
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
bun add @mercurjs/client
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Create a client
|
|
15
|
-
|
|
16
|
-
```typescript
|
|
17
|
-
import { createClient } from "@mercurjs/client";
|
|
18
|
-
import type { Routes } from "./.mercur/_generated";
|
|
19
|
-
|
|
20
|
-
export const client = createClient<Routes>({
|
|
21
|
-
baseUrl: "http://localhost:9000",
|
|
22
|
-
});
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
<Info>
|
|
26
|
-
The `Routes` type is generated from your backend using `@mercurjs/cli@latest
|
|
27
|
-
codegen`. This gives the client full type safety with zero manual type
|
|
28
|
-
definitions.
|
|
29
|
-
</Info>
|
|
30
|
-
|
|
31
|
-
You can pass default fetch options for authentication or other headers:
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
export const client = createClient<Routes>({
|
|
35
|
-
baseUrl: "http://localhost:9000",
|
|
36
|
-
fetchOptions: {
|
|
37
|
-
credentials: "include",
|
|
38
|
-
headers: {
|
|
39
|
-
Authorization: `Bearer ${token}`,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Calling APIs
|
|
46
|
-
|
|
47
|
-
The client exposes three methods:
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
// GET — fetch data
|
|
51
|
-
const { reviews } = await client.vendor.reviews.query({ limit: 10 });
|
|
52
|
-
|
|
53
|
-
// POST — create or update
|
|
54
|
-
const { product } = await client.vendor.products.mutate({
|
|
55
|
-
title: "New Product",
|
|
56
|
-
status: "draft",
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// DELETE — remove a resource
|
|
60
|
-
await client.vendor.reviews.$id.delete({ $id: "rev_123" });
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Use `$`-prefixed keys for path parameters:
|
|
64
|
-
|
|
65
|
-
```typescript
|
|
66
|
-
const { review } = await client.vendor.reviews.$id.query({
|
|
67
|
-
$id: "rev_123",
|
|
68
|
-
});
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Override fetch options per request when needed:
|
|
72
|
-
|
|
73
|
-
```typescript
|
|
74
|
-
const { reviews } = await client.vendor.reviews.query({
|
|
75
|
-
fetchOptions: {
|
|
76
|
-
signal: abortController.signal,
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Inferring types
|
|
82
|
-
|
|
83
|
-
Extract input and output types from any client method using `InferClientInput` and `InferClientOutput`:
|
|
84
|
-
|
|
85
|
-
```typescript
|
|
86
|
-
import type { InferClientInput, InferClientOutput } from "@mercurjs/client";
|
|
87
|
-
|
|
88
|
-
type ListInput = InferClientInput<typeof client.vendor.reviews.query>;
|
|
89
|
-
type ReviewDTO = InferClientOutput<
|
|
90
|
-
typeof client.vendor.reviews.$id.query
|
|
91
|
-
>["review"];
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## React Query
|
|
95
|
-
|
|
96
|
-
The client returns plain Promises, so it works with any data-fetching library. Here's a typical pattern with TanStack React Query:
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
import { useQuery } from "@tanstack/react-query";
|
|
100
|
-
import { client } from "../lib/client";
|
|
101
|
-
|
|
102
|
-
export function useReviews(
|
|
103
|
-
query?: InferClientInput<typeof client.vendor.reviews.query>,
|
|
104
|
-
) {
|
|
105
|
-
const { data, ...rest } = useQuery({
|
|
106
|
-
queryKey: ["reviews", query],
|
|
107
|
-
queryFn: () => client.vendor.reviews.query(query),
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
return { ...data, ...rest };
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## Error handling
|
|
115
|
-
|
|
116
|
-
Failed requests throw a `ClientError`:
|
|
117
|
-
|
|
118
|
-
```typescript
|
|
119
|
-
import { ClientError } from "@mercurjs/client";
|
|
120
|
-
|
|
121
|
-
try {
|
|
122
|
-
await client.vendor.reviews.$id.query({ $id: "invalid" });
|
|
123
|
-
} catch (error) {
|
|
124
|
-
if (error instanceof ClientError) {
|
|
125
|
-
error.message; // "Review not found"
|
|
126
|
-
error.status; // 404
|
|
127
|
-
error.statusText; // "Not Found"
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
## FAQ
|
|
133
|
-
|
|
134
|
-
<AccordionGroup>
|
|
135
|
-
<Accordion title="Why is a route missing from the client after I added it?">
|
|
136
|
-
The client's types come from the generated route map — run `bunx @mercurjs/cli@latest codegen` after adding or changing route files. During development, `codegen --watch` keeps the map current automatically.
|
|
137
|
-
</Accordion>
|
|
138
|
-
<Accordion title="How are URLs derived from property access?">
|
|
139
|
-
Each property becomes a kebab-cased path segment (`client.vendor.salesSummary` → `/vendor/sales-summary`), `$`-prefixed keys fill path parameters, and the terminal method picks the HTTP verb: `query` → GET, `mutate` → POST, `delete` → DELETE.
|
|
140
|
-
</Accordion>
|
|
141
|
-
<Accordion title="Can I upload files through the client?">
|
|
142
|
-
Yes — pass `Blob`/`File` values in the payload and the client switches to multipart form data automatically.
|
|
143
|
-
</Accordion>
|
|
144
|
-
</AccordionGroup>
|
|
145
|
-
|
|
146
|
-
## Next steps
|
|
147
|
-
|
|
148
|
-
<CardGroup cols={2}>
|
|
149
|
-
<Card title="Add a custom API route" href="/rc/resources/tutorials/custom-api-route">
|
|
150
|
-
Build a route and call it through the client, end to end.
|
|
151
|
-
</Card>
|
|
152
|
-
<Card title="CLI" href="/rc/tools/cli">
|
|
153
|
-
The codegen command that generates the client's route map.
|
|
154
|
-
</Card>
|
|
155
|
-
</CardGroup>
|
package/content/tools/cli.mdx
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "CLI"
|
|
3
|
-
description: "Install blocks, scaffold projects, and generate types from the command line."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
The Mercur CLI (`@mercurjs/cli@latest`) manages your marketplace project — installing blocks, generating types, and checking for updates. To create a new project, use [`create-mercur-app`](https://www.npmjs.com/package/create-mercur-app).
|
|
7
|
-
|
|
8
|
-
## Installation
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
bun add -g @mercurjs/cli@latest
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Commands
|
|
15
|
-
|
|
16
|
-
### create
|
|
17
|
-
|
|
18
|
-
Scaffolding new projects lives in the standalone [`create-mercur-app`](https://www.npmjs.com/package/create-mercur-app) package, so it downloads fast and works with every package manager's `create` command.
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
bun create mercur-app@latest my-marketplace
|
|
22
|
-
# or
|
|
23
|
-
npm create mercur-app@latest my-marketplace
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
It will prompt you for database credentials and install dependencies automatically.
|
|
27
|
-
|
|
28
|
-
| Option | Description |
|
|
29
|
-
|--------|-------------|
|
|
30
|
-
| `-t, --template <template>` | Template to use (default: `basic`) |
|
|
31
|
-
| `--no-deps` | Skip dependency installation |
|
|
32
|
-
| `--skip-db` | Skip database configuration |
|
|
33
|
-
| `--db-connection-string <string>` | PostgreSQL connection string |
|
|
34
|
-
|
|
35
|
-
### init
|
|
36
|
-
|
|
37
|
-
Initialize an existing project by creating a `blocks.json` configuration file.
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
bunx @mercurjs/cli@latest init
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
This sets up path aliases so the CLI knows where to place blocks in your project:
|
|
44
|
-
|
|
45
|
-
```json
|
|
46
|
-
{
|
|
47
|
-
"aliases": {
|
|
48
|
-
"api": "packages/api/src",
|
|
49
|
-
"vendor": "apps/vendor/src",
|
|
50
|
-
"admin": "apps/admin/src"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
| Option | Description |
|
|
56
|
-
|--------|-------------|
|
|
57
|
-
| `-d, --defaults` | Use default paths without prompting |
|
|
58
|
-
| `-s, --silent` | Suppress output |
|
|
59
|
-
|
|
60
|
-
### add
|
|
61
|
-
|
|
62
|
-
Install blocks from the registry into your project.
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
bunx @mercurjs/cli@latest add wishlist
|
|
66
|
-
bunx @mercurjs/cli@latest add product-review order-tracking
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Blocks are copied directly into your project as source code. The CLI resolves dependencies, transforms imports to match your path aliases, and installs required packages.
|
|
70
|
-
|
|
71
|
-
| Option | Description |
|
|
72
|
-
|--------|-------------|
|
|
73
|
-
| `-o, --overwrite` | Overwrite existing files |
|
|
74
|
-
| `-y, --yes` | Skip confirmation |
|
|
75
|
-
| `-s, --silent` | Suppress output |
|
|
76
|
-
|
|
77
|
-
### search
|
|
78
|
-
|
|
79
|
-
Find available blocks in the registry.
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
bunx @mercurjs/cli@latest search --query wishlist
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
| Option | Description |
|
|
86
|
-
|--------|-------------|
|
|
87
|
-
| `-q, --query <query>` | Search by name or description |
|
|
88
|
-
| `-r, --registry <registry>` | Registry to search (default: `@mercurjs`) |
|
|
89
|
-
|
|
90
|
-
### view
|
|
91
|
-
|
|
92
|
-
Display detailed information about a block.
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
bunx @mercurjs/cli@latest view wishlist
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### diff
|
|
99
|
-
|
|
100
|
-
Compare local blocks against registry versions to check for updates.
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
bunx @mercurjs/cli@latest diff wishlist
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
If there are changes you want, update with:
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
bunx @mercurjs/cli@latest add wishlist --overwrite
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### codegen
|
|
113
|
-
|
|
114
|
-
Generate TypeScript types from your API routes. Used by the [API Client](/rc/tools/api-client) for type-safe requests.
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
bunx @mercurjs/cli@latest codegen
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
| Option | Description |
|
|
121
|
-
|--------|-------------|
|
|
122
|
-
| `-w, --watch` | Watch for changes and regenerate automatically |
|
|
123
|
-
|
|
124
|
-
### registry:build
|
|
125
|
-
|
|
126
|
-
Build a custom registry from a `registry.json` file.
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
bunx @mercurjs/cli@latest build
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
| Option | Description |
|
|
133
|
-
|--------|-------------|
|
|
134
|
-
| `-o, --output <path>` | Output directory (default: `./r`) |
|
|
135
|
-
| `-v, --verbose` | Show detailed output |
|
|
136
|
-
|
|
137
|
-
### info
|
|
138
|
-
|
|
139
|
-
Display project configuration and diagnostics.
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
bunx @mercurjs/cli@latest info
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### telemetry
|
|
146
|
-
|
|
147
|
-
Control anonymous usage data collection.
|
|
148
|
-
|
|
149
|
-
```bash
|
|
150
|
-
bunx @mercurjs/cli@latest telemetry --disable
|
|
151
|
-
bunx @mercurjs/cli@latest telemetry --enable
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Custom registries
|
|
155
|
-
|
|
156
|
-
Add custom block registries to your `blocks.json`:
|
|
157
|
-
|
|
158
|
-
```json
|
|
159
|
-
{
|
|
160
|
-
"registries": {
|
|
161
|
-
"@mercurjs": "https://registry.mercurjs.com/{name}",
|
|
162
|
-
"@my-registry": "https://my-registry.com/blocks/{name}.json"
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
Use `{name}` as a placeholder for block names. Reference custom registries with the `-r` flag:
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
bunx @mercurjs/cli@latest search --query review --registry @my-registry
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
## FAQ
|
|
174
|
-
|
|
175
|
-
<AccordionGroup>
|
|
176
|
-
<Accordion title="When do I use create vs init?">
|
|
177
|
-
`create` scaffolds a brand-new project from a template. `init` only writes a `blocks.json` into an **existing** project so the CLI knows where to place blocks — use it when adopting blocks in a repo that wasn't created by the CLI.
|
|
178
|
-
</Accordion>
|
|
179
|
-
<Accordion title="When do I need to run codegen?">
|
|
180
|
-
After any change to API route files — added routes, changed validators, renamed paths. The [typed client](/rc/tools/api-client) reads the generated route map, so stale types mean `codegen` hasn't run.
|
|
181
|
-
</Accordion>
|
|
182
|
-
<Accordion title="Will add overwrite my local changes to a block?">
|
|
183
|
-
Not silently — the CLI asks before overwriting existing files unless you pass `--overwrite`. Use `diff` first to see exactly what changed between your copy and the registry.
|
|
184
|
-
</Accordion>
|
|
185
|
-
</AccordionGroup>
|
|
186
|
-
|
|
187
|
-
## Next steps
|
|
188
|
-
|
|
189
|
-
<CardGroup cols={2}>
|
|
190
|
-
<Card title="Add a feature with a block" href="/rc/resources/tutorials/add-a-block">
|
|
191
|
-
The install workflow end to end — search, view, add, migrate.
|
|
192
|
-
</Card>
|
|
193
|
-
<Card title="API Client" href="/rc/tools/api-client">
|
|
194
|
-
What codegen's route map powers on the frontend.
|
|
195
|
-
</Card>
|
|
196
|
-
</CardGroup>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Dashboard SDK"
|
|
3
|
-
description: "The Vite plugin that powers admin and vendor panel extension — file-based routing, virtual modules, and block resolution."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<Note>
|
|
7
|
-
This reference is being written. The outline below is the intended structure.
|
|
8
|
-
</Note>
|
|
9
|
-
|
|
10
|
-
<Info>
|
|
11
|
-
**Not Medusa's admin-vite-plugin.** The dashboard SDK is Mercur's own extension framework for both panels — it scans `src/routes/**/page.tsx` files, generates navigation, and injects everything through `virtual:mercur/*` modules at build time. Medusa's `defineWidgetConfig` / `defineRouteConfig` and widget zones are not part of this model. Start with [Extending Panels](/rc/resources/customization/extending-panels) for the authoring guide; this page covers the plugin's internals and options.
|
|
12
|
-
</Info>
|
|
13
|
-
|
|
14
|
-
## What it does
|
|
15
|
-
|
|
16
|
-
File-based routing, virtual route modules, and block resolution for the admin and vendor panels.
|
|
17
|
-
|
|
18
|
-
## Setup in a host app
|
|
19
|
-
|
|
20
|
-
Registering `mercurDashboardPlugin` in a Vite app.
|
|
21
|
-
|
|
22
|
-
## Configuration options
|
|
23
|
-
|
|
24
|
-
Backend and vendor URLs, i18n, and build-time config.
|
|
25
|
-
|
|
26
|
-
## Extension entry points
|
|
27
|
-
|
|
28
|
-
`admin_ui` and `vendor_ui` entry points exported by block packages.
|
|
29
|
-
|
|
30
|
-
## Next steps
|
|
31
|
-
|
|
32
|
-
<CardGroup cols={2}>
|
|
33
|
-
<Card title="Extending the panels" href="/rc/resources/customization/extending-panels" />
|
|
34
|
-
<Card title="API client" href="/rc/tools/api-client" />
|
|
35
|
-
</CardGroup>
|