chore(): Reorganize modules (#7210)
**What** Move all modules to the modules directory
This commit is contained in:
committed by
GitHub
parent
7a351eef09
commit
4eae25e1ef
23
packages/modules/cache-redis/src/initialize/index.ts
Normal file
23
packages/modules/cache-redis/src/initialize/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import {
|
||||
ExternalModuleDeclaration,
|
||||
InternalModuleDeclaration,
|
||||
MedusaModule,
|
||||
Modules,
|
||||
} from "@medusajs/modules-sdk"
|
||||
import { ICacheService } from "@medusajs/types"
|
||||
import { RedisCacheModuleOptions } from "../types"
|
||||
|
||||
export const initialize = async (
|
||||
options?: RedisCacheModuleOptions | ExternalModuleDeclaration
|
||||
): Promise<ICacheService> => {
|
||||
const serviceKey = Modules.CACHE
|
||||
const loaded = await MedusaModule.bootstrap<ICacheService>({
|
||||
moduleKey: serviceKey,
|
||||
defaultPath: "@medusajs/cache-redis",
|
||||
declaration: options as
|
||||
| InternalModuleDeclaration
|
||||
| ExternalModuleDeclaration,
|
||||
})
|
||||
|
||||
return loaded[serviceKey]
|
||||
}
|
||||
Reference in New Issue
Block a user