Commit Graph

159 Commits

Author SHA1 Message Date
Adrien de Peretti
a095245d71 chore(): Upgrade mikro orm (#13390)
* chore(): Upgrade mikro orm

* handle 'null' value for big number props

* 6.5.2

* remove only

* fix pricing module rule value

* switch select in strategy for balances

* revert to select in strategy for order module

* fix defining DML ManyToOne

* fix define relationship

* test fix

* more fixes

* change order strategy to balanced

* change order strategy to balanced

* prevent unnecessary manager fork

* revert generated www changes

* remove unnecessary changes

* Create real-cobras-deny.md

* address feedback

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-09-08 21:10:44 +02:00
Oli Juhl
115a1deb49 chore: Fix scripts in CLI pipeline (#13402)
* chore: Fix scripts in CLI pipeline

* Create curly-lizards-dress.md
2025-09-03 14:07:24 +02:00
github-actions[bot]
6dca59d0a5 chore: Version Packages (#13338)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-28 22:58:13 +02:00
github-actions[bot]
08ec3ed9f2 chore: Version Packages (#13209)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-28 17:25:32 +02:00
Carlos R. L. Rodrigues
e413cfefc2 feat(utils): define file config (#13283)
** What
 - Allow auto-loaded Medusa files to export a config object.
 - Currently supports isDisabled to control loading.
 - new instance `FeatureFlag` exported by `@medusajs/framework/utils`
 - `feature-flags` is now a supported folder for medusa projects, modules, providers and plugins. They will be loaded and added to `FeatureFlag`

** Why
 - Enables conditional loading of routes, migrations, jobs, subscribers, workflows, and other files based on feature flags.

```ts
// /src/feature-flags

import { FlagSettings } from "@medusajs/framework/feature-flags"

const CustomFeatureFlag: FlagSettings = {
  key: "custom_feature",
  default_val: false,
  env_key: "FF_MY_CUSTOM_FEATURE",
  description: "Enable xyz",
}

export default CustomFeatureFlag
```

```ts
// /src/modules/my-custom-module/migration/Migration20250822135845.ts

import { FeatureFlag } from "@medusajs/framework/utils"

export class Migration20250822135845 extends Migration {
  override async up(){ }
  override async down(){ }
}

defineFileConfig({
  isDisabled: () => !FeatureFlag.isFeatureEnabled("custom_feature")
})
```
2025-08-26 12:22:30 +00:00
github-actions[bot]
01fa17d2ad chore: Version Packages (#13045)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-14 13:23:45 +02:00
Oli Juhl
909fc4c127 fix(create-medusa-app): Don't allow dot in project name (#13042) 2025-07-25 17:44:06 +02:00
github-actions[bot]
137ea0883d chore: Version Packages (#12924)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-24 09:41:35 +02:00
github-actions[bot]
b7aa719540 chore: Version Packages (#12883)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-08 19:49:15 +02:00
Adrien de Peretti
779ed018b9 feat(create-medusa-app): Allow to create project with specific medusa version (#12882)
* feat(create-medusa-app): Allow to create project with specific medusa version

* feat(create-medusa-app): Allow to create project with specific medusa version

* feat(create-medusa-app): Allow to create project with specific medusa version

* naming

* Create smart-singers-dress.md
2025-07-03 15:58:18 +02:00
github-actions[bot]
22396134b3 chore: Version Packages (#12832)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-30 16:16:24 +02:00
github-actions[bot]
628e8d22ee chore: Version Packages (#12691)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-25 11:41:13 +02:00
Shahed Nasser
93cf79cb0f docs: add loyalty plugin routes to OAS (#12811)
* generated OAS

* remove unused schemas

* generated specs

* add cloud badge for routes

* add to loyalty plugin page

* allow clicking the tooltip
2025-06-24 19:17:55 +03:00
Shahed Nasser
2e861a9449 fix(create-medusa-app): ensure the same package manager is used consistently (#12714)
* fix(create-medusa-app): ensure the same package manager is used consistently

* fix verbose not working as expected

* improvements

* remove legacy peer deps

* format
2025-06-16 14:07:35 +03:00
Shahed Nasser
774702153f fix(create-medusa-app): remove "Created admin user" message (#12707) 2025-06-11 13:53:07 +03:00
github-actions[bot]
68a796d300 chore: Version Packages (#12583)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-05 20:33:53 +02:00
github-actions[bot]
5ad3615830 chore: Version Packages (#12576)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-05-22 14:04:27 +02:00
olivermrbl
8c0b49fed4 chore: Version packages 2025-05-16 11:04:39 +02:00
olivermrbl
d2dd2e7c72 chore: Version packages 2025-05-15 09:49:09 +02:00
olivermrbl
d3a5868e8b chore: Version packages 2025-05-13 12:56:07 +02:00
Shahed Nasser
f74586e772 fix(create-medusa-app): updates to text and prompts (#12360) 2025-05-06 14:23:54 +03:00
olivermrbl
2fec5f4aa0 chore: Version packages 2025-04-23 09:27:02 +02:00
Harminder Virk
71a9a7210c fix: oas CLI to convert Windows paths to unix (#12254)
* fix: oas CLI to convert Windows paths to unix

* Create tidy-pigs-heal.md

* refactor: revert to isolate the issue

* refactor: add back the change with logs

* fix: remove external dependency
2025-04-22 14:41:58 +02:00
olivermrbl
d61694385d chore: Version packages 2025-04-11 10:25:36 +02:00
olivermrbl
f1cac99316 chore: Version packages 2025-03-10 15:44:09 +01:00
Oli Juhl
3b470f4142 chore: remove ranges on medusa packages (#11738) 2025-03-06 14:17:05 +01:00
olivermrbl
5d74ac3cc3 chore: Version packages 2025-03-04 14:11:37 +01:00
olivermrbl
3f7470022c chore: Version packages 2025-02-24 11:36:46 +01:00
Adrien de Peretti
0a95c6f6df chore(cli): Prevent swallowing error in non production env (#11534) 2025-02-19 20:02:47 +01:00
olivermrbl
682dcf6507 chore: Version packages 2025-02-11 12:00:43 +01:00
Oli Juhl
db03738b5f chore: Revert version range to ^ (#11390) 2025-02-11 11:35:25 +01:00
Kasper Fabricius Kristensen
f13c1215cb fix(cli): If NODE_ENV is not defined then default to production for medusa start (#11325)
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-02-06 17:56:29 +01:00
RONY GEDEON YEBADOKPO
a16eaad6c9 fix(create-medusa-app): --db-url keep asking db credentials (#11037)
* fix create-medusa-app db-url error

* removed empty lines

* changeset
2025-01-29 15:30:18 +02:00
olivermrbl
986ee8008e chore: Version packages 2025-01-27 09:35:06 +01:00
Adrien de Peretti
eace10e66b fix(medusa,cli): Resources not correctly loaded when running the migration scripts (#11108)
FIXES FRMW-2888

**What**
Since the migration scripts runner run as part of the migrate script, we were cleaning up the resources but we didn't take into consideration that links are loading automagically by just importing the links. The issue is that once a link have been imported, the next import will rely on the cached module and therefore when cleaning the resources, re importing those links is not enough. Instead, we are now treating the run-script as a separate command that we run during running the migration so that resources are isolated and loaded according to the need of each script themselves
2025-01-23 16:33:50 +00:00
Adrien de Peretti
9321920227 fix: Medusa package version should use ~ instead of ^ (#11077)
RESOLVES FRMW-2859
2025-01-22 15:15:30 +00:00
Carlos R. L. Rodrigues
cc73802ab3 chore(order): dml (#10292)
* ../../core/types/src/dml/index.ts

* ../../core/types/src/dml/index.ts

* fix: relationships mapping

* handle nullable foreign keys types

* handle nullable foreign keys types

* handle nullable foreign keys types

* continue to update product category repository

* fix all product category repositories issues

* fix product category service types

* fix product module service types

* fix product module service types

* fix repository template type

* refactor: use a singleton DMLToMikroORM factory instance

Since the MikroORM MetadataStorage is global, we will also have to turn DML
to MikroORM entities conversion use a global bucket as well

* refactor: update product module to use DML in tests

* wip: tests

* WIP product linkable fixes

* continue type fixing and start test fixing

* test: fix more tests

* fix repository

* fix pivot table computaion + fix mikro orm repository

* fix many to many management and configuration

* fix many to many management and configuration

* fix many to many management and configuration

* update product tag relation configuration

* Introduce experimental dml hooks to fix some issues with categories

* more fixes

* fix product tests

* add missing id prefixes

* fix product category handle management

* test: fix more failing tests

* test: make it all green

* test: fix breaking tests

* fix: build issues

* fix: build issues

* fix: more breaking tests

* refactor: fix issues after merge

* refactor: fix issues after merge

* refactor: surpress types error

* test: fix DML failing tests

* improve many to many inference + tests

* Wip fix columns from product entity

* remove product model before create hook and manage handle validation and transformation at the service level

* test: fix breaking unit tests

* fix: product module service to not update handle on product update

* fix define link and joiner config

* test: fix joiner config test

* test: fix joiner config test

* fix joiner config primary keys

* Fix joiner config builder

* Fix joiner config builder

* test: remove only modifier from test

* refactor: remove hooks usage from product collection

* refactor: remove hooks usage from product-option

* refactor: remove hooks usage for computing category handle

* refactor: remove hooks usage from productCategory model

* refactor: remove hooks from DML

* refactor: remove cruft

* order dml

* cleanup

* re add foerign key indexes

* wip

* chore: remove unused types

* wip

* changes

* rm raw

* autoincrement

* wip

* rel

* refactor: cleanup

* migration and models configuration adjustments

* cleanup

* number searchable

* fix random ordering

* fix

* test: fix product-category tests

* test: update breaking DML tests

* test: array assertion to not care about ordering

* fix: temporarily apply id ordering for products

* types

* wip

* WIP type improvements

* update order models

* partially fix types temporarely

* rel

* fix: recursive type issue

* improve type inference breaks

* improve type inference breaks

* update models

* rm nullable

* default value

* repository

* update default value handling

* fix unit tests

* WIP

* toMikroORM

* fix relations

* cascades

* fix

* experimental dml hooks

* rm migration

* serial

* nullable autoincrement

* fix model

* model changes

* fix one to one DML

* order test

* fix addresses

* fix unit tests

* Re align dml entity name inference

* update model table name config

* update model table name config

* revert

* update return relation

* WIP

* hasOne

* models

* fix

* model

* initial commit

* cart service

* order module

* utils unit test

* index engine

* changeset

* merge

* fix hasOne with fk

* update

* free text filter per entity

* tests

* prod category

* property string many to many

* fix big number

* link modules migration set names

* merge

* shipping option rules

* serializer

* unit test

* fix test mikro orm init

* fix test mikro orm init

* Maintain merge object properties

* fix test mikro orm init

* prevent unit test from connecting to db

* wip

* fix test

* fix test

* link test

* schema

* models

* auto increment

* hook

* model hooks

* order

* wip

* orm version

* request return field

* fix return configuration on order model

* workflows

* core flows

* unit test

* test

* base repo

* test

* base repo

* test fix

* inventory move

* locking inventory

* test

* free text fix

* rm timeout mock

* migrate fulfillment values

* v6.4.3

* cleanup

* link-modules update sql

* revert test

* remove fake timers

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Harminder Virk <virk.officials@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-01-21 08:04:47 -05:00
Shahed Nasser
cd758067d4 fix(create-medusa-app): fix database name from input not used in setup (#11071) 2025-01-21 12:35:46 +02:00
olivermrbl
57e9a7a5bf chore: Version packages 2025-01-20 07:41:15 -05:00
Shahed Nasser
2a5f2a5387 fix(cli): fix command description for plugin:db:generate (#11022) 2025-01-18 10:49:23 -05:00
github-actions[bot]
24441e48df chore(docs): Updated API Reference (automated) (#11030)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2025-01-17 16:35:02 +00:00
olivermrbl
efe141f54b chore: Version packages 2025-01-17 10:29:04 -05:00
Adrien de Peretti
0cfaab5bb1 Feat(medusa, cli): plugin db generate (#10988)
RESOLVES FRMW-2875

**What**
Allow to generate migration for plugins. Migration generation defer from project migration generation and therefore we choose to separate responsibility entirely.

The flow is fairly simple, the user run `npx medusa plugin:db:generate` and the script will scan for all available modules in the plugins, gather their models information and generate the appropriate migrations and snapshot (for later generation)

Co-authored-by: Harminder Virk <1706381+thetutlage@users.noreply.github.com>
2025-01-17 12:05:46 +00:00
Adrien de Peretti
0924164e86 feat(core, medusa, cli): Enable migration scripts (#10960)
* feat(core, medusa): Enable migration scripts

* spacing

* rm unnecessary import

* Allow to skip script migration

* fix missing options

* add options

* add tests and small changes

* update

* add checks

* add lock mechanism to be extra safe

* Create six-bears-vanish.md

* update queries

* fix tests

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-01-15 12:51:37 -05:00
Kasper Fabricius Kristensen
4bc3f5b845 feat(medusa,framework,cli,admin-bundler): Integrate admin extensions into medusa build:plugin (#10941)
**What**
Calls the `plugin` script from `@medusajs/admin-bundler` as part of `medusa plugin:build`.
2025-01-13 20:48:55 +00:00
Adrien de Peretti
b7a3759824 feat(cli): Add plugin:publish and plugin:add commands support (#10938)
RESOLVES FRMW-2864
RESOLVES FRMW-2868

**What**
Add support for the following cli commands:
- `plugin:publish`
- `plugin:add`
2025-01-13 14:24:49 +00:00
Adrien de Peretti
c895ed8013 feat: Scaffold plugin in create-medusa-app (#10908)
RESOLVES FRMW-2862

**What**
This PR enable the `create-medusa-app` CLI to accept a new `--plugin` option to scaffold a plugin. This is complementary to all the plugin commands being created/adjusted separately to that pr.
Also, this pr brings a little refactoring around resource scaffolding, the idea was to contain the refactoring to a little area and not expend it to the entire create-medusa-app package to not disrupt and expand the scope for which the purpose was to introduce the plugin scaffolding capabilities

**Addition**
- medusa project will get their package.json name changed to the project name
- Remove build step from medusa project creation

**Plugin flow**

- in the plugin
  - `npx create-medsa-app --plugin`
  - `yarn dev`
- in the project
  - `yalc add plugin-name`
  - `yarn dev`

Any changes on the plugin will publish, push in the local registry which will fire the hot reload of the app and include the new changes from the plugin
2025-01-13 14:18:42 +00:00
Harminder Virk
b0f581cc7c feat: add plugin build command (#10935)
Fixes: FRMW-2863

Adds the `plugin:build` command that is used to compile the source code of a plugin for publishing it to a package registry. The command is similar to the `build` command, except it does not copy the `package.json` and the `lock` files to the build output
2025-01-13 13:33:54 +00:00
Harminder Virk
69e2a6d695 Feat/plugin develop (#10926)
Fixes: FRMW-2865

In this PR we add support for developing a plugin in watch mode. During the file change, we re-compile the source code (incrementally), publishes the package, and updates the installations of the plugin. 

We are using `yalc` under the hood and it must be installed as a dev dependency in the plugin project and the main Medusa app.
2025-01-13 13:08:02 +00:00
Rahul R.
ecf73780e0 [Fix] Update Repository Directory Paths for All Packages (#10910)
This PR updates the `repository.directory` field in the `package.json` files for packages located within the `modules` folder.
2025-01-13 12:49:50 +01:00