@solidstarters/solid-code-builder 1.0.25 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  <%= outputParentImportPathForEntity(parentModel, parentModule) %>
2
- import {Entity} from 'typeorm'
3
- @Entity(<%= table ? `"${table}"` : '' %>)
4
- export class <%= classify(model) %> extends <%= parentModel ? `${classify(parentModel)}` : `CommonEntity` %>{}
2
+ import { <%= parentModel ? `ChildEntity` : `Entity` %> } from 'typeorm'
3
+
4
+ <%= parentModel ? `@ChildEntity()` : `@Entity(${table ? `'${table}'` : ''})` %>
5
+ export class <%= classify(model) %> extends <%= parentModel ? `${classify(parentModel)}` : `CommonEntity` %> {}
@@ -0,0 +1,15 @@
1
+ import { Injectable } from '@nestjs/common';
2
+ import { RequestContextService, SecurityRuleRepository, SolidBaseRepository } from '@solidstarters/solid-core';
3
+ import { DataSource } from 'typeorm';
4
+ import { <%= classify(model) %> } from '../entities/<%= dasherize(model) %>.entity';
5
+
6
+ @Injectable()
7
+ export class <%= classify(model) %>Repository extends SolidBaseRepository<<%= classify(model) %>> {
8
+ constructor(
9
+ readonly dataSource: DataSource,
10
+ readonly requestContextService: RequestContextService,
11
+ readonly securityRuleRepository: SecurityRuleRepository,
12
+ ) {
13
+ super(<%= classify(model) %>, dataSource, requestContextService, securityRuleRepository);
14
+ }
15
+ }
@@ -10,8 +10,8 @@ import { ConfigService } from '@nestjs/config';
10
10
  import { FileService } from '<%= calculateModuleFileImportPath(module,"src/services/file.service") %>';
11
11
  import { CrudHelperService } from '<%= calculateModuleFileImportPath(module,"src/services/crud-helper.service") %>';
12
12
 
13
-
14
13
  import { <%= classify(model) %> } from '../entities/<%= dasherize(model) %>.entity';
14
+ import { <%= classify(model) %>Repository } from '../repositories/<%= dasherize(model) %>.repository';
15
15
 
16
16
  @Injectable()
17
17
  export class <%= classify(model) %>Service extends CRUDService<<%= classify(model) %>>{
@@ -24,8 +24,7 @@ export class <%= classify(model) %>Service extends CRUDService<<%= classify(mode
24
24
  readonly crudHelperService: CrudHelperService,
25
25
  @InjectEntityManager()
26
26
  readonly entityManager: EntityManager,
27
- @InjectRepository(<%= classify(model) %>, '<%= dataSource %>')
28
- readonly repo: Repository<<%= classify(model) %>>,
27
+ readonly repo: <%= classify(model) %>Repository,
29
28
  readonly moduleRef: ModuleRef
30
29
 
31
30
  ) {
@@ -1,4 +1,5 @@
1
1
  <%= outputParentImportPathForEntity(parentModel, parentModule) %>
2
- import {Entity} from 'typeorm'
3
- @Entity(<%= table ? `"${table}"` : '' %>)
4
- export class <%= classify(model) %> extends <%= parentModel ? `${classify(parentModel)}` : `CommonEntity` %>{}
2
+ import { <%= parentModel ? `ChildEntity` : `Entity` %> } from 'typeorm'
3
+
4
+ <%= parentModel ? `@ChildEntity()` : `@Entity(${table ? `'${table}'` : ''})` %>
5
+ export class <%= classify(model) %> extends <%= parentModel ? `${classify(parentModel)}` : `CommonEntity` %> {}
@@ -0,0 +1,15 @@
1
+ import { Injectable } from '@nestjs/common';
2
+ import { RequestContextService, SecurityRuleRepository, SolidBaseRepository } from '@solidstarters/solid-core';
3
+ import { DataSource } from 'typeorm';
4
+ import { <%= classify(model) %> } from '../entities/<%= dasherize(model) %>.entity';
5
+
6
+ @Injectable()
7
+ export class <%= classify(model) %>Repository extends SolidBaseRepository<<%= classify(model) %>> {
8
+ constructor(
9
+ readonly dataSource: DataSource,
10
+ readonly requestContextService: RequestContextService,
11
+ readonly securityRuleRepository: SecurityRuleRepository,
12
+ ) {
13
+ super(<%= classify(model) %>, dataSource, requestContextService, securityRuleRepository);
14
+ }
15
+ }
@@ -10,8 +10,8 @@ import { ConfigService } from '@nestjs/config';
10
10
  import { FileService } from '<%= calculateModuleFileImportPath(module,"src/services/file.service") %>';
11
11
  import { CrudHelperService } from '<%= calculateModuleFileImportPath(module,"src/services/crud-helper.service") %>';
12
12
 
13
-
14
13
  import { <%= classify(model) %> } from '../entities/<%= dasherize(model) %>.entity';
14
+ import { <%= classify(model) %>Repository } from '../repositories/<%= dasherize(model) %>.repository';
15
15
 
16
16
  @Injectable()
17
17
  export class <%= classify(model) %>Service extends CRUDService<<%= classify(model) %>>{
@@ -24,8 +24,7 @@ export class <%= classify(model) %>Service extends CRUDService<<%= classify(mode
24
24
  readonly crudHelperService: CrudHelperService,
25
25
  @InjectEntityManager()
26
26
  readonly entityManager: EntityManager,
27
- @InjectRepository(<%= classify(model) %>, '<%= dataSource %>')
28
- readonly repo: Repository<<%= classify(model) %>>,
27
+ readonly repo: <%= classify(model) %>Repository,
29
28
  readonly moduleRef: ModuleRef
30
29
 
31
30
  ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidstarters/solid-code-builder",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "This package is use to generate code for the @solidstarters projects",
5
5
  "private": false,
6
6
  "publishConfig": {