Skip to content

Commit

Permalink
check definition
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-r-l-rodrigues committed May 13, 2024
1 parent 54f5f03 commit 93bdb4f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/medusa/src/loaders/medusa-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from "@medusajs/modules-sdk"
import {
CommonTypes,
InternalModuleDeclaration,
LoadedModule,
MedusaContainer,
ModuleDefinition,
Expand Down Expand Up @@ -39,15 +40,18 @@ export function mergeDefaultModules(
configModules[defaultModule.key] ??= defaultModule.defaultModuleDeclaration
}

for (const [key, value] of Object.entries(configModules)) {
for (const [key, value] of Object.entries(
configModules as Record<string, InternalModuleDeclaration>
)) {
const def = {} as ModuleDefinition
def.key ??= key
def.registrationName ??= key
def.label ??= upperCaseFirst(key)

if (isObject(value)) {
const orignalDef = value?.definition
if (isObject(orignalDef)) {
value.definition = {
...value.definition,
...orignalDef,
...def,
}
}
Expand Down

0 comments on commit 93bdb4f

Please sign in to comment.