v2.0.0-rc.2
medusajs/medusav2.0.0-rc.2Oct 3, 2024by olivermrbl
AI Summary
Release Candidate 2 moves shared HTTP utilities to the framework package and continues the restructuring of the codebase.
Key Highlights
- Shared HTTP middleware and utilities moved from `@medusajs/medusa` to `@medusajs/framework`.
- Added support for TypeScript path aliases when using ts-node.
Breaking Changes
- Middleware imports changed from `@medusajs/medusa` to `@medusajs/framework`
New Features
- Workflow error hints
- Publishable key middleware for store endpoints
Full Release Notes
<!--

# Medusa v2.0 Release Candidate #2
CMS_BREAK -->
## Get started with a new project
To get started using the RC, run the following command:
```bash
npx create-medusa-app@rc
```
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 `rc` tag:
```json
{
"dependencies": {
"@medusajs/admin-sdk": "rc",
"@medusajs/framework": "rc",
"@medusajs/medusa": "rc",
"@medusajs/medusa-cli": "rc",
...
}
}
```
To ensure an upgrade to a new version is completed correctly, run the following sequence of commands:
```tsx
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
### Continued restructuring
> [!WARNING]
Breaking change
Since the first RC, we have continued our code restructuring, this time affecting commonly used middleware. These have been moved from `@medusajs/medusa` to `@medusajs/framework` to make them usable outside the context of the core commerce package.
This is a breaking change if you are using any of the following middleware in your Medusa project:
- `applyParamsAsFilters`
- `clearFiltersByKey`
- `applyDefaultFilters`
- `setContext`
- `getQueryConfig`
- `httpCompression`
- `maybeApplyLinkFilter`
- `refetchEntities`
- `unlessPath`
- `validateBody`
- `validateQuery`
Importing these middleware will look as follows going forward:
```
import { validateBody } from "@medusajs/framework/http"
```
## Features
* feat(orchestration): Provide hint in workflows error by @adrien2p in https://github.com/medusajs/medusa/pull/9400
* feat(framework,medusa): Ensure publishable key middleware is set for all store endpoints by @riqwan in https://github.com/medusajs/medusa/pull/9429
* breaking: move shared HTTP utils to the framework by @thetutlage in https://github.com/medusajs/medusa/pull/9402
* feature: allow using typescript path aliases when using ts-node by @thetutlage in https://github.com/medusajs/medusa/pull/9443
## Bugs
* fix: Validate `identifier` payload for reset password by @olivermrbl in https://github.com/medusajs/medusa/pull/9302
* fix(utils): knex import by @adrien2p in https://github.com/medusajs/medusa/pull/9408
* fix(types, medusa): http types fixes by @shahednasser in https://github.com/medusajs/medusa/pull/9334
* fix(medusa-oas-cli): Fix incorrect import by @shahednasser in https://github.com/medusajs/medusa/pull/9404
* fix: Export all classes and types from the SDK by @sradevski in https://github.com/medusajs/medusa/pull/9422
* fix(create-medusa-app): remove warnings on installation by @shahednasser in https://github.com/medusajs/medusa/pull/9405
* fix(workflows-sdk): when then return value by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/9427
* fix(dashboard): allocation label condition by @fPolic in https://github.com/medusajs/medusa/pull/9398
* fix(dashboard, fulfilment): fulfilment providers enabled check by @fPolic in https://github.com/medusajs/medusa/pull/9415
* fix(dashboard): location details loader by @fPolic in https://github.com/medusajs/medusa/pull/9412
* fix: Use the default admin port in create medusa app env definition by @sradevski in https://github.com/medusajs/medusa/pull/9439
* fix(core-flows): Remove concurrent steps that rely on the same data update by @adrien2p in https://github.com/medusajs/medusa/pull/9438
* fix: Get backend URL from environment variable if available by @sradevski in https://github.com/medusajs/medusa/pull/9450
## Documentation
* Update page.mdx by @arun-prasath2005 in https://github.com/medusajs/medusa/pull/9366
* docs: fix imports from dist by @shahednasser in https://github.com/medusajs/medusa/pull/9401
* docs: improvements + additions to module docs by @shahednasser in https://github.com/medusajs/medusa/pull/9152
* chore(oas): clean up oas by @shahednasser in https://github.com/medusajs/medusa/pull/9354
* docs: fix how api reference shows any type by @shahednasser in https://github.com/medusajs/medusa/pull/9340
* docs: updates and fixes in utils + fulfillment provider changes by @shahednasser in https://github.com/medusajs/medusa/pull/9347
* docs: fix query option in instrumentation by @shahednasser in https://github.com/medusajs/medusa/pull/9395
* chore(oas): general fixes to OAS by @shahednasser in https://github.com/medusajs/medusa/pull/9413
* docs: DX and performance improvements in API reference by @shahednasser in https://github.com/medusajs/medusa/pull/9430
* docs: Fix typo. Use instead yuse by @zaidrashid in https://github.com/medusajs/medusa/pull/9431
* chore(oas): add more details link to pagination and select fields by @shahednasser in https://github.com/medusajs/medusa/pull/9414
* docs: fix infinite scroll, update next.js, other fixes by @shahednasser in https://github.com/medusajs/medusa/pull/9441
* docs: add a troubleshooting guide for dist imports by @shahednasser in https://github.com/medusajs/medusa/pull/9442
## Chores
* chore(types, utils): update the TSDocs of AbstractFulfillmentProviderService by @shahednasser in https://github.com/medusajs/medusa/pull/9349
* chore: Processing filters deeply looking at the current joiner first by @adrien2p in https://github.com/medusajs/medusa/pull/9428
* chore: improve mikro orm serializer circular ref and link serialization by @adrien2p in https://github.com/medusajs/medusa/pull/9411
* chore: add action to update starter dependencies + update reference actions by @shahednasser in https://github.com/medusajs/medusa/pull/9385
## Other Changes
* feature: Add MikroORM CLI wrapper to bypass hardcoded module system by @thetutlage in https://github.com/medusajs/medusa/pull/9426
## New Contributors
* @arun-prasath2005 made their first contribution in https://github.com/medusajs/medusa/pull/9366
* @zaidrashid made their first contribution in https://github.com/medusajs/medusa/pull/9431
**Full Changelog**: https://github.com/medusajs/medusa/compare/v2.0.0-rc...v2.0.0-rc.2