@tsed/cli 3.20.16 → 3.21.0-rc.2

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.
Files changed (127) hide show
  1. package/lib/{Cli.js → cjs/Cli.js} +4 -2
  2. package/lib/cjs/Cli.js.map +1 -0
  3. package/lib/{bin → cjs/bin}/tsed.js +1 -1
  4. package/lib/cjs/bin/tsed.js.map +1 -0
  5. package/lib/{commands → cjs/commands}/add/AddCmd.js +0 -0
  6. package/lib/cjs/commands/add/AddCmd.js.map +1 -0
  7. package/lib/{commands → cjs/commands}/generate/GenerateCmd.js +3 -3
  8. package/lib/cjs/commands/generate/GenerateCmd.js.map +1 -0
  9. package/lib/{commands → cjs/commands}/generate/ProviderTypes.js +0 -0
  10. package/lib/cjs/commands/generate/ProviderTypes.js.map +1 -0
  11. package/lib/{commands → cjs/commands}/index.js +0 -0
  12. package/lib/cjs/commands/index.js.map +1 -0
  13. package/lib/{commands → cjs/commands}/init/InitCmd.js +0 -0
  14. package/lib/cjs/commands/init/InitCmd.js.map +1 -0
  15. package/lib/{commands → cjs/commands}/run/RunCmd.js +0 -0
  16. package/lib/cjs/commands/run/RunCmd.js.map +1 -0
  17. package/lib/{commands → cjs/commands}/update/UpdateCmd.js +0 -0
  18. package/lib/cjs/commands/update/UpdateCmd.js.map +1 -0
  19. package/lib/cjs/constants/index.js +18 -0
  20. package/lib/cjs/constants/index.js.map +1 -0
  21. package/lib/{index.js → cjs/index.js} +0 -0
  22. package/lib/cjs/index.js.map +1 -0
  23. package/lib/{interfaces → cjs/interfaces}/ArchitectureConvention.js +0 -0
  24. package/lib/cjs/interfaces/ArchitectureConvention.js.map +1 -0
  25. package/lib/{interfaces → cjs/interfaces}/ProjectConvention.js +0 -0
  26. package/lib/cjs/interfaces/ProjectConvention.js.map +1 -0
  27. package/lib/{interfaces → cjs/interfaces}/index.js +0 -0
  28. package/lib/cjs/interfaces/index.js.map +1 -0
  29. package/lib/cjs/package.json +3 -0
  30. package/lib/{pipes → cjs/pipes}/ClassNamePipe.js +0 -0
  31. package/lib/cjs/pipes/ClassNamePipe.js.map +1 -0
  32. package/lib/{pipes → cjs/pipes}/OutputFilePathPipe.js +0 -0
  33. package/lib/cjs/pipes/OutputFilePathPipe.js.map +1 -0
  34. package/lib/{pipes → cjs/pipes}/RoutePipe.js +0 -0
  35. package/lib/cjs/pipes/RoutePipe.js.map +1 -0
  36. package/lib/{pipes → cjs/pipes}/index.js +0 -0
  37. package/lib/cjs/pipes/index.js.map +1 -0
  38. package/lib/{services → cjs/services}/Features.js +0 -0
  39. package/lib/cjs/services/Features.js.map +1 -0
  40. package/lib/{services → cjs/services}/ProvidersInfoService.js +0 -0
  41. package/lib/cjs/services/ProvidersInfoService.js.map +1 -0
  42. package/lib/esm/Cli.js +44 -0
  43. package/lib/esm/Cli.js.map +1 -0
  44. package/lib/esm/bin/tsed.js +22 -0
  45. package/lib/esm/bin/tsed.js.map +1 -0
  46. package/lib/esm/commands/add/AddCmd.js +58 -0
  47. package/lib/esm/commands/add/AddCmd.js.map +1 -0
  48. package/lib/esm/commands/generate/GenerateCmd.js +239 -0
  49. package/lib/esm/commands/generate/GenerateCmd.js.map +1 -0
  50. package/lib/esm/commands/generate/ProviderTypes.js +104 -0
  51. package/lib/esm/commands/generate/ProviderTypes.js.map +1 -0
  52. package/lib/esm/commands/index.js +7 -0
  53. package/lib/esm/commands/index.js.map +1 -0
  54. package/lib/esm/commands/init/InitCmd.js +371 -0
  55. package/lib/esm/commands/init/InitCmd.js.map +1 -0
  56. package/lib/esm/commands/run/RunCmd.js +65 -0
  57. package/lib/esm/commands/run/RunCmd.js.map +1 -0
  58. package/lib/esm/commands/update/UpdateCmd.js +116 -0
  59. package/lib/esm/commands/update/UpdateCmd.js.map +1 -0
  60. package/lib/esm/constants/index.js +14 -0
  61. package/lib/esm/constants/index.js.map +1 -0
  62. package/lib/esm/index.js +10 -0
  63. package/lib/esm/index.js.map +1 -0
  64. package/lib/esm/interfaces/ArchitectureConvention.js +6 -0
  65. package/lib/esm/interfaces/ArchitectureConvention.js.map +1 -0
  66. package/lib/esm/interfaces/ProjectConvention.js +6 -0
  67. package/lib/esm/interfaces/ProjectConvention.js.map +1 -0
  68. package/lib/esm/interfaces/index.js +3 -0
  69. package/lib/esm/interfaces/index.js.map +1 -0
  70. package/lib/esm/package.json +3 -0
  71. package/lib/esm/pipes/ClassNamePipe.js +42 -0
  72. package/lib/esm/pipes/ClassNamePipe.js.map +1 -0
  73. package/lib/esm/pipes/OutputFilePathPipe.js +36 -0
  74. package/lib/esm/pipes/OutputFilePathPipe.js.map +1 -0
  75. package/lib/esm/pipes/RoutePipe.js +23 -0
  76. package/lib/esm/pipes/RoutePipe.js.map +1 -0
  77. package/lib/esm/pipes/index.js +4 -0
  78. package/lib/esm/pipes/index.js.map +1 -0
  79. package/lib/esm/services/Features.js +520 -0
  80. package/lib/esm/services/Features.js.map +1 -0
  81. package/lib/esm/services/ProvidersInfoService.js +48 -0
  82. package/lib/esm/services/ProvidersInfoService.js.map +1 -0
  83. package/lib/{Cli.d.ts → types/Cli.d.ts} +0 -0
  84. package/lib/{bin → types/bin}/tsed.d.ts +0 -0
  85. package/lib/{commands → types/commands}/add/AddCmd.d.ts +0 -0
  86. package/lib/{commands → types/commands}/generate/GenerateCmd.d.ts +0 -0
  87. package/lib/{commands → types/commands}/generate/ProviderTypes.d.ts +0 -0
  88. package/lib/{commands → types/commands}/index.d.ts +0 -0
  89. package/lib/{commands → types/commands}/init/InitCmd.d.ts +0 -0
  90. package/lib/{commands → types/commands}/run/RunCmd.d.ts +0 -0
  91. package/lib/{commands → types/commands}/update/UpdateCmd.d.ts +0 -0
  92. package/lib/{constants → types/constants}/index.d.ts +1 -0
  93. package/lib/{index.d.ts → types/index.d.ts} +0 -0
  94. package/lib/{interfaces → types/interfaces}/ArchitectureConvention.d.ts +0 -0
  95. package/lib/{interfaces → types/interfaces}/ProjectConvention.d.ts +0 -0
  96. package/lib/{interfaces → types/interfaces}/index.d.ts +0 -0
  97. package/lib/{pipes → types/pipes}/ClassNamePipe.d.ts +0 -0
  98. package/lib/{pipes → types/pipes}/OutputFilePathPipe.d.ts +0 -0
  99. package/lib/{pipes → types/pipes}/RoutePipe.d.ts +0 -0
  100. package/lib/{pipes → types/pipes}/index.d.ts +0 -0
  101. package/lib/{services → types/services}/Features.d.ts +0 -0
  102. package/lib/{services → types/services}/ProvidersInfoService.d.ts +0 -0
  103. package/package.json +43 -28
  104. package/templates/generate/server.hbs +7 -8
  105. package/templates/init/src/config/index.ts.hbs +4 -4
  106. package/templates/init/src/config/logger/index.ts.hbs +1 -1
  107. package/lib/Cli.js.map +0 -1
  108. package/lib/bin/tsed.js.map +0 -1
  109. package/lib/commands/add/AddCmd.js.map +0 -1
  110. package/lib/commands/generate/GenerateCmd.js.map +0 -1
  111. package/lib/commands/generate/ProviderTypes.js.map +0 -1
  112. package/lib/commands/index.js.map +0 -1
  113. package/lib/commands/init/InitCmd.js.map +0 -1
  114. package/lib/commands/run/RunCmd.js.map +0 -1
  115. package/lib/commands/update/UpdateCmd.js.map +0 -1
  116. package/lib/constants/index.js +0 -10
  117. package/lib/constants/index.js.map +0 -1
  118. package/lib/index.js.map +0 -1
  119. package/lib/interfaces/ArchitectureConvention.js.map +0 -1
  120. package/lib/interfaces/ProjectConvention.js.map +0 -1
  121. package/lib/interfaces/index.js.map +0 -1
  122. package/lib/pipes/ClassNamePipe.js.map +0 -1
  123. package/lib/pipes/OutputFilePathPipe.js.map +0 -1
  124. package/lib/pipes/RoutePipe.js.map +0 -1
  125. package/lib/pipes/index.js.map +0 -1
  126. package/lib/services/Features.js.map +0 -1
  127. package/lib/services/ProvidersInfoService.js.map +0 -1
