From e77a2ff0323fd1d04a9a6bb2e45ac98ac8e9d7d3 Mon Sep 17 00:00:00 2001 From: Adrien de Peretti Date: Tue, 15 Oct 2024 17:28:45 +0200 Subject: [PATCH] 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 --- packages/core/utils/src/modules-sdk/definition.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/core/utils/src/modules-sdk/definition.ts b/packages/core/utils/src/modules-sdk/definition.ts index 25ff88a363..7582f00f45 100644 --- a/packages/core/utils/src/modules-sdk/definition.ts +++ b/packages/core/utils/src/modules-sdk/definition.ts @@ -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. */