@forinda/kickjs-cli 1.7.1-alpha.0 → 2.0.1
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.
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { _ as E, a as ee, b as P, c as te, d as oe, f as re, g as S, h as L, i as ne, l as ie, m as se, n as w, o as ae, p as _, r as R, s as ce, u as de, v as M, y as $ } from "./config-
|
|
2
|
+
import { _ as E, a as ee, b as P, c as te, d as oe, f as re, g as S, h as L, i as ne, l as ie, m as se, n as w, o as ae, p as _, r as R, s as ce, u as de, v as M, y as $ } from "./config-D9faxBLQ.js";
|
|
3
3
|
import { basename as pe, dirname as le, join as g, resolve as m } from "node:path";
|
|
4
4
|
import { createInterface as N } from "node:readline";
|
|
5
5
|
import { readFile as B, rm as me, writeFile as W } from "node:fs/promises";
|
|
@@ -154,7 +154,7 @@ async function Pe(e) {
|
|
|
154
154
|
const p = g(r, c);
|
|
155
155
|
await P(p, d), s.push(p);
|
|
156
156
|
};
|
|
157
|
-
return await a(`${n}.resolver.ts`, `import { Service } from '@forinda/kickjs
|
|
157
|
+
return await a(`${n}.resolver.ts`, `import { Service } from '@forinda/kickjs'
|
|
158
158
|
import { Resolver, Query, Mutation, Arg } from '@forinda/kickjs-graphql'
|
|
159
159
|
|
|
160
160
|
/**
|
|
@@ -220,7 +220,7 @@ async function Ie(e) {
|
|
|
220
220
|
return await (async (d, p) => {
|
|
221
221
|
const l = g(r, d);
|
|
222
222
|
await P(l, p), a.push(l);
|
|
223
|
-
})(`${n}.job.ts`, `import { Inject } from '@forinda/kickjs
|
|
223
|
+
})(`${n}.job.ts`, `import { Inject } from '@forinda/kickjs'
|
|
224
224
|
import { Job, Process, QUEUE_MANAGER, type QueueService } from '@forinda/kickjs-queue'
|
|
225
225
|
|
|
226
226
|
/**
|
|
@@ -387,7 +387,7 @@ function Ae(e, t) {
|
|
|
387
387
|
"'createdAt'",
|
|
388
388
|
"'updatedAt'"
|
|
389
389
|
].join(", "), s = r.length > 0 ? r.join(", ") : "'name'";
|
|
390
|
-
return `import type { ApiQueryParamsConfig } from '@forinda/kickjs
|
|
390
|
+
return `import type { ApiQueryParamsConfig } from '@forinda/kickjs'
|
|
391
391
|
|
|
392
392
|
export const ${e.toUpperCase()}_QUERY_CONFIG: ApiQueryParamsConfig = {
|
|
393
393
|
filterable: [${n}],
|
|
@@ -398,8 +398,8 @@ export const ${e.toUpperCase()}_QUERY_CONFIG: ApiQueryParamsConfig = {
|
|
|
398
398
|
}
|
|
399
399
|
function ze(e, t, r) {
|
|
400
400
|
return `import { randomUUID } from 'node:crypto'
|
|
401
|
-
import { Repository, HttpException } from '@forinda/kickjs
|
|
402
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
401
|
+
import { Repository, HttpException } from '@forinda/kickjs'
|
|
402
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
403
403
|
import type { I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
404
404
|
import type { ${e}ResponseDTO } from '../../application/dtos/${t}-response.dto'
|
|
405
405
|
import type { Create${e}DTO } from '../../application/dtos/create-${t}.dto'
|
|
@@ -519,7 +519,7 @@ export class ${e}Id {
|
|
|
519
519
|
`;
|
|
520
520
|
}
|
|
521
521
|
function Ge(e, t, r, o) {
|
|
522
|
-
return `import type { AppModule, AppModuleClass } from '@forinda/kickjs
|
|
522
|
+
return `import type { AppModule, AppModuleClass } from '@forinda/kickjs'
|
|
523
523
|
import { ${e}Controller } from './presentation/${t}.controller'
|
|
524
524
|
import { ${e}DomainService } from './domain/services/${t}-domain.service'
|
|
525
525
|
import { ${e.toUpperCase()}_REPOSITORY } from './domain/repositories/${t}.repository'
|
|
@@ -540,8 +540,8 @@ export class ${e}Module implements AppModule {
|
|
|
540
540
|
`;
|
|
541
541
|
}
|
|
542
542
|
function Qe(e, t, r, o) {
|
|
543
|
-
return `import { Controller, Get, Post, Put, Delete, Autowired, ApiQueryParams } from '@forinda/kickjs
|
|
544
|
-
import type { RequestContext } from '@forinda/kickjs
|
|
543
|
+
return `import { Controller, Get, Post, Put, Delete, Autowired, ApiQueryParams } from '@forinda/kickjs'
|
|
544
|
+
import type { RequestContext } from '@forinda/kickjs'
|
|
545
545
|
import { ApiTags } from '@forinda/kickjs-swagger'
|
|
546
546
|
import { Create${e}UseCase } from '../application/use-cases/create-${t}.use-case'
|
|
547
547
|
import { Get${e}UseCase } from '../application/use-cases/get-${t}.use-case'
|
|
@@ -605,7 +605,7 @@ function Le(e, t) {
|
|
|
605
605
|
return `import type { ${e}ResponseDTO } from '../../application/dtos/${t}-response.dto'
|
|
606
606
|
import type { Create${e}DTO } from '../../application/dtos/create-${t}.dto'
|
|
607
607
|
import type { Update${e}DTO } from '../../application/dtos/update-${t}.dto'
|
|
608
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
608
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
609
609
|
|
|
610
610
|
export interface I${e}Repository {
|
|
611
611
|
findById(id: string): Promise<${e}ResponseDTO | null>
|
|
@@ -620,7 +620,7 @@ export const ${e.toUpperCase()}_REPOSITORY = Symbol('I${e}Repository')
|
|
|
620
620
|
`;
|
|
621
621
|
}
|
|
622
622
|
function _e(e, t) {
|
|
623
|
-
return `import { Service, Inject, HttpException } from '@forinda/kickjs
|
|
623
|
+
return `import { Service, Inject, HttpException } from '@forinda/kickjs'
|
|
624
624
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../repositories/${t}.repository'
|
|
625
625
|
|
|
626
626
|
@Service()
|
|
@@ -640,7 +640,7 @@ function Ne(e, t, r, o) {
|
|
|
640
640
|
return [
|
|
641
641
|
{
|
|
642
642
|
file: `create-${t}.use-case.ts`,
|
|
643
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
643
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
644
644
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
645
645
|
import type { Create${e}DTO } from '../dtos/create-${t}.dto'
|
|
646
646
|
|
|
@@ -653,7 +653,7 @@ export class Create${e}UseCase {
|
|
|
653
653
|
},
|
|
654
654
|
{
|
|
655
655
|
file: `get-${t}.use-case.ts`,
|
|
656
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
656
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
657
657
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
658
658
|
|
|
659
659
|
@Service()
|
|
@@ -665,8 +665,8 @@ export class Get${e}UseCase {
|
|
|
665
665
|
},
|
|
666
666
|
{
|
|
667
667
|
file: `list-${r}.use-case.ts`,
|
|
668
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
669
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
668
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
669
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
670
670
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
671
671
|
|
|
672
672
|
@Service()
|
|
@@ -678,7 +678,7 @@ export class List${o}UseCase {
|
|
|
678
678
|
},
|
|
679
679
|
{
|
|
680
680
|
file: `update-${t}.use-case.ts`,
|
|
681
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
681
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
682
682
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
683
683
|
import type { Update${e}DTO } from '../dtos/update-${t}.dto'
|
|
684
684
|
|
|
@@ -691,7 +691,7 @@ export class Update${e}UseCase {
|
|
|
691
691
|
},
|
|
692
692
|
{
|
|
693
693
|
file: `delete-${t}.use-case.ts`,
|
|
694
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
694
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
695
695
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
696
696
|
|
|
697
697
|
@Service()
|
|
@@ -706,7 +706,7 @@ export class Delete${e}UseCase {
|
|
|
706
706
|
async function He(e, t, r) {
|
|
707
707
|
const o = g(e, "index.ts");
|
|
708
708
|
if (!await M(o)) {
|
|
709
|
-
await P(o, `import type { AppModuleClass } from '@forinda/kickjs
|
|
709
|
+
await P(o, `import type { AppModuleClass } from '@forinda/kickjs'
|
|
710
710
|
import { ${t}Module } from './${r}'
|
|
711
711
|
|
|
712
712
|
export const modules: AppModuleClass[] = [${t}Module]
|
|
@@ -743,7 +743,7 @@ async function Fe(e) {
|
|
|
743
743
|
} else a = m("src/__tests__");
|
|
744
744
|
const c = g(a, `${n}.test.ts`);
|
|
745
745
|
return await P(c, `import { describe, it, expect, beforeEach } from 'vitest'
|
|
746
|
-
import { Container } from '@forinda/kickjs
|
|
746
|
+
import { Container } from '@forinda/kickjs'
|
|
747
747
|
|
|
748
748
|
describe('${i}', () => {
|
|
749
749
|
beforeEach(() => {
|
|
@@ -18,11 +18,11 @@ async function B(r) {
|
|
|
18
18
|
return !1;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function g(r) {
|
|
22
22
|
return r.replace(/[-_\s]+(.)?/g, (e, t) => t ? t.toUpperCase() : "").replace(/^(.)/, (e) => e.toUpperCase());
|
|
23
23
|
}
|
|
24
24
|
function T(r) {
|
|
25
|
-
const e =
|
|
25
|
+
const e = g(r);
|
|
26
26
|
return e.charAt(0).toLowerCase() + e.slice(1);
|
|
27
27
|
}
|
|
28
28
|
function y(r) {
|
|
@@ -77,8 +77,8 @@ function ne(r) {
|
|
|
77
77
|
* domain/ — Entities, value objects, repository interfaces, domain services
|
|
78
78
|
* infrastructure/ — Repository implementations (currently ${_(s)})
|
|
79
79
|
*/
|
|
80
|
-
import { Container, type AppModule, type ModuleRoutes } from '@forinda/kickjs
|
|
81
|
-
import { buildRoutes } from '@forinda/kickjs
|
|
80
|
+
import { Container, type AppModule, type ModuleRoutes } from '@forinda/kickjs'
|
|
81
|
+
import { buildRoutes } from '@forinda/kickjs'
|
|
82
82
|
import { ${e.toUpperCase()}_REPOSITORY } from './domain/repositories/${t}.repository'
|
|
83
83
|
import { ${i} } from './infrastructure/repositories/${n}.repository'
|
|
84
84
|
import { ${e}Controller } from './presentation/${t}.controller'
|
|
@@ -131,8 +131,8 @@ function ce(r) {
|
|
|
131
131
|
* ${n}.repository.ts — Repository implementation
|
|
132
132
|
* dtos/ — Request/response schemas
|
|
133
133
|
*/
|
|
134
|
-
import { Container, type AppModule, type ModuleRoutes } from '@forinda/kickjs
|
|
135
|
-
import { buildRoutes } from '@forinda/kickjs
|
|
134
|
+
import { Container, type AppModule, type ModuleRoutes } from '@forinda/kickjs'
|
|
135
|
+
import { buildRoutes } from '@forinda/kickjs'
|
|
136
136
|
import { ${e.toUpperCase()}_REPOSITORY } from './${t}.repository'
|
|
137
137
|
import { ${i} } from './${n}.repository'
|
|
138
138
|
import { ${e}Controller } from './${t}.controller'
|
|
@@ -159,8 +159,8 @@ export class ${e}Module implements AppModule {
|
|
|
159
159
|
}
|
|
160
160
|
function de(r) {
|
|
161
161
|
const { pascal: e, kebab: t, plural: o = "" } = r;
|
|
162
|
-
return `import { type AppModule, type ModuleRoutes } from '@forinda/kickjs
|
|
163
|
-
import { buildRoutes } from '@forinda/kickjs
|
|
162
|
+
return `import { type AppModule, type ModuleRoutes } from '@forinda/kickjs'
|
|
163
|
+
import { buildRoutes } from '@forinda/kickjs'
|
|
164
164
|
import { ${e}Controller } from './${t}.controller'
|
|
165
165
|
|
|
166
166
|
export class ${e}Module implements AppModule {
|
|
@@ -176,8 +176,8 @@ export class ${e}Module implements AppModule {
|
|
|
176
176
|
}
|
|
177
177
|
function pe(r) {
|
|
178
178
|
const { pascal: e, kebab: t, plural: o = "", pluralPascal: s = "" } = r;
|
|
179
|
-
return `import { Controller, Get, Post, Put, Delete, Autowired, ApiQueryParams } from '@forinda/kickjs
|
|
180
|
-
import type { RequestContext } from '@forinda/kickjs
|
|
179
|
+
return `import { Controller, Get, Post, Put, Delete, Autowired, ApiQueryParams } from '@forinda/kickjs'
|
|
180
|
+
import type { RequestContext } from '@forinda/kickjs'
|
|
181
181
|
import { ApiTags } from '@forinda/kickjs-swagger'
|
|
182
182
|
import { Create${e}UseCase } from '../application/use-cases/create-${t}.use-case'
|
|
183
183
|
import { Get${e}UseCase } from '../application/use-cases/get-${t}.use-case'
|
|
@@ -239,8 +239,8 @@ export class ${e}Controller {
|
|
|
239
239
|
}
|
|
240
240
|
function le(r) {
|
|
241
241
|
const { pascal: e, kebab: t, plural: o = "", pluralPascal: s = "" } = r, i = e.charAt(0).toLowerCase() + e.slice(1);
|
|
242
|
-
return `import { Controller, Get, Post, Put, Delete, Autowired, ApiQueryParams } from '@forinda/kickjs
|
|
243
|
-
import type { RequestContext } from '@forinda/kickjs
|
|
242
|
+
return `import { Controller, Get, Post, Put, Delete, Autowired, ApiQueryParams } from '@forinda/kickjs'
|
|
243
|
+
import type { RequestContext } from '@forinda/kickjs'
|
|
244
244
|
import { ApiTags } from '@forinda/kickjs-swagger'
|
|
245
245
|
import { ${e}Service } from './${t}.service'
|
|
246
246
|
import { create${e}Schema } from './dtos/create-${t}.dto'
|
|
@@ -294,7 +294,7 @@ export class ${e}Controller {
|
|
|
294
294
|
}
|
|
295
295
|
function ue(r) {
|
|
296
296
|
const { pascal: e } = r;
|
|
297
|
-
return `import type { QueryParamsConfig } from '@forinda/kickjs
|
|
297
|
+
return `import type { QueryParamsConfig } from '@forinda/kickjs'
|
|
298
298
|
|
|
299
299
|
export const ${e.toUpperCase()}_QUERY_CONFIG: QueryParamsConfig = {
|
|
300
300
|
filterable: ['name'],
|
|
@@ -356,7 +356,7 @@ function me(r) {
|
|
|
356
356
|
* Use cases are thin: validate input (via DTO), call domain/repo, return response.
|
|
357
357
|
* Keep business rules in the domain service, not here.
|
|
358
358
|
*/
|
|
359
|
-
import { Service, Inject } from '@forinda/kickjs
|
|
359
|
+
import { Service, Inject } from '@forinda/kickjs'
|
|
360
360
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
361
361
|
import type { Create${e}DTO } from '../dtos/create-${t}.dto'
|
|
362
362
|
import type { ${e}ResponseDTO } from '../dtos/${t}-response.dto'
|
|
@@ -375,7 +375,7 @@ export class Create${e}UseCase {
|
|
|
375
375
|
},
|
|
376
376
|
{
|
|
377
377
|
file: `get-${t}.use-case.ts`,
|
|
378
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
378
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
379
379
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
380
380
|
import type { ${e}ResponseDTO } from '../dtos/${t}-response.dto'
|
|
381
381
|
|
|
@@ -393,9 +393,9 @@ export class Get${e}UseCase {
|
|
|
393
393
|
},
|
|
394
394
|
{
|
|
395
395
|
file: `list-${o}.use-case.ts`,
|
|
396
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
396
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
397
397
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
398
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
398
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
399
399
|
|
|
400
400
|
@Service()
|
|
401
401
|
export class List${s}UseCase {
|
|
@@ -411,7 +411,7 @@ export class List${s}UseCase {
|
|
|
411
411
|
},
|
|
412
412
|
{
|
|
413
413
|
file: `update-${t}.use-case.ts`,
|
|
414
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
414
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
415
415
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
416
416
|
import type { Update${e}DTO } from '../dtos/update-${t}.dto'
|
|
417
417
|
import type { ${e}ResponseDTO } from '../dtos/${t}-response.dto'
|
|
@@ -430,7 +430,7 @@ export class Update${e}UseCase {
|
|
|
430
430
|
},
|
|
431
431
|
{
|
|
432
432
|
file: `delete-${t}.use-case.ts`,
|
|
433
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
433
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
434
434
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../../domain/repositories/${t}.repository'
|
|
435
435
|
|
|
436
436
|
@Service()
|
|
@@ -461,7 +461,7 @@ function A(r) {
|
|
|
461
461
|
import type { ${e}ResponseDTO } from '${o}/${t}-response.dto'
|
|
462
462
|
import type { Create${e}DTO } from '${o}/create-${t}.dto'
|
|
463
463
|
import type { Update${e}DTO } from '${o}/update-${t}.dto'
|
|
464
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
464
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
465
465
|
|
|
466
466
|
export interface I${e}Repository {
|
|
467
467
|
findById(id: string): Promise<${e}ResponseDTO | null>
|
|
@@ -487,8 +487,8 @@ function v(r) {
|
|
|
487
487
|
* @Repository() registers this class in the DI container as a singleton.
|
|
488
488
|
*/
|
|
489
489
|
import { randomUUID } from 'node:crypto'
|
|
490
|
-
import { Repository, HttpException } from '@forinda/kickjs
|
|
491
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
490
|
+
import { Repository, HttpException } from '@forinda/kickjs'
|
|
491
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
492
492
|
import type { I${e}Repository } from '${o}/${t}.repository'
|
|
493
493
|
import type { ${e}ResponseDTO } from '${s}/${t}-response.dto'
|
|
494
494
|
import type { Create${e}DTO } from '${s}/create-${t}.dto'
|
|
@@ -553,8 +553,8 @@ function j(r) {
|
|
|
553
553
|
* @Repository() registers this class in the DI container as a singleton.
|
|
554
554
|
*/
|
|
555
555
|
import { randomUUID } from 'node:crypto'
|
|
556
|
-
import { Repository, HttpException } from '@forinda/kickjs
|
|
557
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
556
|
+
import { Repository, HttpException } from '@forinda/kickjs'
|
|
557
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
558
558
|
import type { I${e}Repository } from '${s}/${t}.repository'
|
|
559
559
|
import type { ${e}ResponseDTO } from '${i}/${t}-response.dto'
|
|
560
560
|
import type { Create${e}DTO } from '${i}/create-${t}.dto'
|
|
@@ -621,7 +621,7 @@ function fe(r) {
|
|
|
621
621
|
* Use this for cross-entity logic, validation rules, and domain invariants.
|
|
622
622
|
* Keep it free of HTTP/framework concerns.
|
|
623
623
|
*/
|
|
624
|
-
import { Service, Inject, HttpException } from '@forinda/kickjs
|
|
624
|
+
import { Service, Inject, HttpException } from '@forinda/kickjs'
|
|
625
625
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../repositories/${t}.repository'
|
|
626
626
|
|
|
627
627
|
@Service()
|
|
@@ -753,7 +753,7 @@ export class ${e}Id {
|
|
|
753
753
|
function E(r) {
|
|
754
754
|
const { pascal: e, kebab: t, plural: o = "" } = r;
|
|
755
755
|
return `import { describe, it, expect, beforeEach } from 'vitest'
|
|
756
|
-
import { Container } from '@forinda/kickjs
|
|
756
|
+
import { Container } from '@forinda/kickjs'
|
|
757
757
|
|
|
758
758
|
describe('${e}Controller', () => {
|
|
759
759
|
beforeEach(() => {
|
|
@@ -872,10 +872,10 @@ describe('InMemory${e}Repository', () => {
|
|
|
872
872
|
})
|
|
873
873
|
`;
|
|
874
874
|
}
|
|
875
|
-
function
|
|
875
|
+
function ge(r) {
|
|
876
876
|
const { pascal: e, kebab: t } = r;
|
|
877
|
-
return `import { Service, Inject, HttpException } from '@forinda/kickjs
|
|
878
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
877
|
+
return `import { Service, Inject, HttpException } from '@forinda/kickjs'
|
|
878
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
879
879
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from './${t}.repository'
|
|
880
880
|
import type { ${e}ResponseDTO } from './dtos/${t}-response.dto'
|
|
881
881
|
import type { Create${e}DTO } from './dtos/create-${t}.dto'
|
|
@@ -915,7 +915,7 @@ export class ${e}Service {
|
|
|
915
915
|
}
|
|
916
916
|
function J(r) {
|
|
917
917
|
const { pascal: e } = r;
|
|
918
|
-
return `import type { QueryFieldConfig } from '@forinda/kickjs
|
|
918
|
+
return `import type { QueryFieldConfig } from '@forinda/kickjs'
|
|
919
919
|
|
|
920
920
|
export const ${e.toUpperCase()}_QUERY_CONFIG: QueryFieldConfig = {
|
|
921
921
|
filterable: ['name'],
|
|
@@ -924,7 +924,7 @@ export const ${e.toUpperCase()}_QUERY_CONFIG: QueryFieldConfig = {
|
|
|
924
924
|
}
|
|
925
925
|
`;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
927
|
+
function he(r) {
|
|
928
928
|
const { pascal: e, kebab: t, plural: o = "", repo: s } = r, i = {
|
|
929
929
|
inmemory: `InMemory${e}Repository`,
|
|
930
930
|
drizzle: `Drizzle${e}Repository`,
|
|
@@ -947,8 +947,8 @@ function ge(r) {
|
|
|
947
947
|
* events/ — Domain events + handlers (WS broadcast, queue dispatch)
|
|
948
948
|
* dtos/ — Request/response schemas
|
|
949
949
|
*/
|
|
950
|
-
import { Container, type AppModule, type ModuleRoutes } from '@forinda/kickjs
|
|
951
|
-
import { buildRoutes } from '@forinda/kickjs
|
|
950
|
+
import { Container, type AppModule, type ModuleRoutes } from '@forinda/kickjs'
|
|
951
|
+
import { buildRoutes } from '@forinda/kickjs'
|
|
952
952
|
import { ${e.toUpperCase()}_REPOSITORY } from './${t}.repository'
|
|
953
953
|
import { ${a} } from './${c}.repository'
|
|
954
954
|
import { ${e}Controller } from './${t}.controller'
|
|
@@ -983,8 +983,8 @@ export class ${e}Module implements AppModule {
|
|
|
983
983
|
}
|
|
984
984
|
function ke(r) {
|
|
985
985
|
const { pascal: e, kebab: t, plural: o = "", pluralPascal: s = "" } = r;
|
|
986
|
-
return `import { Controller, Get, Post, Put, Delete, Autowired, ApiQueryParams } from '@forinda/kickjs
|
|
987
|
-
import type { RequestContext } from '@forinda/kickjs
|
|
986
|
+
return `import { Controller, Get, Post, Put, Delete, Autowired, ApiQueryParams } from '@forinda/kickjs'
|
|
987
|
+
import type { RequestContext } from '@forinda/kickjs'
|
|
988
988
|
import { ApiTags } from '@forinda/kickjs-swagger'
|
|
989
989
|
import { Create${e}Command } from './commands/create-${t}.command'
|
|
990
990
|
import { Update${e}Command } from './commands/update-${t}.command'
|
|
@@ -1049,7 +1049,7 @@ function ve(r) {
|
|
|
1049
1049
|
return [
|
|
1050
1050
|
{
|
|
1051
1051
|
file: `create-${t}.command.ts`,
|
|
1052
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
1052
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
1053
1053
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../${t}.repository'
|
|
1054
1054
|
import type { Create${e}DTO } from '../dtos/create-${t}.dto'
|
|
1055
1055
|
import type { ${e}ResponseDTO } from '../dtos/${t}-response.dto'
|
|
@@ -1072,7 +1072,7 @@ export class Create${e}Command {
|
|
|
1072
1072
|
},
|
|
1073
1073
|
{
|
|
1074
1074
|
file: `update-${t}.command.ts`,
|
|
1075
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
1075
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
1076
1076
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../${t}.repository'
|
|
1077
1077
|
import type { Update${e}DTO } from '../dtos/update-${t}.dto'
|
|
1078
1078
|
import type { ${e}ResponseDTO } from '../dtos/${t}-response.dto'
|
|
@@ -1095,7 +1095,7 @@ export class Update${e}Command {
|
|
|
1095
1095
|
},
|
|
1096
1096
|
{
|
|
1097
1097
|
file: `delete-${t}.command.ts`,
|
|
1098
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
1098
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
1099
1099
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../${t}.repository'
|
|
1100
1100
|
import { ${e}Events } from '../events/${t}.events'
|
|
1101
1101
|
|
|
@@ -1119,7 +1119,7 @@ function we(r) {
|
|
|
1119
1119
|
const { pascal: e, kebab: t, plural: o = "", pluralPascal: s = "" } = r;
|
|
1120
1120
|
return [{
|
|
1121
1121
|
file: `get-${t}.query.ts`,
|
|
1122
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
1122
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
1123
1123
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../${t}.repository'
|
|
1124
1124
|
import type { ${e}ResponseDTO } from '../dtos/${t}-response.dto'
|
|
1125
1125
|
|
|
@@ -1136,9 +1136,9 @@ export class Get${e}Query {
|
|
|
1136
1136
|
`
|
|
1137
1137
|
}, {
|
|
1138
1138
|
file: `list-${o}.query.ts`,
|
|
1139
|
-
content: `import { Service, Inject } from '@forinda/kickjs
|
|
1139
|
+
content: `import { Service, Inject } from '@forinda/kickjs'
|
|
1140
1140
|
import { ${e.toUpperCase()}_REPOSITORY, type I${e}Repository } from '../${t}.repository'
|
|
1141
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
1141
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
1142
1142
|
|
|
1143
1143
|
@Service()
|
|
1144
1144
|
export class List${s}Query {
|
|
@@ -1157,7 +1157,7 @@ function Re(r) {
|
|
|
1157
1157
|
const { pascal: e, kebab: t } = r;
|
|
1158
1158
|
return [{
|
|
1159
1159
|
file: `${t}.events.ts`,
|
|
1160
|
-
content: `import { Service } from '@forinda/kickjs
|
|
1160
|
+
content: `import { Service } from '@forinda/kickjs'
|
|
1161
1161
|
import { EventEmitter } from 'node:events'
|
|
1162
1162
|
import type { ${e}ResponseDTO } from '../dtos/${t}-response.dto'
|
|
1163
1163
|
|
|
@@ -1196,7 +1196,7 @@ export class ${e}Events {
|
|
|
1196
1196
|
`
|
|
1197
1197
|
}, {
|
|
1198
1198
|
file: `on-${t}-change.handler.ts`,
|
|
1199
|
-
content: `import { Service, Autowired } from '@forinda/kickjs
|
|
1199
|
+
content: `import { Service, Autowired } from '@forinda/kickjs'
|
|
1200
1200
|
import { ${e}Events } from './${t}.events'
|
|
1201
1201
|
|
|
1202
1202
|
/**
|
|
@@ -1263,9 +1263,9 @@ function M(r) {
|
|
|
1263
1263
|
* @Repository() registers this class in the DI container as a singleton.
|
|
1264
1264
|
*/
|
|
1265
1265
|
import { eq, ne, gt, gte, lt, lte, ilike, inArray, between, and, or, asc, desc, count, sql } from 'drizzle-orm'
|
|
1266
|
-
import { Repository, HttpException, Inject } from '@forinda/kickjs
|
|
1266
|
+
import { Repository, HttpException, Inject } from '@forinda/kickjs'
|
|
1267
1267
|
import { DRIZZLE_DB, DrizzleQueryAdapter } from '@forinda/kickjs-drizzle'
|
|
1268
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
1268
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
1269
1269
|
import type { I${e}Repository } from '${o}/${t}.repository'
|
|
1270
1270
|
import type { ${e}ResponseDTO } from '${s}/${t}-response.dto'
|
|
1271
1271
|
import type { Create${e}DTO } from '${s}/create-${t}.dto'
|
|
@@ -1372,9 +1372,9 @@ function q(r) {
|
|
|
1372
1372
|
*
|
|
1373
1373
|
* @Repository() registers this class in the DI container as a singleton.
|
|
1374
1374
|
*/
|
|
1375
|
-
import { Repository, HttpException, Inject } from '@forinda/kickjs
|
|
1375
|
+
import { Repository, HttpException, Inject } from '@forinda/kickjs'
|
|
1376
1376
|
import { PRISMA_CLIENT, type PrismaModelDelegate } from '@forinda/kickjs-prisma'
|
|
1377
|
-
import type { ParsedQuery } from '@forinda/kickjs
|
|
1377
|
+
import type { ParsedQuery } from '@forinda/kickjs'
|
|
1378
1378
|
import type { I${e}Repository } from '${o}/${t}.repository'
|
|
1379
1379
|
import type { ${e}ResponseDTO } from '${s}/${t}-response.dto'
|
|
1380
1380
|
import type { Create${e}DTO } from '${s}/create-${t}.dto'
|
|
@@ -1425,8 +1425,8 @@ async function be(r) {
|
|
|
1425
1425
|
pascal: e,
|
|
1426
1426
|
kebab: t,
|
|
1427
1427
|
plural: o
|
|
1428
|
-
})), await s(`${t}.controller.ts`, `import { Controller, Get } from '@forinda/kickjs
|
|
1429
|
-
import type { RequestContext } from '@forinda/kickjs
|
|
1428
|
+
})), await s(`${t}.controller.ts`, `import { Controller, Get } from '@forinda/kickjs'
|
|
1429
|
+
import type { RequestContext } from '@forinda/kickjs'
|
|
1430
1430
|
|
|
1431
1431
|
@Controller()
|
|
1432
1432
|
export class ${e}Controller {
|
|
@@ -1452,7 +1452,7 @@ async function xe(r) {
|
|
|
1452
1452
|
kebab: t,
|
|
1453
1453
|
plural: o,
|
|
1454
1454
|
pluralPascal: s
|
|
1455
|
-
})), await c(`${t}.service.ts`,
|
|
1455
|
+
})), await c(`${t}.service.ts`, ge({
|
|
1456
1456
|
pascal: e,
|
|
1457
1457
|
kebab: t
|
|
1458
1458
|
})), await c(`dtos/create-${t}.dto.ts`, O({
|
|
@@ -1518,7 +1518,7 @@ async function xe(r) {
|
|
|
1518
1518
|
}
|
|
1519
1519
|
async function De(r) {
|
|
1520
1520
|
const { pascal: e, kebab: t, plural: o, pluralPascal: s, repo: i, noTests: n, prismaClientPath: a, write: c } = r;
|
|
1521
|
-
await c("index.ts",
|
|
1521
|
+
await c("index.ts", he({
|
|
1522
1522
|
pascal: e,
|
|
1523
1523
|
kebab: t,
|
|
1524
1524
|
plural: o,
|
|
@@ -1587,14 +1587,14 @@ async function De(r) {
|
|
|
1587
1587
|
dtoPrefix: "./dtos",
|
|
1588
1588
|
prismaClientPath: a
|
|
1589
1589
|
})
|
|
1590
|
-
}, k = f[i] ?? `${y(i)}-${t}`,
|
|
1590
|
+
}, k = f[i] ?? `${y(i)}-${t}`, h = w[i] ?? (() => j({
|
|
1591
1591
|
pascal: e,
|
|
1592
1592
|
kebab: t,
|
|
1593
1593
|
repoType: i,
|
|
1594
1594
|
repoPrefix: ".",
|
|
1595
1595
|
dtoPrefix: "./dtos"
|
|
1596
1596
|
}));
|
|
1597
|
-
await c(`${k}.repository.ts`,
|
|
1597
|
+
await c(`${k}.repository.ts`, h()), n || (i !== "inmemory" && await c(`in-memory-${t}.repository.ts`, v({
|
|
1598
1598
|
pascal: e,
|
|
1599
1599
|
kebab: t,
|
|
1600
1600
|
repoPrefix: ".",
|
|
@@ -1644,7 +1644,7 @@ async function Pe(r) {
|
|
|
1644
1644
|
plural: o,
|
|
1645
1645
|
pluralPascal: s
|
|
1646
1646
|
});
|
|
1647
|
-
for (const
|
|
1647
|
+
for (const h of u) await d(`application/use-cases/${h.file}`, h.content);
|
|
1648
1648
|
await d(`domain/repositories/${t}.repository.ts`, A({
|
|
1649
1649
|
pascal: e,
|
|
1650
1650
|
kebab: t
|
|
@@ -1712,12 +1712,12 @@ async function at(r) {
|
|
|
1712
1712
|
const { name: e, modulesDir: t, noEntity: o, noTests: s, repo: i = "inmemory", force: n, dryRun: a } = r, c = r.pluralize !== !1;
|
|
1713
1713
|
let d = r.pattern ?? "ddd";
|
|
1714
1714
|
r.minimal && (d = "minimal");
|
|
1715
|
-
const u = y(e), m =
|
|
1715
|
+
const u = y(e), m = g(e), f = c ? Y(u) : u, w = c ? se(m) : m, k = p(t, f), h = [];
|
|
1716
1716
|
let $ = n ?? !1;
|
|
1717
1717
|
const Z = async (D, X) => {
|
|
1718
1718
|
const x = p(k, D);
|
|
1719
1719
|
if (a) {
|
|
1720
|
-
|
|
1720
|
+
h.push(x);
|
|
1721
1721
|
return;
|
|
1722
1722
|
}
|
|
1723
1723
|
if (!$ && await B(x)) {
|
|
@@ -1729,7 +1729,7 @@ async function at(r) {
|
|
|
1729
1729
|
return;
|
|
1730
1730
|
}
|
|
1731
1731
|
}
|
|
1732
|
-
await l(x, X),
|
|
1732
|
+
await l(x, X), h.push(x);
|
|
1733
1733
|
}, b = {
|
|
1734
1734
|
kebab: u,
|
|
1735
1735
|
pascal: m,
|
|
@@ -1741,7 +1741,7 @@ async function at(r) {
|
|
|
1741
1741
|
noTests: s ?? !1,
|
|
1742
1742
|
prismaClientPath: r.prismaClientPath ?? "@prisma/client",
|
|
1743
1743
|
write: Z,
|
|
1744
|
-
files:
|
|
1744
|
+
files: h
|
|
1745
1745
|
};
|
|
1746
1746
|
switch (d) {
|
|
1747
1747
|
case "minimal":
|
|
@@ -1757,12 +1757,12 @@ async function at(r) {
|
|
|
1757
1757
|
await Pe(b);
|
|
1758
1758
|
break;
|
|
1759
1759
|
}
|
|
1760
|
-
return a || await Oe(t, m, f),
|
|
1760
|
+
return a || await Oe(t, m, f), h;
|
|
1761
1761
|
}
|
|
1762
1762
|
async function Oe(r, e, t) {
|
|
1763
1763
|
const o = p(r, "index.ts");
|
|
1764
1764
|
if (!await B(o)) {
|
|
1765
|
-
await l(o, `import type { AppModuleClass } from '@forinda/kickjs
|
|
1765
|
+
await l(o, `import type { AppModuleClass } from '@forinda/kickjs'
|
|
1766
1766
|
import { ${e}Module } from './${t}'
|
|
1767
1767
|
|
|
1768
1768
|
export const modules: AppModuleClass[] = [${e}Module]
|
|
@@ -1790,8 +1790,8 @@ export const modules: AppModuleClass[] = [${e}Module]
|
|
|
1790
1790
|
await N(o, s, "utf-8");
|
|
1791
1791
|
}
|
|
1792
1792
|
async function nt(r) {
|
|
1793
|
-
const { name: e, outDir: t } = r, o = y(e), s =
|
|
1794
|
-
return await l(n, `import type { AppAdapter, AdapterContext, AdapterMiddleware } from '@forinda/kickjs
|
|
1793
|
+
const { name: e, outDir: t } = r, o = y(e), s = g(e), i = [], n = p(t, `${o}.adapter.ts`);
|
|
1794
|
+
return await l(n, `import type { AppAdapter, AdapterContext, AdapterMiddleware } from '@forinda/kickjs'
|
|
1795
1795
|
|
|
1796
1796
|
export interface ${s}AdapterOptions {
|
|
1797
1797
|
// Add your adapter configuration here
|
|
@@ -1920,12 +1920,12 @@ async function ct(r) {
|
|
|
1920
1920
|
}), n = y(e), a = T(e), c = [], d = p(i, `${n}.middleware.ts`);
|
|
1921
1921
|
return await l(d, `import type { Request, Response, NextFunction } from 'express'
|
|
1922
1922
|
|
|
1923
|
-
export interface ${
|
|
1923
|
+
export interface ${g(e)}Options {
|
|
1924
1924
|
// Add configuration options here
|
|
1925
1925
|
}
|
|
1926
1926
|
|
|
1927
1927
|
/**
|
|
1928
|
-
* ${
|
|
1928
|
+
* ${g(e)} middleware.
|
|
1929
1929
|
*
|
|
1930
1930
|
* Usage in bootstrap:
|
|
1931
1931
|
* middleware: [${a}()]
|
|
@@ -1936,7 +1936,7 @@ export interface ${h(e)}Options {
|
|
|
1936
1936
|
* Usage with @Middleware decorator:
|
|
1937
1937
|
* @Middleware(${a}())
|
|
1938
1938
|
*/
|
|
1939
|
-
export function ${a}(options: ${
|
|
1939
|
+
export function ${a}(options: ${g(e)}Options = {}) {
|
|
1940
1940
|
return (req: Request, res: Response, next: NextFunction) => {
|
|
1941
1941
|
// Implement your middleware logic here
|
|
1942
1942
|
next()
|
|
@@ -1952,9 +1952,9 @@ async function dt(r) {
|
|
|
1952
1952
|
modulesDir: o,
|
|
1953
1953
|
defaultDir: "src/guards",
|
|
1954
1954
|
pattern: s
|
|
1955
|
-
}), n = y(e), a = T(e), c =
|
|
1956
|
-
return await l(u, `import { Container, HttpException } from '@forinda/kickjs
|
|
1957
|
-
import type { RequestContext } from '@forinda/kickjs
|
|
1955
|
+
}), n = y(e), a = T(e), c = g(e), d = [], u = p(i, `${n}.guard.ts`);
|
|
1956
|
+
return await l(u, `import { Container, HttpException } from '@forinda/kickjs'
|
|
1957
|
+
import type { RequestContext } from '@forinda/kickjs'
|
|
1958
1958
|
|
|
1959
1959
|
/**
|
|
1960
1960
|
* ${c} guard.
|
|
@@ -1999,8 +1999,8 @@ async function pt(r) {
|
|
|
1999
1999
|
modulesDir: o,
|
|
2000
2000
|
defaultDir: "src/services",
|
|
2001
2001
|
pattern: s
|
|
2002
|
-
}), n = y(e), a =
|
|
2003
|
-
return await l(d, `import { Service } from '@forinda/kickjs
|
|
2002
|
+
}), n = y(e), a = g(e), c = [], d = p(i, `${n}.service.ts`);
|
|
2003
|
+
return await l(d, `import { Service } from '@forinda/kickjs'
|
|
2004
2004
|
|
|
2005
2005
|
@Service()
|
|
2006
2006
|
export class ${a}Service {
|
|
@@ -2019,9 +2019,9 @@ async function lt(r) {
|
|
|
2019
2019
|
modulesDir: o,
|
|
2020
2020
|
defaultDir: "src/controllers",
|
|
2021
2021
|
pattern: s
|
|
2022
|
-
}), n = y(e), a =
|
|
2023
|
-
return await l(d, `import { Controller, Get, Post, Autowired } from '@forinda/kickjs
|
|
2024
|
-
import type { RequestContext } from '@forinda/kickjs
|
|
2022
|
+
}), n = y(e), a = g(e), c = [], d = p(i, `${n}.controller.ts`);
|
|
2023
|
+
return await l(d, `import { Controller, Get, Post, Autowired } from '@forinda/kickjs'
|
|
2024
|
+
import type { RequestContext } from '@forinda/kickjs'
|
|
2025
2025
|
|
|
2026
2026
|
@Controller()
|
|
2027
2027
|
export class ${a}Controller {
|
|
@@ -2047,7 +2047,7 @@ async function ut(r) {
|
|
|
2047
2047
|
modulesDir: o,
|
|
2048
2048
|
defaultDir: "src/dtos",
|
|
2049
2049
|
pattern: s
|
|
2050
|
-
}), n = y(e), a =
|
|
2050
|
+
}), n = y(e), a = g(e), c = T(e), d = [], u = p(i, `${n}.dto.ts`);
|
|
2051
2051
|
return await l(u, `import { z } from 'zod'
|
|
2052
2052
|
|
|
2053
2053
|
export const ${c}Schema = z.object({
|
|
@@ -2060,8 +2060,7 @@ export type ${a}DTO = z.infer<typeof ${c}Schema>
|
|
|
2060
2060
|
}
|
|
2061
2061
|
function je(r, e, t) {
|
|
2062
2062
|
const o = {
|
|
2063
|
-
"@forinda/kickjs
|
|
2064
|
-
"@forinda/kickjs-http": t,
|
|
2063
|
+
"@forinda/kickjs": t,
|
|
2065
2064
|
"@forinda/kickjs-config": t,
|
|
2066
2065
|
express: "^5.1.0",
|
|
2067
2066
|
"reflect-metadata": "^0.2.2",
|
|
@@ -2238,7 +2237,7 @@ function Le(r, e, t) {
|
|
|
2238
2237
|
switch (e) {
|
|
2239
2238
|
case "graphql":
|
|
2240
2239
|
return `import 'reflect-metadata'
|
|
2241
|
-
import { bootstrap } from '@forinda/kickjs
|
|
2240
|
+
import { bootstrap } from '@forinda/kickjs'
|
|
2242
2241
|
import { DevToolsAdapter } from '@forinda/kickjs-devtools'
|
|
2243
2242
|
import { GraphQLAdapter } from '@forinda/kickjs-graphql'
|
|
2244
2243
|
import { modules } from './modules'
|
|
@@ -2260,7 +2259,7 @@ bootstrap({
|
|
|
2260
2259
|
`;
|
|
2261
2260
|
case "cqrs":
|
|
2262
2261
|
return `import 'reflect-metadata'
|
|
2263
|
-
import { bootstrap } from '@forinda/kickjs
|
|
2262
|
+
import { bootstrap } from '@forinda/kickjs'
|
|
2264
2263
|
import { DevToolsAdapter } from '@forinda/kickjs-devtools'
|
|
2265
2264
|
import { SwaggerAdapter } from '@forinda/kickjs-swagger'
|
|
2266
2265
|
import { OtelAdapter } from '@forinda/kickjs-otel'
|
|
@@ -2287,14 +2286,14 @@ bootstrap({
|
|
|
2287
2286
|
`;
|
|
2288
2287
|
case "minimal":
|
|
2289
2288
|
return `import 'reflect-metadata'
|
|
2290
|
-
import { bootstrap } from '@forinda/kickjs
|
|
2289
|
+
import { bootstrap } from '@forinda/kickjs'
|
|
2291
2290
|
import { modules } from './modules'
|
|
2292
2291
|
|
|
2293
2292
|
bootstrap({ modules })
|
|
2294
2293
|
`;
|
|
2295
2294
|
default:
|
|
2296
2295
|
return `import 'reflect-metadata'
|
|
2297
|
-
import { bootstrap } from '@forinda/kickjs
|
|
2296
|
+
import { bootstrap } from '@forinda/kickjs'
|
|
2298
2297
|
import { DevToolsAdapter } from '@forinda/kickjs-devtools'
|
|
2299
2298
|
import { SwaggerAdapter } from '@forinda/kickjs-swagger'
|
|
2300
2299
|
import { modules } from './modules'
|
|
@@ -2312,7 +2311,7 @@ bootstrap({
|
|
|
2312
2311
|
}
|
|
2313
2312
|
}
|
|
2314
2313
|
function Ne() {
|
|
2315
|
-
return `import type { AppModuleClass } from '@forinda/kickjs
|
|
2314
|
+
return `import type { AppModuleClass } from '@forinda/kickjs'
|
|
2316
2315
|
|
|
2317
2316
|
export const modules: AppModuleClass[] = []
|
|
2318
2317
|
`;
|
|
@@ -2487,7 +2486,7 @@ ${e === "graphql" ? `├── resolvers/ # GraphQL resolvers
|
|
|
2487
2486
|
Use decorators to define routes:
|
|
2488
2487
|
|
|
2489
2488
|
\`\`\`ts
|
|
2490
|
-
import { Controller, Get, Post, RequestContext } from '@forinda/kickjs
|
|
2489
|
+
import { Controller, Get, Post, RequestContext } from '@forinda/kickjs'
|
|
2491
2490
|
|
|
2492
2491
|
@Controller('/users')
|
|
2493
2492
|
export class UserController {
|
|
@@ -2509,7 +2508,7 @@ export class UserController {
|
|
|
2509
2508
|
Inject dependencies with \`@Service()\` and \`@Autowired()\`:
|
|
2510
2509
|
|
|
2511
2510
|
\`\`\`ts
|
|
2512
|
-
import { Service, Autowired } from '@forinda/kickjs
|
|
2511
|
+
import { Service, Autowired } from '@forinda/kickjs'
|
|
2513
2512
|
|
|
2514
2513
|
@Service()
|
|
2515
2514
|
export class UserService {
|
|
@@ -2527,7 +2526,7 @@ export class UserService {
|
|
|
2527
2526
|
Register controllers and providers in modules:
|
|
2528
2527
|
|
|
2529
2528
|
\`\`\`ts
|
|
2530
|
-
import { Module } from '@forinda/kickjs
|
|
2529
|
+
import { Module } from '@forinda/kickjs'
|
|
2531
2530
|
import { UserController } from './user.controller'
|
|
2532
2531
|
import { UserService } from './user.service'
|
|
2533
2532
|
|
|
@@ -2635,7 +2634,7 @@ Tests live in \`src/**/*.test.ts\`:
|
|
|
2635
2634
|
|
|
2636
2635
|
\`\`\`ts
|
|
2637
2636
|
import { describe, it, expect, beforeEach } from 'vitest'
|
|
2638
|
-
import { Container } from '@forinda/kickjs
|
|
2637
|
+
import { Container } from '@forinda/kickjs'
|
|
2639
2638
|
import { createTestApp } from '@forinda/kickjs-testing'
|
|
2640
2639
|
|
|
2641
2640
|
describe('UserController', () => {
|
|
@@ -2881,7 +2880,7 @@ All tests use Vitest:
|
|
|
2881
2880
|
|
|
2882
2881
|
\`\`\`ts
|
|
2883
2882
|
import { describe, it, expect, beforeEach } from 'vitest'
|
|
2884
|
-
import { Container } from '@forinda/kickjs
|
|
2883
|
+
import { Container } from '@forinda/kickjs'
|
|
2885
2884
|
import { createTestApp } from '@forinda/kickjs-testing'
|
|
2886
2885
|
|
|
2887
2886
|
describe('UserController', () => {
|
|
@@ -3086,7 +3085,7 @@ async function yt(r) {
|
|
|
3086
3085
|
return null;
|
|
3087
3086
|
}
|
|
3088
3087
|
export {
|
|
3089
|
-
|
|
3088
|
+
g as _,
|
|
3090
3089
|
ut as a,
|
|
3091
3090
|
l as b,
|
|
3092
3091
|
dt as c,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../../src/generators/templates/project-config.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAA;AAEtE,6DAA6D;AAC7D,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,eAAe,EACzB,aAAa,EAAE,MAAM,GACpB,MAAM,
|
|
1
|
+
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../../src/generators/templates/project-config.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAA;AAEtE,6DAA6D;AAC7D,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,eAAe,EACzB,aAAa,EAAE,MAAM,GACpB,MAAM,CA6DR;AAED,yDAAyD;AACzD,wBAAgB,kBAAkB,IAAI,MAAM,CAkC3C;AAED,oDAAoD;AACpD,wBAAgB,gBAAgB,IAAI,MAAM,CAyBzC;AAED,yDAAyD;AACzD,wBAAgB,sBAAsB,IAAI,MAAM,CAY/C;AAED,4DAA4D;AAC5D,wBAAgB,oBAAoB,IAAI,MAAM,CAe7C;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,IAAI,MAAM,CAQ1C;AAED,0DAA0D;AAC1D,wBAAgB,qBAAqB,IAAI,MAAM,CAoB9C;AAED,4DAA4D;AAC5D,wBAAgB,WAAW,IAAI,MAAM,CAIpC;AAED,+CAA+C;AAC/C,wBAAgB,kBAAkB,IAAI,MAAM,CAI3C;AAED,uDAAuD;AACvD,wBAAgB,oBAAoB,IAAI,MAAM,CAa7C"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as a, a as s, c as r, d as t, g as o, h as n, i, l as g, n as l, o as d, p as C, s as c, t as p, u as f } from "./config-
|
|
1
|
+
import { _ as a, a as s, c as r, d as t, g as o, h as n, i, l as g, n as l, o as d, p as C, s as c, t as p, u as f } from "./config-D9faxBLQ.js";
|
|
2
2
|
export {
|
|
3
3
|
p as defineConfig,
|
|
4
4
|
f as generateAdapter,
|