fix(utils): Reversed module package missing references (#9589)

**What**
When resolving the modules through an array, if the module does not have a joiner config to rely on (not `queryable`, not using the `Module` util), then the key should be provided to register the module in the container. Eventually, the module author should provide that key to be used.

The only exception is for the medusa modules where we have a map that allows us to resolve that key automatically from the path of the resolve value
This commit is contained in:
Adrien de Peretti
2024-10-15 17:28:45 +02:00
committed by GitHub
parent e9383f25e0
commit e77a2ff032

View File

@@ -63,6 +63,13 @@ export const REVERSED_MODULE_PACKAGE_NAMES = Object.entries(
return acc
}, {})
// TODO: temporary fix until the event bus, cache and workflow engine are migrated to use providers and therefore only a single resolution will be good
REVERSED_MODULE_PACKAGE_NAMES["@medusajs/medusa/event-bus-redis"] =
Modules.EVENT_BUS
REVERSED_MODULE_PACKAGE_NAMES["@medusajs/medusa/cache-redis"] = Modules.CACHE
REVERSED_MODULE_PACKAGE_NAMES["@medusajs/medusa/workflow-engine-redis"] =
Modules.WORKFLOW_ENGINE
/**
* Making modules be referenced as a type as well.
*/