github medusajs/medusa v2.0.2-preview

one month ago

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

Bugs

Documentation

Chores

New Contributors

Full Changelog: v2.0.1-preview...v2.0.2-preview

Don't miss a new medusa release

NewReleases is sending notifications on new releases.