Get started with a new project
To get started using the preview release, run the following command:
npx create-medusa-app@preview
This command will create a new Medusa project with our redesigned admin and a 2.0-compatible Next.js storefront. The Medusa application and the Next.js storefront are separate projects in separate folders.
Update existing project
Ensure your Medusa dependencies in package.json
are using the preview
tag:
{
"dependencies": {
"@medusajs/medusa": "preview",
"@medusajs/pricing": "preview",
"@medusajs/product": "preview",
...
}
}
To ensure an upgrade to a new version is completed correctly, run the following sequence of commands:
rm -rf node_modules
rm yarn.lock // or package-lock.json
yarn // If you are using yarn berry, you need to create the lock-file first
Highlights
Migrations and Linking CLI
We have introduced new CLI commands for generating migrations and managing links between modules. The latter is used to ensure links are in sync.
To generate migrations in your module, you can run the following command:
npx medusa migrations generate <name of module>
To sync the links between modules, you can run the following command:
npx medusa links sync
In case your links are out of sync, you'll be guided through possible actions to take.
Explore our full CLI reference in our documentation.
New Middlewares API
🚧 Breaking change
We have introduced a new way of defining middlewares for API Routes. This is a breaking change.
Instead of exporting a config from middlewares.ts
, you will now need to use a new utility function defineMiddlewares
.
To upgrade your project, you should apply the following changes:
- import { MiddlewareConfig } from '@medusajs/medusa'
+ import { defineMiddlewares } from '@medusajs/medusa'
- export const config: MiddlewareConfig = {
- routes: []
- }
+ export default defineMiddlewares({
+ routes: []
+ })
Read more about the new Middlewares API in our documentation.
Tax-inclusive Pricing
We have re-introduced tax-inclusive pricing. Tax-Inclusive pricing allows you to set the final prices for products and shipping options regardless of the customer's applicable tax rates. When tax-inclusive prices are used, Medusa automatically calculates the tax amount for a given price.
Read more about tax-inclusive pricing in our documentation.
Coming soon
The following are work-in-progress and will be released soon:
- Returns, Exchanges, and Claims of Orders
- Export and Import of Products
- Bulk Editor improvements
- Digital Products and Subscription Recipes
Features
- feat(core-flows,types): adds workflow to request item return by @riqwan in #8098
- feat(dashboard): allocate items by @fPolic in #8021
- feat(migrations): CLI generate command by @adrien2p in #8103
- feat(core-flows): request return on order exchanges and claims by @carlos-r-l-rodrigues in #8107
- feat: Add return shipping by @olivermrbl in #8106
- feat: Add tax inclusivity management to currenices by @sradevski in #8112
- feat: Admin Returns API by @olivermrbl in #8117
- feat: Add exchange return shipping by @olivermrbl in #8108
- feat: Returns order previews by @olivermrbl in #8135
- feat(core-flows,medusa,order): remove return shipping by @carlos-r-l-rodrigues in #8137
- feat(medusa): Order preview endpoint by @olivermrbl in #8144
- feat: Ensure async workflow executions have access to shared container by @sradevski in #8157
- feat: Add support for private files to file module by @sradevski in #8169
- feat(core-flows, medusa): remove request item return by @carlos-r-l-rodrigues in #8146
- feat(pricing): big number support by @carlos-r-l-rodrigues in #8113
- feat(core-flows,order): exchange/claim add item by @carlos-r-l-rodrigues in #8126
- feat: rework how links database migrations are managed by @adrien2p in #8162
- feat: Add product export endpoint and a dummy workflow by @sradevski in #8178
- feat: Add notification endpoints for admin by @sradevski in #8196
- feat(dashboard,js-sdk,types): Update app layout, and add user sdk methods by @kasperkristensen in #8182
- feat: Add support for exporting products in backend by @sradevski in #8214
- feat(medusa): allow filtering returns by
order_id
by @fPolic in #8225 - feat: Add skeleton for supporting product imports in BE by @sradevski in #8232
- feat: Extending API routes validators by @thetutlage in #8254
- feat: add extend router helper by @thetutlage in #8263
- feat(dashboard, order, medusa, types, js-sdk): Request return e2e flow by @fPolic in #7848
- feat(utils,link-modules): link between fulfillment provider and stock location by @riqwan in #8275
- feat: remove loading middlewares file in favor of routes-config files by @thetutlage in #8274
- feat: Implement notifications feed by @sradevski in #8224
- feat: Add basic support for importing products by @sradevski in #8266
Bugs
- fix: Migration generator and generated migrations by @adrien2p in #8090
- fix: Handle multiple id prop generation by @adrien2p in #8097
- fix: product module joiner config by @adrien2p in #8170
- fix(dashboard): product create input focus by @fPolic in #8095
- fix(utils): error message when isQueryable is possibly not enabled. by @shahednasser in #8096
- fix(dashboard): promotions disable conditions by @fPolic in #8104
- fix(payment, stripe) stripe payment cannot be captured by @silenaker in #8075
- fix(dashboard): reservation and price list fixes by @fPolic in #8110
- fix: defineMikroOrmCliConfig helper to provide default db credentials by @thetutlage in #8131
- fix: workflow return type inf missing type by @adrien2p in #8133
- fix(dashboard): create variant remove inventory quantity by @fPolic in #8129
- fix: install modules-sdk for test-utils to work by @adrien2p in #8142
- fix(core-flow): request item return reason by @carlos-r-l-rodrigues in #8152
- fix: Log error if a scheduled job handler throws by @sradevski in #8164
- fix(medusa): normalize build path by @carlos-r-l-rodrigues in #8166
- fix(dashboard): create SO modal by @fPolic in #8167
- fix: Remove the option to pass a container to workflow engine API by @sradevski in #8165
- fix: normalize path before consuming it while loading models by @adrien2p in #8194
- fix(medusa): rm default created at field by @adrien2p in #8213
- fix(utils): Fix inferrence of public method name and service registration name based on configuration by @adrien2p in #8237
- fix: Dont restart server if static file is added to the private folder by @sradevski in #8181
- fix: workflow 'when' should return T or undefined instead of Partial by @adrien2p in #8195
- fix(utils): totals calculation by @carlos-r-l-rodrigues in #8190
- fix(dashboard): fix header in create tax region form by @shahednasser in #8197
- fix(create-medusa-app): run links sync during setup by @shahednasser in #8215
- fix(admin-shared): Fix autocomplete for InjectionZones by @kasperkristensen in #8219
- fix(medusa): GET return/:id by @carlos-r-l-rodrigues in #8226
- fix(core-flows): create return items by @carlos-r-l-rodrigues in #8227
- fix: Event emitter not cleared in export tests by @sradevski in #8228
- fix(core-flows): confirm return request by @carlos-r-l-rodrigues in #8242
- fix(order): remove nested entities by @carlos-r-l-rodrigues in #8250
- fix(types,order): fixes to order module's service and data models by @shahednasser in #8247
- fix:
isList
on field alias in link configuration by @adrien2p in #8244 - fix: Product options were not preserved over updates by @sradevski in #8267
Documentation
- docs: updated marketplace recipe + added example by @shahednasser in #8061
- docs: highlight fixes by @shahednasser in #8094
- docs: add documentation for migration generate cli tool by @shahednasser in #8128
- docs: remove imports from src in medusa-config.js by @shahednasser in #8132
- docs-util: add support for RequestWithContext in route-handler detection by @shahednasser in #8141
- docs: rename data to event in subscribers across docs by @shahednasser in #8149
- docs: remove type arguments passed to createWorkflow by @shahednasser in #8161
- docs: fix cross-project links to use base path in production by @shahednasser in #8160
- docs: add update dependencies + release note details by @shahednasser in #8159
- docs: fix installation version of packages by @shahednasser in #8177
- docs: fix module provider definition export by @shahednasser in #8180
- docs: fix auth routes in api reference by @shahednasser in #8187
- docs: added tax-inclusive conceptual guide and updates to storefront guide by @shahednasser in #8186
- Update page.mdx by @akmaksumov in #8189
- docs: add chapter on executing a workflow in another / in a step by @shahednasser in #8163
- docs: remove the requirement on is queryable by @shahednasser in #8199
- docs: add section on delete cascades by @shahednasser in #8198
- docs: fix fulfillment provider option name by @shahednasser in #8211
- docs: document links sync command by @shahednasser in #8212
- docs: updates and fixes to marketplace recipe example by @shahednasser in #8150
- docs: fix note about how method names are generated by @shahednasser in #8240
- docs: fix information related to link directions by @shahednasser in #8236
- docs: fix rewrites in sub-projects to prevent loop on 404 page by @shahednasser in #8255
- docs: add 404 page by @shahednasser in #8260
- docs: fix package names of event bus modules by @shahednasser in #8262
- docs: added a section to introduction on using docs by @shahednasser in #8257
- docs: updates to Medusa server deployment guides by @shahednasser in #8268
Chores
- chore: add generated OAS and Typedoc output to automated PRs by @shahednasser in #8054
- chore: temporarely disabling link revert by @adrien2p in #8105
- chore: fix docs issue template by @shahednasser in #8068
- chore: Allow to fetch remote link using the service name or the alias from the use remote link step by @adrien2p in #8140
- chore: restructure events payload by @thetutlage in #8143
- chore(medusa,core-flows): update request return items and shipping by @carlos-r-l-rodrigues in #8151
- chore(core-flows, medusa): cancel request return by @carlos-r-l-rodrigues in #8153
- chore(ui-preset,icons,toolbox): Update dark mode theme by @kasperkristensen in #8168
- chore: default isQueryable module by @adrien2p in #8192
- chore(framework): Initial commit by @adrien2p in #8221
- chore(framework): update deps by @adrien2p in #8261
- chore(medusa,core-flows): begin and cancel receive return by @carlos-r-l-rodrigues in #8171
- chore(medusa, core-flows): receive item return request by @carlos-r-l-rodrigues in #8172
- chore(order): simplify order engine by @carlos-r-l-rodrigues in #8188
- chore(inventory, core-flows): big number support by @carlos-r-l-rodrigues in #8204
- chore: Fix flaky test for scheduled workflows by @sradevski in #8216
- chore: Make scheduled job tests reliable by @sradevski in #8241
- chore(core-flows): adjust inventory when return is received by @carlos-r-l-rodrigues in #8222
- chore: rm testing path by @carlos-r-l-rodrigues in #8249
- chore: Add
@medusajs/framework
to changeset by @olivermrbl in #8256 - chore(types): update workerMode tsdocs by @shahednasser in #8269
- chore(core-flows,medusa): order claims by @carlos-r-l-rodrigues in #8271
New Contributors
- @silenaker made their first contribution in #8075
- @silenaker made their first contribution in #8075
- @akmaksumov made their first contribution in #8189
Full Changelog: v2.0.1-preview...v2.0.2-preview