Commit 96cc77e7 authored by nanahira's avatar nanahira

fix inject

parent f4e04082
Pipeline #6054 passed with stages
in 35 seconds
{ {
"name": "koishi-nestjs", "name": "koishi-nestjs",
"version": "1.0.6", "version": "1.0.7",
"description": "Koishi.js as Nest.js Module", "description": "Koishi.js as Nest.js Module",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
......
...@@ -17,31 +17,35 @@ import { ...@@ -17,31 +17,35 @@ import {
KOISHI_CONTEXT_PRIVATE, KOISHI_CONTEXT_PRIVATE,
KOISHI_MODULE_OPTIONS, KOISHI_MODULE_OPTIONS,
} from './koishi.constants'; } from './koishi.constants';
const koishiContextProviderAny: Provider = {
const koishiContextProvider: Provider = {
provide: KOISHI_CONTEXT, provide: KOISHI_CONTEXT,
inject: [KoishiService],
useFactory: (koishiApp: KoishiService) => koishiApp.any(), useFactory: (koishiApp: KoishiService) => koishiApp.any(),
}; };
const koishiContextProviderChannel: Provider = { const koishiContextProviderChannel: Provider = {
provide: KOISHI_CONTEXT_CHANNEL, provide: KOISHI_CONTEXT_CHANNEL,
inject: [KoishiService],
useFactory: (koishiApp: KoishiService) => koishiApp.channel(), useFactory: (koishiApp: KoishiService) => koishiApp.channel(),
}; };
const koishiContextProviderPrivate: Provider = { const koishiContextProviderPrivate: Provider = {
provide: KOISHI_CONTEXT_PRIVATE, provide: KOISHI_CONTEXT_PRIVATE,
inject: [KoishiService],
useFactory: (koishiApp: KoishiService) => koishiApp.private(), useFactory: (koishiApp: KoishiService) => koishiApp.private(),
}; };
@Module({ @Module({
providers: [ providers: [
KoishiService, KoishiService,
koishiContextProviderAny, koishiContextProvider,
koishiContextProviderChannel, koishiContextProviderChannel,
koishiContextProviderPrivate, koishiContextProviderPrivate,
], ],
exports: [ exports: [
KoishiService, KoishiService,
koishiContextProviderAny, koishiContextProvider,
koishiContextProviderChannel, koishiContextProviderChannel,
koishiContextProviderPrivate, koishiContextProviderPrivate,
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment