From f77bd30558036c920fdcd7815ba73e9840777176 Mon Sep 17 00:00:00 2001 From: Yaapa Hage Date: Wed, 24 Jun 2020 20:40:02 +0530 Subject: [PATCH] chore: clean up Clean up --- packages/typeorm/LICENSE | 2 +- packages/typeorm/src/decorators/typeorm.decorator.ts | 6 +++--- packages/typeorm/src/index.ts | 2 +- packages/typeorm/src/mixins/index.ts | 2 +- packages/typeorm/src/mixins/typeorm.mixin.ts | 9 ++++++++- packages/typeorm/src/utils.ts | 2 +- tsconfig.json | 3 --- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/typeorm/LICENSE b/packages/typeorm/LICENSE index 51234e181136..1db784a60fcb 100644 --- a/packages/typeorm/LICENSE +++ b/packages/typeorm/LICENSE @@ -1,5 +1,5 @@ Copyright (c) IBM Corp. 2017,2019. -Node module: @loopback/repository +Node module: @loopback/typeorm This project is licensed under the MIT License, full text below. -------- diff --git a/packages/typeorm/src/decorators/typeorm.decorator.ts b/packages/typeorm/src/decorators/typeorm.decorator.ts index 8482d5238bdc..1e4755ef1d41 100644 --- a/packages/typeorm/src/decorators/typeorm.decorator.ts +++ b/packages/typeorm/src/decorators/typeorm.decorator.ts @@ -11,7 +11,7 @@ export namespace typeorm { export function connection(connectionName?: string) { return inject( '', - {decorator: '@typeormConnection'}, + {decorator: '@typeorm.connection'}, async ( ctx: Context, injection: Readonly, @@ -28,7 +28,7 @@ export namespace typeorm { ) { return inject( '', - {decorator: '@typeormEntityManager'}, + {decorator: '@typeorm.entityManager'}, async ( ctx: Context, injection: Readonly, @@ -43,7 +43,7 @@ export namespace typeorm { export function repository(entity: Function, connectionName?: string) { return inject( '', - {decorator: '@typeormRepository'}, + {decorator: '@typeorm.repository'}, async ( ctx: Context, injection: Readonly, diff --git a/packages/typeorm/src/index.ts b/packages/typeorm/src/index.ts index 67b8d1b28ffa..ded74ac6d0f6 100644 --- a/packages/typeorm/src/index.ts +++ b/packages/typeorm/src/index.ts @@ -1,5 +1,5 @@ // Copyright IBM Corp. 2017,2020. All Rights Reserved. -// Node module: @loopback/repository +// Node module: @loopback/typeorm // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/packages/typeorm/src/mixins/index.ts b/packages/typeorm/src/mixins/index.ts index 95e2d38f84fe..d3d73ec59f35 100644 --- a/packages/typeorm/src/mixins/index.ts +++ b/packages/typeorm/src/mixins/index.ts @@ -1,5 +1,5 @@ // Copyright IBM Corp. 2018,2020. All Rights Reserved. -// Node module: @loopback/repository +// Node module: @loopback/typeorm // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/packages/typeorm/src/mixins/typeorm.mixin.ts b/packages/typeorm/src/mixins/typeorm.mixin.ts index e68cf3c38011..f1f95cc94850 100644 --- a/packages/typeorm/src/mixins/typeorm.mixin.ts +++ b/packages/typeorm/src/mixins/typeorm.mixin.ts @@ -1,11 +1,12 @@ // Copyright IBM Corp. 2018,2020. All Rights Reserved. -// Node module: @loopback/repository +// Node module: @loopback/typeorm // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {Application, MixinTarget} from '@loopback/core'; import debugFactory from 'debug'; import {ConnectionOptions} from 'typeorm'; +import {TypeOrmComponent} from '../'; const debug = debugFactory('loopback:typeorm:mixin'); @@ -15,6 +16,12 @@ export function TypeOrmMixin>( return class extends superClass { typeormConnectionOptions: ConnectionOptions[] = []; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(...args: any[]) { + super(...args); + this.component(TypeOrmComponent); + } + async migrateSchema(options: SchemaMigrationOptions = {}): Promise { // TODO: implement using TypeORM } diff --git a/packages/typeorm/src/utils.ts b/packages/typeorm/src/utils.ts index 264d549a3824..df797dd646f9 100644 --- a/packages/typeorm/src/utils.ts +++ b/packages/typeorm/src/utils.ts @@ -1,5 +1,5 @@ // Copyright IBM Corp. 2017,2020. All Rights Reserved. -// Node module: @loopback/repository +// Node module: @loopback/typeorm // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/tsconfig.json b/tsconfig.json index 71857160a13e..d4f47f6b266c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -181,9 +181,6 @@ { "path": "packages/typeorm/tsconfig.json" }, - { - "path": "sandbox/appa/tsconfig.json" - } ], "files": [] }