chore(modules-sdk): Custom Module definition (#7315)
This commit is contained in:
@@ -16,7 +16,6 @@ describe("module definitions loader", () => {
|
||||
registrationName: "testService",
|
||||
defaultPackage: "@medusajs/test-service",
|
||||
label: "TestService",
|
||||
isLegacy: true,
|
||||
isRequired: false,
|
||||
defaultModuleDeclaration: {
|
||||
scope: MODULE_SCOPE.INTERNAL,
|
||||
|
||||
@@ -55,6 +55,13 @@ async function loadModule(
|
||||
loaderOnly?: boolean
|
||||
): Promise<{ error?: Error } | void> {
|
||||
const modDefinition = resolution.definition
|
||||
|
||||
if (!modDefinition.key) {
|
||||
throw new Error(`Module definition is missing property "key"`)
|
||||
}
|
||||
|
||||
modDefinition.registrationName ??= modDefinition.key
|
||||
|
||||
const registrationName = modDefinition.registrationName
|
||||
|
||||
const { scope, resources } = resolution.moduleDeclaration ?? ({} as any)
|
||||
|
||||
Reference in New Issue
Block a user