Commit Graph

121 Commits

Author SHA1 Message Date
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
olivermrbl
3919b26eb6 chore: Version packages 2025-01-07 13:31:40 +01:00
Shahed Nasser
632600ee11 fix(create-medusa-app): add default storefront url to auth CORS (#10853)
* fix(create-medusa-app): add default storefront url to auth CORS

* add docs cors to store / admin
2025-01-07 11:01:37 +02:00
Shahed Nasser
152a94e1e1 feat(create-medusa-app): improve by adding depth to clone commands (#10812)
Improve command by passing `--depth 1` to decrease download size + improve for slow speed.

Closes TRI-742
2025-01-05 13:24:57 +00:00
Shahed Nasser
1e6d56bc18 feat(create-medusa-app): allow passing project name on command line (#10755)
Allow passing the project name on the command line:

```bash
npx create-medusa-app@latest my-project
```
2024-12-29 09:41:15 +00:00
github-actions[bot]
198fa53120 chore(docs): Updated API Reference (automated) (#10685)
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>
2024-12-23 08:35:12 +00:00
olivermrbl
348f866ffe chore: Version packages 2024-12-20 11:25:36 +01:00
Shahed Nasser
570c85538b chore: fix redocly circular dependencies (#10642) 2024-12-17 19:45:57 +02:00
olivermrbl
a391a29aa8 chore: Version packages 2024-12-17 14:41:05 +01:00
olivermrbl
0e342b491d chore: Version packages 2024-12-10 14:01:50 +01:00
olivermrbl
4723acd949 chore: Version packages 2024-12-04 18:36:57 +01:00
olivermrbl
e9c1b1127e chore: Version packages 2024-11-27 15:40:07 +01:00
github-actions[bot]
7865909891 chore(docs): Updated API Reference (automated) (#10258)
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>
2024-11-25 14:33:22 +00:00
olivermrbl
ccf4e801f3 chore: Version packages 2024-11-25 12:14:36 +01:00
olivermrbl
4245312d8d chore: Version packages 2024-11-25 09:57:00 +01:00
olivermrbl
d5605656ae chore: Version packages 2024-11-12 10:10:07 +01:00
olivermrbl
ecece05b72 chore: Version packages 2024-11-11 10:58:20 +01:00
olivermrbl
8feb589659 chore: Release 2024-11-06 21:47:01 +01:00
Harminder Virk
b0f416769f fix: do not set default host to localhost (#9957)
Fixes bug introduced by https://github.com/medusajs/medusa/pull/9912

By default the Node.js server listens on the `0.0.0.0` host. However, the related PR changes the host to `localhost` and hence resulted in an unwanted breaking change. This PR reverts the default value assignment and let Node.js decide the host when not explicitly specified.
2024-11-06 17:04:49 +00:00
Harminder Virk
c9a2b42252 fix: log cause property from the error (#9944)
Fixes: FRMW-2762

This PR fixes the error reporting to include the original error message and the error cause when logging it using the JSON formatter of Winston.

> Side note: There is still a lot of room for improvements in our logging. But that require a overhaul cleanup in multiple places and will require dedicated loggers for commands and APP and special treatment for pretty printing errors.

## Error output in JSON format

**Before**
![CleanShot 2024-11-06 at 13 12 32@2x](https://github.com/user-attachments/assets/a986d33c-9c30-45bc-816d-e9aa142ea097)

**After**
![CleanShot 2024-11-06 at 13 11 28@2x](https://github.com/user-attachments/assets/15430e55-40b3-4d1c-b91d-3b3b4f9d0d39)
2024-11-06 15:43:54 +00:00
Harminder Virk
300ef8dbb9 fix: consider --host flag and HOST env variable (#9912) 2024-11-04 14:56:57 +05:30
olivermrbl
4ccab16336 chore: Version packages 2024-10-25 17:19:36 +02:00
Shahed Nasser
92bbd7953b chore: update links to v2 docs in source code and comments (#9732) 2024-10-24 15:18:38 +03:00
Harminder Virk
809c8a6741 fix: missing dependency in dev-cli (#9730) 2024-10-23 10:01:39 +02:00
olivermrbl
2fbebb60e3 chore: Release 2024-10-22 20:43:47 +02:00
Oli Juhl
c3418a2b93 chore: Prepare versions + changeset (#9707)
* chore: Prepare version + changeset

* chore: Bump dependencies

* chore: Update lock-file
2024-10-22 20:31:33 +02:00
Oli Juhl
f1b2d22db7 chore: Remove v2 branches from starters (#9721)
* chore: Remove v2 branches from starters

* revert imports
2024-10-22 20:00:13 +02:00
Harminder Virk
d77d184729 Fix/production logging (#9658)
Keep the old format (ie combined) when logging in production.

**Development**
![CleanShot 2024-10-18 at 16 51 18@2x](https://github.com/user-attachments/assets/7656422a-0329-4062-ad6a-5bbc4a892b37)

**Production**
![CleanShot 2024-10-18 at 16 52 25@2x](https://github.com/user-attachments/assets/89527547-25e3-432f-b561-2514856b6aec)
2024-10-18 13:11:46 +00:00
Harminder Virk
aa6a28ac56 feature: use application logger to log HTTP requests (#9655) 2024-10-18 15:08:55 +05:30
Harminder Virk
68560787e5 breaking: rename package names to be consistent and under @medusajs scope (#9580) 2024-10-16 22:28:09 +05:30
Adrien de Peretti
84fa6ccde5 chore: Update admin build/serve configuration (#9584)
**Breaking changes**

The `outDir` has been deprecated and wont be used anymore, instead all the path are computed internally following these rules
- if admin is not `disabled` and the `build` command is run without the `--admin-only` flag, then the admin output dir will be `.medusa/server/public/admin` and it will be served from that same location from the medusa instance.
- if admin is not `disabled` and the `build` command is run with the `--admin-only` flag, then the admin output dir will be `.medusa/admin` with the purpose of deploying the admin separately. ⚠️ (expect to receive a warning log)
- if the admin is `disabled` and the `build` command is run with the `--admin-only` flag, then fallback to rule number 2

| admin enabled  | medusa build --admin-only  | output dir |
|---|---|---|
| true  | true  | `.medusa/admin` ⚠️ (expect to receive a warning log) |
| true  | false  | `.medusa/server/public/admin`  |
| false  | true  | `.medusa/admin`  |
| false  | false  | none |

```diff
// medusa-config.ts

{
  // ...
  admin: {
-    outDir: 'some/path'
  }
}
```


cc @kasperkristensen @sradevski @olivermrbl
2024-10-15 15:59:47 +00:00
Adrien de Peretti
e9383f25e0 fix(utils): update medusa config resolution for consistency (#9591) 2024-10-15 11:52:06 -03:00
Harminder Virk
f8e8b276bd fix: remove default value for the cluster flag (#9570)
Defining the default value applies the flag automatically and hence activates the cluster mode.
2024-10-14 16:54:13 +00:00
Shahed Nasser
86f744cf3b fix(create-medusa-app): use db:migrate to run migrations (#9565) 2024-10-14 15:54:05 +00:00
Harminder Virk
ad322f2760 breaking: remove deprecated commands and code (#9521)
* breaking: remove deprecated commands

* feat: remove deprecated code and usages

* refactor: remove more logic around default relations

* fix tests

* remove log

* fix: remove defaultFields usage

* fix: add back accidentally removed code

* refactor: implement feedback

* feat: add --cluster flag to the start command

* refactor: assign limit to defaultLimit property

* fix: breaking code because of removed check

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
2024-10-14 20:11:34 +05:30
Adrien de Peretti
eea2bfdef1 chore(cli): Update start description (#9448)
**What**
Update description of the start command
2024-10-04 15:11:29 +00:00
Harminder Virk
1e046f2b81 feat: allow using typescript path aliases when using ts-node (#9443) 2024-10-03 16:56:36 +05:30
Harminder Virk
48e00169d2 breaking: move shared HTTP utils to the framework (#9402)
Fixes: FRMW-2728, FRMW-2729

After this PR gets merged the following middleware will be exported from the `@medusajs/framework/http` import path.

- applyParamsAsFilters
- clearFiltersByKey
- applyDefaultFilters
- setContext
- getQueryConfig
- httpCompression
- maybeApplyLinkFilter
- refetchEntities
- unlessPath
- validateBody
- validateQuery

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-10-03 09:42:00 +00:00
Stevche Radevski
bffb36cd11 fix: Use the default admin port in create medusa app env definition (#9439) 2024-10-03 09:53:57 +02:00