Skip to content

Releases: medusajs/medusa

v1.15.1

08 Sep 12:32
Compare
Choose a tag to compare

Highlights

Updated create-medusa-app onboarding

We've updated the create-medusa-app command with a new option, allowing you to get started with a Next.js storefront right away.

Try the new step in the flow yourself:

npx create-medusa-app@latest

Or pass the argument --with-nextjs-starter when running the command:

npx create-medusa-app@latest --with-nextjs-starter

AbstractFulfillmentService

We've done some housekeeping around fulfillment plugins, introducing a new interface and an abstract class correctly typed with added documentation.

As a result, fulfillment plugin services will now need to extend the AbstractFulfillmentService from @medusajs/medusa. Rest assured, the changes are backward compatible, so you are in no rush to migrate your implementation or plugin.

The deprecated fulfillment service will be removed in a future release. We will announce these changes beforehand so you can take the proper precautions.

Improvements to S3 file plugin

The AWS SDK used in medusa-file-s3 has been upgraded to V3, as V2 will enter maintenance mode later this year.

Cache-control has been added to the plugin options, allowing you to optimize your storage more granularly.

Solves:

EventBus enqueuer reconnection

We've introduced a mechanism to ensure the EventBus will not stop processing events in case the database connection momentarily dies.

If the connection is lost, we will try to reestablish the connection every 3rd second until successful. Changes was added in #4855 and further improved in #4963.

Additionally, logs have been added to inform the user in case this should happen.

Solves:

Breaking changes

Product Module
In #4965, we introduced breaking changes in the list and listAndCount methods of the ProductService in package @medusajs/product.

Specifically, the category filter has changed from category_ids to category_id:

// before
ProductService.list({ category_ids: ["pcat_123", "pcat_345"] })
ProductService.listAndCount({ category_ids: ["pcat_123", "pcat_345"] })

// after
ProductService.list({ category_id: ["pcat_123", "pcat_345"] })
ProductService.listAndCount({ category_id: ["pcat_123", "pcat_345"] })

Features

  • feat(create-medusa-app): add install Next.js storefront option by @shahednasser in #4968
  • feat(pricing, utils, types): adds money amount to pricing module by @riqwan in #4909
  • feat(medusa): Add AbstractFulfillmentService by @olivermrbl in #4922
  • feat(admin-ui): batch job completed notification by @fPolic in #4886
  • feat(medusa-file-s3): Add cache-control option + update to sdk v3 by @pevey in #4884
  • feat(pricing, types, utils, medusa-sdk): Pricing Module Setup + Currency by @riqwan in #4860
  • feat(link-modules,modules-sdk, utils, types, products) - Remote Link and Link modules by @carlos-r-l-rodrigues in #4695
  • feat(medusa, admin-ui): Improve gift card application by @mortenengel in #4944
  • feat(medusa-fulfillment-webshipper): Create webshipper return order by @josipmatichr in #4846
  • feat(products,types,pricing): allow scoping products by collection_id + pricing by currency_code by @riqwan in #4965
  • feat(medusa): Event bus db failure handling by @adrien2p in #4963

Bugs

  • fix(medusa-file-*): Add types as devDeps by @olivermrbl in #4871
  • fix(medusa): category_id and q params for list products endpoint ld work by @riqwan in #4889
  • fix(admin-ui): currency input exception by @fPolic in #4888
  • fix(admin-ui): delete customer group by @fPolic in #4893
  • fix(ci): Increase memory allocation for plugin tests by @olivermrbl in #4898
  • fix(medusa): Make event enqueuer reconnect the database when it lost the connection by @hanam1ni in #4855
  • fix(medusa, admin-ui): Add deleted_at to Return Reason unique constraint by @StephixOne in #4834
  • fix(utils, product, pricing, link-modules): add missing dependencies for utils + fix migration path issue by @riqwan in #4915
  • fix(medusa): csv parser check match prop on column by @fPolic in #4913
  • fix(medusa-payment-stripe): api endpoint for getStripePayments by @zulianrizki in #4928
  • fix(medusa): Double tax issue on return refund amount by @josipmatichr in #4899
  • fix(admin): Export RouteProps and SettingProps by @kasperkristensen in #4950
  • fix(medusa-plugin-brightpearl): Inventory sync for OOS items in brightpearl by @josipmatichr in #4966