@@ -0,0 +1,520 @@
1
+ import { CliPackageJson, Inject, registerProvider } from "@tsed/cli-core";
2
+ import { getValue } from "@tsed/core";
3
+ import { ProjectConvention, ArchitectureConvention } from "../interfaces.js";
4
+ export function Features() {
5
+ return Inject(Features);
6
+ }
7
+ export function hasFeature(feature) {
8
+ return (ctx) => !!ctx.features.find((item) => item.type === feature);
9
+ }
10
+ export function hasValue(expression, value) {
11
+ return (ctx) => getValue(expression, ctx) === value;
12
+ }
13
+ export function isPlatform(...types) {
14
+ return (ctx) => [types].includes(ctx.platform);
15
+ }
16
+ export const FEATURES_TYPEORM_CONNECTION_TYPES = [
17
+ {
18
+ name: "MySQL",
19
+ value: {
20
+ type: "typeorm:mysql",
21
+ dependencies: {
22
+ mysql2: "latest"
23
+ }
24
+ }
25
+ },
26
+ {
27
+ name: "MariaDB",
28
+ value: {
29
+ type: "typeorm:mariadb",
30
+ dependencies: {
31
+ mariadb: "latest"
32
+ }
33
+ }
34
+ },
35
+ {
36
+ name: "Postgres",
37
+ value: {
38
+ type: "typeorm:postgres",
39
+ dependencies: {
40
+ pg: "latest"
41
+ }
42
+ }
43
+ },
44
+ {
45
+ name: "CockRoachDB",
46
+ value: {
47
+ type: "typeorm:postgres",
48
+ dependencies: {
49
+ cockroachdb: "latest"
50
+ }
51
+ }
52
+ },
53
+ {
54
+ name: "SQLite",
55
+ value: {
56
+ type: "typeorm:sqlite",
57
+ dependencies: {
58
+ sqlite3: "latest"
59
+ }
60
+ }
61
+ },
62
+ {
63
+ name: "Better SQLite3",
64
+ value: {
65
+ type: "typeorm:better-sqlite3",
66
+ dependencies: {
67
+ "better-sqlite3": "latest"
68
+ }
69
+ }
70
+ },
71
+ {
72
+ name: "Cordova",
73
+ value: {
74
+ type: "typeorm:cordova"
75
+ }
76
+ },
77
+ {
78
+ name: "NativeScript",
79
+ value: {
80
+ type: "typeorm:nativescript"
81
+ }
82
+ },
83
+ {
84
+ name: "Oracle",
85
+ value: {
86
+ type: "typeorm:oracle",
87
+ dependencies: {
88
+ oracledb: "latest"
89
+ }
90
+ }
91
+ },
92
+ {
93
+ name: "MsSQL",
94
+ value: {
95
+ type: "typeorm:mssql",
96
+ dependencies: {
97
+ mssql: "latest"
98
+ }
99
+ }
100
+ },
101
+ {
102
+ name: "MongoDB",
103
+ value: {
104
+ type: "typeorm:mongodb",
105
+ dependencies: {
106
+ mongodb: "latest"
107
+ }
108
+ }
109
+ },
110
+ {
111
+ name: "SQL.js",
112
+ value: {
113
+ type: "typeorm:sqljs",
114
+ dependencies: {}
115
+ }
116
+ },
117
+ {
118
+ name: "ReactNative",
119
+ value: {
120
+ type: "typeorm:reactnative",
121
+ dependencies: {}
122
+ }
123
+ },
124
+ {
125
+ name: "Expo",
126
+ value: {
127
+ type: "typeorm:expo",
128
+ dependencies: {}
129
+ }
130
+ }
131
+ ];
132
+ const babelDevDependencies = {
133
+ "@babel/cli": "latest",
134
+ "@babel/core": "latest",
135
+ "@babel/node": "latest",
136
+ "@babel/plugin-proposal-class-properties": "latest",
137
+ "@babel/plugin-proposal-decorators": "latest",
138
+ "@babel/preset-env": "latest",
139
+ "@babel/preset-typescript": "latest",
140
+ "babel-plugin-transform-typescript-metadata": "latest",
141
+ "babel-watch": "latest"
142
+ };
143
+ const platformChoices = [
144
+ {
145
+ name: "Express.js",
146
+ checked: true,
147
+ value: "express"
148
+ },
149
+ {
150
+ name: "Koa.js",
151
+ checked: false,
152
+ value: "koa"
153
+ }
154
+ ];
155
+ const conventionChoices = [
156
+ {
157
+ name: "Ts.ED",
158
+ checked: true,
159
+ value: ProjectConvention.DEFAULT
160
+ },
161
+ {
162
+ name: "Angular",
163
+ checked: false,
164
+ value: ProjectConvention.ANGULAR
165
+ }
166
+ ];
167
+ const featureChoices = (cliVersion) => [
168
+ {
169
+ name: "TypeGraphQL",
170
+ value: {
171
+ type: "graphql",
172
+ dependencies: {
173
+ "@tsed/typegraphql": "{{tsedVersion}}"
174
+ },
175
+ devDependencies: {
176
+ "@tsed/cli-plugin-typegraphql": cliVersion
177
+ }
178
+ }
179
+ },
180
+ {
181
+ name: "Database",
182
+ value: { type: "db" }
183
+ },
184
+ {
185
+ name: "Passport.js",
186
+ when: isPlatform("express"),
187
+ value: {
188
+ type: "passportjs",
189
+ devDependencies: {
190
+ "@tsed/cli-plugin-passport": cliVersion
191
+ }
192
+ }
193
+ },
194
+ {
195
+ name: "Socket.io",
196
+ value: {
197
+ type: "socketio",
198
+ dependencies: {
199
+ "@tsed/socketio": "{{tsedVersion}}",
200
+ "socket.io": "latest"
201
+ }
202
+ }
203
+ },
204
+ {
205
+ name: "Swagger",
206
+ value: {
207
+ type: "swagger",
208
+ dependencies: {
209
+ "@tsed/swagger": "{{tsedVersion}}"
210
+ }
211
+ }
212
+ },
213
+ {
214
+ name: "OpenID Connect provider",
215
+ value: {
216
+ type: "oidc",
217
+ devDependencies: {
218
+ "@tsed/cli-plugin-oidc-provider": cliVersion
219
+ }
220
+ }
221
+ },
222
+ {
223
+ name: "Testing",
224
+ value: {
225
+ type: "testing",
226
+ dependencies: {},
227
+ devDependencies: {
228
+ "@types/supertest": "latest",
229
+ supertest: "latest"
230
+ }
231
+ }
232
+ },
233
+ {
234
+ name: "Linter",
235
+ value: {
236
+ type: "linter"
237
+ }
238
+ },
239
+ {
240
+ name: "Bundler",
241
+ value: {
242
+ type: "bundler"
243
+ }
244
+ },
245
+ {
246
+ name: "Commands",
247
+ value: {
248
+ type: "commands",
249
+ dependencies: {
250
+ "@tsed/cli-core": cliVersion
251
+ },
252
+ devDependencies: {
253
+ "@types/inquirer": "latest"
254
+ }
255
+ }
256
+ }
257
+ ];
258
+ const featuresDbChoices = (cliVersion) => [
259
+ {
260
+ name: "Prisma",
261
+ value: {
262
+ type: "prisma",
263
+ devDependencies: {
264
+ "@tsed/cli-plugin-prisma": cliVersion
265
+ }
266
+ }
267
+ },
268
+ {
269
+ name: "Mongoose",
270
+ value: {
271
+ type: "mongoose",
272
+ devDependencies: {
273
+ "@tsed/cli-plugin-mongoose": cliVersion
274
+ }
275
+ }
276
+ },
277
+ {
278
+ name: "TypeORM",
279
+ value: {
280
+ type: "typeorm",
281
+ devDependencies: {
282
+ "@tsed/cli-plugin-typeorm": cliVersion
283
+ }
284
+ }
285
+ }
286
+ ];
287
+ const featuresTestingChoices = (cliVersion) => [
288
+ {
289
+ name: "Jest",
290
+ value: {
291
+ type: "jest",
292
+ devDependencies: {
293
+ "@tsed/cli-plugin-jest": cliVersion
294
+ }
295
+ }
296
+ },
297
+ {
298
+ name: "Mocha + Chai + Sinon",
299
+ value: {
300
+ type: "mocha",
301
+ devDependencies: {
302
+ "@tsed/cli-plugin-mocha": cliVersion
303
+ }
304
+ }
305
+ }
306
+ ];
307
+ const featuresLinterChoices = (cliVersion) => [
308
+ {
309
+ name: "EsLint",
310
+ checked: true,
311
+ value: {
312
+ type: "eslint",
313
+ devDependencies: {
314
+ "@tsed/cli-plugin-eslint": cliVersion
315
+ }
316
+ }
317
+ }
318
+ ];
319
+ const featuresExtraLinterChoices = [
320
+ {
321
+ name: "Prettier",
322
+ value: {
323
+ type: "prettier"
324
+ }
325
+ },
326
+ {
327
+ name: "Lint on commit",
328
+ value: {
329
+ type: "lintstaged"
330
+ }
331
+ }
332
+ ];
333
+ const featuresBundlerChoices = [
334
+ {
335
+ name: "Babel",
336
+ value: {
337
+ type: "babel",
338
+ devDependencies: {
339
+ ...babelDevDependencies
340
+ }
341
+ }
342
+ },
343
+ {
344
+ name: "Webpack",
345
+ value: {
346
+ type: "babel:webpack",
347
+ devDependencies: {
348
+ ...babelDevDependencies,
349
+ "babel-loader": "latest",
350
+ webpack: "latest",
351
+ "webpack-cli": "latest"
352
+ }
353
+ }
354
+ }
355
+ ];
356
+ const packageManagerChoices = [
357
+ {
358
+ name: "Yarn",
359
+ checked: true,
360
+ value: "yarn"
361
+ },
362
+ {
363
+ name: "NPM",
364
+ checked: false,
365
+ value: "npm"
366
+ },
367
+ {
368
+ name: "PNPM - experimental",
369
+ checked: false,
370
+ value: "pnpm"
371
+ }
372
+ ];
373
+ export const parseFeaturesFile = (features, cliVersion) => {
374
+ var _a, _b, _c, _d, _e;
375
+ return {
376
+ platform: features.platform,
377
+ convention: features.convention,
378
+ features: [
379
+ ...featureChoices(cliVersion)
380
+ .map((v) => v.value)
381
+ .filter((v) => features.features.filter((v) => typeof v === "string").includes(v.type)),
382
+ ...features.features.filter((v) => typeof v === "object")
383
+ ],
384
+ featuresDB: (_a = featuresDbChoices(cliVersion).find((v) => v.value.type === features.featuresDB)) === null || _a === void 0 ? void 0 : _a.value,
385
+ featuresTypeORM: (_b = FEATURES_TYPEORM_CONNECTION_TYPES.find((v) => v.value.type === features.featuresTypeORM)) === null || _b === void 0 ? void 0 : _b.value,
386
+ featuresTesting: (_c = featuresTestingChoices(cliVersion).find((v) => v.value.type === features.featuresTesting)) === null || _c === void 0 ? void 0 : _c.value,
387
+ featuresLinter: (_d = featuresLinterChoices(cliVersion).find((v) => v.value.type === features.featuresLinter)) === null || _d === void 0 ? void 0 : _d.value,
388
+ featuresExtraLinter: featuresExtraLinterChoices.map((v) => v.value).filter((v) => { var _a; return (_a = features.featuresExtraLinter) === null || _a === void 0 ? void 0 : _a.includes(v.type); }),
389
+ featuresBundler: (_e = featuresBundlerChoices.find((v) => v.value.type === features.featuresBundlerChoices)) === null || _e === void 0 ? void 0 : _e.value,
390
+ packageManager: features.packageManager
391
+ };
392
+ };
393
+ export const getFeaturesChoicesValues = (cliVersion) => {
394
+ return {
395
+ platform: platformChoices.map((v) => v.value),
396
+ convention: conventionChoices.map((v) => v.value),
397
+ features: featureChoices(cliVersion).map((v) => v.value.type),
398
+ featuresDB: featuresDbChoices(cliVersion).map((v) => v.value.type),
399
+ featuresTypeORM: FEATURES_TYPEORM_CONNECTION_TYPES.map((v) => v.value.type),
400
+ featuresTesting: featuresTestingChoices(cliVersion).map((v) => v.value.type),
401
+ featuresLinter: featuresLinterChoices(cliVersion).map((v) => v.value.type),
402
+ featuresExtraLinter: featuresExtraLinterChoices.map((v) => v.value.type),
403
+ featuresBundler: featuresBundlerChoices.map((v) => v.value.type),
404
+ packageManager: packageManagerChoices.map((v) => v.value)
405
+ };
406
+ };
407
+ registerProvider({
408
+ provide: Features,
409
+ deps: [CliPackageJson],
410
+ useFactory(cliPackageJson) {
411
+ const cliVersion = cliPackageJson.version;
412
+ return [
413
+ {
414
+ message: "Choose the target platform:",
415
+ type: "list",
416
+ name: "platform",
417
+ choices: platformChoices
418
+ },
419
+ {
420
+ message: "Choose the architecture for your project:",
421
+ type: "list",
422
+ name: "architecture",
423
+ choices: [
424
+ {
425
+ name: "Ts.ED",
426
+ checked: true,
427
+ value: ArchitectureConvention.DEFAULT
428
+ },
429
+ {
430
+ name: "feature",
431
+ checked: false,
432
+ value: ArchitectureConvention.FEATURE
433
+ }
434
+ ]
435
+ },
436
+ {
437
+ message: "Choose the convention file styling:",
438
+ type: "list",
439
+ name: "convention",
440
+ choices: conventionChoices
441
+ },
442
+ {
443
+ type: "checkbox",
444
+ name: "features",
445
+ message: "Check the features needed for your project",
446
+ choices: featureChoices(cliVersion)
447
+ },
448
+ {
449
+ message: "Choose a ORM manager",
450
+ type: "list",
451
+ name: "featuresDB",
452
+ when: hasFeature("db"),
453
+ choices: featuresDbChoices(cliVersion)
454
+ },
455
+ {
456
+ type: "list",
457
+ name: "featuresTypeORM",
458
+ message: "Which TypeORM you want to install?",
459
+ choices: FEATURES_TYPEORM_CONNECTION_TYPES,
460
+ when: hasValue("featuresDB.type", "typeorm")
461
+ },
462
+ // {
463
+ // type: "password",
464
+ // name: "GH_TOKEN",
465
+ // message:
466
+ // "Enter GH_TOKEN to use the premium @tsedio/prisma package or leave blank (see https://tsed.io/tutorials/prisma-client.html)",
467
+ // when: hasValue("featuresDB.type", "prisma")
468
+ // },
469
+ {
470
+ message: "Choose unit framework",
471
+ type: "list",
472
+ name: "featuresTesting",
473
+ when: hasFeature("testing"),
474
+ choices: featuresTestingChoices(cliVersion)
475
+ },
476
+ {
477
+ message: "Choose linter tools framework",
478
+ type: "list",
479
+ name: "featuresLinter",
480
+ when: hasFeature("linter"),
481
+ choices: featuresLinterChoices(cliVersion)
482
+ },
483
+ {
484
+ message: "Choose extra linter tools",
485
+ type: "checkbox",
486
+ name: "featuresExtraLinter",
487
+ when: hasFeature("linter"),
488
+ choices: featuresExtraLinterChoices
489
+ },
490
+ {
491
+ message: "Choose your bundler",
492
+ type: "list",
493
+ name: "featuresBundler",
494
+ when: hasFeature("bundler"),
495
+ choices: featuresBundlerChoices
496
+ },
497
+ {
498
+ message: "Choose the OIDC base path server",
499
+ name: "oidcBasePath",
500
+ default: "/oidc",
501
+ when: hasFeature("oidc"),
502
+ type: "input"
503
+ },
504
+ {
505
+ message: "Choose the OIDC base path server",
506
+ name: "oidcBasePath",
507
+ default: "/oidc",
508
+ when: hasFeature("oidc"),
509
+ type: "input"
510
+ },
511
+ {
512
+ message: "Choose the package manager:",
513
+ type: "list",
514
+ name: "packageManager",
515
+ choices: packageManagerChoices
516
+ }
517
+ ];
518
+ }
519
+ });
520
+ //# sourceMappingURL=Features.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Features.js","sourceRoot":"","sources":["../../../src/services/Features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,MAAM,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAexE,MAAM,UAAU,QAAQ;IACtB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,CAAC,GAAQ,EAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;AAC1F,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,UAAkB,EAAE,KAAU;IACrD,OAAO,CAAC,GAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,KAAK,KAAK,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU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AO;gBAChB,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC;gBACxB,IAAI,EAAE,OAAO;aACd;YACD;gBACE,OAAO,EAAE,6BAA6B;gBACtC,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,qBAAqB;aAC/B;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import {CliPackageJson, Inject, registerProvider} from \"@tsed/cli-core\";\nimport {getValue} from \"@tsed/core\";\nimport {ProjectConvention, ArchitectureConvention} from \"../interfaces\";\n\nexport interface FeatureValue {\n type: string;\n dependencies?: {[key: string]: string | undefined};\n devDependencies?: {[key: string]: string | undefined};\n}\n\nexport interface Feature {\n name: string;\n value: FeatureValue;\n}\n\nexport type Features = Feature[];\n\nexport function Features() {\n return Inject(Features);\n}\n\nexport function hasFeature(feature: string) {\n return (ctx: any): boolean => !!ctx.features.find((item: any) => item.type === feature);\n}\n\nexport function hasValue(expression: string, value: any) {\n return (ctx: any) => getValue(expression, ctx) === value;\n}\n\nexport function isPlatform(...types: string[]) {\n return (ctx: any) => [types].includes(ctx.platform);\n}\n\nexport const FEATURES_TYPEORM_CONNECTION_TYPES = [\n {\n name: \"MySQL\",\n value: {\n type: \"typeorm:mysql\",\n dependencies: {\n mysql2: \"latest\"\n }\n }\n },\n {\n name: \"MariaDB\",\n value: {\n type: \"typeorm:mariadb\",\n dependencies: {\n mariadb: \"latest\"\n }\n }\n },\n {\n name: \"Postgres\",\n value: {\n type: \"typeorm:postgres\",\n dependencies: {\n pg: \"latest\"\n }\n }\n },\n {\n name: \"CockRoachDB\",\n value: {\n type: \"typeorm:postgres\",\n dependencies: {\n cockroachdb: \"latest\"\n }\n }\n },\n {\n name: \"SQLite\",\n value: {\n type: \"typeorm:sqlite\",\n dependencies: {\n sqlite3: \"latest\"\n }\n }\n },\n {\n name: \"Better SQLite3\",\n value: {\n type: \"typeorm:better-sqlite3\",\n dependencies: {\n \"better-sqlite3\": \"latest\"\n }\n }\n },\n {\n name: \"Cordova\",\n value: {\n type: \"typeorm:cordova\"\n }\n },\n {\n name: \"NativeScript\",\n value: {\n type: \"typeorm:nativescript\"\n }\n },\n {\n name: \"Oracle\",\n value: {\n type: \"typeorm:oracle\",\n dependencies: {\n oracledb: \"latest\"\n }\n }\n },\n {\n name: \"MsSQL\",\n value: {\n type: \"typeorm:mssql\",\n dependencies: {\n mssql: \"latest\"\n }\n }\n },\n {\n name: \"MongoDB\",\n value: {\n type: \"typeorm:mongodb\",\n dependencies: {\n mongodb: \"latest\"\n }\n }\n },\n {\n name: \"SQL.js\",\n value: {\n type: \"typeorm:sqljs\",\n dependencies: {}\n }\n },\n {\n name: \"ReactNative\",\n value: {\n type: \"typeorm:reactnative\",\n dependencies: {}\n }\n },\n {\n name: \"Expo\",\n value: {\n type: \"typeorm:expo\",\n dependencies: {}\n }\n }\n];\n\nconst babelDevDependencies = {\n \"@babel/cli\": \"latest\",\n \"@babel/core\": \"latest\",\n \"@babel/node\": \"latest\",\n \"@babel/plugin-proposal-class-properties\": \"latest\",\n \"@babel/plugin-proposal-decorators\": \"latest\",\n \"@babel/preset-env\": \"latest\",\n \"@babel/preset-typescript\": \"latest\",\n \"babel-plugin-transform-typescript-metadata\": \"latest\",\n \"babel-watch\": \"latest\"\n};\n\nconst platformChoices = [\n {\n name: \"Express.js\",\n checked: true,\n value: \"express\"\n },\n {\n name: \"Koa.js\",\n checked: false,\n value: \"koa\"\n }\n];\n\nconst conventionChoices = [\n {\n name: \"Ts.ED\",\n checked: true,\n value: ProjectConvention.DEFAULT\n },\n {\n name: \"Angular\",\n checked: false,\n value: ProjectConvention.ANGULAR\n }\n];\n\nconst featureChoices = (cliVersion: string) => [\n {\n name: \"TypeGraphQL\",\n value: {\n type: \"graphql\",\n dependencies: {\n \"@tsed/typegraphql\": \"{{tsedVersion}}\"\n },\n devDependencies: {\n \"@tsed/cli-plugin-typegraphql\": cliVersion\n }\n }\n },\n {\n name: \"Database\",\n value: {type: \"db\"}\n },\n {\n name: \"Passport.js\",\n when: isPlatform(\"express\"),\n value: {\n type: \"passportjs\",\n devDependencies: {\n \"@tsed/cli-plugin-passport\": cliVersion\n }\n }\n },\n {\n name: \"Socket.io\",\n value: {\n type: \"socketio\",\n dependencies: {\n \"@tsed/socketio\": \"{{tsedVersion}}\",\n \"socket.io\": \"latest\"\n }\n }\n },\n {\n name: \"Swagger\",\n value: {\n type: \"swagger\",\n dependencies: {\n \"@tsed/swagger\": \"{{tsedVersion}}\"\n }\n }\n },\n {\n name: \"OpenID Connect provider\",\n value: {\n type: \"oidc\",\n devDependencies: {\n \"@tsed/cli-plugin-oidc-provider\": cliVersion\n }\n }\n },\n {\n name: \"Testing\",\n value: {\n type: \"testing\",\n dependencies: {},\n devDependencies: {\n \"@types/supertest\": \"latest\",\n supertest: \"latest\"\n }\n }\n },\n {\n name: \"Linter\",\n value: {\n type: \"linter\"\n }\n },\n {\n name: \"Bundler\",\n value: {\n type: \"bundler\"\n }\n },\n {\n name: \"Commands\",\n value: {\n type: \"commands\",\n dependencies: {\n \"@tsed/cli-core\": cliVersion\n },\n devDependencies: {\n \"@types/inquirer\": \"latest\"\n }\n }\n }\n];\n\nconst featuresDbChoices = (cliVersion: string) => [\n {\n name: \"Prisma\",\n value: {\n type: \"prisma\",\n devDependencies: {\n \"@tsed/cli-plugin-prisma\": cliVersion\n }\n }\n },\n {\n name: \"Mongoose\",\n value: {\n type: \"mongoose\",\n devDependencies: {\n \"@tsed/cli-plugin-mongoose\": cliVersion\n }\n }\n },\n {\n name: \"TypeORM\",\n value: {\n type: \"typeorm\",\n devDependencies: {\n \"@tsed/cli-plugin-typeorm\": cliVersion\n }\n }\n }\n];\n\nconst featuresTestingChoices = (cliVersion: string) => [\n {\n name: \"Jest\",\n value: {\n type: \"jest\",\n devDependencies: {\n \"@tsed/cli-plugin-jest\": cliVersion\n }\n }\n },\n {\n name: \"Mocha + Chai + Sinon\",\n value: {\n type: \"mocha\",\n devDependencies: {\n \"@tsed/cli-plugin-mocha\": cliVersion\n }\n }\n }\n];\n\nconst featuresLinterChoices = (cliVersion: string) => [\n {\n name: \"EsLint\",\n checked: true,\n value: {\n type: \"eslint\",\n devDependencies: {\n \"@tsed/cli-plugin-eslint\": cliVersion\n }\n }\n }\n];\n\nconst featuresExtraLinterChoices = [\n {\n name: \"Prettier\",\n value: {\n type: \"prettier\"\n }\n },\n {\n name: \"Lint on commit\",\n value: {\n type: \"lintstaged\"\n }\n }\n];\n\nconst featuresBundlerChoices = [\n {\n name: \"Babel\",\n value: {\n type: \"babel\",\n devDependencies: {\n ...babelDevDependencies\n }\n }\n },\n {\n name: \"Webpack\",\n value: {\n type: \"babel:webpack\",\n devDependencies: {\n ...babelDevDependencies,\n \"babel-loader\": \"latest\",\n webpack: \"latest\",\n \"webpack-cli\": \"latest\"\n }\n }\n }\n];\n\nconst packageManagerChoices = [\n {\n name: \"Yarn\",\n checked: true,\n value: \"yarn\"\n },\n {\n name: \"NPM\",\n checked: false,\n value: \"npm\"\n },\n {\n name: \"PNPM - experimental\",\n checked: false,\n value: \"pnpm\"\n }\n];\n\nexport const parseFeaturesFile = (features: Record<string, any>, cliVersion: string) => {\n return {\n platform: features.platform,\n convention: features.convention,\n features: [\n ...featureChoices(cliVersion)\n .map((v) => v.value)\n .filter((v) => features.features.filter((v: string | Record<string, any>) => typeof v === \"string\").includes(v.type)),\n ...features.features.filter((v: string | Record<string, any>) => typeof v === \"object\")\n ],\n featuresDB: featuresDbChoices(cliVersion).find((v) => v.value.type === features.featuresDB)?.value,\n featuresTypeORM: FEATURES_TYPEORM_CONNECTION_TYPES.find((v) => v.value.type === features.featuresTypeORM)?.value,\n featuresTesting: featuresTestingChoices(cliVersion).find((v) => v.value.type === features.featuresTesting)?.value,\n featuresLinter: featuresLinterChoices(cliVersion).find((v) => v.value.type === features.featuresLinter)?.value,\n featuresExtraLinter: featuresExtraLinterChoices.map((v) => v.value).filter((v) => features.featuresExtraLinter?.includes(v.type)),\n featuresBundler: featuresBundlerChoices.find((v) => v.value.type === features.featuresBundlerChoices)?.value,\n packageManager: features.packageManager\n };\n};\n\nexport const getFeaturesChoicesValues = (cliVersion: string) => {\n return {\n platform: platformChoices.map((v) => v.value),\n convention: conventionChoices.map((v) => v.value),\n features: featureChoices(cliVersion).map((v) => v.value.type),\n featuresDB: featuresDbChoices(cliVersion).map((v) => v.value.type),\n featuresTypeORM: FEATURES_TYPEORM_CONNECTION_TYPES.map((v) => v.value.type),\n featuresTesting: featuresTestingChoices(cliVersion).map((v) => v.value.type),\n featuresLinter: featuresLinterChoices(cliVersion).map((v) => v.value.type),\n featuresExtraLinter: featuresExtraLinterChoices.map((v) => v.value.type),\n featuresBundler: featuresBundlerChoices.map((v) => v.value.type),\n packageManager: packageManagerChoices.map((v) => v.value)\n };\n};\n\nregisterProvider({\n provide: Features,\n deps: [CliPackageJson],\n useFactory(cliPackageJson: CliPackageJson) {\n const cliVersion = cliPackageJson.version;\n\n return [\n {\n message: \"Choose the target platform:\",\n type: \"list\",\n name: \"platform\",\n choices: platformChoices\n },\n {\n message: \"Choose the architecture for your project:\",\n type: \"list\",\n name: \"architecture\",\n choices: [\n {\n name: \"Ts.ED\",\n checked: true,\n value: ArchitectureConvention.DEFAULT\n },\n {\n name: \"feature\",\n checked: false,\n value: ArchitectureConvention.FEATURE\n }\n ]\n },\n {\n message: \"Choose the convention file styling:\",\n type: \"list\",\n name: \"convention\",\n choices: conventionChoices\n },\n {\n type: \"checkbox\",\n name: \"features\",\n message: \"Check the features needed for your project\",\n choices: featureChoices(cliVersion)\n },\n {\n message: \"Choose a ORM manager\",\n type: \"list\",\n name: \"featuresDB\",\n when: hasFeature(\"db\"),\n choices: featuresDbChoices(cliVersion)\n },\n {\n type: \"list\",\n name: \"featuresTypeORM\",\n message: \"Which TypeORM you want to install?\",\n choices: FEATURES_TYPEORM_CONNECTION_TYPES,\n when: hasValue(\"featuresDB.type\", \"typeorm\")\n },\n // {\n // type: \"password\",\n // name: \"GH_TOKEN\",\n // message:\n // \"Enter GH_TOKEN to use the premium @tsedio/prisma package or leave blank (see https://tsed.io/tutorials/prisma-client.html)\",\n // when: hasValue(\"featuresDB.type\", \"prisma\")\n // },\n {\n message: \"Choose unit framework\",\n type: \"list\",\n name: \"featuresTesting\",\n when: hasFeature(\"testing\"),\n choices: featuresTestingChoices(cliVersion)\n },\n {\n message: \"Choose linter tools framework\",\n type: \"list\",\n name: \"featuresLinter\",\n when: hasFeature(\"linter\"),\n choices: featuresLinterChoices(cliVersion)\n },\n {\n message: \"Choose extra linter tools\",\n type: \"checkbox\",\n name: \"featuresExtraLinter\",\n when: hasFeature(\"linter\"),\n choices: featuresExtraLinterChoices\n },\n {\n message: \"Choose your bundler\",\n type: \"list\",\n name: \"featuresBundler\",\n when: hasFeature(\"bundler\"),\n choices: featuresBundlerChoices\n },\n {\n message: \"Choose the OIDC base path server\",\n name: \"oidcBasePath\",\n default: \"/oidc\",\n when: hasFeature(\"oidc\"),\n type: \"input\"\n },\n {\n message: \"Choose the OIDC base path server\",\n name: \"oidcBasePath\",\n default: \"/oidc\",\n when: hasFeature(\"oidc\"),\n type: \"input\"\n },\n {\n message: \"Choose the package manager:\",\n type: \"list\",\n name: \"packageManager\",\n choices: packageManagerChoices\n }\n ];\n }\n});\n"]}
@@ -0,0 +1,48 @@
1
+ import { __decorate } from "tslib";
2
+ import { Injectable, nameOf } from "@tsed/cli-core";
3
+ let ProvidersInfoService = class ProvidersInfoService {
4
+ constructor() {
5
+ this.map = new Map();
6
+ }
7
+ /**
8
+ *
9
+ * @param providerInfo
10
+ * @param owner
11
+ */
12
+ add(providerInfo, owner) {
13
+ this.map.set(providerInfo.value, {
14
+ ...providerInfo,
15
+ owner: nameOf(owner)
16
+ });
17
+ return this;
18
+ }
19
+ get(value) {
20
+ return this.map.get(value);
21
+ }
22
+ isMyProvider(value, owner) {
23
+ var _a;
24
+ return ((_a = this.map.get(value)) === null || _a === void 0 ? void 0 : _a.owner) === nameOf(owner);
25
+ }
26
+ toArray() {
27
+ return Array.from(this.map.values());
28
+ }
29
+ findProviders(type) {
30
+ const providers = this.toArray();
31
+ if (!type) {
32
+ return providers;
33
+ }
34
+ type = type.toLowerCase();
35
+ if (this.get(type)) {
36
+ return [this.get(type)];
37
+ }
38
+ const proposedProviders = providers.filter((provider) => {
39
+ return provider.name.toLowerCase().includes(type) || provider.value.includes(type);
40
+ });
41
+ return proposedProviders.length ? proposedProviders : providers;
42
+ }
43
+ };
44
+ ProvidersInfoService = __decorate([
45
+ Injectable()
46
+ ], ProvidersInfoService);
47
+ export { ProvidersInfoService };
48
+ //# sourceMappingURL=ProvidersInfoService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProvidersInfoService.js","sourceRoot":"","sources":["../../../src/services/ProvidersInfoService.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAE,MAAM,EAAO,MAAM,gBAAgB,CAAC;AAWxD,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAAjC;QACW,QAAG,GAA8B,IAAI,GAAG,EAAE,CAAC;IA8CtD,CAAC;IA5CC;;;;OAIG;IACH,GAAG,CAAC,YAA0B,EAAE,KAAiB;QAC/C,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,EAAE;YAC/B,GAAG,YAAY;YACf,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;SACrB,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,GAAG,CAAC,KAAa;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,YAAY,CAAC,KAAa,EAAE,KAAgB;;QAC1C,OAAO,CAAA,MAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,0CAAE,KAAK,MAAK,MAAM,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,aAAa,CAAC,IAAwB;QACpC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAE1B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAClB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;SACzB;QAED,MAAM,iBAAiB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;YACtD,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAK,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAK,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;QAEH,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,CAAC;CACF,CAAA;AA/CY,oBAAoB;IADhC,UAAU,EAAE;GACA,oBAAoB,CA+ChC;SA/CY,oBAAoB","sourcesContent":["import {Injectable, nameOf, Type} from \"@tsed/cli-core\";\n\nexport interface ProviderInfo {\n name: string;\n value: string;\n model?: string;\n baseDir?: string;\n owner?: string;\n}\n\n@Injectable()\nexport class ProvidersInfoService {\n readonly map: Map<string, ProviderInfo> = new Map();\n\n /**\n *\n * @param providerInfo\n * @param owner\n */\n add(providerInfo: ProviderInfo, owner?: Type<any>) {\n this.map.set(providerInfo.value, {\n ...providerInfo,\n owner: nameOf(owner)\n });\n\n return this;\n }\n\n get(value: string): any {\n return this.map.get(value);\n }\n\n isMyProvider(value: string, owner: Type<any>) {\n return this.map.get(value)?.owner === nameOf(owner);\n }\n\n toArray() {\n return Array.from(this.map.values());\n }\n\n findProviders(type: string | undefined): ProviderInfo[] {\n const providers = this.toArray();\n if (!type) {\n return providers;\n }\n\n type = type.toLowerCase();\n\n if (this.get(type)) {\n return [this.get(type)];\n }\n\n const proposedProviders = providers.filter((provider) => {\n return provider.name.toLowerCase().includes(type!) || provider.value.includes(type!);\n });\n\n return proposedProviders.length ? proposedProviders : providers;\n }\n}\n"]}
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,4 @@
1
+ export declare const PKG: import("read-pkg").NormalizedPackageJson;
1
2
  export declare const MINIMAL_TSED_VERSION = "6";
2
3
  export declare const DEFAULT_TSED_TAGS = "latest";
3
4
  export declare const IGNORE_VERSIONS: string[];
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes