* chore(): Move peer deps into a single package and re export from framework * WIP * update core packages * update cli and deps * update medusa * update exports path * remove analyze * update modules deps * finalise changes * fix yarn * fix import * Refactor peer dependencies into a single package Consolidate peer dependencies into one package and re-export from the framework. * update changeset * Update .changeset/brown-cows-sleep.md Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * rm deps * fix deps * increase timeout * upgrade version * update versions * update versions * fixes * update lock * fix missing import * fix missing import --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
36 lines
902 B
TypeScript
36 lines
902 B
TypeScript
import {
|
|
InternalModuleDeclaration,
|
|
LoaderOptions,
|
|
ModuleServiceInitializeCustomDataLayerOptions,
|
|
ModuleServiceInitializeOptions,
|
|
} from "@medusajs/framework/types"
|
|
import { ModulesSdkUtils } from "@medusajs/framework/utils"
|
|
|
|
import { EntitySchema } from "@medusajs/framework/mikro-orm/core"
|
|
|
|
export function connectionLoader(entity: EntitySchema) {
|
|
return async (
|
|
{
|
|
options,
|
|
container,
|
|
logger,
|
|
}: LoaderOptions<
|
|
| ModuleServiceInitializeOptions
|
|
| ModuleServiceInitializeCustomDataLayerOptions
|
|
>,
|
|
moduleDeclaration?: InternalModuleDeclaration
|
|
): Promise<void> => {
|
|
const pathToMigrations = __dirname + "/../migrations"
|
|
|
|
await ModulesSdkUtils.mikroOrmConnectionLoader({
|
|
moduleName: "link_module",
|
|
entities: [entity],
|
|
container,
|
|
options,
|
|
moduleDeclaration,
|
|
logger,
|
|
pathToMigrations,
|
|
})
|
|
}
|
|
}
|