Skip to content

Commit

Permalink
feat: remove global module, add option instead (PL-000) (#12)
Browse files Browse the repository at this point in the history
* feat: remove global module, add option instead (PL-000)

* refactor: isGlobal true by default
  • Loading branch information
trs authored Dec 14, 2023
1 parent 76438ae commit 4dbddee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 11 additions & 1 deletion src/chargebee.module-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,14 @@ import { ChargebeeModuleOptions } from "./chargebee.interface";
export const {
ConfigurableModuleClass,
MODULE_OPTIONS_TOKEN: CHARGEBEE_MODULE_OPTIONS_TOKEN,
} = new ConfigurableModuleBuilder<ChargebeeModuleOptions>().build();
} = new ConfigurableModuleBuilder<ChargebeeModuleOptions>()
.setExtras(
{
isGlobal: true,
},
(definition, extras) => ({
...definition,
global: extras.isGlobal,
}),
)
.build();
3 changes: 1 addition & 2 deletions src/chargebee.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Global, Module } from "@nestjs/common";
import { Module } from "@nestjs/common";

import { ConfigurableModuleClass } from "./chargebee.module-definition";
import { ChargebeeService } from "./chargebee.service";

@Global()
@Module({
providers: [ChargebeeService],
exports: [ChargebeeService],
Expand Down

0 comments on commit 4dbddee

Please sign in to comment.