fix: load custom modules by path (#6312)
What:
medusa-config.js loading custom modules by their path.
```typescript
{
modules: {
internalModule: {
scope: MODULE_SCOPE.INTERNAL,
resources: MODULE_RESOURCE_TYPE.SHARED,
resolve: "./internal_module",
definition: {
key: "internalModule",
registrationName: "internalModule",
},
},
}
}
```
This commit is contained in:
@@ -36,7 +36,7 @@ export type InternalModuleDeclaration = {
|
||||
scope: MODULE_SCOPE.INTERNAL
|
||||
resources: MODULE_RESOURCE_TYPE
|
||||
dependencies?: string[]
|
||||
definition?: ModuleDefinition // That represent the definition of the module, such as the one we have for the medusa supported modules. This property is used for custom made modules.
|
||||
definition?: Partial<ModuleDefinition> // That represent the definition of the module, such as the one we have for the medusa supported modules. This property is used for custom made modules.
|
||||
resolve?: string | ModuleExports
|
||||
options?: Record<string, unknown>
|
||||
/**
|
||||
@@ -51,7 +51,7 @@ export type InternalModuleDeclaration = {
|
||||
|
||||
export type ExternalModuleDeclaration = {
|
||||
scope: MODULE_SCOPE.EXTERNAL
|
||||
definition?: ModuleDefinition // That represent the definition of the module, such as the one we have for the medusa supported modules. This property is used for custom made modules.
|
||||
definition?: Partial<ModuleDefinition> // That represent the definition of the module, such as the one we have for the medusa supported modules. This property is used for custom made modules.
|
||||
server?: {
|
||||
type: "http"
|
||||
url: string
|
||||
@@ -82,13 +82,6 @@ export type ModuleDefinition = {
|
||||
registrationName: string
|
||||
defaultPackage: string | false
|
||||
label: string
|
||||
/**
|
||||
* @deprecated property will be removed in future versions
|
||||
*/
|
||||
canOverride?: boolean
|
||||
/**
|
||||
* @deprecated property will be removed in future versions
|
||||
*/
|
||||
isRequired?: boolean
|
||||
isQueryable?: boolean // If the module is queryable via Remote Joiner
|
||||
isLegacy?: boolean // If the module is a legacy module TODO: Remove once all the legacy modules are migrated
|
||||
|
||||
Reference in New Issue
Block a user