github medusajs/medusa v2.0.1-preview

latest releases: v2.0.10-preview, v2.0.10, v2.0.9-preview...
2 months ago

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

Bugs

Documentation

Chores

New Contributors

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

Don't miss a new medusa release

NewReleases is sending notifications on new releases.