Chores

Documentation

New Contributors

Full Changelog: v1.15.0...v1.16.0

v1.15.0

25 Aug 14:54
8190476
Compare
Choose a tag to compare

Highlights

Import and Export support in @medusajs/file-local

The file plugin, @medusajs/file-local, used for local development, now supports uploads and downloads via streaming, making it possible to import products right after setting up a project, among other things.

New Search UI in Medusa Documentation

You can now filter the search results to view specific results such as plugins, API reference, UI, and other areas of the documentation.

Check it out here.

Breaking changes

Reading and writing streams with file plugins now default to a private bucket across all providers.

The file plugin streaming API to upload to public/private buckets has been updated to be consistent across all providers.

// before
// MinIO
fileService.getUploadStreamDescriptor({..., usePrivateBucket: false})
// S3 & Spaces
fileService.getUploadStreamDescriptor({..., acl: "public-read"})

// after
fileService.getUploadStreamDescriptor({..., isPrivate: true}) // private bucket (default)
fileService.getUploadStreamDescriptor({..., isPrivate: false}) // public bucket

The following method signatures in the Price List and Product import strategies have been updated:

// before
downloadImportOpsFile(batchJobId: string, op: OperationType)
deleteOpsFiles(batchJobId: string)

// after
downloadImportOpsFile(batchJob: BatchJob, op: OperationType)
deleteOpsFiles(batchJob: BatchJob)

The following types specific to file services have moved from @medusajs/medusa to @medusajs/types:

export type FileServiceUploadResult = {
  url: string
  key: string
}

export type FileServiceGetUploadStreamResult = {
  writeStream: stream.PassThrough
  promise: Promise<any>
  url: string
  fileKey: string
  [x: string]: unknown
}

export type GetUploadedFileType = {
  fileKey: string
  isPrivate?: boolean
  [x: string]: unknown
}

export type DeleteFileType = {
  fileKey: string
  [x: string]: unknown
}

export type UploadStreamDescriptorType = {
  name: string
  ext?: string
  isPrivate?: boolean
  [x: string]: unknown
}

Features

  • feat(api-reference): Add rewrite to UI docs by @kasperkristensen in #4791
  • feat(medusa-file-local): implement missing streaming methods by @fPolic in #4788
  • feat(medusa): PriceListImportStrategy descriptive errors by @fPolic in #4842

Bugs

  • fix(medusa-interfaces, medusa-file-*): flag for streaming to a private bucket by @fPolic in #4771
  • fix(utils,product): mikro orm connection loader by @carlos-r-l-rodrigues in #4825
  • fix(medusa-telemetry): added missing babel dependencies by @shahednasser in #4817
  • fix(admin-ui): Fix sign out in admin panel not redirecting correctly by @StephixOne in #4837
  • fix(admin-ui): Fix variant creation when no stock locations provided by @StephixOne in #4843
  • fix(admin-ui): Typo for should in the "Create Region" form by @ vfrunza in #4854

Docs

Full Changelog: v1.14.0...v1.15.0

v1.14.0

17 Aug 15:20
Compare
Choose a tag to compare

Highlights

Admin Extensions reaches general availability

We are excited to announce the general availability of Admin Extensibility, shipping alongside version 1.14.0 of Medusa Core and a brand-new component library.

To start using it, install the latest versions of the core and admin packages, and check out our guide to building your first Admin Widgets and UI Routes.

yarn add @medusajs/admin@latest @medusajs/medusa@latest

The following is a breaking change from the beta version released in June.

path should now have the format /<path> instead of <path>. A path with a trailing / will still throw an error.

Separately, it is worth highlighting that to use environment variables in Admin Extensions, they should be prefixed with MEDUSA_ADMIN_. Variables with this prefix are included in the admin build and otherwise omitted for security reasons. If you have used Next.js or Gatsby, the concept will be familiar to you.

UI Component Library

To build Admin Extensions with the same look and feel as Medusa Admin, we are excited to announce our new component Library, Medusa UI.

Medusa UI is a React implementation of the Medusa design system. Most components are based on Radix UI Primitives, and we use Tailwind CSS for styling, shipping our own preset with our customizations.

