Releases: medusajs/medusa
v1.20.9
Fixes
- fix: Add fix for Stripe paid amount by @pepijn-vanvlaanderen in #8234
- fix: Pass cart_id so that prices can be calculated correctly. by @Arsenalist in #7554
- fix(admin): Allow
backend
to pass through in development by @kasperkristensen in #8231
Full Changelog: v1.20.8...v1.20.9
v2.0.2-preview
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 https...
v1.20.8
Features
- feat: add default remove options for scheduled jobs by @u11d-bartlomiej-galezowski in #8156
Bugs
- fix(create-medusa-app): ensure the latest create-next-app version is used by @shahednasser in #7806
- fix: remove products from product collection type in generated references by @shahednasser in #7812
- fix: Check if the SalesChannel FF is enabled before using it on the /admin/products/:id route by @adevinwild in #8120
Documentation
- docs: update admin auth api by @lekterable in #7710
- docs: store api ref reset password response tag by @ank-2222 in #7817
- docs: Update currencies.md by @gulshankumardev in #7843
- docs: prepare for v2 docs by @shahednasser in #7878
- docs: fix payment processor reference by @shahednasser in #7965
- docs: cancel building new docs on v1.x branch by @shahednasser in #7966
- docs: fix build:server command in plugin documentation by @shahednasser in #7970
- docs: fixed a typo in development docs by @yakin-ts in #7680
- docs(development): update typescript code examples by @ikhvost in #6195
- docs(development): fix yarn version by @xyzones in #6186
- docs: fixes to deployments of new docs on v1.x branch by @shahednasser in #7971
- docs: regenerate OAS + references to fix products in product collection by @shahednasser in #7976
- docs: added a note about retrieving the cart using Medusa React by @shahednasser in #7978
- docs(v1.x): fix page crashing when using google translate by @shahednasser in #8010
Chores
- chore(v1.x): remove docs actions no longer relevant by @shahednasser in #7686
- chore: Update create.mdx by @martinomancino in #7772
- chore(oas): fix inventory level titles in OAS by @shahednasser in #7890
- chore(utils): added declarationMap option to tsconfig by @shahednasser in #6937
- chore: fix CLI test by adding resolution for glob by @shahednasser in #8029
New Contributors
- @lekterable made their first contribution in #7710
- @martinomancino made their first contribution in #7772
- @ank-2222 made their first contribution in #7817
- @gulshankumardev made their first contribution in #7843
- @yakin-ts made their first contribution in #7680
- @ikhvost made their first contribution in #6195
- @u11d-bartlomiej-galezowski made their first contribution in #8156
Full Changelog: v1.20.7...v1.20.8
v2.0.1-preview
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 he...
v2.0.0-preview
Medusa 2.0 Public Preview Release
Today, we’re excited to share a Preview Release of Medusa 2.0.
The following document covers resources, guides, and things to know about the first preview release of Medusa 2.0. It will help you get started and give you a high-level overview of your new Medusa 2.0 application and what’s still to be done.
The preview release is not ready for production and is only intended for experimentation and development of new projects.
The release candidate later this year will include more fully-fledged resources for 2.0, including an overview of breaking changes, migration guides, and much more that will ensure a smoother onboarding.
We advise against upgrading your project to 2.0 at this point, as we are still working on documentating the best possible path.
These release notes are only intended to help you start and introduce you to your new Medusa 2.0 project. For a more in-depth exploration of the major upgrade, refer to our new documentation.
We are publishing this release to solicit early user and community feedback. Please file Issues for bug reports and/or submit Discussions with input or questions.
We thank you all very much in advance.
Get started
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.
The folder structure of Medusa projects has changed:
my-project
├── src
│ ├── admin
│ ├── api
│ ├── jobs
│ ├── subscribers
-│ ├── services
-│ ├── models
-│ ├── migrations
-│ ├── loaders
+│ ├── modules
+│ │ └── my-module
+│ │ ├── loaders
+│ │ ├── migrations
+│ │ ├── models
+│ │ ├── index.ts
+│ │ └── service.ts
+│ ├── workflows
└── medusa-config.ts
The modules
folder replaces a lot of folders from a 1.0 project and will contain most business logic customizations in your Medusa 2.0 application. We highly encourage you to read the section of our docs covering this new concept in detail.
The workflows
folder holds your custom workflows. Workflows are a fundamental concept in cross-module operations and a core element of Medusa 2.0. Read more about workflows here.
Additionally, medusa-config.js
has been cleaned up and improved with a new type-safe utility function for defining the config for your Medusa project. The file can also now live as both a JS and TS file.
export default defineConfig({
projectConfig: {
http: {
storeCors: "<STORE_CORS>",
adminCors: "<ADMIN_CORS>",
authCors: "<AUTH_CORS>"
},
redisUrl: "<REDIS URL>",
databaseUrl: "<DATABASE_URL>",
},
admin: {
backendUrl: "https://my-medusa-server.medusajs.app",
},
})
You are now ready to explore all the new features in the preview release. However, we recommend reading through our documentation to fully understand what is new in 2.0 and how it differs from 1.0.
Additionally, you can find references and code snippets for our tools in our Learning Resources.
Keeping up with preview releases
We release preview versions every three hours. We recommend setting the version of your Medusa dependencies to preview
, so you can regularly update without knowing specific version numbers.
All your Medusa dependencies in package.json
should look something like this:
{
"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
What’s new?
Medusa 2.0 is a huge upgrade, in fact, the biggest upgrade since we open-sourced the project four years ago. The upgrade comes with many new features and improvements, some of which are still work-in-progress. In the following sections, we will briefly cover these features and the parts of the product still subject to change. A more detailed changelog will be released as part of the release candidate and, subsequently, the official release later this year.
Admin dashboard
Our admin dashboard has been completely overhauled, improving its overall look and feel to provide end-users with a more cohesive and consistent experience.
Additionally, we have migrated away from Webpack to Vite, which improves the developer experience with features like HMR and allows us and our users to tap into a rich and flourishing community and plugin ecosystem.
Read more about the admin dashboard and its extension capabilities here.
A few admin flows have yet to be built. This is primarily around returns, exchanges, claims, and order edits. We expect to finalize these in the coming weeks.
Modules architecture
Our modules foundation has been re-architected to entirely decouple modules from one another, enabling greater composability, a new standalone usage mode, and a more approachable incremental adoption of Medusa.
Read more about the architecture refactor in our 2.0 announcement from earlier this year.
New commerce features
We saw reworking the module's architecture as an opportunity to rethink the feature set of some of the business domains in Medusa 1.x. As a result, we are excited to introduce a range of advanced capabilities across a series of modules. Here are a few noteworthy improvements:
- Stock location: Build omnichannel experiences with new stock location features, including “Buy online, pick up in-store” options.
- Inventory: Compose multi-part variants and share inventory across products with our new inventory management features
- Authentication: Enable authentication with external providers, such as Google, with our new authentication and user management features
- Promotion: Create granular promotions with our new rules engine. Use conditions to create bundled discounts, buy-get, spend-get, temporary campaigns, and more
Many other modules have also seen improvements. Browse through all of them in our learning resources.
Data modeling language
A core feature of Medusa is the ability to extend the default commerce application with additional business logic to cater to a specific use case, natively integrate with third-party providers, replace existing domains, and more.
At the core of extensions in Medusa 2.0 are modules, and at the core of modules are data models. Data models define the concepts living within your application. In our commerce modules, you find orders, products, customers, promotions, etc. By introducing your own data models, you extend this semantic layer of your application, enabling you to build features and custom workflows by integrating existing and new concepts. Because data models are at the core of every customization, we decided to make them easier to work with.
We are excited to announce a new data modeling language in Medusa 2.0 that will improve the experience of defining and working with data in your application. You can read more about the new feature here.
Below is a simple example of what data models will look like in 2.0:
Long-running Workflows
We are excited to extend our existing workflow capabilities with Long-running Workflows for processing long-running operations in the background. Instead of synchronously receiving a workflow's result, Long-running Workflows are subscribed to for status changes and execution progress. Additionally, the Long-running Workflows comes with an API for programmatically moving from one step to the next. These features make Long-running Workflows a great fit for use cases that require a human-in-the-loop or operations with a varying long-running execution time.
For example, we use Long-running Workflows extensively to build the infrastructure provisioning of Medusa Cloud.
Alongside the Long-running Workflows, we are also introducing a new admin section for managing them. Here, you can see currently executing and completed workflows, providing full transparency into your long-running operations.
Medusa 2.0 comes with much more than what is highlighted in this post. We will cover everything in-depth in the official release notes.
These release notes are published as a GitHub Discussion as well for comments and questions on the preview release.
v1.20.7
Highlights
Duplicate workflow registration no longer throws
Workflows are not utilized in v1.x, however our core package comes with a few workflows for v2.0. We are currently investigating an issue with checking for duplicate workflow registrations, but we can safely remove this check in v1.x, as it will never affect users using these versions.
Isolation level in batch job subscriber
The transaction isolation level set by the batch job processing subscriber has been changed from the default "READ COMMITTED" to "REPEATABLE READ" to ensure correct data in long-running job processors.
This was always the intention, but the "REPEATABLE READ" level set in the batch job strategies was overwritten by the default level set in the subscriber calling the strategy. This happens because the subscriber initiates a transaction with the default level that is then reused within the strategies.
Bugs
- fix(workflows-sdk): workflow registration by @carlos-r-l-rodrigues in #7590
- fix(medusa): TX isolation level in batch job subscriber by @olivermrbl in #7661
Docs
- docs(v1.x): use correct branch name by @shahednasser in #7233
- docs: fix code snippet for webpack custom configurations by @shahednasser in #7188
- docs(v1.x): fix rewrites of api-reference by @shahednasser in #7318
- docs: fix example code block by @chiuwah in #7453
- docs(v1.x): fix link to stripe plugin by @shahednasser in #7557
Chores
- chore(v1.x): fix build command in docs-util by @shahednasser in #7280
- chore(ap-ref v1.x): add v2 rewrite + remove versioning snippets by @shahednasser in #7305
New Contributors
Full Changelog: v1.20.6...v1.20.7
v1.20.6
Highlights
Resolves several issues in @medusajs/admin
- Add default value for
host
option in@medusjs/admin
. - Updates the version of
tailwindcss
,autoprefixer
, andpostcss
in@medusajs/admin-ui
, to avoid issues when importing components usingtailwindcss@4
. - Fixes an issue in
@medusajs/medusa
where thedevelop
command would throw an error when@medusajs/admin
was not installed.
Bugs
- fix(admin,admin-ui,medusa): Set default value for
host
+ other minor fixes by @kasperkristensen in #7203
Full Changelog: v1.20.5...v1.20.6
v1.20.5
Highlights
Preview release of Medusa 2.0 next week
We recently announced Medusa 2.0, and the majority of our time and resources are currently going into making this new major a reality as soon as possible. We will reach an important milestone next week by releasing an early preview version for experimentation and exploration. More information about the preview version will be shared alongside the release.
Remove useToast
hook from @medusajs/ui
🚧 Breaking change
The useToast
hook has been removed. Users should instead use the toast
function that is exported from the @medusajs/ui
package. This function can be used to show toasts in your application. For more information on how to use the toast
function, please refer to the documentation.
The Toaster
component is still available but the options for the component have changed. The default position has been changed to bottom-right
. For more information on the Toaster
component, please refer to the documentation.
Order totals account for deleted discounts
An issue with order totals not accounting for deleted discounts has been resolved.
Resolve node-gyp
installation issue in @medusajs/admin
An issue with node-gyp
in a dependency of a dependency has been resolved. The solution should, for the time being, be considered temporary.
Expose backend URL for admin in local development
The forced backend URL for admin in local development has been removed in favor of a plugin configuration.
You can now specify a host
value:
// medusa-config.js
const plugins = [
...
{
resolve: "@medusajs/admin",
options: {
// other options...
develop: {
port: 7000,
host: "example.com",
},
},
},
]
Features
- feat(medusa): add list location levels endpoint in api v2 by @pKorsholm in #6741
- feat: API key sales channel link by @olivermrbl in #6851
- feat: Modify the abstract repository upsert to handle subresources as per convention by @sradevski in #6813
- feat(medusa, stock-location-next): add list-stock-locations endpoint to api-v2 by @pKorsholm in #6788
- feat(admin-next): Email password invite flow in admin 2.0 by @olivermrbl in #6821
- feat: Refactor the product module definitions and implementation by @sradevski in #6866
- feat(modules-sdk): remote query retrieve by @carlos-r-l-rodrigues in #6849
- feat: Implemented price set update with prices and aligned pricing API by @sradevski in #6872
- feat(medusa-react,medusa,types,dashboard): added empty state + table for promotions list page by @riqwan in #6827
- feat: Remove sales channels from pub keys by @olivermrbl in #6876
- feat: Add v2 product types endpoints by @sradevski in #6880
- feat(dashboard): admin 3.0 order refund form by @fPolic in #6850
- feat(create-medusa-app): Add a
--verbose
option. by @shahednasser in #6027 - feat: Pricing update and refactor product API tests to not rely on internals by @sradevski in #6892
- feat: Admin V2 users domain by @olivermrbl in #6844
- feat(dashboard): Variant edit form by @kasperkristensen in #6870
- feat: Correctly define all product module models and SQL migration script by @sradevski in #6906
- feat: add sales channel management by @olivermrbl in #6761
- feat(link-module, core-flows, medusa): Add sales channel location management by @pKorsholm in #6905
- feat(workflows-sdk,orchestration): async step as background task by @carlos-r-l-rodrigues in #6886
- feat(dashboard): Update v2 store domain to follow conventions, and abstract some logic by @kasperkristensen in #6927
- feat(medusa): added endpoints for rule attribute/operator/values options by @riqwan in #6911
- feat: Add some of the missing pieces in the create product form by @sradevski in #6918
- feat(dashboard): Setup V2 Collections domain by @kasperkristensen in #6935
- feat(dashboard): admin locations v2 by @pKorsholm in #6868
- feat(dashboard): Add forms for edit and create product options by @kasperkristensen in #6907
- feat: region payment providers management workflows/api by @adrien2p in #6864
- feat: Normalize known DB errors to a MedusaError when possible by @sradevski in #6922
- feat(dashboard): Setup workflows in V2 routes by @kasperkristensen in #6939
- feat(dashboard): Edit variant options + create option callback for combobox by @kasperkristensen in #6920
- feat: Admin V2 API keys by @olivermrbl in #6883
- feat: Add boilerplate for the file module by @sradevski in #6956
- feat(utils): Support free text configuration by @adrien2p in #6942
- feat: Shipping options API by @adrien2p in #6957
- feat: Add zod middleware by @olivermrbl in #6961
- feat(dashboard): Migrate to new hooks and API client by @kasperkristensen in #6963
- feat(product): return parents tree by @carlos-r-l-rodrigues in #6944
- feat: Add create location fulfillment set flow + API by @olivermrbl in #6945
- feat: Add generic link filter middleware by @olivermrbl in #6969
- feat: Add product routes and components to v2 in admin-next by @sradevski in #6958
- feat(dashboard): added details page for promotions + edit sliders by @riqwan in #6882
- feat: Create shipping options workflow by @adrien2p in #6962
- feat: Switch to zod for the product API and implement missing primitives by @sradevski in #6978
- Feat: draft order api by @carlos-r-l-rodrigues in #6797
- feat(dashboard): regions v2 by @fPolic in #6943
- feat: Bring back API key sales channel management by @olivermrbl in #6976
- feat: Clean up shipping options management by @adrien2p in #6977
- feat: Add support for defining options when creating product by @sradevski in #6981
- feat(medusa, core-flows): Create service zones by @olivermrbl in #6979
- feat: Delete service zone by @olivermrbl in #6984
- feat: Add support for setting sales channel when creating a product by @sradevski in #6986
- feat: Add tax regions table by @olivermrbl in #6983
- feat: Revamp product details page and several product fixes and cleanups by @sradevski in #6988
- feat: Add decimal digits and rounding info to currencies by @sradevski in #6991
- feat: Totals calculation by @carlos-r-l-rodrigues in #6980
- feat: Update service zone by @olivermrbl in #6990
- feat: Improvements to the products details page in the admin by @sradevski in #6994
- feat(*): shipping options update API by @adrien2p in #6987
- feat: Admin V2 Customers by @olivermrbl in #6998
- feat: Add variant creation and editing in the products UI by @sradevski in #6997
- feat: Improve how options are defined and handled for product by @sradevski in #7007
- feat: Make tags unique, clean up searchability of product entities by @sradevski in #7014
- feat: Categories retrieve + list API by @olivermrbl in #7009
- feat(dashboard): Initial pricing domain by @kasperkristensen in #6996
- feat: Add support for loading file providers to file module by @sradevski in https://github.com...
v1.20.4
Highlights
Introducing Worker Mode
This release ships Worker Mode, a new runtime mode for Medusa instances.
Worker Mode allows you to start a Medusa instance in a process separate from the main application process. An instance running in Worker Mode is useful for executing long-running or resource-heavy tasks in the background. Those tasks are offloaded to a separate process and will not affect the performance of the main application. Examples of tasks are importing data or updating a search index. While Worker Mode is especially good for resource-intensive tasks, we recommend always starting an instance in this mode if possible.
Worker Mode introduces three new runtime modes for your Medusa instance:
server
: API Routes are registered, and no workers are started.worker
: API Routes are not registered, and workers are started.shared
: API routes are registered, and workers are started (the regular runtime mode + default).
The worker mode is configured in medusa-config.js
:
// medusa-config.js
const projectConfig = {
...,
database_url: "...",
worker_mode: "worker",
};
In this release, the Redis Event Bus has been updated to leverage the worker architecture. Instantiating a Medusa instance with worker_mode: "server"
and a different one with worker_mode: "worker"
will separate background job processing from the public-facing main application, given that the Redis Event Bus module is installed.
Features
- feat: Update the signatures for variants and options to follow convention by @sradevski in #6748
- feat(fulfillment): Events management by @adrien2p in #6730
- feat: Init. v2 implementation in admin by @olivermrbl in #6715
- feat(medusa, core-flows): add Update inventory item endpoint in api-v2 by @pKorsholm in #6735
- feat(utils): autogenerates create and update methods when dto is provided by @riqwan in #6751
- feat: Align the product module HTTP API to follow our conventions by @sradevski in #6759
- feat(pricing): pricing models are made soft deletable by @riqwan in #6732
- Feat(workflows-sdk): additional properties to context by @carlos-r-l-rodrigues in #6760
- feat: shard modules and API integration tests by @riqwan in #6775
- feat: v2 - add worker mode by @srindom in #6739
- Feat(user): Invite expiration fix by @pKorsholm in #6758
- feat: List products middleware by @olivermrbl in #6769
- feat(core-flows): Use remote link methods to dismiss all links related to inventory item by @pKorsholm in #6737
- Feat(orchestration,workflows-sdk,core-flows): workflow cancel by @carlos-r-l-rodrigues in #6778
- feat(dashboard) admin 3.0 return creation by @fPolic in #6713
- feat(core-flows, types, medusa): Add Update location level endpoint for api-v2 by @pKorsholm in #6743
- feat: Add
successRedirectUrl
to auth options by @olivermrbl in #6792 - update prefix for inventory-next reservation item by @pKorsholm in #6816
- feat(dashboard): Price List configurations section by @kasperkristensen in #6663
- feat(dashboard, ui): Product image modals by @kasperkristensen in #6779
- feat(core-flows, medusa): add create stock location endpoint for api-v2 by @pKorsholm in #6787
- feat(create-medusa-app): Added --v2 option by @shahednasser in #6729
- feat(core-flows,medusa,types,utils): rename psma to prices by @riqwan in #6796
- feat(medusa-payment-paypal,medusa-payment-stripe): speed up unit tests in CI by @riqwan in #6806
- feat(dashboard): Order timeline by @kasperkristensen in #6815
- feat(types, medusa, core-flows): add delete-stock-location endpoint to api-v2 by @pKorsholm in #6801
- feat(medusa, core-flows): add retrieve stock location endpoint to api-v2 by @pKorsholm in #6791
- feat(dashboard): Draft orders create by @kasperkristensen in #6680
- feat(medusa): migrate medusa unit tests / plugins integration tests to swc jest by @riqwan in #6820
- feat: Create user account by @olivermrbl in #6819
- chore(dashboard): render main layout as home page for v2 by @riqwan in #6823
Bugs
- fix(orchestration): Properly handle select all by @adrien2p in #6742
- fix(link-modules): recreate dismissed link by @carlos-r-l-rodrigues in #6764
- fix: revert no server start by @srindom in #6790
- fix: make module test runner configurable by @srindom in #6803
- fix(medusa-oas-cli): fix tool not working in Medusa backends by @shahednasser in #6812
- Fix/pricing create price lists by @adrien2p in #6818
- fix(medusa): migrate with feature flag by @srindom in #6771
Chores
- chore: Deprecate extra in favor of driver options by @adrien2p in #6772
- chore: merge money amounts and price set money amounts by @riqwan in #6768
- chore: pricing models uses standardized relationships attributes by @riqwan in #6767
- chore: update naming in abstract service to dto specifics by @riqwan in #6763
- chore: add TSDocs to the API Key Module by @shahednasser in #6785
- chore(docs): Updated UI Reference by @github-actions in #6754
Documentation
New Contributors
Full Changelog: v1.20.3...v1.20.4
v1.20.3
Highlights
Medusa 2.0 update
Most of the changes in this release are related to Medusa 2.0 and will not affect any users' setup. The expected date for a 2.0 release candidate is early summer. You can track the progress in our high-level roadmap.
The larger remaining todos are:
- Convert Rest API to use Workflows, new modules, and API routes
- Migrate Admin to use 2.0
- Documentation
- Migration guide
- Cleanup/housekeeping
Admin Redesign update
Aside from changes for Medusa 2.0, this release also contains work for the Admin Redesign, set to be released in beta at the beginning of April. The redesign will significantly improve the UX and UI of our admin dashboard and make the overall look and feel much more consistent.
Others
Additionally, this release squashes some minor bugs in Medusa 1.*.
Make medusaClient
optional in MedusaProvider
The property medusaClient
on the type MedusaProviderProps
in medusa-react
has been updated to be optional.
Using the MedusaProvider
without the medusaClient
will initialize and use a new default client under the hood:
<MedusaProvider
baseUrl={process.env.MEDUSA_BASE_URL}
...
>
{children}
</MedusaProvider>
Add Product Categories to search subscriber
Product categories are included in search indexing on product updates and creations if the product categories feature flag is enabled.
Update index on customer table
The multicolumn uniqueness index on the customer table (email, has_account)
has been updated to only apply to rows where deleted_at
is null. This is to allow for the creation of customers that were previously soft-deleted.
Features
- feat: Add BigNumber implementation by @olivermrbl in #6253
- feat(region): Add admin region get + list endpoints by @olivermrbl in #6322
- feat(fulfillment): Init dtos work by @adrien2p in #6329
- feat(dashboard,medusa,ui): Manual gift cards + cleanup by @kasperkristensen in #6380
- feat(payment): provider service by @fPolic in #6308
- feat(region): Add store region get + list endpoints by @olivermrbl in #6342
- feat(medusa): workflow engine api by @carlos-r-l-rodrigues in #6330
- feat(region): Create region with countries by @olivermrbl in #6372
- feat(user, types): add invite and user properties + migration by @pKorsholm in #6327
- feat(cart):
POST /store/carts/:id
by @olivermrbl in #6274 - feat(medusa, types, core-flows): Add invite endpoints for api-v2 by @pKorsholm in #6395
- feat(fulfillment): Module service implementation first iteration by @adrien2p in #6381
- feat(order): module foundation by @carlos-r-l-rodrigues in #6399
- feat(tax): tax module scaffolding by @srindom in #6417
- feat: CartRegion link, definition + workflow by @olivermrbl in #6392
- feat: Cart SalesChannel link + clean-up by @olivermrbl in #6418
- feat(tax): Add TaxRegion by @srindom in #6421
- Feat(medusa, user, core-flows): User creation with invites by @pKorsholm in #6413
- feat: Cart Customer link + create cart with customer by @olivermrbl in #6426
- feat(core-flow, medusa): Create cart with Sales Channel by @olivermrbl in #6427
- feat(fulfillment): implementation part 2 by @adrien2p in #6408
- feat(region): Region create, delete, update admin endpoints by @olivermrbl in #6332
- feat(regions): Add support for updating countries in a region by @sradevski in #6432
- feat: Add skeleton for api key module by @sradevski in #6451
- feat(tax): introduce tax override data models by @srindom in #6422
- Feat(order): order changes by @carlos-r-l-rodrigues in #6435
- feat(dashboard, medusa, medusa-js, medusa-react, icons): DataGrid, partial Product domain, and ProductVariant hook by @kasperkristensen in #6428
- feat(api-key): Add CRUD functionalities to the api key module by @sradevski in #6463
- chore(utils): Move generic utils from region module to utils by @sradevski in #6466
- feat(dashboard): Rework route modals by @kasperkristensen in #6459
- feat(tax): adds getItemTaxLines by @srindom in #6440
- feat(utils): Fix big number decorator and cleanup by @adrien2p in #6473
- feat(modules-sdk, types, user, utils):init user module events by @pKorsholm in #6431
- feat(api-key): Add the endpoints and workflows for api key module by @sradevski in #6471
- feat(fulfillment): Shipping options, rules CRUD + rules based context filtering by @adrien2p in #6455
- feat: Update signature of region module to match latest spec by @sradevski in #6487
- feat(tax): singular creates and deletes of regions, rates, rules by @srindom in #6464
- feat(tax): soft deletes by @srindom in #6486
- feat: Add skeleton for Store module by @sradevski in #6506
- feat(workflows-sdk,core-flows,medusa,types): add workflow to update promotions to cart by @riqwan in #6474
- feat: Create cart with line items by @olivermrbl in #6449
- feat: Add basic CRUD functionality to store module by @sradevski in #6510
- feat(fulfillment): List shipping options filtered by context anmd rules by @adrien2p in #6507
- feat(payment, payment-stripe): Add Stripe module provider by @olivermrbl in #6311
- feat(tax): add tax provider support by @srindom in #6492
- feat: Update authentication middleware by @pKorsholm in #6447
- feat: Refresh invite by @pKorsholm in #6469
- feat(tax): normalize country and province code by @srindom in #6513
- feat(tax): add support for updating tax rates by @srindom in #6516
- feat(api-key): Allow revoking in the future, and enforce the secret key by @sradevski in #6484
- feat(user): standardize events emitted for token generation by @pKorsholm in #6520
- feat(admin-next) discounts list page by @fPolic in #6490
- feat(core-flows,medusa,types,utils): adds update cart API with promotions by @riqwan in #6514
- feat: Line Items API Routes by @olivermrbl in #6478
- feat(api-key): Add api-key authentication to middleware by @sradevski in #6521
- feat(payment): Add migration by @olivermrbl in #6509
- feat: Add basic endpoints and workflows for Store module by @sradevski in #6515
- feat(types): add util to transform get response to an update request by @riqwan in #6289
- feat(types): promotion module uses big number by @riqwan in #6522
- feat(tax): migration file by @srindom in #6523
- feat(medusa,core-flows): update cart adjustments on item updates by @riqwan in #6539
- feat(dashboard,medusa): Update Pub. API key table and add query params to endpoint by @kasperkristensen in #6483
- feat(tax): add endpoints to create tax regions and tax rates by @srindom in #6533
- feat(tax): add support for updating tax rates by @srindom in #6537
- feat(tax): v2 api tax rates and regions deletes by @srindom in #6541
- feat(utils): consolidate promotion utils + refactor + fixes by @riqwan in #6531
- feat(dashboard): Regions domain by @kasperkristensen in #6534
- feat: Add currency module and remove currency models from region and pricing modules by @sradevski in https:/...