Commit Graph

69 Commits

Author SHA1 Message Date
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
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
olivermrbl
348f866ffe chore: Version packages 2024-12-20 11:25:36 +01: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
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
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
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
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
Harminder Virk
37f4d03b7b fix: db:rollback and db:generate commands to cast module names to arrays (#9377)
FIXES: FRMW-2720
2024-09-30 12:17:04 +00:00
Harminder Virk
a578313db9 feature: bundle all modules (#9324) 2024-09-30 09:04:03 +02:00
Adrien de Peretti
a8e19faf8d chore: use framework sub paths everywhere (#9253) 2024-09-26 16:38:38 +05:30
Harminder Virk
48bea267dc chore: perform dependencies scan and fix all dependencies (#9296) 2024-09-26 14:14:38 +05:30
Adrien de Peretti
2c5e72d141 feat: Application types generation from project GQL schema's (#8995) 2024-09-06 15:15:32 +05:30
Harminder Virk
69c5d122b1 feature: add db:setup command (#8830) 2024-08-28 13:08:48 +05:30
Harminder Virk
2a5ee970e6 feat: move migrations commands to the new db namespace (#8810) 2024-08-27 16:40:00 +05:30
Oli Juhl
2bacf86d3c chore: Remove prepublishOnly script (#8699)
* wip

* wip

* verbose logging

* remove prepublish scripts

* chore: add back prepublish scripts

* wip

* remove prepublishOnly script

* chore: Clean up rest of build scripts

* add back build script

* feedback

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-08-27 10:31:38 +02:00
Harminder Virk
98b4c76ece feature: add sync links command (#8775) 2024-08-27 13:43:54 +05:30
Harminder Virk
965c3c99db refactor: cleanup error output and do not add red color to help output (#8778) 2024-08-27 13:18:22 +05:30
Carlos R. L. Rodrigues
3b4eea08ef chore: peer dependency version (#8771)
* fix peer dependency version

* dotenv

* commands

* dotenv cli
2024-08-26 21:55:57 +02:00
Carlos R. L. Rodrigues
afd25846f0 chore: dependencies reorg (#8744) 2024-08-26 09:37:05 +00:00
Harminder Virk
7c2cfc132a feature: add db:create command (#8760) 2024-08-26 15:04:52 +05:30
Carlos R. L. Rodrigues
058378970a chore: dependecies reorg (#8535) 2024-08-23 07:16:04 -03:00
Carlos R. L. Rodrigues
c9c1a5b41c chore: rm pg dependency (#8526) 2024-08-08 17:22:57 +00:00