Skip to content

Commit

Permalink
Merge pull request #122 from conceptadev/feature/remove-default-modul…
Browse files Browse the repository at this point in the history
…e-defs

feat: remove default module defs
  • Loading branch information
MrMaz authored Sep 22, 2023
2 parents 19c4b23 + 3316676 commit dce0098
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 87 deletions.
2 changes: 1 addition & 1 deletion packages/nestjs-auth-github/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './auth-github.module';
export * from './auth-github.controller';
export * from './dto/auth-github-login.dto'
export * from './dto/auth-github-login.dto';
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export function createAuthenticationProviders(options: {
}): Provider[] {
return [
...(options.providers ?? []),
JwtIssueService,
JwtVerifyService,
createAuthenticationOptionsProvider(options.overrides),
createAuthenticationVerifyTokenServiceProvider(options.overrides),
createAuthenticationIssueTokenServiceProvider(options.overrides),
Expand Down
10 changes: 1 addition & 9 deletions packages/nestjs-authentication/src/authentication.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { DynamicModule, Module } from '@nestjs/common';

import { JwtIssueService, JwtVerifyService } from '@concepta/nestjs-jwt';

import {
AuthenticationAsyncOptions,
AuthenticationModuleClass,
Expand All @@ -11,16 +9,10 @@ import {
createAuthenticationExports,
} from './authentication.module-definition';

import { IssueTokenService } from './services/issue-token.service';
import { VerifyTokenService } from './services/verify-token.service';

/**
* Authentication module
*/
@Module({
providers: [JwtIssueService, JwtVerifyService],
exports: [IssueTokenService, VerifyTokenService],
})
@Module({})
export class AuthenticationModule extends AuthenticationModuleClass {
static register(options: AuthenticationOptions): DynamicModule {
return super.register(options);
Expand Down
9 changes: 2 additions & 7 deletions packages/nestjs-email/src/email.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DynamicModule, Logger, Module } from '@nestjs/common';
import { DynamicModule, Module } from '@nestjs/common';

import {
EmailAsyncOptions,
Expand All @@ -9,15 +9,10 @@ import {
createEmailExports,
} from './email.module-definition';

import { EmailService } from './email.service';

/**
* Email module
*/
@Module({
providers: [Logger, EmailService],
exports: [EmailService],
})
@Module({})
export class EmailModule extends EmailModuleClass {
static register(options: EmailOptions): DynamicModule {
return super.register(options);
Expand Down
9 changes: 2 additions & 7 deletions packages/nestjs-event/src/event.module.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import { DynamicModule, Logger, Module } from '@nestjs/common';
import { DynamicModule, Module } from '@nestjs/common';

import {
EventAsyncOptions,
EventModuleClass,
EventOptions,
} from './event.module-definition';
import { EventDispatchService } from './services/event-dispatch.service';
import { EventListenService } from './services/event-listen.service';

/**
* Event module
*/
@Module({
providers: [Logger, EventListenService, EventDispatchService],
exports: [EventListenService, EventDispatchService],
})
@Module({})
export class EventModule extends EventModuleClass {
static forRoot(options: EventOptions): DynamicModule {
return super.forRoot({ ...options, global: true });
Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs-federated/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export { FederatedUserMutateServiceInterface } from './interfaces/federated-user

export { FederatedDto } from './dto/federated.dto';
export { FederatedCreateDto } from './dto/federated-create.dto';
export { FederatedUpdateDto } from './dto/federated-update.dto';
export { FederatedUpdateDto } from './dto/federated-update.dto';
14 changes: 1 addition & 13 deletions packages/nestjs-logger/src/logger.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import {
createLoggerExports,
} from './logger.module-definition';

import { LoggerService } from './logger.service';
import { LoggerTransportService } from './logger-transport.service';
import { LoggerExceptionFilter } from './logger-exception.filter';
import { LoggerRequestInterceptor } from './logger-request.interceptor';

/**
* Logger Module imports all configuration needed for logger and sentry
* With classes for request interceptor and Exceptions filters
Expand Down Expand Up @@ -60,14 +55,7 @@ import { LoggerRequestInterceptor } from './logger-request.interceptor';
* }
* ```
*/
@Module({
providers: [
LoggerTransportService,
LoggerRequestInterceptor,
LoggerExceptionFilter,
],
exports: [LoggerService],
})
@Module({})
export class LoggerModule extends LoggerModuleClass {
static register(options: LoggerOptions): DynamicModule {
return super.register(options);
Expand Down
10 changes: 1 addition & 9 deletions packages/nestjs-org/src/org.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { DynamicModule, Module } from '@nestjs/common';
import { OrgController } from './org.controller';
import { OrgLookupService } from './services/org-lookup.service';
import { OrgCrudService } from './services/org-crud.service';
import { OrgMutateService } from './services/org-mutate.service';
import {
OrgAsyncOptions,
OrgModuleClass,
Expand All @@ -16,11 +12,7 @@ import {
/**
* Org Module
*/
@Module({
providers: [OrgLookupService, OrgMutateService, OrgCrudService],
exports: [OrgLookupService, OrgMutateService, OrgCrudService],
controllers: [OrgController],
})
@Module({})
export class OrgModule extends OrgModuleClass {
static register(options: OrgOptions): DynamicModule {
return super.register(options);
Expand Down
6 changes: 1 addition & 5 deletions packages/nestjs-otp/src/otp.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DynamicModule, Module } from '@nestjs/common';

import { OtpService } from './services/otp.service';
import {
OtpAsyncOptions,
OtpModuleClass,
Expand All @@ -13,10 +12,7 @@ import {
/**
* Otp Module
*/
@Module({
providers: [OtpService],
exports: [OtpService],
})
@Module({})
export class OtpModule extends OtpModuleClass {
static register(options: OtpOptions): DynamicModule {
return super.register(options);
Expand Down
17 changes: 1 addition & 16 deletions packages/nestjs-password/src/password.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,7 @@ import {
createPasswordExports,
} from './password.module-definition';

import { PasswordCreationService } from './services/password-creation.service';
import { PasswordStorageService } from './services/password-storage.service';
import { PasswordStrengthService } from './services/password-strength.service';

@Module({
providers: [
PasswordCreationService,
PasswordStrengthService,
PasswordStorageService,
],
exports: [
PasswordCreationService,
PasswordStrengthService,
PasswordStorageService,
],
})
@Module({})
export class PasswordModule extends PasswordModuleClass {
static register(options: PasswordOptions): DynamicModule {
return super.register(options);
Expand Down
2 changes: 0 additions & 2 deletions packages/nestjs-role/src/role.module-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ export function createRoleProviders(
entities: options.overrides?.entities ?? options.entities,
}),
RoleService,
RoleLookupService,
RoleMutateService,
RoleCrudService,
];
}
Expand Down
18 changes: 1 addition & 17 deletions packages/nestjs-role/src/role.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,10 @@ import {
createRoleControllers,
} from './role.module-definition';

import { RoleService } from './services/role.service';
import { RoleCrudService } from './services/role-crud.service';
import { RoleLookupService } from './services/role-lookup.service';
import { RoleMutateService } from './services/role-mutate.service';
import { RoleController } from './role.controller';
import { RoleAssignmentController } from './role-assignment.controller';

/**
* Role Module
*/
@Module({
providers: [
RoleService,
RoleLookupService,
RoleMutateService,
RoleCrudService,
],
exports: [RoleService, RoleLookupService, RoleMutateService, RoleCrudService],
controllers: [RoleController, RoleAssignmentController],
})
@Module({})
export class RoleModule extends RoleModuleClass {
static register(options: RoleOptions): DynamicModule {
return super.register(options);
Expand Down

0 comments on commit dce0098

Please sign in to comment.