diff --git a/.changeset/great-lies-decide.md b/.changeset/great-lies-decide.md new file mode 100644 index 0000000000..0ef9a5abff --- /dev/null +++ b/.changeset/great-lies-decide.md @@ -0,0 +1,14 @@ +--- +"@medusajs/analytics": patch +"@medusajs/auth": patch +"@medusajs/cache-redis": patch +"@medusajs/caching": patch +"@medusajs/event-bus-redis": patch +"@medusajs/file": patch +"@medusajs/locking": patch +"@medusajs/notification": patch +"@medusajs/payment": patch +"@medusajs/workflow-engine-redis": patch +--- + +feat(): Add modules options autocomplete to medusa config diff --git a/packages/modules/analytics/src/index.ts b/packages/modules/analytics/src/index.ts index f14a4ab313..d5380ece54 100644 --- a/packages/modules/analytics/src/index.ts +++ b/packages/modules/analytics/src/index.ts @@ -1,3 +1,4 @@ +import "./types" import { Module, Modules } from "@medusajs/framework/utils" import AnalyticsService from "./services/analytics-service" import loadProviders from "./loaders/providers" diff --git a/packages/modules/analytics/src/types/index.ts b/packages/modules/analytics/src/types/index.ts index 514684a9dc..15b936cd83 100644 --- a/packages/modules/analytics/src/types/index.ts +++ b/packages/modules/analytics/src/types/index.ts @@ -22,3 +22,10 @@ export type AnalyticsModuleOptions = Partial & { options?: Record }[] } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/analytics": AnalyticsModuleOptions + "@medusajs/medusa/analytics": AnalyticsModuleOptions + } +} diff --git a/packages/modules/auth/src/index.ts b/packages/modules/auth/src/index.ts index 6ce752fdea..f237837277 100644 --- a/packages/modules/auth/src/index.ts +++ b/packages/modules/auth/src/index.ts @@ -1,3 +1,4 @@ +import "./types" import { AuthModuleService } from "@services" import loadProviders from "./loaders/providers" import { Module, Modules } from "@medusajs/framework/utils" diff --git a/packages/modules/auth/src/types/index.ts b/packages/modules/auth/src/types/index.ts index b049b3334d..55cbd95fcb 100644 --- a/packages/modules/auth/src/types/index.ts +++ b/packages/modules/auth/src/types/index.ts @@ -46,3 +46,10 @@ export interface MedusaCloudAuthProviderOptions { callback_url: string disabled: boolean } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/auth": AuthModuleOptions + "@medusajs/medusa/auth": AuthModuleOptions + } +} diff --git a/packages/modules/cache-inmemory/src/types/index.ts b/packages/modules/cache-inmemory/src/types/index.ts index 1a06bcf52b..0c56fee40b 100644 --- a/packages/modules/cache-inmemory/src/types/index.ts +++ b/packages/modules/cache-inmemory/src/types/index.ts @@ -15,3 +15,10 @@ export type InMemoryCacheModuleOptions = { */ ttl?: number } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/cache-inmemory": InMemoryCacheModuleOptions + "@medusajs/medusa/cache-inmemory": InMemoryCacheModuleOptions + } +} diff --git a/packages/modules/cache-redis/src/types/index.ts b/packages/modules/cache-redis/src/types/index.ts index 16662bd692..834153b109 100644 --- a/packages/modules/cache-redis/src/types/index.ts +++ b/packages/modules/cache-redis/src/types/index.ts @@ -25,3 +25,10 @@ export type RedisCacheModuleOptions = { */ namespace?: string } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/cache-redis": RedisCacheModuleOptions + "@medusajs/medusa/cache-redis": RedisCacheModuleOptions + } +} diff --git a/packages/modules/caching/src/index.ts b/packages/modules/caching/src/index.ts index 95d8045a12..2235a0698e 100644 --- a/packages/modules/caching/src/index.ts +++ b/packages/modules/caching/src/index.ts @@ -1,3 +1,4 @@ +import "./types" import { Module, Modules } from "@medusajs/framework/utils" import { default as loadHash } from "./loaders/hash" import { default as loadProviders } from "./loaders/providers" diff --git a/packages/modules/caching/src/types/index.ts b/packages/modules/caching/src/types/index.ts index 99ba914ce0..cffdc0cff3 100644 --- a/packages/modules/caching/src/types/index.ts +++ b/packages/modules/caching/src/types/index.ts @@ -88,3 +88,10 @@ export type CachingModuleOptions = Partial & { options?: Record }[] } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/caching": CachingModuleOptions + "@medusajs/medusa/caching": CachingModuleOptions + } +} diff --git a/packages/modules/event-bus-redis/src/types/index.ts b/packages/modules/event-bus-redis/src/types/index.ts index 5c918fd1bf..80a4d92200 100644 --- a/packages/modules/event-bus-redis/src/types/index.ts +++ b/packages/modules/event-bus-redis/src/types/index.ts @@ -69,3 +69,10 @@ export type EventBusRedisModuleOptions = { */ jobOptions?: EmitOptions } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/event-bus-redis": EventBusRedisModuleOptions + "@medusajs/medusa/event-bus-redis": EventBusRedisModuleOptions + } +} diff --git a/packages/modules/file/src/index.ts b/packages/modules/file/src/index.ts index a826355cce..e929dcae1a 100644 --- a/packages/modules/file/src/index.ts +++ b/packages/modules/file/src/index.ts @@ -1,3 +1,4 @@ +import "./types" import { FileModuleService } from "@services" import loadProviders from "./loaders/providers" import { Module, Modules } from "@medusajs/framework/utils" diff --git a/packages/modules/file/src/types/index.ts b/packages/modules/file/src/types/index.ts index 8d9ef992ef..9eb144f3e0 100644 --- a/packages/modules/file/src/types/index.ts +++ b/packages/modules/file/src/types/index.ts @@ -27,3 +27,10 @@ export type FileModuleOptions = Partial & { options?: Record } } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/file": FileModuleOptions + "@medusajs/medusa/file": FileModuleOptions + } +} diff --git a/packages/modules/fulfillment/src/index.ts b/packages/modules/fulfillment/src/index.ts index 83803a5c5d..853cd990ad 100644 --- a/packages/modules/fulfillment/src/index.ts +++ b/packages/modules/fulfillment/src/index.ts @@ -1,3 +1,4 @@ +import "./types" import { FulfillmentModuleService } from "@services" import loadProviders from "./loaders/providers" import { Module, Modules } from "@medusajs/framework/utils" diff --git a/packages/modules/fulfillment/src/types/index.ts b/packages/modules/fulfillment/src/types/index.ts index 106e08ecc2..7700883961 100644 --- a/packages/modules/fulfillment/src/types/index.ts +++ b/packages/modules/fulfillment/src/types/index.ts @@ -33,3 +33,10 @@ export type FulfillmentModuleOptions = options?: Record }[] } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/fulfillment": FulfillmentModuleOptions + "@medusajs/medusa/fulfillment": FulfillmentModuleOptions + } +} diff --git a/packages/modules/locking/src/index.ts b/packages/modules/locking/src/index.ts index 86a0ba40fe..f67fc5afd8 100644 --- a/packages/modules/locking/src/index.ts +++ b/packages/modules/locking/src/index.ts @@ -1,3 +1,4 @@ +import "./types" import { Module, Modules } from "@medusajs/framework/utils" import { default as loadProviders } from "./loaders/providers" import LockingModuleService from "./services/locking-module" diff --git a/packages/modules/locking/src/types/index.ts b/packages/modules/locking/src/types/index.ts index 9b66511bba..8af47be033 100644 --- a/packages/modules/locking/src/types/index.ts +++ b/packages/modules/locking/src/types/index.ts @@ -31,3 +31,10 @@ export type LockingModuleOptions = Partial & { options?: Record }[] } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/locking": LockingModuleOptions + "@medusajs/medusa/locking": LockingModuleOptions + } +} diff --git a/packages/modules/notification/src/index.ts b/packages/modules/notification/src/index.ts index 1808b7064c..dcc0f1fb51 100644 --- a/packages/modules/notification/src/index.ts +++ b/packages/modules/notification/src/index.ts @@ -1,3 +1,4 @@ +import "./types" import { NotificationModuleService } from "@services" import loadProviders from "./loaders/providers" import { Module, Modules } from "@medusajs/framework/utils" diff --git a/packages/modules/notification/src/types/index.ts b/packages/modules/notification/src/types/index.ts index a527e3b1d1..26ff2e9eb4 100644 --- a/packages/modules/notification/src/types/index.ts +++ b/packages/modules/notification/src/types/index.ts @@ -45,3 +45,10 @@ export type MedusaCloudEmailOptions = { environment_handle?: string sandbox_handle?: string } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/notification": NotificationModuleOptions + "@medusajs/medusa/notification": NotificationModuleOptions + } +} diff --git a/packages/modules/payment/src/index.ts b/packages/modules/payment/src/index.ts index 19710fc9fc..1d2ac29a64 100644 --- a/packages/modules/payment/src/index.ts +++ b/packages/modules/payment/src/index.ts @@ -1,3 +1,4 @@ +import "./types" import { PaymentModuleService } from "@services" import loadProviders from "./loaders/providers" import { Module, Modules } from "@medusajs/framework/utils" diff --git a/packages/modules/payment/src/types/index.ts b/packages/modules/payment/src/types/index.ts index f19bd65ca7..3e57add3f3 100644 --- a/packages/modules/payment/src/types/index.ts +++ b/packages/modules/payment/src/types/index.ts @@ -27,3 +27,10 @@ export type PaymentModuleOptions = Partial & { options?: Record }[] } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/payment": PaymentModuleOptions + "@medusajs/medusa/payment": PaymentModuleOptions + } +} diff --git a/packages/modules/workflow-engine-redis/src/index.ts b/packages/modules/workflow-engine-redis/src/index.ts index 62a98e03f7..db73c9c1c4 100644 --- a/packages/modules/workflow-engine-redis/src/index.ts +++ b/packages/modules/workflow-engine-redis/src/index.ts @@ -1,3 +1,4 @@ +import "./types" import { Module, Modules } from "@medusajs/framework/utils" import { WorkflowsModuleService } from "@services" import { loadUtils, redisConnection } from "./loaders" diff --git a/packages/modules/workflow-engine-redis/src/types/index.ts b/packages/modules/workflow-engine-redis/src/types/index.ts index c22653472e..1c14f12cbd 100644 --- a/packages/modules/workflow-engine-redis/src/types/index.ts +++ b/packages/modules/workflow-engine-redis/src/types/index.ts @@ -177,3 +177,10 @@ export type RedisWorkflowsOptions = { options?: RedisOptions } } + +declare module "@medusajs/types" { + interface ModuleOptions { + "@medusajs/workflow-engine-redis": RedisWorkflowsOptions + "@medusajs/medusa/workflow-engine-redis": RedisWorkflowsOptions + } +}