Feat(medusa): implement feature flags (#1768)
* feat: add feature flag loading in projects * fix: make feature flag consume itself * fix: rename container registration to featureFlagRouter * fix: refactor * behavioral feature flags * add environment to server * limit "useTemplateDb" to non feature flagged migrations * filter migrations and entities according to those which are enabled in the environment * run only migrations that are enabled when running 'medusa migrations run' * add logging to the featureflag loader * initial implementation of featureFlagEntity * column descriptors * initial startServerWithEnv (to be refactored) * update commands * final touches * update loaders to fix unit tests * enable all batch job tests * update seed method * add api test capabilities * revert batch job test * revert formatting changes * pr feedback * pr feedback * remove unused imports * rename feature flag decorators * pr feedback Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
This commit is contained in:
1 parent
f0704a7e17
commit
41681b45b1
19 files changed
+527
-58
No files matched your search
@@ -0,0 +1,28 @@
|
||||
const setupServer = require("./setup-server")
|
||||
const { initDb } = require("./use-db")
|
||||
|
||||
const startServerWithEnvironment = async ({ cwd, verbose, env }) => {
|
||||
if (env) {
|
||||
Object.entries(env).forEach(([key, value]) => {
|
||||
process.env[key] = value
|
||||
})
|
||||
}
|
||||
|
||||
const dbConnection = await initDb({
|
||||
cwd,
|
||||
})
|
||||
|
||||
Object.entries(env).forEach(([key, value]) => {
|
||||
delete process.env[key]
|
||||
})
|
||||
|
||||
const medusaProcess = await setupServer({
|
||||
cwd,
|
||||
verbose,
|
||||
env,
|
||||
})
|
||||
|
||||
return [medusaProcess, dbConnection]
|
||||
}
|
||||
|
||||
export default startServerWithEnvironment
|
||||
Reference in new issue
Block a user