@mercurjs/docs 2.2.0-canary.51 → 2.2.0-canary.53
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/resources/best-practices/api-routes.mdx +306 -0
- package/content/resources/best-practices/custom-fields.mdx +241 -0
- package/content/resources/best-practices/frontend.mdx +286 -0
- package/content/resources/best-practices/module-links.mdx +157 -0
- package/content/resources/best-practices/modules.mdx +144 -0
- package/content/resources/best-practices/overview.mdx +115 -0
- package/content/resources/best-practices/subscribers-and-jobs.mdx +133 -0
- package/content/resources/best-practices/types.mdx +120 -0
- package/content/resources/best-practices/workflows.mdx +173 -0
- package/content/resources/tutorials/add-order-detail-button.mdx +113 -0
- package/llms.txt +10 -0
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -28,6 +28,15 @@ package (`node_modules/@mercurjs/docs/`).
|
|
|
28
28
|
- [LLMs](content/resources/ai/llms.mdx) — Feed Mercur documentation directly to LLMs for accurate, context-aware assistance.
|
|
29
29
|
- [MCP Server](content/resources/ai/mcp.mdx) — Connect your AI environment to Mercur documentation via Model Context Protocol.
|
|
30
30
|
- [Building with AI](content/resources/ai/overview.mdx) — Mercur ships version-matched docs inside your project so AI coding agents build from accurate APIs instead of stale training data.
|
|
31
|
+
- [API routes](content/resources/best-practices/api-routes.mdx) — Thin HTTP adapters — typed request/response generics, Zod validation with createFindParams, filterable fields, middlewares as filters, and queryConfig.
|
|
32
|
+
- [Custom fields](content/resources/best-practices/custom-fields.mdx) — The full loop — add a custom field in core, render it in the panels with defineCustomFieldsConfig, pull linked data with the link property, and type it end-to-end.
|
|
33
|
+
- [Frontend](content/resources/best-practices/frontend.mdx) — Build panel UI the right way — @medusajs/ui usage, custom-field extensions (forms, tables, read-only section fields), and new pages, with the correct imports.
|
|
34
|
+
- [Module links](content/resources/best-practices/module-links.mdx) — Relate modules without coupling them — defineLink, the link-direction rule, built-in link steps, and filtering by links.
|
|
35
|
+
- [Modules](content/resources/best-practices/modules.mdx) — Keep modules thin — data access and CRUD only. Naming, decorators, and what must never live in a module service.
|
|
36
|
+
- [Best Practices Overview](content/resources/best-practices/overview.mdx) — How to build with Mercur — the layered architecture, the non-negotiable rules, and where each piece of logic belongs.
|
|
37
|
+
- [Subscribers & jobs](content/resources/best-practices/subscribers-and-jobs.mdx) — React to events and run periodic work safely — fetch from { id }, mutate via workflows, log-don't-throw, idempotency and loop guards, cron jobs.
|
|
38
|
+
- [Types & augmentation](content/resources/best-practices/types.mdx) — Type the panels against your own backend extensions — augment framework DTOs with declaration merging so every SDK endpoint carries your custom data.
|
|
39
|
+
- [Workflows](content/resources/best-practices/workflows.mdx) — Where all business logic and mutations live — composition-function constraints, one-mutation-per-step with compensation, reusing built-in steps, and the query engine.
|
|
31
40
|
- [Custom Fields](content/resources/customization/custom-fields.mdx) — Extend any Medusa entity with additional fields without modifying core code.
|
|
32
41
|
- [Extend a workflow](content/resources/customization/extend-a-workflow.mdx) — Inject custom logic into an existing Mercur workflow through hooks — without rewriting it.
|
|
33
42
|
- [Extending Panels](content/resources/customization/extending-panels.mdx) — Add pages, inject widgets, customize navigation, and extend forms and tables in the admin and vendor panels.
|
|
@@ -37,6 +46,7 @@ package (`node_modules/@mercurjs/docs/`).
|
|
|
37
46
|
- [Stripe Connect Integration](content/resources/integrations/stripe-connect.mdx) — Set up Stripe Connect for marketplace payments and seller payouts — from Stripe Dashboard configuration to the full end-to-end payment lifecycle.
|
|
38
47
|
- [Add a feature with a block](content/resources/tutorials/add-a-block.mdx) — Install the reviews block end-to-end and see it live across the admin, vendor, and storefront surfaces.
|
|
39
48
|
- [Add a widget](content/resources/tutorials/add-a-widget.mdx) — Inject a React component at a named zone on a built-in panel page with defineWidgetConfig — no forking.
|
|
49
|
+
- [Add a button to order details](content/resources/tutorials/add-order-detail-button.mdx) — Drop a 'Copy link' button onto the vendor order detail page with a widget — no forking, no page override.
|
|
40
50
|
- [Create attributes and variant axes](content/resources/tutorials/attributes-and-variant-axes.mdx) — Build the attribute catalog: a filterable attribute, a variant axis backed by a native product option, and an inline product-scoped axis.
|
|
41
51
|
- [Build your own block](content/resources/tutorials/build-a-block.mdx) — Author a reusable feature as a block — backend, panel UI, and docs — build it into a registry, and install it into any Mercur project.
|
|
42
52
|
- [Configure commissions](content/resources/tutorials/configure-commissions.mdx) — Set the global commission, add scoped rules for categories and sellers, and confirm the right rate lands on an order.
|