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:
Carlos R. L. Rodrigues
2024-02-04 14:26:34 +00:00
committed by GitHub
parent 58baead34e
commit 96ba49329b
13 changed files with 14 additions and 35 deletions
+2 -9
View File
@@ -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