github medusajs/medusa v2.15.0

4 hours ago

Highlights

Aligned Product and Variant Attribute Types

🚧 Breaking change

This version aligns the width, length, height, and weight properties on the Product and ProductVariant data models to be of type float. In previous versions, their type was text on the Product data model, and number on the ProductVariant data model.

This change only affects customizations that relied on the previous text type for these attributes, which are now expected to be float values.


Medusa Cloud Proxy Command

The Medusa CLI now includes a mcloud proxy command for working with Medusa Cloud deployments, streamlining local development workflows against cloud environments.

medusa mcloud proxy

#15320


Promotion Context Hooks

The promotion computation system now supports custom context hooks, allowing developers to pass additional context data when calculating promotions. This enables more sophisticated promotion rules based on external data sources or custom business logic.

Example:

// in src/workflows/hooks/promotion.ts
import { StepResponse } from "@medusajs/framework/workflows-sdk";
import { updateCartPromotionsWorkflow } from "@medusajs/medusa/core-flows";

updateCartPromotionsWorkflow.hooks.setPromotionContext(
  ({ cart }, { container }) => {
    if (cart.items.length >= 2) {
      return new StepResponse({
        company_id: "company_123"
      });
    }
  }
);

#15301


Product SKU Search Support

The admin API now supports searching products by SKU, making it easier to find and manage products through their stock keeping unit identifiers.

#13930


Translation Copy Actions

The admin dashboard translation edit page now includes copy actions for original translations, improving the translation workflow by allowing translators to quickly copy base text.

#14943

Features

  • feat(core-flows): add setPromotionContext hook to pass additional context for promotion computation by @NicolasGorga in #15301
  • feat: Add mcloud proxy command to medusa CLI by @sradevski in #15320
  • feat(product): add SKU search support to admin API by @bqst in #13930
  • feat(dashboard): add copy action for Original translations on translations edit page by @LukasKri in #14943
  • fix(core-flows, payment, types): expose metadata on refund creation through refundPaymentsWorkflow by @Metbcy in #15273

Bugs

  • fix(index): backfill missing inSchemaRef for existing parent entries by @ranma-dev in #15131
  • fix(workflows-sdk): flatten WorkflowData type to remove recursive expansion that caused TS excessive stack depth errors in large consumer codebases by @NicolasGorga in #15174
  • fix(settings): mark Order computed status fields as non-filterable by @aliaksei-loi in #15262
  • fix(utils): preserve casing in toCamelCase for PascalCase identifiers with digits by @Chicolll in #15293
  • fix(dashboard): auto-select currency row when its tax-inclusive toggle is enabled by @Anexus5919 in #15164
  • fix(core-flows): populate delivery_address on return fulfillments by @ShriyansSharma27 in #15241
  • fix(core-flows): validate cart has items before completing by @rnagulapalle in #15231
  • fix(utils): skip empty string translations when applying locale by @asynchroza in #15013
  • fix(medusa): prevent plugin:db:generate crash when model files export by @shubhamchoudhary-2003 in #14718
  • fix(order): fix regression on order.items.metadata showing null when line item metadata is set by @NicolasGorga in #15329
  • fix(core-flows): apply currency-precision tolerance to refundPayments by @hunnyboy1217 in #15316
  • Fixes #14793 -- paymentService_ was not getting updated with the data causing the issue by @Ultron03 in #15295
  • fix(index,modules-sdk,): introduce locking to avoid race conditions in distributed systems for migrations, links and index partition creation by @NicolasGorga in #15176
  • fix(i18n): refresh Czech (cs) translations by @dugynoo in #15286
  • fix(pricing): calculatePrices() with empty context selects prices from pricelists that explicitly have rules by @ShriyansSharma27 in #15277
  • fix(product, dashboard): align product and variant volumetric attributes data types by @NicolasGorga in #14762
  • fix(core-flows,payment): Fix rounding issue on refund creation by @NicolasGorga in #15303
  • fix(run-scripts): load WorkflowLoader during db:migrate so workflow hooks are registered by @AKIB473 in #15260
  • fix(admin): correct settings-related routes in global search results by @biocodersin in #14853
  • fix(file-s3): encode URL path segments individually to preserve prefix slashes by @aayushbaluni in #15109

Documentation

Chores

New Contributors

Full Changelog: v2.14.2...v2.15.0

Don't miss a new medusa release

NewReleases is sending notifications on new releases.