The library is a dependency of our Admin package, so you can start using it if you have the latest version of that installed. Alternatively, you can install it in a standalone project. However, this comes with the required configuration. See the documentation.

To help you get started with Medusa UI, we have published its own documentation. This should get you up and running and provide more information on the available components and how to use them. You will also find information on Medusa Icons we have made public and more details on theming.

Bulk Editor improvements

The following improvements have been shipped to the Bulk Editor

  • 2-dimensional selection
  • Keyboard navigation
    • Arrow
    • Shift + arrow
    • Command/ctrl + shift + arrow
    • Tab
    • Shit + tab
  • Copy/paste functionality

Extended create-medusa-app options

The following options have been added:

--no-browser: Disables opening the browser at the end of the project creation and only shows success message.

--skip-db: Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser. Useful if you want to set the database URL at a later point in the configurations.

--db-url <url>: Skips database creation and sets the database URL to the provided URL. Throws an error if connection to the database fails. Will still run migrations and open the admin after project creation. Useful if you already have a database created, locally or remotely.

--no-migrations: Skips running migrations, creating admin user, and seeding. If used, it's expected that you pass the `--db-url` option with a URL of a database that has all necessary migrations. Otherwise, unexpected errors will occur. Helpful only if combined with `--db-url`.

--directory-path <path>: Allows specifying the parent directory path to create the directory of the new project in.

Important fix: Cart Shipping Methods

Shipping methods are now always deleted on cart line item updates. This was always the intention, but the functionality has been broken until now. This release patches the functionality.

Other breaking changes

The FlagRouter that manages feature flags has been removed from @medusajs/medusa and added to @medusajs/utils.

Features

  • feat(workflows):product handlers should be reusable in different context by @adrien2p in #4703
  • feat(medusa,workflows) Create cart workflow by @riqwan in #4685
  • feat(orchestration,workflows): pipe oncomplete and workflow preparation by @carlos-r-l-rodrigues in #4697
  • feat(types, product, utils, medusa): Include shared connection for modules by @adrien2p in #4626
  • feat(workflows): Data aggregation by @adrien2p in #4732
  • feat(admin-ui): bulk advanced selections + copy/paste by @fPolic in #4568
  • feat(create-medusa-app): add database options by @shahednasser in #4733
  • feat(medusa-plugin-restock-notifications): Multi-warehouse support by @josipmatichr in #4718
  • feat(admin, admin-ui, medusa-js, medusa-react, medusa): Support Admin Extensions (#4761)

Bugs

  • fix(medusa): Fixed existingItems query in addOrUpdateLineItems by @DidierGuyon in #4714
  • fix(medusa): Remove shipping on updates to cart.items by @olivermrbl in #4715
  • fix(medusa-js): return type of collection hook + export by @olivermrbl in #4747
  • fix(medusa): removal of shipping methods on addOrUpdateLineItems by @SimonsThijs in #4725
  • fix(medusa): ignore region_id update w/o value change by @srindom in #4751

Chores

  • chore: scope errors on workflow to invoke by @riqwan in #4709
  • chore: Remove FlagRouter from core by @olivermrbl in #4710
  • chore(integration-tests): Test the create product workflow compensation by @adrien2p in #4716
  • chore(product): remove decorator where it is not necessary and cleanup by @adrien2p in #4731
  • chore: Remove rimraf from prepare by @olivermrbl in #4741

New Contributors

Full Changelog: v1.13.1...v1.14.0

v1.13.1

07 Aug 12:54
Compare
Choose a tag to compare

Highlights

Write logs to file

Environment variable LOG_FILE has been introduced to enable winston to write logs to file.

Thanks, @pevey, for the contribution.

Features

  • feat(product): Move mikro orm utils to the utils package by @adrien2p in #4631
  • feat(medusa): Expose some commonly used utils by @zhangpengchen in #4630
  • feat(prduct, utils, types): Create soft delete pattern for link module by @adrien2p in #4649
  • feat(workflows): Improve typings by @adrien2p in #4689
  • feat(product, types, modules-sdk): added event bus events for products by @riqwan in #4654
  • feat(medusa, types, utils, workflow): Migrate medusa workflow to the workflow package by @adrien2p in #4682
  • feat(medusa): Allow logging to file by @pevey in #4696
  • feat(medusa, utils): Allow object feature flags by @olivermrbl in #4701

Bugs

Chores

New Contributors

Full Changelog: v1.13.0...v1.13.1

v1.13.0

27 Jul 11:41
Compare
Choose a tag to compare

Highlights

This version ships with schema changes (breaking) and minor fixes improving Medusa Admin.

Breaking changes

Version 1.13.0 introduces database schema changes that require you to run migrations. The relationship between Shipping Profile and Product has been changed to a Many-to-Many relation.

After upgrading to 1.13.0, run the following command:

medusa migrations run

Features

Bugs

Chores

Full Changelog: v1.12.3...v1.13.0

v1.12.3 + Bulk Editor

19 Jul 16:11
Compare
Choose a tag to compare

Highlights

This release ships with the first iteration of our Bulk Editor, allowing you to edit your product variant prices in an Excel-like fashion.

bulk.mp4

Features

Bugs

  • fix(medusa): Return correct region count by @pKorsholm in #4514
  • fix(medusa-plugin-sendgrid): Use correct SendGrid client by @olivermrbl in #4524
  • fix(admin): Price input by @pKorsholm in #4530
  • fix(medusa-file-minio): Minio private bucket default by @pKorsholm in #4540
  • fix(medusa-react): Admin user mutation hooks invalidating wrong keys by @josetr in #4538
  • fix(medusa-react): Add missing query keys to inventory hooks by @josetr in #4467
  • fix(medusa-plugin-brightpearl): stacking reservations by @pKorsholm in #4383
  • fix(admin-ui): Omit PriceList prices from variant update by @olivermrbl in #4552

Chores

Full Changelog: v1.12.2...v1.12.3

v1.12.2

11 Jul 18:45
Compare
Choose a tag to compare

Highlights

Simplified entity extensions

We've simplified the steps to extend an entity so you no longer need to 1) override the entity's repository (step 4 from our guide) and 2) override the models in a custom entry point file.

