From db8d0ddc297e9d3d45ba5aa6678b38986fae8b00 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Fri, 22 Mar 2024 21:05:10 +0530 Subject: [PATCH] [Fix] Plugins Builds (#7695) * fix: missing mikro base repository build * fix: missing mikro base repository build * fix: missing mikro base repository build --- packages/core/src/core/index.ts | 1 + packages/core/src/core/repository/index.ts | 1 + .../src/repository/mikro-orm-changelog.repository.ts | 2 +- .../lib/repository/mikro-orm-wakatime.repository.ts | 2 +- .../src/lib/repository/type-orm-wakatime.repository.ts | 1 - .../help-center-article/help-center-article.module.ts | 5 +++-- .../help-center-article/help-center-article.service.ts | 10 +++------- .../src/help-center-article/repository/index.ts | 2 ++ .../mikro-orm-help-center-article.repository.ts | 2 +- .../type-orm-help-center-article.repository.ts | 9 ++++++++- .../help-center-author/help-center-author.module.ts | 5 +++-- .../src/help-center-author/repository/index.ts | 2 ++ .../mikro-orm-help-center-author.repository.ts | 2 +- .../type-orm-help-center-author.repository.ts | 9 ++++++++- .../src/help-center/help-center.module.ts | 5 +++-- .../knowledge-base/src/help-center/repository/index.ts | 2 ++ .../repository/mikro-orm-help-center.repository.ts | 2 +- .../repository/type-orm-help-center.repository.ts | 9 ++++++++- .../repository/mikro-orm-product-review.repository.ts | 2 +- 19 files changed, 50 insertions(+), 23 deletions(-) create mode 100644 packages/core/src/core/repository/index.ts create mode 100644 packages/plugins/knowledge-base/src/help-center-article/repository/index.ts create mode 100644 packages/plugins/knowledge-base/src/help-center-author/repository/index.ts create mode 100644 packages/plugins/knowledge-base/src/help-center/repository/index.ts diff --git a/packages/core/src/core/index.ts b/packages/core/src/core/index.ts index 6e3bced01c0..9fef4528ecf 100644 --- a/packages/core/src/core/index.ts +++ b/packages/core/src/core/index.ts @@ -3,6 +3,7 @@ export * from './core.module'; export * from './utils'; export * from './context'; export * from './entities'; +export * from './repository'; export * from './entities/internal'; export * from './entities/subscribers'; export * from './decorators'; diff --git a/packages/core/src/core/repository/index.ts b/packages/core/src/core/repository/index.ts new file mode 100644 index 00000000000..7a1f7442829 --- /dev/null +++ b/packages/core/src/core/repository/index.ts @@ -0,0 +1 @@ +export * from './mikro-orm-base-entity.repository'; diff --git a/packages/plugins/changelog/src/repository/mikro-orm-changelog.repository.ts b/packages/plugins/changelog/src/repository/mikro-orm-changelog.repository.ts index 3f27f54a980..dea9ca20b4d 100644 --- a/packages/plugins/changelog/src/repository/mikro-orm-changelog.repository.ts +++ b/packages/plugins/changelog/src/repository/mikro-orm-changelog.repository.ts @@ -1,4 +1,4 @@ -import { MikroOrmBaseEntityRepository } from '../../core/repository/mikro-orm-base-entity.repository'; +import { MikroOrmBaseEntityRepository } from '@gauzy/core'; import { Changelog } from '../changelog.entity'; export class MikroOrmChangelogRepository extends MikroOrmBaseEntityRepository { } diff --git a/packages/plugins/integration-wakatime/src/lib/repository/mikro-orm-wakatime.repository.ts b/packages/plugins/integration-wakatime/src/lib/repository/mikro-orm-wakatime.repository.ts index 0855dfe72ab..8e4dd60042a 100644 --- a/packages/plugins/integration-wakatime/src/lib/repository/mikro-orm-wakatime.repository.ts +++ b/packages/plugins/integration-wakatime/src/lib/repository/mikro-orm-wakatime.repository.ts @@ -1,4 +1,4 @@ -import { MikroOrmBaseEntityRepository } from '../../core/repository/mikro-orm-base-entity.repository'; +import { MikroOrmBaseEntityRepository } from '@gauzy/core'; import { Wakatime } from '../wakatime.entity'; export class MikroOrmWakatimeRepository extends MikroOrmBaseEntityRepository { } diff --git a/packages/plugins/integration-wakatime/src/lib/repository/type-orm-wakatime.repository.ts b/packages/plugins/integration-wakatime/src/lib/repository/type-orm-wakatime.repository.ts index 71ed873c8e7..c48e60a64ae 100644 --- a/packages/plugins/integration-wakatime/src/lib/repository/type-orm-wakatime.repository.ts +++ b/packages/plugins/integration-wakatime/src/lib/repository/type-orm-wakatime.repository.ts @@ -3,7 +3,6 @@ import { Repository } from 'typeorm'; import { Wakatime } from '../wakatime.entity'; export class TypeOrmWakatimeRepository extends Repository { - constructor( @InjectRepository(Wakatime) readonly repository: Repository ) { diff --git a/packages/plugins/knowledge-base/src/help-center-article/help-center-article.module.ts b/packages/plugins/knowledge-base/src/help-center-article/help-center-article.module.ts index 3d92ab53ad1..f9567ad94b7 100644 --- a/packages/plugins/knowledge-base/src/help-center-article/help-center-article.module.ts +++ b/packages/plugins/knowledge-base/src/help-center-article/help-center-article.module.ts @@ -8,6 +8,7 @@ import { HelpCenterArticle } from './help-center-article.entity'; import { HelpCenterArticleService } from './help-center-article.service'; import { HelpCenterArticleController } from './help-center-article.controller'; import { CommandHandlers } from './commands/handlers'; +import { TypeOrmHelpCenterArticleRepository } from './repository'; @Module({ imports: [ @@ -17,9 +18,9 @@ import { CommandHandlers } from './commands/handlers'; RolePermissionModule, CqrsModule ], - providers: [HelpCenterArticleService, ...CommandHandlers], + providers: [HelpCenterArticleService, TypeOrmHelpCenterArticleRepository, ...CommandHandlers], controllers: [HelpCenterArticleController], - exports: [HelpCenterArticleService] + exports: [HelpCenterArticleService, TypeOrmHelpCenterArticleRepository] }) export class HelpCenterArticleModule implements OnModuleInit { constructor() { } diff --git a/packages/plugins/knowledge-base/src/help-center-article/help-center-article.service.ts b/packages/plugins/knowledge-base/src/help-center-article/help-center-article.service.ts index 523479d2be2..87078cd4711 100644 --- a/packages/plugins/knowledge-base/src/help-center-article/help-center-article.service.ts +++ b/packages/plugins/knowledge-base/src/help-center-article/help-center-article.service.ts @@ -1,19 +1,15 @@ import { Injectable } from '@nestjs/common'; -import { InjectRepository } from '@nestjs/typeorm'; import { TenantAwareCrudService } from '@gauzy/core'; import { isNotEmpty } from '@gauzy/common'; import { IHelpCenterArticleUpdate } from '@gauzy/contracts'; import { HelpCenterArticle } from './help-center-article.entity'; -import { TypeOrmHelpCenterArticleRepository } from './repository/type-orm-help-center-article.repository'; -import { MikroOrmHelpCenterArticleRepository } from './repository/mikro-orm-help-center-article.repository'; +import { MikroOrmHelpCenterArticleRepository, TypeOrmHelpCenterArticleRepository } from './repository'; @Injectable() export class HelpCenterArticleService extends TenantAwareCrudService { constructor( - @InjectRepository(HelpCenterArticle) - typeOrmHelpCenterArticleRepository: TypeOrmHelpCenterArticleRepository, - - mikroOrmHelpCenterArticleRepository: MikroOrmHelpCenterArticleRepository + readonly typeOrmHelpCenterArticleRepository: TypeOrmHelpCenterArticleRepository, + readonly mikroOrmHelpCenterArticleRepository: MikroOrmHelpCenterArticleRepository ) { super(typeOrmHelpCenterArticleRepository, mikroOrmHelpCenterArticleRepository); } diff --git a/packages/plugins/knowledge-base/src/help-center-article/repository/index.ts b/packages/plugins/knowledge-base/src/help-center-article/repository/index.ts new file mode 100644 index 00000000000..c9a1e18ef22 --- /dev/null +++ b/packages/plugins/knowledge-base/src/help-center-article/repository/index.ts @@ -0,0 +1,2 @@ +export * from './mikro-orm-help-center-article.repository'; +export * from './type-orm-help-center-article.repository'; diff --git a/packages/plugins/knowledge-base/src/help-center-article/repository/mikro-orm-help-center-article.repository.ts b/packages/plugins/knowledge-base/src/help-center-article/repository/mikro-orm-help-center-article.repository.ts index 50551964023..29647e8f34b 100644 --- a/packages/plugins/knowledge-base/src/help-center-article/repository/mikro-orm-help-center-article.repository.ts +++ b/packages/plugins/knowledge-base/src/help-center-article/repository/mikro-orm-help-center-article.repository.ts @@ -1,4 +1,4 @@ -import { MikroOrmBaseEntityRepository } from '../../core/repository/mikro-orm-base-entity.repository'; +import { MikroOrmBaseEntityRepository } from '@gauzy/core'; import { HelpCenterArticle } from '../help-center-article.entity'; export class MikroOrmHelpCenterArticleRepository extends MikroOrmBaseEntityRepository { } diff --git a/packages/plugins/knowledge-base/src/help-center-article/repository/type-orm-help-center-article.repository.ts b/packages/plugins/knowledge-base/src/help-center-article/repository/type-orm-help-center-article.repository.ts index 7afd371a385..5433c909eed 100644 --- a/packages/plugins/knowledge-base/src/help-center-article/repository/type-orm-help-center-article.repository.ts +++ b/packages/plugins/knowledge-base/src/help-center-article/repository/type-orm-help-center-article.repository.ts @@ -1,4 +1,11 @@ +import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { HelpCenterArticle } from '../help-center-article.entity'; -export class TypeOrmHelpCenterArticleRepository extends Repository { } \ No newline at end of file +export class TypeOrmHelpCenterArticleRepository extends Repository { + constructor( + @InjectRepository(HelpCenterArticle) readonly repository: Repository + ) { + super(repository.target, repository.manager, repository.queryRunner); + } +} diff --git a/packages/plugins/knowledge-base/src/help-center-author/help-center-author.module.ts b/packages/plugins/knowledge-base/src/help-center-author/help-center-author.module.ts index f1c0f856c97..7f8ca2e0fbb 100644 --- a/packages/plugins/knowledge-base/src/help-center-author/help-center-author.module.ts +++ b/packages/plugins/knowledge-base/src/help-center-author/help-center-author.module.ts @@ -8,6 +8,7 @@ import { HelpCenterAuthorService } from './help-center-author.service'; import { HelpCenterAuthorController } from './help-center-author.controller'; import { HelpCenterAuthor } from './help-center-author.entity'; import { CommandHandlers } from './commands/handlers'; +import { TypeOrmHelpCenterAuthorRepository } from './repository'; @Module({ imports: [ @@ -17,9 +18,9 @@ import { CommandHandlers } from './commands/handlers'; RolePermissionModule, CqrsModule ], - providers: [HelpCenterAuthorService, ...CommandHandlers], controllers: [HelpCenterAuthorController], - exports: [HelpCenterAuthorService] + providers: [HelpCenterAuthorService, TypeOrmHelpCenterAuthorRepository, ...CommandHandlers], + exports: [HelpCenterAuthorService, TypeOrmHelpCenterAuthorRepository] }) export class HelpCenterAuthorModule implements OnModuleInit { constructor() { } diff --git a/packages/plugins/knowledge-base/src/help-center-author/repository/index.ts b/packages/plugins/knowledge-base/src/help-center-author/repository/index.ts new file mode 100644 index 00000000000..f36e2fde2ad --- /dev/null +++ b/packages/plugins/knowledge-base/src/help-center-author/repository/index.ts @@ -0,0 +1,2 @@ +export * from './mikro-orm-help-center-author.repository'; +export * from './type-orm-help-center-author.repository'; diff --git a/packages/plugins/knowledge-base/src/help-center-author/repository/mikro-orm-help-center-author.repository.ts b/packages/plugins/knowledge-base/src/help-center-author/repository/mikro-orm-help-center-author.repository.ts index 0280995ed9f..16cc53c2729 100644 --- a/packages/plugins/knowledge-base/src/help-center-author/repository/mikro-orm-help-center-author.repository.ts +++ b/packages/plugins/knowledge-base/src/help-center-author/repository/mikro-orm-help-center-author.repository.ts @@ -1,4 +1,4 @@ -import { MikroOrmBaseEntityRepository } from '../../core/repository/mikro-orm-base-entity.repository'; +import { MikroOrmBaseEntityRepository } from '@gauzy/core'; import { HelpCenterAuthor } from '../help-center-author.entity'; export class MikroOrmHelpCenterAuthorRepository extends MikroOrmBaseEntityRepository { } diff --git a/packages/plugins/knowledge-base/src/help-center-author/repository/type-orm-help-center-author.repository.ts b/packages/plugins/knowledge-base/src/help-center-author/repository/type-orm-help-center-author.repository.ts index 4db0f5efbbd..09286358a4d 100644 --- a/packages/plugins/knowledge-base/src/help-center-author/repository/type-orm-help-center-author.repository.ts +++ b/packages/plugins/knowledge-base/src/help-center-author/repository/type-orm-help-center-author.repository.ts @@ -1,4 +1,11 @@ +import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { HelpCenterAuthor } from '../help-center-author.entity'; -export class TypeOrmHelpCenterAuthorRepository extends Repository { } \ No newline at end of file +export class TypeOrmHelpCenterAuthorRepository extends Repository { + constructor( + @InjectRepository(HelpCenterAuthor) readonly repository: Repository + ) { + super(repository.target, repository.manager, repository.queryRunner); + } +} diff --git a/packages/plugins/knowledge-base/src/help-center/help-center.module.ts b/packages/plugins/knowledge-base/src/help-center/help-center.module.ts index 6201bc254b3..72ffd9df145 100644 --- a/packages/plugins/knowledge-base/src/help-center/help-center.module.ts +++ b/packages/plugins/knowledge-base/src/help-center/help-center.module.ts @@ -8,6 +8,7 @@ import { HelpCenterController } from './help-center.controller'; import { HelpCenter } from './help-center.entity'; import { HelpCenterService } from './help-center.service'; import { CommandHandlers } from './commands/handlers'; +import { TypeOrmHelpCenterRepository } from './repository'; @Module({ imports: [ @@ -17,9 +18,9 @@ import { CommandHandlers } from './commands/handlers'; RolePermissionModule, CqrsModule ], - providers: [HelpCenterService, ...CommandHandlers], controllers: [HelpCenterController], - exports: [HelpCenterService] + providers: [HelpCenterService, TypeOrmHelpCenterRepository, ...CommandHandlers], + exports: [HelpCenterService, TypeOrmHelpCenterRepository] }) export class HelpCenterModule implements OnModuleInit { constructor() { } diff --git a/packages/plugins/knowledge-base/src/help-center/repository/index.ts b/packages/plugins/knowledge-base/src/help-center/repository/index.ts new file mode 100644 index 00000000000..300ec2cae37 --- /dev/null +++ b/packages/plugins/knowledge-base/src/help-center/repository/index.ts @@ -0,0 +1,2 @@ +export * from './mikro-orm-help-center.repository'; +export * from './type-orm-help-center.repository'; diff --git a/packages/plugins/knowledge-base/src/help-center/repository/mikro-orm-help-center.repository.ts b/packages/plugins/knowledge-base/src/help-center/repository/mikro-orm-help-center.repository.ts index 880cbf9f695..9e56f0e4776 100644 --- a/packages/plugins/knowledge-base/src/help-center/repository/mikro-orm-help-center.repository.ts +++ b/packages/plugins/knowledge-base/src/help-center/repository/mikro-orm-help-center.repository.ts @@ -1,4 +1,4 @@ -import { MikroOrmBaseEntityRepository } from '../../core/repository/mikro-orm-base-entity.repository'; +import { MikroOrmBaseEntityRepository } from '@gauzy/core'; import { HelpCenter } from '../help-center.entity'; export class MikroOrmHelpCenterRepository extends MikroOrmBaseEntityRepository { } diff --git a/packages/plugins/knowledge-base/src/help-center/repository/type-orm-help-center.repository.ts b/packages/plugins/knowledge-base/src/help-center/repository/type-orm-help-center.repository.ts index 3190cccc203..fb7c617e939 100644 --- a/packages/plugins/knowledge-base/src/help-center/repository/type-orm-help-center.repository.ts +++ b/packages/plugins/knowledge-base/src/help-center/repository/type-orm-help-center.repository.ts @@ -1,4 +1,11 @@ +import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { HelpCenter } from '../help-center.entity'; -export class TypeOrmHelpCenterRepository extends Repository { } \ No newline at end of file +export class TypeOrmHelpCenterRepository extends Repository { + constructor( + @InjectRepository(HelpCenter) readonly repository: Repository + ) { + super(repository.target, repository.manager, repository.queryRunner); + } +} diff --git a/packages/plugins/product-reviews/src/entities/repository/mikro-orm-product-review.repository.ts b/packages/plugins/product-reviews/src/entities/repository/mikro-orm-product-review.repository.ts index 03567aa6ae8..98bb3d3c6dd 100644 --- a/packages/plugins/product-reviews/src/entities/repository/mikro-orm-product-review.repository.ts +++ b/packages/plugins/product-reviews/src/entities/repository/mikro-orm-product-review.repository.ts @@ -1,4 +1,4 @@ -import { MikroOrmBaseEntityRepository } from '../../core/repository/mikro-orm-base-entity.repository'; +import { MikroOrmBaseEntityRepository } from '@gauzy/core'; import { ProductReview } from '../product-review.entity'; export class MikroOrmProductReviewRepository extends MikroOrmBaseEntityRepository { }