Published by olivermrbl 7 months ago
This release ships Worker Mode, a new runtime mode for Medusa instances.
Worker Mode allows you to start a Medusa instance in a process separate from the main application process. An instance running in Worker Mode is useful for executing long-running or resource-heavy tasks in the background. Those tasks are offloaded to a separate process and will not affect the performance of the main application. Examples of tasks are importing data or updating a search index. While Worker Mode is especially good for resource-intensive tasks, we recommend always starting an instance in this mode if possible.
Worker Mode introduces three new runtime modes for your Medusa instance:
server
: API Routes are registered, and no workers are started.worker
: API Routes are not registered, and workers are started.shared
: API routes are registered, and workers are started (the regular runtime mode + default).The worker mode is configured in medusa-config.js
:
// medusa-config.js
const projectConfig = {
...,
database_url: "...",
worker_mode: "worker",
};
In this release, the Redis Event Bus has been updated to leverage the worker architecture. Instantiating a Medusa instance with worker_mode: "server"
and a different one with worker_mode: "worker"
will separate background job processing from the public-facing main application, given that the Redis Event Bus module is installed.
successRedirectUrl
to auth options by @olivermrbl in https://github.com/medusajs/medusa/pull/6792
Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.3...v1.20.4
Published by olivermrbl 7 months ago
Most of the changes in this release are related to Medusa 2.0 and will not affect any users' setup. The expected date for a 2.0 release candidate is early summer. You can track the progress in our high-level roadmap.
The larger remaining todos are:
Aside from changes for Medusa 2.0, this release also contains work for the Admin Redesign, set to be released in beta at the beginning of April. The redesign will significantly improve the UX and UI of our admin dashboard and make the overall look and feel much more consistent.
Additionally, this release squashes some minor bugs in Medusa 1.*.
Make medusaClient
optional in MedusaProvider
The property medusaClient
on the type MedusaProviderProps
in medusa-react
has been updated to be optional.
Using the MedusaProvider
without the medusaClient
will initialize and use a new default client under the hood:
<MedusaProvider
baseUrl={process.env.MEDUSA_BASE_URL}
...
>
{children}
</MedusaProvider>
https://github.com/medusajs/medusa/pull/6363
Add Product Categories to search subscriber
Product categories are included in search indexing on product updates and creations if the product categories feature flag is enabled.
https://github.com/medusajs/medusa/pull/6555
Update index on customer table
The multicolumn uniqueness index on the customer table (email, has_account)
has been updated to only apply to rows where deleted_at
is null. This is to allow for the creation of customers that were previously soft-deleted.
https://github.com/medusajs/medusa/pull/6631
POST /store/carts/:id
by @olivermrbl in https://github.com/medusajs/medusa/pull/6274
dotenv
by @kasperkristensen in https://github.com/medusajs/medusa/pull/6657
medusa_v2
flag by @shahednasser in https://github.com/medusajs/medusa/pull/6406
Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.2...v1.20.3
Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.2...v1.20.3
Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.2...v1.20.3
Published by olivermrbl 9 months ago
We have improved error messaging for missing exports of custom services. Until now, the following non-descriptive message was logged:
In 1.20.2, the same error will now log to the console:
This change landed in https://github.com/medusajs/medusa/pull/6240.
We have introduced an option jobs_batch_size
in the projectConfig
in medusa-config.js
, allowing users to configure the batch size of staged jobs we poll from the database every 3rd second. By default, we poll 1000 jobs, which has proven to cause issues with some setups. This option aims to resolve those.
Example config:
module.exports = {
projectConfig: {
jobs_batch_size: 10 // poll 10 jobs every 3rd second
},
}
This change landed in https://github.com/medusajs/medusa/pull/6333.
GET /admin/orders
We have introduced an order
query param on the GET /admin/orders
endpoint to support ordering orders.
This change landed in https://github.com/medusajs/medusa/pull/6258.
Our work on the admin revamp is progressing well. Below is an overview of completed and remaining work:
Completed
Remaining
We spend most of our time working on Medusa 2.0 and are seeing great improvements weekly.
You can follow our development in our roadmap.
Here's a high-level overview of completed, WIP, and planned work:
Completed
Work-in-progress
Planned (non-exhaustive)
GET /store/carts/:id
by @olivermrbl in https://github.com/medusajs/medusa/pull/6262
medusaClient
as an input to MedusaProvider
by @erikengervall in https://github.com/medusajs/medusa/pull/6299
POST /store/carts
by @olivermrbl in https://github.com/medusajs/medusa/pull/6273
order
field on GET /admin/orders by @kasperkristensen in https://github.com/medusajs/medusa/pull/6258
use-copy-promotion
to map product IDs by @erikengervall in https://github.com/medusajs/medusa/pull/6306
Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.1...v1.20.2
Published by olivermrbl 9 months ago
Landed in #5904.
Landed in #5833.
@medusajs/medusa-js
Landed in #6214.
Landed in #6183.
Core API Routes (located in packages/medusa/src/api
) are not registered when Medusa v2 feature flag is enabled.
And to repeat, all changes behind Medusa v2 are very unstable, highly experimental, and a work in progress at this point, so we do not encourage the use of the feature flag yet.
Follow our development toward Medusa v2 in our roadmap.
Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.0...v1.21.0
Published by olivermrbl 10 months ago
🚧 Breaking change in
medusa-plugin-stripe
Two important changes have been introduced to the Stripe plugin, one of which is breaking.
The endpoints and subscribers in the plugin have been migrated to use our new API Routes and Subscribers. This significantly lowers the code footprint of the package and makes it easier to maintain.
The webhook event management has changed significantly from in-band processing of the event to now using our Event Bus to process it as a background job. There were several motivations for this change: 1) it is deemed best practice to respond with a 200 immediately upon receiving a webhook request, 2) it allows for our retry mechanism to kick in in case the processing fails, and 3) it gives us more control of how the event is processed.
One example of the latter, effective from this release, is that we've added a 5s delay on processing events to avoid conflicts stemming from race conditions between the webhook and client requests.
instance of
to a static property check🚧 Breaking change
Several issues have been filed related to failing registrations of different types of services, such as payment providers, fulfillment providers, and similar. The culprit to these issues was found in how we check the type of the service class.
Until now, we've relied on instance of
to perform the check:
export function isPaymentProcessor(obj: unknown): boolean {
return obj instanceof AbstractPaymentProcessor
}
However, if you have a version mismatch in your packages, the instance of
check will fail even though the services are seemingly the expected type.
With this release, the service class type checks are now performed with static properties to eliminate this issue:
static isPaymentProcessor(object): boolean {
return object?.constructor?._isPaymentProcessor
}
🚧 Important change
Our cart completion API has been updated to increase robustness and reliability - especially under high load. The update includes removing serializable transactions from the API and generally refactoring our transaction management.
As a positive side effect, the changes have also made for a more performant API.
Minor changes to the schema of table publishable_api_key_sales_channel
have been introduced.
Please, apply the new migration by running the following command in your Medusa project after having updated:
npx @medusajs/medusa-cli migrations run
order by
queries on deeply nested relationsAn issue with duplicated rows in the result set in order by
queries on deeply nested relations has been resolved.
Read more about the change in the PR description.
medusa-react
An API reference and examples for our medusa-react
library have been introduced to our documentation.
With this release, the following languages are supported in Medusa Admin: Simplified Chinese, Bulgarian, Slovenian, Czech, and Japanese.
query
field in AdminInventoryItemsResource.deleteLocationLevel
method by @shahednasser in https://github.com/medusajs/medusa/pull/5941
npx
by @olivermrbl in https://github.com/medusajs/medusa/pull/5952
EVENT_REDIS_URL
by @dinesh-58 in https://github.com/medusajs/medusa/pull/5948
Full Changelog: https://github.com/medusajs/medusa/compare/v1.19.0...v1.20.0
Published by olivermrbl 11 months ago
🚧 Breaking change
Attempting to complete an already completed cart will no longer return a 409 conflict. Instead, the order or swap associated with the completed cart is returned.
More specifically, the response will take one of the following two shapes:
// completing a regular cart
{
response_code: 200,
response_body: { data: order, type: "order" },
}
// completing a swap cart
{
response_code: 200,
response_body: { data: swap, type: "swap" },
}
node-redis
replaced with ioredis
for session management🚧 Important change
Our default Express session store has been changed from node-redis
to ioredis
.
This was done in response to a request for higher configurability of the Redis client used for session management. It was decided to not only expose more options but simultaneously change the library to ioredis
to be consistent with other packages that use Redis, e.g. the Redis Event Bus + Redis Cache.
The add-to-cart endpoint, POST /store/carts/:id/line-items
, has been refactored, improving performance and transaction management. The latter was done in response to some users experiencing issues with concurrent requests leading to database conflicts. The changes to transaction management in the endpoint should significantly reduce the risk of this issue occurring while improving performance.
Some rough benchmarks show that for 1000 requests (10-20/s), we see approx. 30% of requests fail due to database conflicts in the latest version. With this PR, 0% of requests fail – even under a higher load.
@medusajs/medusa-cli
A new cluster command has been added to our CLI, @medusajs/medusa-cli
:
medusa start-cluster --cpus 3
The command allows you to start Medusa in cluster mode. By default, cluster mode will try to consume all available CPUs for Medusa instances. You can specify the number of CPUs with a CLI argument --cpus
.
Running in cluster mode will likely significantly improve performance as the workload and tasks are distributed among all available instances instead of a single one.
medusa-react
🚧 Important change
You can now specify maxRetries
as a prop to the MedusaProvider
from medusa-react
. This config is passed on to the underlying medusa-js
client, which means failed requests are retried the amount of times specified by the param. If not provided, the maxRetries
defaults to 3.
import { MedusaProvider as Provider } from "medusa-react"
import { queryClient } from "../constants/query-client"
export const MedusaProvider = ({ children }) => {
return (
<Provider
queryClientProviderProps={{
client: queryClient,
}}
baseUrl={process.env.MEDUSA_BACKEND_URL}
maxRetries={2}
>
{children}
</Provider>
)
}
Full Changelog: https://github.com/medusajs/medusa/compare/v1.18.1...v1.19.0
Published by olivermrbl 11 months ago
This release introduces Workflows to Medusa's toolbox for creating digital commerce applications.
Our new Workflows tooling is published under @medusajs/workflows-sdk
.
Workflows is in beta. Please help us improve the product and squash bugs by filing issues for the errors you encounter.
A workflow is a series of queries and actions that complete a task. You can think of Medusa as being made up of many workflows. For example, when adding line items to carts, we perform several actions:
All these actions are steps in a workflow.
Workflows can also be more advanced - like managing a return or processing an inbound purchase order.
You can explore and try our new Workflow tooling in our documentation.
Read more about Workflows on our blog.
This release marks the completion of the first iteration of our Pricing Module - a standalone pricing service that enables granular pricing configurations.
The Pricing Module is published under @medusajs/pricing
.
You can use the Pricing Module separately from Medusa to enable advanced pricing logic for any resource specific to your needs.
The module is integrated into our core @medusajs/medusa
behind the feature flag medusa_v2
. All features behind this flag are deemed highly experimental as we move toward Medusa 2.0, so please use it with caution.
The feature flag medusa_v2
is not stable for production environments.
Read more about the Pricing Module and our plans for Medusa 2.0.
The introduction of the Bulk Editor made it easy to update product variant prices.
With this release, we are centralizing product variant pricing in the Bulk Editor and removing all other entry points for operations related to pricing.
As a result, you can no longer modify prices of product variants in the following flows:
You should use the "Edit Prices" option in the dropdown of the variants section:
Full Changelog: https://github.com/medusajs/medusa/compare/v1.18.0...v1.18.1
Published by olivermrbl 11 months ago
This release comes with an improved Subscriber API and a new Scheduled Jobs API. These are drastic improvements of the developer experience of setting up event subscribers and cron jobs.
Subscriber API
// src/subscribers/product-update-handler.ts
import type { SubscriberConfig, SubscriberArgs, ProductService } from "@medusajs/medusa"
export default async function productUpdateHandler({ data, eventName, container, pluginOptions }: SubscriberArgs) {
const productService: ProductService = container.resolve("productService")
const { id } = data
const product = await productService.retrieve(id)
// do something with the product...
}
export const config: SubscriberConfig = {
event: ProductService.Events.UPDATE
}
Scheduled Jobs API
// src/jobs/once-a-minute.ts
import type { ProductService, ScheduledJobConfig, ScheduledJobArgs } from "@medusajs/medusa"
export default async function handler({ container, data, pluginOptions }: ScheduledJobArgs) {
const productService: ProductService = container.resolve("productService")
const count = await productService.count()
console.log(`You have ${count} products`)
}
export const config: ScheduledJobConfig = {
name: "every-minute",
schedule: "* * * * *"
}
Read more about the new APIs in the PR details.
Changes to feature flags
This version significantly changes the feature flags in our core @medusajs/medusa
. We've decided to replace all module-specific feature flags with one that encapsulates all the work around modularizing Medusa further.
The following feature flags no longer exist:
Name | Flag | Environment variable |
---|---|---|
Product Module | isolate_product_domain |
MEDUSA_FF_ISOLATE_PRODUCT_DOMAIN |
Pricing Module | isolate_pricing_domain |
MEDUSA_FF_ISOLATE_PRICING_DOMAIN |
These feature flags have been replaced with one capturing all work for Medusa V2, releasing next year:
Name | Flag | Environment variable |
---|---|---|
Medusa V2 | medusa_v2 |
MEDUSA_FF_MEDUSA_V2 |
Creating a NotificationService
The introduction of the new Subscriber API changes the recommended way to define the subscribers of a NotificationService. The recommended approach is to use a loader until our Subscriber API natively supports NotificationServices or we introduce a mechanism dedicated towards it.
Read more here.
Full Changelog: https://github.com/medusajs/medusa/compare/v1.17.4...v1.18.0
Published by olivermrbl 12 months ago
promiseAll
utilTransactions in Typeorm do not play well with Promise.all
when the operations contain nested promises. In case one of the operations fail i.e. reject the promise, all other operations are not guaranteed to be rolled back properly.
See https://github.com/medusajs/medusa/issues/5529 for more context.
To mitigate this issue, we've introduced the promiseAll
util in @medusajs/utils
. It uses Promise.allSettled
under the hood, but has been wrapped to work like Promise.all
with a transaction rollback guarantee. See here.
You will use it like so:
import { promiseAll } from "@medusajs/utils"
import { TransactionBaseService } from "@medusajs/medusa"
class MyService extends TransactionBaseService {
async performTransactions() {
return await promiseAll([
// your operations....
])
}
}
API Routes now support body-parser configuration.
You can opt-out:
export config = {
routes: [
{
matcher: "/webhooks/*",
bodyParser: false,
middlewares: [raw({ type: "application/json" })]
}
]
}
Or configure it with options:
export config = {
routes: [
{
matcher: "/webhooks/*",
bodyParser: { sizeLimit: 2000 } // in bytes
middlewares: [raw({ type: "application/json" })]
}
]
}
Our design packages, @medusajs/ui
, @medusajs/icons
, @medusajs/ui-preset
, have been moved to our monorepo to centralize issues and PRs.
https://github.com/medusajs/medusa/pull/5511 contains breaking changes in @medusajs/cache-redis
.
If option ttl
is 0 when calling .set
the attempt to add a cache entry is skipped.
Full Changelog: https://github.com/medusajs/medusa/compare/v1.17.3...v1.17.4
Published by olivermrbl 12 months ago
An issue with path parsing on Windows for API Routes registration has been resolved (#5497).
Custom batch jobs can now be rendered in the activity drawer in Medusa Admin (#5288)
Use format [entity]-[operation]
for your batch job type to render a human-readable activity title. For example, product-import
.
Vietnamese, Ukrainian, Tamil, Russian, and Hindi translations added to Medusa Admin.
source-map-plugin
from @medusajs/admin-ui
Removed source-map-plugin
to make Webpack more fault tolerant. The plugin would cause admin builds to throw if a dependency had no source maps (#5484)
Full Changelog: https://github.com/medusajs/medusa/compare/v1.17.2...v1.17.3
Published by olivermrbl about 1 year ago
Version 1.17.2 of @medusajs/medusa
introduces API Routes - a massive improvement of the developer experience of creating custom endpoints in Medusa.
Custom API endpoints can now be implemented using similar patterns to frameworks like Next.js and Svelte.
// api/admin/products/route.ts
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
export async function GET(req: MedusaRequest, res: MedusaResponse) {
const productService = req.scope.resolve("productService")
const products = await productService.list()
res.json({ products })
}
In the above example, we create the endpoint GET /admin/products
. The example illustrates a few key points:
route.{ts|js}
is a new special file that contains the route handlersGET
)Read more about the API Routes in the PR and announcement post.
partitionItems_ method
of Fulfillment Service by @DidierGuyon in https://github.com/medusajs/medusa/pull/5247
Full Changelog: https://github.com/medusajs/medusa/compare/v1.17.1...v1.17.2
Published by olivermrbl about 1 year ago
The Price List domain in @medusajs/admin
has been revamped to improve merchants' experience in creating promotional sales and customer-specific prices.
The update includes:
https://github.com/medusajs/medusa/assets/59018053/65008316-cb46-43a0-9116-6c279853bd4d
We will incrementally migrate Medusa Admin to use our UI components library. Therefore, you can expect to find UI inconsistencies in the foreseeable future.
The next iteration of the Price List revamp will introduce minimum and maximum requirements support (in the UI), as well as the ability to import and export Price List to/from CSV files.
We've introduced an AI Assistant to our documentation, helping you on your journey building digital commerce experiences.
https://github.com/medusajs/medusa/assets/59018053/57564836-7233-43d9-840d-5b943353e9b4
Spanish, Italian, and German translations have been added to Medusa Admin.
Full Changelog: https://github.com/medusajs/medusa/compare/v1.17.0...v1.17.1
Published by olivermrbl about 1 year ago
Version 1.17.0 of @medusajs/medusa
ships new and improved authentication methods. A contribution by @dPreininger.
Medusa supports three authentication methods:
Sessions
Our session cookie authentication remains unchanged. However, the strategy name has been updated in both the store and admin API, making existing cookie sessions invalid.
⚠️ We will not convert existing sessions to work with this update. Make sure to plan your upgrade accordingly.
API tokens (⚠️ breaking changes)
The header for API token authentication has changed from a Bearer authorization scheme to a custom header scheme specific to Medusa, x-medusa-access-token
.
Previously, you would use API tokens like so:
curl -L GET '<BACKEND_URL>/admin/products' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {api_token}'
This has changed to:
curl -L GET '<BACKEND_URL>/admin/products' \
-H 'Content-Type: application/json' \
-H 'x-medusa-access-token: {api_token}'
Bearer tokens
Bearer token authentication is a "new" method that utilizes JWT tokens and the Bearer scheme. Request a token from a client and attach it to subsequent requests to keep the authenticated session alive. The approach is identical to that of the old API authentication but uses a different token type.
First, request a token:
curl -L POST 'http://localhost:9000/admin/auth/token' \
-H 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]",
"password": "supersecret"
}'
Then, hit an authenticated route:
curl -L GET 'http://localhost:9000/admin/products?limit=1' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer some_access_token'
Thanks to @PeterAbdalla, you can now operate Medusa Admin in Arabic.
Version 2.0 of @medusajs/ui
is out. To upgrade, run the following command in your project:
yarn add @medusajs/[email protected]
The release includes:
And much more.
Check out all changes and the upgrade guide in our documentation: https://docs.medusajs.com/upgrade-guides
@medusajs/medusa-js
import by @olivermrbl in https://github.com/medusajs/medusa/pull/5207
Full Changelog: https://github.com/medusajs/medusa/compare/v1.16.1...v1.17.0
Published by olivermrbl about 1 year ago
Huge thanks to @chemicalkosek for the contribution!
Upgrade to the latest version of Medusa Admin:
yarn add @medusajs/admin@latest
Solves:
count
serialization and incorrect function call by @adevinwild in https://github.com/medusajs/medusa/pull/5090
Full Changelog: https://github.com/medusajs/medusa/compare/v1.16.0...v1.16.1
Published by olivermrbl about 1 year ago
We are excited to announce multi-language support in Medusa Admin, allowing merchants to manage products, orders, customers, etc. in their preferred language.
This release ships English, Portuguese (Brazil), and French translations.
Check it out by upgrading to the latest version of Medusa Admin:
yarn add @medusajs/admin@latest
Huge thanks to @gempain and @mj-mehdizadeh for this amazing contribution. And thanks @dahorarodrigo for contributing with Portuguese translations.
If you want to help us translate Admin to other languages, see the contribution guide in our documentation.
Your efforts are highly appreciated!
This release introduces the first iteration of our new standalone Pricing Module, which ships on npm under @medusajs/pricing
. This version of the module comes with limited functionality as we've focused on putting down a solid foundation for follow-up work.
You can think of the Pricing Module as a way to assign a price to any type of resource, for example, ProductVariants.
We will share an announcement article soon, describing the module's features and what you can expect from follow-up iterations.
Database schema changes
In our effort to build Standalone Commerce Modules, we will incrementally be dropping foreign key constraints across many business domains and change relationships between entities in the core, @medusajs/medusa
.
Right now, we are focused on finalizing the Product (@medusajs/product
) and Pricing (@medusajs/pricing
) module, which has led to the following database changes.
The relationship between MoneyAmounts and ProductVariants has been changed from a Many-to-One to a Many-to-Many in package @medusajs/medusa
. Therefore, you are required to apply the new migration by running the following command in your Medusa project:
npx @medusajs/medusa-cli migrations run
Additionally, the following foreign key constraints have been dropped:
These changes are only relevant if you are using the feature flag
isolate_product_domain
. Please be careful about enabling this flag, as it will introduce experimental changes and work in progress.
Full Changelog: https://github.com/medusajs/medusa/compare/v1.15.1...v1.16.0
Published by olivermrbl about 1 year ago
create-medusa-app
onboardingWe'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
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.
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:
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:
Product Module
In https://github.com/medusajs/medusa/pull/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"] })
deleted_at
to Return Reason unique constraint by @StephixOne in https://github.com/medusajs/medusa/pull/4834
match
prop on column by @fPolic in https://github.com/medusajs/medusa/pull/4913
Full Changelog: https://github.com/medusajs/medusa/compare/v1.15.0...v1.16.0
Published by olivermrbl about 1 year ago
@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.
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.
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
}
PriceListImportStrategy
descriptive errors by @fPolic in https://github.com/medusajs/medusa/pull/4842
Full Changelog: https://github.com/medusajs/medusa/compare/v1.14.0...v1.15.0
Published by olivermrbl about 1 year ago
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.
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.
The following improvements have been shipped to the Bulk Editor
create-medusa-app
optionsThe 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.
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.
The FlagRouter that manages feature flags has been removed from @medusajs/medusa
and added to @medusajs/utils
.
cart.items
by @olivermrbl in https://github.com/medusajs/medusa/pull/4715
rimraf
from prepare by @olivermrbl in https://github.com/medusajs/medusa/pull/4741
Full Changelog: https://github.com/medusajs/medusa/compare/v1.13.1...v1.14.0
Published by olivermrbl about 1 year ago
Environment variable LOG_FILE
has been introduced to enable winston
to write logs to file.
Thanks, @pevey, for the contribution.
Full Changelog: https://github.com/medusajs/medusa/compare/v1.13.0...v1.13.1
Published by olivermrbl over 1 year ago
This version ships with schema changes (breaking) and minor fixes improving Medusa Admin.
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
@medusajs/workflows
by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/4553
Full Changelog: https://github.com/medusajs/medusa/compare/v1.12.3...v1.13.0