-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Add MikroORM CLI wrapper to bypass hardcoded module system #9426
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested this, thanks man! 💪🏻
…edusajs#9426) FIXES: FRMW-2727 MikroORM (with version 5.9) has [hardcoded the TypeScript module](https:/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.
FIXES: FRMW-2727
MikroORM (with version 5.9) has hardcoded the TypeScript module system to
commonjs
, which makes it incompatible with the module system we are using, ieNode16
.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.
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.