Get started with 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 CLI
🚧 Breaking change
The migrations workflow and CLI output have changed. Here's a summary of the changes.
- The commands remain the same as npx medusa migrations run and npx medusa migrations revert
- The CLI output has been changed to be more visually appealing and add separate migrations logs for each module with a line break
Breaking changes
The revert command has a breaking change that it requires one or more module names to perform the revert. It means, the action revert is not valid at the global/app level. It must be executed on a specific module.
If you are developing a custom module, you can run the revert command for it as follows:
# helloWorld is the moduleName
npx medusa migrations revert helloWorld
When-then utility for conditional execution of steps in Workflows
We have added a new when-then utility to execute steps conditionally.
Here's a basic example of its usage within a workflow:
const workflow = createWorkflow("workflow", function (input) {
const result = when(input, (input) => {
return input.someConditionalData
}).then(() => {
const otherResult = someStep({ ... })
return otherResult
})
return someOtherStep(result)
}
)
Tax Regions UI update
The Tax Regions domain in Medusa Admin has been revamped, improving the overall UI and UX.
Features
- feat(workflows-sdk): step conditional by @carlos-r-l-rodrigues in #7912
- feat(core-flows, types): add workflow to update order change actions by @riqwan in #8080
- feat(core-flows, types): workflow to delete order change actions by @riqwan in #8064
- feat(core-flows, order): add workflow to create change order actions by @riqwan in #8056
- feat(dashboard,types,js-sdk,ui): Tax Regions UI by @kasperkristensen in #7935
- feat: Update toast design by @kasperkristensen in #8018
- feat(core-flows,types): cancel order changes workflow by @riqwan in #8035
- feat(order,core-flows): added order change create workflow by @riqwan in #8033
- feat: Add support in BE for setting tax inclusivity on currency by @sradevski in #8037
- feat: Plug tax inclusivity in cart and order workflows by @sradevski in #8013
- feat: Add necessary middlewares for tax inclusive pricing by @sradevski in #7827
- Feat: Add tax inclusivity to admin by @sradevski in #8003
- feat: Add static server and adjust file local to work out of the box by @sradevski in #8019
- feat: Add types to the workflow conditional by @adrien2p in #7979
- feat: Add HTTP endpoints and workflows for price preference management by @sradevski in #7960
- feat: Initial implementation with programmatic APIs by @thetutlage in #7973
- feat: Improvements to the migrations CLI and workflow by @thetutlage in #8060
- feat(core-flows): begin returns, claims and exchanges by @carlos-r-l-rodrigues in #8088
- feat(dashboard,medusa): Add updated Metadata Form by @kasperkristensen in #8084
Bugs
- fix: Improve get caller file path util by @adrien2p in #7974
- fix: error 4082 when using defineLink by @adrien2p in #8014
- fix(create-medusa-app): remove glob-related warnings by @shahednasser in #7985
- fix(notification): fix notification loader error by @riqwan in #7969
- fix(vite-plugin-admin): Ensure UI Routes are HMR by @kasperkristensen in #7982
- fix(dashboard): Hide edit rank button when no categories exist by @kasperkristensen in #7986
- fix(dashboard): StockLocations overview sidebar by @kasperkristensen in #7984
- fix(docs) : Fix wrong model names in the Marketplace recipe by @adevinwild in #8002
- fix: Modules providers loading mechanism to infer the source dir by @adrien2p in #8015
- fix(notification): fix notification loader error by @riqwan in #7969
- fix(vite-plugin-admin): Ensure UI Routes are HMR by @kasperkristensen in #7982
- fix(dashboard): Hide edit rank button when no categories exist by @kasperkristensen in #7986
- fix(dashboard): StockLocations overview sidebar by @kasperkristensen in #7984
- fix(docs) : Fix wrong model names in the Marketplace recipe by @adevinwild in #8002
- fix: Modules providers loading mechanism to infer the source dir by @adrien2p in #8015
- fix: Test failing after recent changes by @sradevski in #8031
- fix: Have shipping options open by default by @sradevski in #8040
- fix(dashboard): JSON view by @kasperkristensen in #8038
- fix(dashboard): Shipping Type tooltip by @kasperkristensen in #8042
- fix(admin-vite-plugin): ensure forward slashes are used for paths by @kasperkristensen in #8023
- fix(dashboard): Allow cmd+click on table rows by @kasperkristensen in #8045
- fix(core-flows): order partial fulfillment by @carlos-r-l-rodrigues in #8047
- fix(dashboard): Add safe zone around link Table rows by @kasperkristensen in #8058
- fix(ui): Use correct text style for primary button by @kasperkristensen in #8059
- fix(dashboard, medusa): mark shipped flow by @fPolic in #8065
- fix(dashboard): stock location hook cache invalidation by @fPolic in #8049
- fix(tax): Add indexes to enforce unique constraint on tax region by @olivermrbl in #8067
- fix(utils): define link alias + pluralize by @carlos-r-l-rodrigues in #8070
- fix: Investigate geo zones with address checks by @adrien2p in #8066
- fix(migrations): small fix to the text by @shahednasser in #8091
- fix: Gracefully handle migrations that cannot be reverted by @thetutlage in #8087
Documentation
- docs: restructure api-reference to allow base path by @shahednasser in #7954
- docs: remove limitation on arrow functions in workflows by @shahednasser in #7958
- docs: fix URL of Algolia cron job by @shahednasser in #7957
- docs: fix edit button on resources homepage by @shahednasser in #7967
- docs: fix pagination on mobile devices by @shahednasser in #7968
- docs: fix page crashing when using google translate by @shahednasser in #8009
- docs: fix type in module path by @shahednasser in #8011
- docs: rename property when defining a list link by @shahednasser in #8017
- docs: fix download button + other fixes by @shahednasser in #8032
- docs: added chapter on managing relationships by @shahednasser in #8043
- docs: update order module's conceptual guides by @shahednasser in #7893
- docs: updates to local file module provider documentation by @shahednasser in #8030
- docs: add a section about constraints on step return value by @shahednasser in #8036
- docs: add a need help button by @shahednasser in #8069
- docs: fix typo in curl command example by @MustafaM257 in #8071
- docs: change event payload handling in subscribers by @shahednasser in #8078
- docs: improvements to module and data model documentation by @shahednasser in #8062
- docs: document when-then + migrations revert change by @shahednasser in #8089
Chores
- chore: rm database extra by @adrien2p in #7963
- chore: Apply defineMikroOrmCliConfig by @adrien2p in #7975
- chore: Rename entity to model by @adrien2p in #7977
- chore: update docs issue template by @shahednasser in #8012
- chore: rename source to linkable in defineLink options by @adrien2p in #8016
- chore: Ensure the events are emitted with the same shape all accross by @adrien2p in #8063
- chore: Migrate modules to use the Module util by @adrien2p in #7964
- chore: Attempt to fix flaky migration tests by @thetutlage in #8034
- chore(order): preview order change by @carlos-r-l-rodrigues in #8025
- chore: properly infer return type from model config by @adrien2p in #8079
- chore(dashboard): text changes and fixes by @shahednasser in #7925
- chore: rename return flow by @carlos-r-l-rodrigues in #8050
- chore: Ensure the events are emitted with the same shape all accross by @adrien2p in #8063
New Contributors
- @MustafaM257 made their first contribution in #8071
Full Changelog: v2.0-preview...v2.0.1-preview