chore(framework): Continue to move loaders to framework (#8258)
**What** More move and cleanup FIXES FRMW-2603 FIXES FRMW-2608 FIXES FRMW-2610 FIXES FRMW-2611 Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
co-authored by
Oli Juhl
parent
a2a377c8ca
commit
bcd9d9c2b1
@@ -1,5 +1,5 @@
|
||||
import { ApiKeyDTO, CreateApiKeyDTO } from "@medusajs/types"
|
||||
import { WorkflowData, createWorkflow } from "@medusajs/workflows-sdk"
|
||||
import { createWorkflow, WorkflowData } from "@medusajs/workflows-sdk"
|
||||
import { createApiKeysStep } from "../steps"
|
||||
|
||||
type WorkflowInput = { api_keys: CreateApiKeyDTO[] }
|
||||
|
||||
@@ -24,14 +24,15 @@
|
||||
"author": "Medusa",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@medusajs/framework": "^0.0.1",
|
||||
"@medusajs/types": "^1.11.16",
|
||||
"@medusajs/utils": "^1.11.9",
|
||||
"cross-env": "^5.2.1",
|
||||
"jest": "^29.7.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^5.1.6"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@medusajs/framework": "workspace:^",
|
||||
"@medusajs/medusa": ">1.19",
|
||||
"@medusajs/modules-sdk": "^1.12.10",
|
||||
"axios": "^0.28.0",
|
||||
@@ -40,9 +41,6 @@
|
||||
"pg-god": "^1.0.12"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@medusajs/framework": {
|
||||
"optional": true
|
||||
},
|
||||
"@medusajs/medusa": {
|
||||
"optional": true
|
||||
},
|
||||
|
||||
@@ -4,8 +4,6 @@ export async function configLoaderOverride(
|
||||
entryDirectory: string,
|
||||
override: { clientUrl: string; debug?: boolean }
|
||||
) {
|
||||
// in case it is not install as it is optional and required only when using this util
|
||||
// @ts-ignore
|
||||
const { configManager } = await import("@medusajs/framework/config")
|
||||
const { configModule, error } = getConfigFile<
|
||||
ReturnType<typeof configManager.loadConfig>
|
||||
@@ -27,5 +25,8 @@ export async function configLoaderOverride(
|
||||
idle_in_transaction_session_timeout: 20000,
|
||||
}
|
||||
|
||||
configManager.loadConfig(configModule)
|
||||
configManager.loadConfig({
|
||||
projectConfig: configModule,
|
||||
baseDir: entryDirectory,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
createMedusaContainer,
|
||||
isObject,
|
||||
} from "@medusajs/utils"
|
||||
import { ContainerRegistrationKeys, isObject } from "@medusajs/utils"
|
||||
import { asValue } from "awilix"
|
||||
|
||||
export async function initDb({ env = {} }: { env?: Record<any, any> }) {
|
||||
@@ -10,18 +6,12 @@ export async function initDb({ env = {} }: { env?: Record<any, any> }) {
|
||||
Object.entries(env).forEach(([k, v]) => (process.env[k] = v))
|
||||
}
|
||||
|
||||
const container = createMedusaContainer()
|
||||
|
||||
// in case it is not install as it is optional and required only when using this util
|
||||
// @ts-ignore
|
||||
const { configManager } = await import("@medusajs/framework/config")
|
||||
const { configManager, pgConnectionLoader, container } = await import(
|
||||
"@medusajs/framework"
|
||||
)
|
||||
const configModule = configManager.config
|
||||
|
||||
const pgConnection =
|
||||
await require("@medusajs/medusa/dist/loaders/pg-connection").default({
|
||||
configModule,
|
||||
container,
|
||||
})
|
||||
const pgConnection = pgConnectionLoader()
|
||||
|
||||
const featureFlagRouter =
|
||||
require("@medusajs/medusa/dist/loaders/feature-flags").default(configModule)
|
||||
|
||||
Reference in New Issue
Block a user