mit einem Klick
migration-guide
// Analyze a Mercur 1.x project and guide migration to 2.0. Self-contained — works without access to the mercur monorepo.
// Analyze a Mercur 1.x project and guide migration to 2.0. Self-contained — works without access to the mercur monorepo.
| name | migration-guide |
| description | Analyze a Mercur 1.x project and guide migration to 2.0. Self-contained — works without access to the mercur monorepo. |
| argument-hint | [path-to-old-project] |
Use this skill when:
| 1.x | 2.0 |
|---|---|
@mercurjs/b2c-core | @mercurjs/core — all core modules built in |
@mercurjs/commission | Built into core |
@mercurjs/algolia | Registry block: mercurjs add algolia |
@mercurjs/resend | No 2.0 equivalent — port manually |
@mercurjs/payment-stripe-connect | No 2.0 equivalent — port manually |
@mercurjs/stripe-tax-provider | No 2.0 equivalent — port manually |
@medusajs/admin-vite-plugin | @mercurjs/dashboard-sdk |
@medusajs/js-sdk | @mercurjs/client (generated typed client) |
| 1.x | 2.0 |
|---|---|
apps/backend/src/* | packages/api/src/* |
apps/backend/src/modules/ | packages/api/src/modules/ |
apps/backend/src/workflows/ | packages/api/src/workflows/ |
apps/backend/src/api/ | packages/api/src/api/ |
apps/backend/src/subscribers/ | packages/api/src/subscribers/ |
apps/backend/src/links/ | packages/api/src/links/ |
apps/admin/src/routes/ | apps/admin/src/routes/ |
apps/vendor/src/routes/ | apps/vendor/src/routes/ |
| Old | New |
|---|---|
from "@medusajs/utils" | from "@medusajs/framework/utils" |
from "@medusajs/js-sdk" | from "@mercurjs/client" |
from "@custom-types/*" | from "@mercurjs/types" |
from "@hooks/*" | from "@mercurjs/dashboard-shared" or local |
from "@components/*" | from "@mercurjs/dashboard-shared" |
from "@lib/*" | from "@mercurjs/dashboard-shared" |
from "@mercurjs/b2c-core" | from "@mercurjs/core" |
Custom providers in medusa-config.ts must use ./src/ prefix:
// Wrong (will fail with "Cannot find module")
resolve: './providers/my-provider'
// Correct
resolve: './src/providers/my-provider'
Provider entry files must import from @medusajs/framework/utils, not @medusajs/utils:
import { Modules, ModuleProvider } from "@medusajs/framework/utils"
medusa-config.ts plugin registration changed:
// 1.x
plugins: [{ resolve: "@mercurjs/b2c-core", options: {} }]
// 2.0
plugins: [{ resolve: "@mercurjs/core", options: {} }]
// + individual module registrations in modules array
Scan the 1.x project the user provides:
package.json — list all @mercurjs/* and @medusajs/* dependencies. Note the @mercurjs/b2c-core version to determine project version.apps/admin/) — search apps/backend/ when scanning for custom dashboard pagesmedusa-config.ts — list plugins, modules, providerssrc/modules/ — count and list custom modulessrc/workflows/ — count custom workflowssrc/api/ — count custom API routessrc/subscribers/ — count subscriberssrc/links/ — count custom linksapps/admin/src/ and apps/vendor/src/ for custom pages| Level | Criteria |
|---|---|
| Starter | No custom code beyond configuration |
| Light custom | < 10 custom endpoints, < 5 workflows, no custom modules |
| Heavy custom | Custom modules, > 10 workflows, custom admin pages, third-party integrations |
Communicate classification to user before proceeding.
For every custom element found, determine:
mercurjs add <block>Port in this order:
medusa-config.ts (plugins, modules, providers)packages/api/src/providers/, fix importspackages/api/src/modules/, register in configpackages/api/src/workflows/<entity>/packages/api/src/links/ (skip core duplicates)packages/api/src/subscribers/packages/api/src/api/, type both genericspackages/api/src/api/middlewares.tssrc/routes/ (NOT src/pages/ — dashboard SDK scans src/routes/), update importsAfter each group: run bun medusa develop and verify server starts.
After API routes: run bunx @mercurjs/cli@latest codegen.
After dashboard: run bun vite build in apps/admin and apps/vendor.
Stop and ask the user when:
index.ts files in workflows/ or steps/ (conflicts with block installation)Full migration documentation: https://docs.mercur.js/v2/migrations/overview
Review code changes for contract compliance, type safety, and regression risk. Use after completing any non-trivial implementation, before merging PRs, or when asked to review code quality across any mercur package.
Plan and execute migration from Mercur 1.x to 2.0. Classifies project difficulty, reads relevant migration docs, and follows stop conditions.
Enforce correct form UI patterns when creating or modifying forms in packages/admin. Use when writing form fields, edit drawers, create modals, or any form-based UI in the admin package. Covers Form.Field pattern, labels, errors, hints, grids, submit guards, drawer/modal structure.
Enforce correct page and section UI patterns when creating or modifying admin pages. Use when building list pages, detail pages, Container sections, action menus, empty states, delete flows, or any page-level UI in packages/admin.
Enforce correct tab UI patterns when creating custom tabs for TabbedForm wizards in packages/admin. Use when adding new tabs to product create, price list create, or any multi-step form wizard. Covers defineTabMeta, layout, heading levels, section structure, i18n.
Review admin UI code for consistency with established patterns. Use after writing any UI code in packages/admin to catch anti-patterns — wrong form components, hardcoded strings, missing i18n, incorrect heading levels, manual error rendering, missing data-testid, raw Controller usage.