Our documentation on Extending an Entity has been updated to reflect these changes.

Simplified validator extensions

We've simplified the steps to extend the API payload validation so you no longer have to create a util to perform an override and include it in a loader.

Our documentation will be updated very soon to reflect these changes.

To extend a validator, import and use a new util registerOverriddenValidators.

 import { registerOverriddenValidators } from "@medusajs/medusa"
 import { AdminPostProductsReq as MedusaAdminPostProductsReq } from "@medusajs/medusa/dist/api/routes/admin/products/create-product"
 import { IsString } from "class-validator"
 
 class AdminPostProductsReq extends MedusaAdminPostProductsReq {
    @IsString()
    test: string
 }
 
 registerOverriddenValidators(AdminPostProductsReq)

Features

  • feat(create-medusa-app): support admin onboarding experience by @shahednasser in #4339
  • feat(medusa-plugin-sendgrid): Add error messages by @pevey in #4384
  • feat(medusa): Allow to register extended validators seemlesly by @adrien2p in #4397
  • feat(medusa): Improve error messaging in plugin loader by @olivermrbl in #4410
  • feat(medusa-react,medusa-js): Allow custom headers by @pevey in #4409
  • feat(medusa, types): Improve DX of model extensions (#4398) by @riqwan in #4398
  • feat: Remote Joiner by @carlos-r-l-rodrigues in #4098
  • feat(medusa, stripe, paypal): Add update payment session support to the abstract payment processor API by @adrien2p in #4442
  • feat(create-medusa-app): remove .git directory in the project by @shahednasser in #4493

Bugs

  • fix(product, types): correct path for migration files + fix types on products service module by @riqwan in #4348
  • fix(medusa, utils): fix the way selects are consumed alongside the relations by @adrien2p in #4389
  • fix(medusa-react): fix wrong admin reservations query key by @josetr in #4441

Chores

  • chore(medusa): Concurrently get the items and count instead of sequentially by @adrien2p in #4367
  • chore(gatsby-source-medusa): Cleanup plugin setup by @adrien2p in #4419
  • chore(medusa-dev-cli): Cleanup plugin setup by @adrien2p in #4421
  • chore(medusa-cli): Cleanup plugin setup by @adrien2p in #4420
  • chore(create-medusa-app): Cleanup the main script for readability and maintainability by @adrien2p in #4369

Full Changelog: v1.12.1...v1.12.2

v1.12.1

18 Jun 11:29
Compare
Choose a tag to compare

Highlights

Added invite option to Medusa CLI

We've added support for inviting users to @medusajs/medusa-cli.

Invites are generated using the following command:

medusa user -e [email protected] --invite

The command generates and outputs the token to use for signup. You should see the below in your terminal:

Invite token: some_token
Open the invite in Medusa Admin at: [your-admin-url]/invite?token=some_token

Replacing [your-admin-url] with the URL of your Medusa Admin and appending the /invite?token-some_token will allow the invited user to signup.

The URL end result should look like this: https://myadmin.com/invite?token=some_token

Filtering reservations

Advanced filter capabilities have been added to the Reservations overview in Medusa Admin.

reservations-filters.mp4

Node flags in develop command

We've added support for passing all node flags to our develop command from @medusajs/medusa-cli.

E.g. medusa develop -- --preserve-symlinks

Prefix for core Redis client

You can now configure the core Redis client with prefixes using the following project configuration:

const projectConfig = {
  redis_url: REDIS_URL,
  redis_prefix: "shared"
};

Features

  • feat(medusa, inventory, stock-location): Remove unnecessary transaction usage in the modules and the list product end points by @adrien2p in #4232
  • feat(admin-ui): Rename allocation to reservation by @pKorsholm in #4133
  • feat(medusa): variants expand inventory_items by @pKorsholm in #4203
  • feat(medusa,medusa-cli): Added an invite option to the create user command, and allow seeding publishable api keys by @shahednasser in #4192
  • feat(create-medusa-app): update command for a better onboarding experience by @shahednasser in #4215
  • feat(admin-ui): Filter reservations by @pKorsholm in #4115
  • feat(medusa): Preserve node flags in develop command by @liamjcooper in #1860
  • feat(medusa): add redis_prefix in configModule.projectConfig by @dwene in #4268

Bugs

  • fix(medusa-fulfillment-manual): Missing retrieveDocuments override by @josipmatichr in #4221
  • fix(medusa): Order edit missing transaction when consuming the inventory module by @adrien2p in #4211
  • fix(medusa-plugin-brightpearl): Add bp from sales channel of order where possible by @pKorsholm in #4160
  • fix(create-medusa-app): remove seed command from create-medusa-app and improve success message by @shahednasser in #4247
  • fix(admin-ui): flickering Timeline by @fPolic in #4231
  • fix(create-medusa-app): handle todos by @shahednasser in #4262
  • fix(medusa): getAvailableContext should first check if the inventory service is present by @adrien2p in #4293
  • fix(medusa): Remove items.refundable from the order default store fields by @adrien2p in #4294
  • fix(medusa): Query parser issues with large array by @adrien2p in #4213
  • fix(medusa): medusa develop does not take execArgv into account properly by @adrien2p in #4338

Chores

  • chore(medusa,medusa-cli): Clean up new command + fix CI by @olivermrbl in #4214
  • chore(medusa): Improve database loader error handling by @adrien2p in #4254
  • chore: Clean up deps, devDeps, and peerDeps across all packages by @olivermrbl in #4276

New Contributors

Full Changelog: v1.12.0...v1.12.1

v1.12.0

30 May 10:15
Compare
Choose a tag to compare

Highlights

Breaking changes
In our quest to improve performance, a public method in the PriceSelectionStrategy has been updated to support bulk calculations of variant prices. Specifically, the following signatures have changed:

// Before
calculateVariantPrice(variantId: string, context: PriceSelectionContext): Promise<PriceSelectionResult>
// Now
calculateVariantPrice(data: { variantId: string; quantity?: number; }[], context: PriceSelectionContext): Promise<Map<string, PriceSelectionResult>>

Additionally (non-breaking), the following DB indexes have been added:

idx_money_amount_variant_id ON money_amount (variant_id);
idx_money_amount_region_id ON money_amount (region_id);
idx_product_option_value_variant_id ON product_option_value (variant_id);
idx_product_option_value_option_id ON product_option_value (option_id);

idx_gin_product_title ON product USING gin (title gin_trgm_ops);
idx_gin_product_description ON product USING gin (description gin_trgm_ops);
idx_gin_product_variant_title ON product_variant USING gin (title gin_trgm_ops);
idx_gin_product_variant_sku ON product_variant USING gin (sku gin_trgm_ops);
idx_gin_product_collection ON product_collection USING gin (title gin_trgm_ops);

The packages class-validator and class-transformer have been removed from @medusajs/utils.

The TransactionBaseService has been removed from @medusajs/utils. This class should be imported from @medusajs/medusa.

The utilities build-query, db-aware-column, base-entity, and soft-deletable-entity have been removed from @medusajs/utils. These should be imported from @medusajs/medusa.

Support for SQLite dropped
SQLite support was initially added to reduce friction for developers trying Medusa for the first time. It runs on most operating systems without installation, allowing you to start a Medusa starter without preparing a Postgres database.

Though, as we've added features that use more advanced database concepts, we've seen that SQLite has started to cause more harm than good. And frankly, we've not prioritized maintaining the support, as removing it was always part of our plans. SQLite still allows developers to get started very quickly. However, as soon as you start using our admin system or set up the storefront starter, issues caused by the limitations of SQLite arise. These issues are primarily centered around transaction management. A concept used extensively in our core and poorly supported by SQLite.

Therefore, as of this release, SQLite is no longer supported. The pros simply do not outweigh the cons at this point.

What does this mean for your setup?

In the highly unlikely case that you are using SQLite, this will be a breaking change. So, you'll need to set up Postgres for your Medusa server as part of bumping to this version. You can find a guide in our documentation on how to do this.

If you are not using SQLite, these changes will not affect your setup.

Reservation management
With the introduction of our Inventory Module, we added the notion of reservations. Right now, reservations are, from a store administrator perspective, limited to order items and cannot really be used outside the context of an order - unless you consume the API directly.

In this release, we ship the first elements to more extensive reservation management, including an overview of all reservations and the ability to search and edit existing reservations. The feature is still WIP, so we will hide the UI behind a new feature flag, reservations, that you can enable as any other feature flag, if you want to start playing around with the feature now.

Features

Bugs

  • fix(medusa-payment-stripe): Added withTransaction to capturePaymentIfNecessary by @DidierGuyon in #3930
  • fix(medusa): downgrade papaparse version by @fPolic in #4174
  • fix(admin-ui): Ensure that default invite link uses BASE if set by @kasperkristensen in #4173
  • fix(admin-ui): Ensure order of variant options matches order of product options by @kasperkristensen in #4178
  • fix(admin-ui): Delete variant by @olivermrbl in #4163
  • fix(inventory): Use correct table name in migration by @pKorsholm in #4155
  • fix(medusa): migrations cli should also pull from ${plugin}/dist by @dwene in #3956
  • fix(admin-ui): Omit purchasable variant prop on duplicate by @olivermrbl in #4180

Chores

New Contributors

Full Changelog: v1.11.0...v1.12.0

v1.11.0

16 May 09:19
Compare
Choose a tag to compare

Features

In 1.10.0, we changed the mechanism for loading relations in Typeorm from join to query, which meant that instead of firing one large query with joins, we fire separate queries for each requested relation. This was added to improve performance and eliminate an issue with heavy memory usage. Read more about it in the release notes for 1.10.0.

Unfortunately, we found the query strategy to come with unexpected issues related to database connection management. In short, it turned out the query strategy obtains a new database connection for each separate query – instead of reusing the already established connection – leading to a drained connection pool and eventually unresponsive applications.

To eliminate these issues (and potential future ones), we've decided to ditch the query strategy. Instead, we are bringing back our (own) custom query strategies for Carts, Products, and Orders to maintain highly performant APIs while mitigating the risk of unexpected memory and/or database connection problems.

This also means we'll be moving away from our Typeorm fork, as the fix related to the query strategy is now irrelevant. You should update your project to use the official Typeorm package.

In your package.json, replace our forked version with the latest from Typeorm:

"typeorm": "^0.3.16"

This is in addition to bumping all you Medusa-related packages to their latest versions.

Bugs

  • fix(medusa-oas-cli): Add separator after tmpdir base by @pevey in #3924

Chores

Full Changelog: v1.10.1...v1.11.0