Commit Graph
99 Commits
Author SHA1 Message Date
Harminder Virk 1e046f2b81 feat: allow using typescript path aliases when using ts-node (#9443) 2024-10-03 16:56:36 +05:30
Harminder VirkandAdrien de Peretti 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 2d1cf12dac feature: Add MikroORM CLI wrapper to bypass hardcoded module system (#9426)
FIXES: FRMW-2727

MikroORM (with version 5.9) has [hardcoded the TypeScript module](https://github.com/mikro-orm/mikro-orm/blob/5.x/packages/core/src/utils/ConfigurationLoader.ts#L138-L139) system to `commonjs`, which makes it incompatible with the module system we are using, ie `Node16`.

So, in order to continue using the Mikro ORM CLI within our modules, we will have to monkey-patch the block of code responsible for configuring `ts-node`. However, the monkey-patching must be done before their CLI gets booted.

As a result of this, we have to create a wrapper CLI on top of Mikro ORM CLI that performs the following steps.

- Monkey-patch the relevant code
- Register Mikro ORM CLI as the second step.

Due do this, we will have to use this new wrapper CLI within the modules, which is exposed as `medusa-db`. Maybe, `medusa-db` is not a great name, so please send your suggestions.
2024-10-03 04:51:20 +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
Harminder Virk 48bea267dc chore: perform dependencies scan and fix all dependencies (#9296) 2024-09-26 14:14:38 +05:30
Harminder Virk 1d3a60023a fix: add missing dependency to utils package (#9297) 2024-09-25 08:18:13 +02:00
Harminder Virk 9e711720dd chore: upgrade moduleResolution to Node16 (#9269) 2024-09-24 17:19:20 +05:30
Harminder Virk 9f72fb5902 Chore: cleanup workflows SDK (#9244)
Fixes: FRMW-2712
2024-09-23 11:04:38 +00:00
Harminder VirkandAdrien de Peretti 97e003ef4f chore: Cleanup utils package (#9238)
Fixes: FRMW-2712

Old PR: https://github.com/medusajs/medusa/pull/9234 Closed because of incorrect branch naming

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-09-23 10:37:58 +00:00
Harminder Virk 812b80b6a3 fix: migrate old links tables before performing a sync (#9164) 2024-09-17 19:20:35 +05:30
Harminder Virk 261588f6b8 fix: import open telemetry dependencies lazily (#9161) 2024-09-17 16:28:28 +05:30
Harminder Virk a872c76b85 refactor: rename remoteQuery to query and db instrumentation flag (#9159) 2024-09-17 14:09:02 +05:30
Harminder Virk 653a4bff71 feat: add tracing to workflow steps (#9140) 2024-09-17 11:35:38 +05:30
Harminder Virk c97ea9546d feature: add tracing to remote query (#9128) 2024-09-13 14:09:59 +05:30
Harminder Virkandadrien2p 9cf0df53b5 feature: add telemetry to the HTTP layer (#9116)
---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
2024-09-13 12:36:54 +05:30
Harminder Virk 2b8e15d2ec feat: introduce a thin wrapper on top of OpenTelemetry (#9109) 2024-09-12 12:59:49 +05:30
Harminder Virk a944226025 fix: JSON stringify DML json property default value (#9074) 2024-09-10 15:58:42 +05:30
Harminder Virk 2020b35e52 breaking: turn off mikro orm casing change with DML properties (#9058) 2024-09-09 19:54:02 +05:30
Harminder Virk 32ebfa619f feature: introduce types for query.graph method (#9031) 2024-09-09 13:26:40 +05:30
Harminder Virk 3bb6ef3735 fix: move get-port to main dependencies list (#8938) 2024-09-02 18:37:54 +05:30
Harminder Virk 0ce584029c fix: handle case where product to be updated does not exist (#8897) 2024-09-02 16:23:31 +05:30
Harminder Virk 9b6c2e5efa fix: ignore metadata when computing relationships from payload (#8895) 2024-08-30 13:32:25 +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
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
Harminder Virk 7c2cfc132a feature: add db:create command (#8760) 2024-08-26 15:04:52 +05:30
Harminder Virk 9a508056f6 feat: add env editor utility to edit update .env files (#8741) 2024-08-25 19:31:56 +05:30
Harminder Virk 5f310c0a00 breaking: remove POSTGRES prefix env variables in favor of DATABASE prefix (#8672) 2024-08-20 17:05:19 +05:30
Harminder Virk 69830ca89c fix: maintain connections pool (#8670) 2024-08-20 14:54:52 +05:30
Harminder Virk 19d30df624 refactor: Run migrations and links sync after loading the app (#8582) 2024-08-14 14:09:24 +05:30
Harminder Virk 9cd66bc842 feature: share execution context with hook handlers (#8501) 2024-08-08 17:18:07 +05:30
Harminder Virk f831deaf74 cleanup: use WithAdditionalData helper everywhere (#8499) 2024-08-08 16:55:15 +05:30
Harminder Virk 08764e3965 feature: add workflows hooks to the order module (#8496) 2024-08-08 16:25:11 +05:30
Harminder Virk 7695d30952 feature: add create and update cart hooks (#8481) 2024-08-07 16:00:37 +05:30
Harminder Virk 8fb079786d feature: add hooks to campaigns (#8450) 2024-08-06 15:15:41 +05:30
Harminder Virk 0dab340013 feature: add hooks to customers modules workflows (#8442) 2024-08-05 15:16:32 +05:30
Harminder Virk 0706bab663 feature: introduce additional_data to the product endpoints (#8405) 2024-08-05 09:24:49 +05:30
Harminder Virk c2faca1e8b fix: pass updatedCollections to the hook and not the step (#8402) 2024-08-02 10:27:03 +05:30
Harminder Virk 6efdba1967 feat: add hooks to product module's workflows (#8389) 2024-08-01 22:02:07 +05:30
Harminder Virk 864bb0df05 breaking: implement workflow hooks (first iteration) (#8346) 2024-07-31 15:36:38 +05:30
Harminder Virk 7f4b085964 refactor: revert to using middlewares.ts file (#8280) 2024-07-25 17:16:38 +05:30
Harminder Virk 0bd46c97b7 breaking: remove loading middlewares file in favor of routes-config files (#8274) 2024-07-25 12:53:35 +05:30
Harminder Virk a356d12ac4 feat: add extend router helper (#8263) 2024-07-24 16:53:04 +05:30
Harminder Virk ca88f204d4 feat: Extending API routes validators (#8254) 2024-07-24 14:36:41 +05:30
Harminder VirkandAdrien de Peretti f579f0b3be feat: restructure events payload (#8143)
* refactor: restructure events payload

Breaking change: This PR changes the event payload accepted by the event
listeners

* refactor: fix failing tests and implement feedback

* add integration tests

* fix timeout

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2024-07-16 17:09:16 +01:00
Harminder Virk 5bb870948a fix: defineMikroOrmCliConfig helper to provide default db credentials (#8131) 2024-07-15 15:49:00 +05:30
Harminder Virk e489b0c037 fix: gracefully handle migrations that cannot be reverted (#8087) 2024-07-11 17:40:34 +05:30
Harminder Virk 45c573b03a Feat: Improvements to the migrations CLI and workflow (#8060) 2024-07-11 16:52:34 +05:30
Harminder Virk 9516890bb3 fix: attempt to fix flaky migration tests (#8034) 2024-07-09 17:13:45 +05:30
Harminder Virk 4b391fc3cf Initial implementation with just the generate method (#7973) 2024-07-09 12:32:02 +05:30
Harminder Virk cc3eb8698d fix: omit mikro orm entities values from the config (#7938) 2024-07-04 13:21:52 +05:30
Harminder Virk aa0390af4b Prettify DML properties when inferred (#7937) 2024-07-04 12:24:07 +05:30
Harminder Virk 46f15b4909 fix: inferring of relationship types (#7913)
FIXES: CORE-2448
2024-07-03 13:29:27 +05:30
Harminder Virk b3236ff31c Add support for native enums (#7903) 2024-07-02 15:22:09 +05:30
Harminder Virk 074e4a888e Mark keys as primary with explicit method call (#7900) 2024-07-02 13:27:21 +05:30
Harminder Virk d122b678a8 feat: initialize nullable properties with null value (#7795) 2024-06-21 16:41:26 +05:30
Harminder Virk 45ad70e96b Add support for pivot table and entity in manyToMany relationships (#7779) 2024-06-20 14:13:31 +05:30
Harminder Virk 2895ccfba8 Add support for id property type (#7775) 2024-06-19 17:59:03 +05:30
Harminder Virk fd87858bd9 Handle embedded pg schema name inside the table name when generating indexes (#7774) 2024-06-19 16:48:44 +05:30
Harminder Virk 0b623fa27a Allow entities to contain pg schema name in their name (#7773) 2024-06-19 14:39:33 +05:30
Harminder Virk 1451112f08 Add support for created and updated at timestamps (#7765) 2024-06-18 21:22:31 +05:30
Harminder Virk 8410592239 Rename schema to property (#7761) 2024-06-18 16:14:09 +05:30
Harminder Virk 4f7bbf1f29 feat: add support for indexes (#7756) 2024-06-18 13:41:16 +05:30
Harminder Virk 0886869148 feat: mark all DML entities as soft delete-able by default (#7744) 2024-06-17 16:16:56 +05:30
Harminder Virk 0b9a6d5a52 Identify the owner when both sides defines a many to many relationship (#7741) 2024-06-17 14:47:14 +05:30
Harminder Virk 2af3f9e954 Add support for cascades to DML (#7721) 2024-06-14 13:45:11 +05:30
Harminder Virk fbd8eef18b Overall revamp of relationships (#7690) 2024-06-13 11:19:53 +05:30
Harminder Virk 6d43daa930 Code cleanup and add support for default values and nullable relationships (#7687) 2024-06-12 14:39:03 +05:30
Harminder Virk 5f348d88f4 Initial implementation of DML to Mikro ORM entity generation (#7667)
* feat: initial implementation of DML to Mikro ORM entity generation

CORE-2279

* test: fix breaking tests

* refactor: cleanup code for defining properties and relationships

* feat: finish initial implementation of relationships
2024-06-11 21:00:36 +05:30
Harminder Virk 7f53fe06b6 Initial implementation of data types and base schema (#7644) 2024-06-10 14:31:42 +05:30
Harminder Virk 2b62686ec6 implement events to the pricing module (#7584) 2024-06-05 17:33:49 +05:30
Harminder Virk 8d9d78029b Remove redundant methods from pricing module (#7597) 2024-06-04 16:33:06 +05:30
Harminder Virk 11528526fa feat: loosely typed container 2024-05-31 15:22:03 +05:30
Harminder Virk a40b6aef6d Add defineConfig helper (#7517) 2024-05-29 17:10:15 +05:30
Harminder Virk 51ea166df2 chore: use yarn@3.2.1 in all the packages (#7514) 2024-05-29 09:00:40 +02:00
Harminder VirkandOli Juhl 82be054a1a chore: Rename config properties to camelCase (#7498)
* refactor: rename config types to camelCase

* refactor: update config references to use renamed options

* refactor: update more references

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-05-28 14:49:29 +02:00
Harminder Virk 6fa364d728 ci: remove unsupported scripts-prepend-node-path command (#7499) 2024-05-28 13:36:49 +02:00
Harminder Virk ef6d748784 feat: add Filesystem util and load env util (#7487) 2024-05-28 15:31:13 +05:30
Harminder Virk ba66ab8d56 Update teams.yml (#7451) 2024-05-24 20:37:13 +05:30
Harminder Virk d29d5436fb Update develop command to use JIT compiler (#7436) 2024-05-24 12:46:48 +05:30
Harminder Virk ada33e984d refactor: silently load ts-node (#7424) 2024-05-23 18:34:34 +05:30
Harminder Virk 66279f1691 Remove redundant bin option in the medusa package (#7418) 2024-05-23 16:56:54 +05:30
Harminder Virk 965a50d483 fix: Commands loading entrypoints (#7404)
* fix: enable worker mode when executing user and migrate commands

* refactor: do not enable worker mode for migrate command

* refactor: auto detect is application is using ts-node

* refactor: remove directories node from config

* style: update comments next to enabling worker mode
2024-05-22 19:31:13 +05:30
Harminder Virk ff5d573887 refactor: register plugin routes before the Medusa core routes (#7395) 2024-05-22 15:34:53 +05:30
Harminder Virk 3dbb256ddf load resources from starter kit and introduce srcDir configuration 2024-05-21 15:02:53 +05:30
Harminder Virk ff337498a0 Merge pull request #7348 from medusajs/fix/2152
Fix issue related to removing last product from the collection
2024-05-17 15:47:37 +05:30
Harminder Virk cf15f5d498 refactor: use flatMap 2024-05-17 15:31:50 +05:30
Harminder Virk 72718101c6 Merge branch 'develop' into fix/2152 2024-05-17 14:43:21 +05:30
Harminder Virk 72f98ea50b refactor: implement query suggestions from Adrien 2024-05-17 14:42:57 +05:30
Harminder Virk 9ff3b08b0b Merge branch 'develop' into fix/2152 2024-05-17 13:24:39 +05:30
Harminder Virk 1abf9f19b3 test: increase notification module tests timeout 2024-05-17 13:10:35 +05:30
Harminder Virk 9c97356098 Merge branch 'develop' into fix/2152 2024-05-17 09:54:37 +05:30
Harminder Virk a15f2b37b3 test: add tests 2024-05-17 09:33:34 +05:30
Harminder Virk 9298a57be1 Merge branch 'develop' into fix/2152 2024-05-16 17:28:54 +05:30
Harminder Virk 230337aef9 refactor: remove early return check when products list is undefined 2024-05-16 17:13:49 +05:30
Harminder Virk 17486cda99 Validate product and collection handles to be URL safe (#7310)
* fix: allow URL safe characters for product handle

Fixes: CORE-2072
2024-05-15 17:50:26 +02:00
Harminder Virk a502222582 refactor: remove usage of inventory_quantity from the codebase (#7323) 2024-05-14 13:01:49 +02:00