@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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Panel extensions"
|
|
3
|
+
sidebarTitle: "Overview"
|
|
4
|
+
description: "Customize the admin and vendor panels with pages, widgets, custom fields, and navigation, without forking them."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Panel extensions let you customize the Admin and Vendor panels without forking
|
|
8
|
+
them. You drop a file into a panel's `src/` folder and the SDK registers it at
|
|
9
|
+
build time. There is no manifest to maintain and no core code to patch.
|
|
10
|
+
|
|
11
|
+
## What you can add
|
|
12
|
+
|
|
13
|
+
Each extension is a file in a known location. The file's folder decides what it
|
|
14
|
+
does.
|
|
15
|
+
|
|
16
|
+
- **Pages:** add a route and a page with a `page.tsx` under `src/routes/`.
|
|
17
|
+
- **Widgets:** render a component in a slot on a built-in page with `defineWidgetConfig`.
|
|
18
|
+
- **Custom fields:** add fields, rows, and columns to a built-in model with `defineCustomFieldsConfig`.
|
|
19
|
+
- **Navigation:** reorder, hide, or relabel sidebar items with `defineNavigationConfig`.
|
|
20
|
+
|
|
21
|
+
## File conventions
|
|
22
|
+
|
|
23
|
+
An extension is discovered by its location under a panel's `src/`. The folder is
|
|
24
|
+
the surface, so there is no registration step beyond creating the file.
|
|
25
|
+
|
|
26
|
+
| Path | Adds | Documented in |
|
|
27
|
+
| ------------------------ | ---------------------------------------- | ------------------------------------------------------------- |
|
|
28
|
+
| `src/routes/**/page.tsx` | A page and route | [Create a new page](/references/panel-extensions/create-page) |
|
|
29
|
+
| `src/widgets/**` | A widget on a zone | [Widgets](/references/panel-extensions/widgets) |
|
|
30
|
+
| `src/custom-fields/**` | Model form, display, and list extensions | [Custom Fields](/references/panel-extensions/custom-fields) |
|
|
31
|
+
| `src/_navigation.ts` | Sidebar overrides | [Create a new page](/references/panel-extensions/create-page) |
|
|
32
|
+
| `src/i18n/index.ts` | Translation resources | Default-exports the i18n resource map |
|
|
33
|
+
|
|
34
|
+
Widgets and custom fields crawl subfolders, so group related files however you
|
|
35
|
+
like. Navigation is a single host-owned file, not a folder crawl.
|
|
36
|
+
|
|
37
|
+
## Separate apps, no surface field
|
|
38
|
+
|
|
39
|
+
Admin (`@mercurjs/admin`, port 7000) and vendor (`@mercurjs/vendor`, port 7001)
|
|
40
|
+
are separate Vite apps. A file under a panel's `src/` targets that panel, so the
|
|
41
|
+
folder you author in is the surface. There is no `surface` field to set. The
|
|
42
|
+
helpers are the same in both. Import the config helpers from
|
|
43
|
+
`@mercurjs/dashboard-sdk` and `createFormHelper` from `@mercurjs/dashboard-shared`.
|
|
44
|
+
|
|
45
|
+
## Typed targets
|
|
46
|
+
|
|
47
|
+
Zone ids, nav item ids, models, and built-in field ids are typed per panel from a
|
|
48
|
+
generated `extension-targets.d.ts`. Reference it once per host app so every
|
|
49
|
+
extension file type-checks with no per-file import.
|
|
50
|
+
|
|
51
|
+
```typescript apps/vendor/src/extension-targets.d.ts
|
|
52
|
+
/// <reference types="@mercurjs/vendor/extension-targets" />
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```typescript apps/admin-test/src/extension-targets.d.ts
|
|
56
|
+
/// <reference types="@mercurjs/admin/extension-targets" />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
A wrong `zone`, `model`, or nav `id` fails `tsc` (`bun run lint`) rather than
|
|
60
|
+
silently doing nothing at runtime.
|
|
61
|
+
|
|
62
|
+
## Persistence
|
|
63
|
+
|
|
64
|
+
<Warning>
|
|
65
|
+
**The MVP is a UI surface only.** Custom fields render, validate, and display
|
|
66
|
+
through the built-in forms, sections, and tables. There is no generic core-side
|
|
67
|
+
write path. For `product`, values submit under `additional_data` and persist
|
|
68
|
+
onto `metadata`. To store data for other models, wire your own route or
|
|
69
|
+
workflow, or use the backend
|
|
70
|
+
[Custom Fields module](/rc/resources/customization/custom-fields).
|
|
71
|
+
</Warning>
|
|
72
|
+
|
|
73
|
+
## Explore the extensions
|
|
74
|
+
|
|
75
|
+
<CardGroup cols={2}>
|
|
76
|
+
<Card title="Widgets" href="/references/panel-extensions/widgets">
|
|
77
|
+
Render a component in a named zone with `defineWidgetConfig`.
|
|
78
|
+
</Card>
|
|
79
|
+
<Card title="Custom Fields" href="/references/panel-extensions/custom-fields">
|
|
80
|
+
Add form fields, detail rows, and list columns with `defineCustomFieldsConfig`.
|
|
81
|
+
</Card>
|
|
82
|
+
<Card title="Create a new page" href="/references/panel-extensions/create-page">
|
|
83
|
+
Add a route with file-based routing, then register it in the sidebar.
|
|
84
|
+
</Card>
|
|
85
|
+
</CardGroup>
|
|
86
|
+
|
|
87
|
+
## Related guides
|
|
88
|
+
|
|
89
|
+
<CardGroup cols={2}>
|
|
90
|
+
<Card title="Extend forms and tables" href="/rc/resources/tutorials/extend-forms-and-tables">
|
|
91
|
+
Step-by-step build with `defineCustomFieldsConfig`.
|
|
92
|
+
</Card>
|
|
93
|
+
<Card title="Add a widget" href="/rc/resources/tutorials/add-a-widget">
|
|
94
|
+
Inject a component into a zone.
|
|
95
|
+
</Card>
|
|
96
|
+
<Card title="Customize navigation" href="/rc/resources/tutorials/customize-navigation">
|
|
97
|
+
Reorder and hide sidebar items.
|
|
98
|
+
</Card>
|
|
99
|
+
<Card title="Custom Fields module" href="/resources/best-practices/custom-fields">
|
|
100
|
+
The backend storage layer.
|
|
101
|
+
</Card>
|
|
102
|
+
</CardGroup>
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Widgets"
|
|
3
|
+
sidebarTitle: "Widgets"
|
|
4
|
+
description: "Render a React component in a fixed slot on a built-in admin or vendor page."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
A widget is a React component that renders in a named slot on a built-in page.
|
|
8
|
+
Use a widget to show extra information or an action next to the data a page
|
|
9
|
+
already displays, such as a payout summary on the order detail page.
|
|
10
|
+
|
|
11
|
+
You add a widget by dropping a file into a panel's `src/widgets/` folder. The SDK
|
|
12
|
+
finds it at build time. There is no manifest to edit and no route to register.
|
|
13
|
+
|
|
14
|
+
## Create a widget
|
|
15
|
+
|
|
16
|
+
<Steps>
|
|
17
|
+
<Step title="Add a widget file">
|
|
18
|
+
Create a file anywhere under `src/widgets/` in the panel you want to extend.
|
|
19
|
+
The file name is up to you.
|
|
20
|
+
|
|
21
|
+
```tsx apps/vendor/src/widgets/product-list-banner.tsx
|
|
22
|
+
import { defineWidgetConfig } from "@mercurjs/dashboard-sdk"
|
|
23
|
+
import { Container, Text } from "@medusajs/ui"
|
|
24
|
+
|
|
25
|
+
const ProductListBanner = () => {
|
|
26
|
+
return (
|
|
27
|
+
<Container>
|
|
28
|
+
<Text>Welcome to your catalog.</Text>
|
|
29
|
+
</Container>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default ProductListBanner
|
|
34
|
+
```
|
|
35
|
+
</Step>
|
|
36
|
+
|
|
37
|
+
<Step title="Target a zone with `defineWidgetConfig`">
|
|
38
|
+
Export a `config` that names the zone to render in. The last segment of the
|
|
39
|
+
zone id, `before` or `after`, sets the placement.
|
|
40
|
+
|
|
41
|
+
```tsx apps/vendor/src/widgets/product-list-banner.tsx
|
|
42
|
+
export const config = defineWidgetConfig({
|
|
43
|
+
zone: "product.list.before",
|
|
44
|
+
})
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Zone ids are typed. A zone that does not exist fails `tsc` (`bun run lint`),
|
|
48
|
+
so you cannot target a page that has no slot. See [Available zones](#vendor-zones)
|
|
49
|
+
for the full list.
|
|
50
|
+
</Step>
|
|
51
|
+
|
|
52
|
+
<Step title="Run the panel">
|
|
53
|
+
Start the panel and open the page you targeted. The widget renders in its
|
|
54
|
+
zone.
|
|
55
|
+
|
|
56
|
+
```bash Terminal
|
|
57
|
+
bun run dev
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The vendor panel runs on `http://localhost:7001` and the admin panel on
|
|
61
|
+
`http://localhost:7000`.
|
|
62
|
+
</Step>
|
|
63
|
+
</Steps>
|
|
64
|
+
|
|
65
|
+
## Configuration
|
|
66
|
+
|
|
67
|
+
`defineWidgetConfig` takes one object.
|
|
68
|
+
|
|
69
|
+
| Field | Type | Description |
|
|
70
|
+
| ------ | -------------------------------- | ----------------------------------------------------------------------- |
|
|
71
|
+
| `zone` | `WidgetZoneId \| WidgetZoneId[]` | The zone or zones to render in. Multiple widgets in one zone stack in registration order. |
|
|
72
|
+
| `id` | `string` (optional) | A stable id. Derived from the file path at build time when omitted. |
|
|
73
|
+
|
|
74
|
+
## Component props
|
|
75
|
+
|
|
76
|
+
The widget component receives a single prop.
|
|
77
|
+
|
|
78
|
+
| Prop | Type | Description |
|
|
79
|
+
| ------ | --------- | ---------------------------------------------------------------------------------------------- |
|
|
80
|
+
| `data` | `unknown` | The zone's contextual entity, such as the loaded product on a `product.detail.*` zone. Undefined on list and public zones that have no single entity. |
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { Container } from "@medusajs/ui"
|
|
84
|
+
import type { HttpTypes } from "@medusajs/types"
|
|
85
|
+
|
|
86
|
+
const ProductDetailNote = ({ data }: { data?: HttpTypes.AdminProduct }) => (
|
|
87
|
+
<Container>{data?.title}</Container>
|
|
88
|
+
)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
<Note>
|
|
92
|
+
The public `login.logo`, `login.before`, and `login.after` zones render before
|
|
93
|
+
authentication and receive no `data`.
|
|
94
|
+
</Note>
|
|
95
|
+
|
|
96
|
+
## Zone ids
|
|
97
|
+
|
|
98
|
+
A zone id reads `<domain>.<view>.<placement>`.
|
|
99
|
+
|
|
100
|
+
- **Domain** is the page family, such as `product`, `orders`, or `customers`.
|
|
101
|
+
- **View** is the surface within that family: `list` for a list page, or
|
|
102
|
+
`detail.main` and `detail.side` for the two columns of a detail page.
|
|
103
|
+
- **Placement** is `before` or `after`. It is the last segment and decides
|
|
104
|
+
whether the widget renders above or below the target.
|
|
105
|
+
|
|
106
|
+
Each surface in the tables below expands to two zone ids. The `product` detail
|
|
107
|
+
main column, for example, gives you `product.detail.main.before` and
|
|
108
|
+
`product.detail.main.after`.
|
|
109
|
+
|
|
110
|
+
## Vendor zones
|
|
111
|
+
|
|
112
|
+
Widgets in `@mercurjs/vendor` (`apps/vendor`) can target these surfaces. Each cell
|
|
113
|
+
expands to a `.before` and an `.after` zone.
|
|
114
|
+
|
|
115
|
+
| Domain | List | Detail main | Detail side | Other |
|
|
116
|
+
| ------------------ | :--: | :---------: | :---------: | ----- |
|
|
117
|
+
| `campaigns` | ✓ | ✓ | ✓ | |
|
|
118
|
+
| `categories` | ✓ | ✓ | ✓ | |
|
|
119
|
+
| `collections` | ✓ | ✓ | | |
|
|
120
|
+
| `customer-groups` | ✓ | ✓ | | |
|
|
121
|
+
| `customers` | ✓ | ✓ | ✓ | |
|
|
122
|
+
| `inventory` | ✓ | ✓ | ✓ | |
|
|
123
|
+
| `locations` | ✓ | ✓ | ✓ | |
|
|
124
|
+
| `offer-variants` | | ✓ | ✓ | |
|
|
125
|
+
| `offers` | ✓ | ✓ | ✓ | |
|
|
126
|
+
| `orders` | ✓ | ✓ | ✓ | `detail.summary` |
|
|
127
|
+
| `payouts` | ✓ | ✓ | | |
|
|
128
|
+
| `price-lists` | ✓ | ✓ | ✓ | |
|
|
129
|
+
| `product` | ✓ | ✓ | ✓ | |
|
|
130
|
+
| `product-tags` | ✓ | ✓ | | |
|
|
131
|
+
| `product-types` | ✓ | ✓ | | |
|
|
132
|
+
| `product-variants` | | ✓ | | |
|
|
133
|
+
| `profile` | | ✓ | | |
|
|
134
|
+
| `promotions` | ✓ | ✓ | ✓ | |
|
|
135
|
+
| `regions` | ✓ | ✓ | | |
|
|
136
|
+
| `reservations` | ✓ | ✓ | ✓ | |
|
|
137
|
+
| `return-reasons` | ✓ | | | |
|
|
138
|
+
| `shipping-profiles`| ✓ | ✓ | | |
|
|
139
|
+
| `tax-regions` | ✓ | ✓ | | `province.detail.main` |
|
|
140
|
+
| `team` | ✓ | | | |
|
|
141
|
+
|
|
142
|
+
### Vendor public and setup zones
|
|
143
|
+
|
|
144
|
+
These sit outside the list and detail shape. The `login.*` zones render before
|
|
145
|
+
authentication and receive no `data`.
|
|
146
|
+
|
|
147
|
+
| Zone base | Ids | Renders |
|
|
148
|
+
| --------------- | ----------------------------------------------- | ---------------------------------- |
|
|
149
|
+
| `login.logo` | `login.logo.before`, `login.logo.after` | Around the logo on the login page. |
|
|
150
|
+
| `login.before` | `login.before.before`, `login.before.after` | Before the login form. |
|
|
151
|
+
| `login.after` | `login.after.before`, `login.after.after` | After the login form. |
|
|
152
|
+
| `seller.setup` | `seller.setup.before`, `seller.setup.after` | Around the store setup step. |
|
|
153
|
+
|
|
154
|
+
## Admin zones
|
|
155
|
+
|
|
156
|
+
Widgets in `@mercurjs/admin` (`apps/admin-test`) can target these surfaces. Each
|
|
157
|
+
cell expands to a `.before` and an `.after` zone.
|
|
158
|
+
|
|
159
|
+
| Domain | List | Detail main | Detail side | Other |
|
|
160
|
+
| ----------------------- | :--: | :---------: | :---------: | ----- |
|
|
161
|
+
| `api-keys` | ✓ | ✓ | | |
|
|
162
|
+
| `attributes` | ✓ | ✓ | | |
|
|
163
|
+
| `campaigns` | ✓ | ✓ | ✓ | |
|
|
164
|
+
| `categories` | ✓ | ✓ | ✓ | |
|
|
165
|
+
| `collections` | ✓ | ✓ | | |
|
|
166
|
+
| `commissions` | ✓ | ✓ | | |
|
|
167
|
+
| `customer-groups` | ✓ | ✓ | | |
|
|
168
|
+
| `customers` | ✓ | ✓ | ✓ | |
|
|
169
|
+
| `inventory` | ✓ | ✓ | ✓ | |
|
|
170
|
+
| `locations` | ✓ | ✓ | ✓ | |
|
|
171
|
+
| `marketplace` | | ✓ | | |
|
|
172
|
+
| `offer-variants` | | ✓ | ✓ | |
|
|
173
|
+
| `offers` | ✓ | ✓ | ✓ | |
|
|
174
|
+
| `orders` | ✓ | ✓ | ✓ | |
|
|
175
|
+
| `payouts` | ✓ | ✓ | | |
|
|
176
|
+
| `price-lists` | ✓ | ✓ | ✓ | |
|
|
177
|
+
| `product` | | ✓ | ✓ | |
|
|
178
|
+
| `products` | ✓ | | | |
|
|
179
|
+
| `product-tags` | ✓ | ✓ | | |
|
|
180
|
+
| `product-types` | ✓ | ✓ | | |
|
|
181
|
+
| `product-variants` | | ✓ | ✓ | |
|
|
182
|
+
| `profile` | | ✓ | | |
|
|
183
|
+
| `promotions` | ✓ | ✓ | ✓ | |
|
|
184
|
+
| `refund-reasons` | ✓ | | | |
|
|
185
|
+
| `regions` | ✓ | ✓ | | |
|
|
186
|
+
| `reservation` | ✓ | ✓ | ✓ | |
|
|
187
|
+
| `return-reasons` | ✓ | | | |
|
|
188
|
+
| `sales-channels` | ✓ | ✓ | | |
|
|
189
|
+
| `shipping-option-types` | ✓ | ✓ | | |
|
|
190
|
+
| `shipping-profiles` | ✓ | ✓ | | |
|
|
191
|
+
| `stores` | ✓ | ✓ | ✓ | |
|
|
192
|
+
| `tax-regions` | ✓ | ✓ | | `province.detail.main` |
|
|
193
|
+
| `users` | ✓ | ✓ | | |
|
|
194
|
+
|
|
195
|
+
<Note>
|
|
196
|
+
Admin splits the product list and product detail across two domains. List zones
|
|
197
|
+
are `products.list.*` (plural) and detail zones are `product.detail.*`
|
|
198
|
+
(singular). Vendor uses `product` for both. Detail-page reservation zones are
|
|
199
|
+
`reservation.*` (singular) in admin and `reservations.*` (plural) in vendor.
|
|
200
|
+
Follow the tables above rather than guessing the pluralization.
|
|
201
|
+
</Note>
|
|
202
|
+
|
|
203
|
+
## Next steps
|
|
204
|
+
|
|
205
|
+
<CardGroup cols={2}>
|
|
206
|
+
<Card title="Custom Fields" href="/references/panel-extensions/custom-fields">
|
|
207
|
+
Add fields, section rows, and list columns to a built-in model.
|
|
208
|
+
</Card>
|
|
209
|
+
<Card title="Create a new page" href="/references/panel-extensions/create-page">
|
|
210
|
+
Add a route with file-based routing and register it in the sidebar.
|
|
211
|
+
</Card>
|
|
212
|
+
</CardGroup>
|
|
@@ -147,6 +147,6 @@ Use it when you need to look up API references, understand how a module works, f
|
|
|
147
147
|
|
|
148
148
|
| Approach | Best for |
|
|
149
149
|
|----------|----------|
|
|
150
|
-
| **[Bundled docs](/rc/resources/ai/overview)** | Coding agents inside a project
|
|
150
|
+
| **[Bundled docs](/rc/resources/ai/overview)** | Coding agents inside a project: version-matched, offline, no setup |
|
|
151
151
|
| **MCP Server** | Live search from your editor, always the latest published docs |
|
|
152
|
-
| **[llms.txt](/
|
|
152
|
+
| **[llms.txt](https://docs.mercurjs.com/llms-full.txt)** | Feeding full context to a chat assistant (Claude, ChatGPT) |
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Building with AI"
|
|
3
|
+
sidebarTitle: "Overview"
|
|
3
4
|
description: "Mercur ships version-matched docs inside your project so AI coding agents build from accurate APIs instead of stale training data."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
Mercur is built so AI coding agents work from **accurate, version-matched documentation** instead of their training data
|
|
7
|
+
Mercur is built so AI coding agents work from **accurate, version-matched documentation** instead of their training data. Training data is almost always out of date for a fast-moving platform. The docs ship *inside your project's dependencies*, and your project tells agents to read them before writing any code.
|
|
7
8
|
|
|
8
9
|
<Info>
|
|
9
|
-
**Why agents do well here.** Every extension surface an agent touches has a machine-checkable contract: routes generate
|
|
10
|
+
**Why agents do well here.** Every extension surface an agent touches has a machine-checkable contract: routes generate a typed client (wrong calls fail to compile), pages follow [file conventions](/rc/resources/customization/extending-panels) the SDK validates at build time, and blocks are diffable source. An agent doesn't need to guess whether its change works. The toolchain tells it.
|
|
10
11
|
</Info>
|
|
11
12
|
|
|
12
13
|
## How it works
|
|
@@ -17,25 +18,25 @@ When you install a Mercur project, the documentation is bundled as a dependency
|
|
|
17
18
|
node_modules/@mercurjs/docs/
|
|
18
19
|
├── llms.txt # index: every page with a one-line description
|
|
19
20
|
└── content/
|
|
20
|
-
├── learn/ # concepts
|
|
21
|
+
├── learn/ # concepts: sellers, products, offers, commissions…
|
|
21
22
|
├── resources/ # tutorials, integrations, deployment, this guide
|
|
22
23
|
├── tools/ # CLI, API client, dashboard SDK
|
|
23
24
|
├── references/ # module, HTTP API, and configuration reference
|
|
24
25
|
└── user-guide/ # admin and vendor panel usage
|
|
25
26
|
```
|
|
26
27
|
|
|
27
|
-
Because the docs travel with the package, an agent always has documentation that **matches your installed version
|
|
28
|
+
Because the docs travel with the package, an agent always has documentation that **matches your installed version**. There is no network request, no external lookup, and no drift between what the agent reads and what your code actually runs.
|
|
28
29
|
|
|
29
30
|
## Set up your project
|
|
30
31
|
|
|
31
32
|
### New projects
|
|
32
33
|
|
|
33
|
-
Projects created with `
|
|
34
|
+
Projects created with `bun create mercur-app@latest` are ready out of the box. The template ships:
|
|
34
35
|
|
|
35
36
|
- `@mercurjs/docs` as a dependency, so the docs land in `node_modules` on install
|
|
36
37
|
- an `AGENTS.md` and a `CLAUDE.md` at the project root that tell agents to read the bundled docs first
|
|
37
38
|
|
|
38
|
-
Most AI coding agents
|
|
39
|
+
Most AI coding agents, such as Claude Code, Cursor, and GitHub Copilot, read `AGENTS.md` automatically when they start a session. There is nothing else to configure.
|
|
39
40
|
|
|
40
41
|
### Existing projects
|
|
41
42
|
|
|
@@ -50,7 +51,7 @@ Then create an `AGENTS.md` at the project root with a single, focused instructio
|
|
|
50
51
|
```md AGENTS.md
|
|
51
52
|
# Mercur: read the docs before coding
|
|
52
53
|
|
|
53
|
-
Before any non-trivial change, read the bundled documentation
|
|
54
|
+
Before any non-trivial change, read the bundled documentation. It is
|
|
54
55
|
version-matched to this project's installed packages, and far more accurate
|
|
55
56
|
than training data.
|
|
56
57
|
|
|
@@ -68,30 +69,34 @@ Don't guess at an API, data model, or file convention the docs already describe.
|
|
|
68
69
|
|
|
69
70
|
## What the agent reads
|
|
70
71
|
|
|
71
|
-
The workflow is deliberately simple: **index first, then the page.** An agent reads `llms.txt` to see what exists, then opens the one or two `content/` pages relevant to the task before implementing. The bundled docs cover the full domain model (sellers, products, offers, attributes, commissions, payouts, order groups), the CLI, the typed API client, the dashboard SDK, module references, and how-to guides
|
|
72
|
+
The workflow is deliberately simple: **index first, then the page.** An agent reads `llms.txt` to see what exists, then opens the one or two `content/` pages relevant to the task before implementing. The bundled docs cover the full domain model (sellers, products, offers, attributes, commissions, payouts, order groups), the CLI, the typed API client, the dashboard SDK, module references, and how-to guides. The agent looks up the correct contract rather than inventing one.
|
|
72
73
|
|
|
73
74
|
## Verify its work
|
|
74
75
|
|
|
75
|
-
Mercur gives an agent a fast, machine-checkable way to know whether a change is correct
|
|
76
|
+
Mercur gives an agent a fast, machine-checkable way to know whether a change is correct. It is the equivalent of a grading loop the agent can run itself:
|
|
76
77
|
|
|
77
78
|
| Check | What it proves |
|
|
78
79
|
|-------|----------------|
|
|
79
80
|
| `bun run build` | Types resolve and the generated client matches the routes |
|
|
80
81
|
| `bun run lint` | Code conforms to the project's rules |
|
|
81
82
|
| Integration tests (`packages/api`) | Backend behavior still holds |
|
|
82
|
-
| `bunx @mercurjs/cli@latest diff` | Local blocks vs. the registry
|
|
83
|
+
| `bunx @mercurjs/cli@latest diff` | Local blocks vs. the registry: what changed and what drifted |
|
|
83
84
|
|
|
84
|
-
Because these are objective, an agent can define what "done" looks like, run the checks, read the output, and iterate until they pass
|
|
85
|
+
Because these are objective, an agent can define what "done" looks like, run the checks, read the output, and iterate until they pass, instead of stopping at "looks plausible."
|
|
85
86
|
|
|
86
|
-
##
|
|
87
|
+
## More AI tooling
|
|
87
88
|
|
|
88
|
-
The bundled docs are
|
|
89
|
+
The bundled docs are the foundation. Layer more on top:
|
|
89
90
|
|
|
90
91
|
<CardGroup cols={2}>
|
|
91
|
-
<Card title="
|
|
92
|
-
|
|
92
|
+
<Card title="Skills" icon="wand-magic-sparkles" href="/resources/ai/skills">
|
|
93
|
+
Add the official Medusa agent skills for the framework Mercur runs on.
|
|
93
94
|
</Card>
|
|
94
|
-
<Card title="MCP server" href="/
|
|
95
|
+
<Card title="MCP server" icon="plug" href="/resources/ai/mcp">
|
|
95
96
|
Let your editor search the docs live via Model Context Protocol.
|
|
96
97
|
</Card>
|
|
97
98
|
</CardGroup>
|
|
99
|
+
|
|
100
|
+
For chat assistants like Claude or ChatGPT, Mercur also publishes a hosted
|
|
101
|
+
[`llms.txt`](https://docs.mercurjs.com/llms.txt) index and a full
|
|
102
|
+
[`llms-full.txt`](https://docs.mercurjs.com/llms-full.txt) you can load as context.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Skills"
|
|
3
|
+
description: "Agent skills for building on Mercur: the bundled-docs contract plus the official Medusa agent skills."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Agent skills are packaged instructions that teach an AI coding agent how to perform
|
|
7
|
+
a specific kind of task the right way for your stack, such as a migration, a form,
|
|
8
|
+
or a module. On Mercur, skills build on two foundations: the **version-matched docs**
|
|
9
|
+
bundled in your project, and the **official Medusa agent skills** for the
|
|
10
|
+
framework Mercur runs on.
|
|
11
|
+
|
|
12
|
+
## Start with the bundled docs
|
|
13
|
+
|
|
14
|
+
Mercur's own mechanism is the documentation bundled at
|
|
15
|
+
`node_modules/@mercurjs/docs/` plus an `AGENTS.md` that tells agents to read it
|
|
16
|
+
before writing code. That's the contract every agent should read first. It's
|
|
17
|
+
version-matched to your installed packages, so an agent looks up the real API
|
|
18
|
+
instead of guessing.
|
|
19
|
+
|
|
20
|
+
<Card title="Building with AI" icon="robot" href="/resources/ai/overview">
|
|
21
|
+
How the bundled docs work and how to point your agent at them.
|
|
22
|
+
</Card>
|
|
23
|
+
|
|
24
|
+
## Official Medusa agent skills
|
|
25
|
+
|
|
26
|
+
Mercur is built on Medusa, so the [official Medusa agent skills](https://docs.medusajs.com/learn/introduction/build-with-llms-ai/agentic-skills)
|
|
27
|
+
apply directly to the Medusa layer under your marketplace: modules, workflows,
|
|
28
|
+
API routes, migrations, admin widgets, and storefronts. Install them as plugins
|
|
29
|
+
in Claude Code, or copy them into any AI tool that supports custom skills.
|
|
30
|
+
|
|
31
|
+
```bash Claude Code
|
|
32
|
+
claude
|
|
33
|
+
/plugin marketplace add medusajs/medusa-agent-skills
|
|
34
|
+
/plugin install medusa-dev@medusa
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Available plugins
|
|
38
|
+
|
|
39
|
+
| Plugin | What it does |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `medusa-dev` | Build features, fix bugs, and generate accurate Medusa code |
|
|
42
|
+
| `ecommerce-storefront` | A `storefront-best-practices` skill for any frontend framework |
|
|
43
|
+
| `learn-medusa` | An interactive experience for learning Medusa |
|
|
44
|
+
|
|
45
|
+
### `medusa-dev` commands
|
|
46
|
+
|
|
47
|
+
| Command | Description |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| `/medusa-dev:db-migrate` | Run database migrations |
|
|
50
|
+
| `/medusa-dev:db-generate <module>` | Generate migrations for a custom module |
|
|
51
|
+
| `/medusa-dev:new-user <email> <password>` | Create an admin user |
|
|
52
|
+
|
|
53
|
+
<Note>
|
|
54
|
+
Using a different agent? These are plain skills. Copy them from the
|
|
55
|
+
[medusajs/medusa-agent-skills](https://github.com/medusajs/medusa-agent-skills)
|
|
56
|
+
marketplace into any tool that supports custom skills.
|
|
57
|
+
</Note>
|
|
58
|
+
|
|
59
|
+
## Combine skills with the Mercur docs
|
|
60
|
+
|
|
61
|
+
For the framework layer, such as a custom module, a workflow, or an admin widget,
|
|
62
|
+
lean on the Medusa skills. For anything marketplace-specific, such as sellers,
|
|
63
|
+
offers, commissions, payouts, or order groups, pair them with the bundled Mercur
|
|
64
|
+
docs so the agent has both the framework skill and the version-matched marketplace
|
|
65
|
+
contract. The [Platform](/platform/store/overview) reference is written to be
|
|
66
|
+
read by agents: each domain's data models, workflows, service, and events are
|
|
67
|
+
documented exactly where an agent looks for them.
|