feat(workflows,medusa,utils): add medusa v2 feature flag (#5603)
* chore: add medusa v2 feature flag * chore: cleanup more FF * chore: cleanup workflows FF * chore: add comments on broken specs * chore: added check for package registration * chore: reenable workflows FF for create order workflow * chore: disable FF on test cli db * chore: hide loader validation behind FF * chore: use medusa v2 enabled * chore: register feature flag router in use-db * chore: change to minro
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
import { FlagRouter, MedusaError, promiseAll } from "@medusajs/utils"
|
||||
import { IPricingModuleService, MedusaContainer } from "@medusajs/types"
|
||||
import {
|
||||
FlagRouter,
|
||||
MedusaError,
|
||||
MedusaV2Flag,
|
||||
promiseAll,
|
||||
} from "@medusajs/utils"
|
||||
import dotenv from "dotenv"
|
||||
import express from "express"
|
||||
import { EntityManager } from "typeorm"
|
||||
import IsolatePricingDomainFeatureFlag from "../loaders/feature-flags/isolate-pricing-domain"
|
||||
import { Modules } from "@medusajs/modules-sdk"
|
||||
import loaders from "../loaders"
|
||||
import loadMedusaApp from "../loaders/medusa-app"
|
||||
import { ProductVariant } from "../models"
|
||||
import { ProductVariantService } from "../services"
|
||||
import { createDefaultRuleTypes } from "./create-default-rule-types"
|
||||
import dotenv from "dotenv"
|
||||
import express from "express"
|
||||
import loadMedusaApp from "../loaders/medusa-app"
|
||||
import loaders from "../loaders"
|
||||
|
||||
dotenv.config()
|
||||
|
||||
@@ -93,10 +96,7 @@ const migrate = async function ({ directory }) {
|
||||
"featureFlagRouter"
|
||||
)
|
||||
|
||||
if (
|
||||
!featureFlagRouter.isFeatureEnabled(IsolatePricingDomainFeatureFlag.key) &&
|
||||
!featureFlagRouter.isFeatureEnabled(Modules.PRICING)
|
||||
) {
|
||||
if (!featureFlagRouter.isFeatureEnabled(MedusaV2Flag.key)) {
|
||||
throw new MedusaError(
|
||||
MedusaError.Types.NOT_ALLOWED,
|
||||
"Pricing module not enabled"
|
||||
|
||||
Reference in New Issue
Block a user