@tsed/cli 3.25.0 → 4.0.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 (86) hide show
  1. package/lib/cjs/Cli.js.map +1 -1
  2. package/lib/cjs/commands/init/InitCmd.js +70 -35
  3. package/lib/cjs/commands/init/InitCmd.js.map +1 -1
  4. package/lib/cjs/commands/init/config/FeaturesPrompt.js +406 -0
  5. package/lib/cjs/commands/init/config/FeaturesPrompt.js.map +1 -0
  6. package/lib/cjs/commands/init/config/InitFileSchema.js +53 -0
  7. package/lib/cjs/commands/init/config/InitFileSchema.js.map +1 -0
  8. package/lib/cjs/commands/init/interfaces/InitCmdContext.js +3 -0
  9. package/lib/cjs/commands/init/interfaces/InitCmdContext.js.map +1 -0
  10. package/lib/cjs/commands/init/interfaces/InitOptions.js +3 -0
  11. package/lib/cjs/commands/init/interfaces/InitOptions.js.map +1 -0
  12. package/lib/cjs/commands/init/interfaces/InitPromptAnswers.js +3 -0
  13. package/lib/cjs/commands/init/interfaces/InitPromptAnswers.js.map +1 -0
  14. package/lib/cjs/commands/init/mappers/mapToContext.js +16 -0
  15. package/lib/cjs/commands/init/mappers/mapToContext.js.map +1 -0
  16. package/lib/cjs/commands/init/mappers/mapUniqFeatures.js +18 -0
  17. package/lib/cjs/commands/init/mappers/mapUniqFeatures.js.map +1 -0
  18. package/lib/cjs/commands/init/prompts/getFeaturesPrompt.js +25 -0
  19. package/lib/cjs/commands/init/prompts/getFeaturesPrompt.js.map +1 -0
  20. package/lib/cjs/commands/init/utils/hasFeature.js +13 -0
  21. package/lib/cjs/commands/init/utils/hasFeature.js.map +1 -0
  22. package/lib/cjs/commands/init/utils/isPlatform.js +8 -0
  23. package/lib/cjs/commands/init/utils/isPlatform.js.map +1 -0
  24. package/lib/cjs/constants/index.js +3 -3
  25. package/lib/cjs/constants/index.js.map +1 -1
  26. package/lib/cjs/index.js +5 -1
  27. package/lib/cjs/index.js.map +1 -1
  28. package/lib/cjs/interfaces/PlatformType.js +9 -0
  29. package/lib/cjs/interfaces/PlatformType.js.map +1 -0
  30. package/lib/cjs/interfaces/index.js +1 -0
  31. package/lib/cjs/interfaces/index.js.map +1 -1
  32. package/lib/esm/Cli.js.map +1 -1
  33. package/lib/esm/commands/init/InitCmd.js +73 -38
  34. package/lib/esm/commands/init/InitCmd.js.map +1 -1
  35. package/lib/esm/commands/init/config/FeaturesPrompt.js +402 -0
  36. package/lib/esm/commands/init/config/FeaturesPrompt.js.map +1 -0
  37. package/lib/esm/commands/init/config/InitFileSchema.js +50 -0
  38. package/lib/esm/commands/init/config/InitFileSchema.js.map +1 -0
  39. package/lib/esm/commands/init/interfaces/InitCmdContext.js +2 -0
  40. package/lib/esm/commands/init/interfaces/InitCmdContext.js.map +1 -0
  41. package/lib/esm/commands/init/interfaces/InitOptions.js +2 -0
  42. package/lib/esm/commands/init/interfaces/InitOptions.js.map +1 -0
  43. package/lib/esm/commands/init/interfaces/InitPromptAnswers.js +2 -0
  44. package/lib/esm/commands/init/interfaces/InitPromptAnswers.js.map +1 -0
  45. package/lib/esm/commands/init/mappers/mapToContext.js +12 -0
  46. package/lib/esm/commands/init/mappers/mapToContext.js.map +1 -0
  47. package/lib/esm/commands/init/mappers/mapUniqFeatures.js +14 -0
  48. package/lib/esm/commands/init/mappers/mapUniqFeatures.js.map +1 -0
  49. package/lib/esm/commands/init/prompts/getFeaturesPrompt.js +21 -0
  50. package/lib/esm/commands/init/prompts/getFeaturesPrompt.js.map +1 -0
  51. package/lib/esm/commands/init/utils/hasFeature.js +8 -0
  52. package/lib/esm/commands/init/utils/hasFeature.js.map +1 -0
  53. package/lib/esm/commands/init/utils/isPlatform.js +4 -0
  54. package/lib/esm/commands/init/utils/isPlatform.js.map +1 -0
  55. package/lib/esm/constants/index.js +3 -3
  56. package/lib/esm/constants/index.js.map +1 -1
  57. package/lib/esm/index.js +5 -1
  58. package/lib/esm/index.js.map +1 -1
  59. package/lib/esm/interfaces/PlatformType.js +6 -0
  60. package/lib/esm/interfaces/PlatformType.js.map +1 -0
  61. package/lib/esm/interfaces/index.js +1 -0
  62. package/lib/esm/interfaces/index.js.map +1 -1
  63. package/lib/types/Cli.d.ts +2 -2
  64. package/lib/types/commands/init/InitCmd.d.ts +8 -24
  65. package/lib/types/commands/init/config/FeaturesPrompt.d.ts +98 -0
  66. package/lib/types/commands/init/config/InitFileSchema.d.ts +49 -0
  67. package/lib/types/commands/init/interfaces/InitCmdContext.d.ts +6 -0
  68. package/lib/types/commands/init/interfaces/InitOptions.d.ts +19 -0
  69. package/lib/types/commands/init/interfaces/InitPromptAnswers.d.ts +16 -0
  70. package/lib/types/commands/init/mappers/mapToContext.d.ts +2 -0
  71. package/lib/types/commands/init/mappers/mapUniqFeatures.d.ts +3 -0
  72. package/lib/types/commands/init/prompts/getFeaturesPrompt.d.ts +2 -0
  73. package/lib/types/commands/init/utils/hasFeature.d.ts +2 -0
  74. package/lib/types/commands/init/utils/isPlatform.d.ts +1 -0
  75. package/lib/types/constants/index.d.ts +2 -2
  76. package/lib/types/index.d.ts +5 -1
  77. package/lib/types/interfaces/PlatformType.d.ts +4 -0
  78. package/lib/types/interfaces/index.d.ts +1 -0
  79. package/package.json +14 -9
  80. package/readme.md +104 -14
  81. package/templates/init/tsconfig.json.hbs +5 -3
  82. package/lib/cjs/services/Features.js +0 -528
  83. package/lib/cjs/services/Features.js.map +0 -1
  84. package/lib/esm/services/Features.js +0 -519
  85. package/lib/esm/services/Features.js.map +0 -1
  86. package/lib/types/services/Features.d.ts +0 -412
@@ -0,0 +1,406 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FeaturesPrompt = exports.FeaturesMap = exports.FeatureType = void 0;
4
+ const cli_core_1 = require("@tsed/cli-core");
5
+ const isPlatform_1 = require("../utils/isPlatform");
6
+ const hasFeature_1 = require("../utils/hasFeature");
7
+ const interfaces_1 = require("../../../interfaces");
8
+ var FeatureType;
9
+ (function (FeatureType) {
10
+ FeatureType["GRAPHQL"] = "graphql";
11
+ FeatureType["SOCKETIO"] = "socketio";
12
+ FeatureType["SWAGGER"] = "swagger";
13
+ FeatureType["OIDC"] = "oidc";
14
+ FeatureType["PASSPORTJS"] = "passportjs";
15
+ FeatureType["COMMANDS"] = "commands";
16
+ FeatureType["DB"] = "db";
17
+ // ORM
18
+ FeatureType["PRISMA"] = "prisma";
19
+ FeatureType["MONGOOSE"] = "mongoose";
20
+ // TYPEORM
21
+ FeatureType["TYPEORM"] = "typeorm";
22
+ FeatureType["TYPEORM_MYSQL"] = "typeorm:mysql";
23
+ FeatureType["TYPEORM_MARIADB"] = "typeorm:mariadb";
24
+ FeatureType["TYPEORM_POSTGRES"] = "typeorm:postgres";
25
+ FeatureType["TYPEORM_COCKROACHDB"] = "typeorm:cockroachdb";
26
+ FeatureType["TYPEORM_SQLITE"] = "typeorm:sqlite";
27
+ FeatureType["TYPEORM_BETTER_SQLITE3"] = "typeorm:better-sqlite3";
28
+ FeatureType["TYPEORM_CORDOVA"] = "typeorm:cordova";
29
+ FeatureType["TYPEORM_NATIVESCRIPT"] = "typeorm:nativescript";
30
+ FeatureType["TYPEORM_ORACLE"] = "typeorm:oracle";
31
+ FeatureType["TYPEORM_MSSQL"] = "typeorm:mssql";
32
+ FeatureType["TYPEORM_MONGODB"] = "typeorm:mongodb";
33
+ FeatureType["TYPEORM_SQLJS"] = "typeorm:sqljs";
34
+ FeatureType["TYPEORM_REACTNATIVE"] = "typeorm:reactnative";
35
+ FeatureType["TYPEORM_EXPO"] = "typeorm:expo";
36
+ // TESTING
37
+ FeatureType["TESTING"] = "testing";
38
+ FeatureType["JEST"] = "jest";
39
+ FeatureType["MOCHA"] = "mocha";
40
+ FeatureType["LINTER"] = "linter";
41
+ FeatureType["ESLINT"] = "eslint";
42
+ FeatureType["LINT_STAGED"] = "lintstaged";
43
+ FeatureType["PRETTIER"] = "prettier";
44
+ // BUNDLER
45
+ FeatureType["BUNDLER"] = "bundler";
46
+ FeatureType["BABEL"] = "babel";
47
+ FeatureType["WEBPACK"] = "babel:webpack";
48
+ })(FeatureType = exports.FeatureType || (exports.FeatureType = {}));
49
+ exports.FeaturesMap = {
50
+ [interfaces_1.PlatformType.EXPRESS]: {
51
+ name: "Express.js",
52
+ checked: (options) => options.platform !== interfaces_1.PlatformType.KOA
53
+ },
54
+ [interfaces_1.PlatformType.KOA]: {
55
+ name: "Koa.js",
56
+ checked: (options) => options.platform === interfaces_1.PlatformType.KOA
57
+ },
58
+ [FeatureType.GRAPHQL]: {
59
+ name: "TypeGraphQL",
60
+ dependencies: {
61
+ "@tsed/typegraphql": "{{tsedVersion}}"
62
+ },
63
+ devDependencies: {
64
+ "@tsed/cli-plugin-typegraphql": "{{cliVersion}}"
65
+ }
66
+ },
67
+ [FeatureType.DB]: {
68
+ name: "Database"
69
+ },
70
+ [FeatureType.PASSPORTJS]: {
71
+ name: "Passport.js",
72
+ when: (0, isPlatform_1.isPlatform)(interfaces_1.PlatformType.EXPRESS),
73
+ devDependencies: {
74
+ "@tsed/cli-plugin-passport": "{{cliVersion}}"
75
+ }
76
+ },
77
+ [FeatureType.SOCKETIO]: {
78
+ name: "Socket.io",
79
+ dependencies: {
80
+ "@tsed/socketio": "{{tsedVersion}}",
81
+ "socket.io": "latest"
82
+ }
83
+ },
84
+ [FeatureType.SWAGGER]: {
85
+ name: "Swagger",
86
+ dependencies: {
87
+ "@tsed/swagger": "{{tsedVersion}}"
88
+ }
89
+ },
90
+ [FeatureType.OIDC]: {
91
+ name: "OpenID Connect provider",
92
+ devDependencies: {
93
+ "@tsed/cli-plugin-oidc-provider": "{{cliVersion}}"
94
+ }
95
+ },
96
+ [FeatureType.TESTING]: {
97
+ name: "Testing",
98
+ dependencies: {},
99
+ devDependencies: {
100
+ "@types/supertest": "latest",
101
+ supertest: "latest"
102
+ }
103
+ },
104
+ [FeatureType.LINTER]: {
105
+ name: "Linter"
106
+ },
107
+ [FeatureType.BUNDLER]: {
108
+ name: "Bundler"
109
+ },
110
+ [FeatureType.COMMANDS]: {
111
+ name: "Commands",
112
+ dependencies: {
113
+ "@tsed/cli-core": "{{cliVersion}}"
114
+ },
115
+ devDependencies: {
116
+ "@types/inquirer": "latest"
117
+ }
118
+ },
119
+ [interfaces_1.ProjectConvention.DEFAULT]: {
120
+ name: "Ts.ED",
121
+ checked: true
122
+ },
123
+ [interfaces_1.ProjectConvention.ANGULAR]: {
124
+ name: "Angular",
125
+ checked: false
126
+ },
127
+ [interfaces_1.ArchitectureConvention.DEFAULT]: {
128
+ name: "Ts.ED",
129
+ checked: true
130
+ },
131
+ [interfaces_1.ArchitectureConvention.FEATURE]: {
132
+ name: "feature",
133
+ checked: false
134
+ },
135
+ [FeatureType.TYPEORM_MYSQL]: {
136
+ name: "MySQL",
137
+ dependencies: {
138
+ mysql2: "latest"
139
+ }
140
+ },
141
+ [FeatureType.TYPEORM_MARIADB]: {
142
+ name: "MariaDB",
143
+ dependencies: {
144
+ mariadb: "latest"
145
+ }
146
+ },
147
+ [FeatureType.TYPEORM_POSTGRES]: {
148
+ name: "Postgres",
149
+ dependencies: {
150
+ pg: "latest"
151
+ }
152
+ },
153
+ [FeatureType.TYPEORM_COCKROACHDB]: {
154
+ name: "CockRoachDB",
155
+ dependencies: {
156
+ cockroachdb: "latest"
157
+ }
158
+ },
159
+ [FeatureType.TYPEORM_SQLITE]: {
160
+ name: "SQLite",
161
+ dependencies: {
162
+ sqlite3: "latest"
163
+ }
164
+ },
165
+ [FeatureType.TYPEORM_BETTER_SQLITE3]: {
166
+ name: "Better SQLite3",
167
+ dependencies: {
168
+ "better-sqlite3": "latest"
169
+ }
170
+ },
171
+ [FeatureType.TYPEORM_CORDOVA]: {
172
+ name: "Cordova"
173
+ },
174
+ [FeatureType.TYPEORM_NATIVESCRIPT]: {
175
+ name: "NativeScript"
176
+ },
177
+ [FeatureType.TYPEORM_ORACLE]: {
178
+ name: "Oracle",
179
+ dependencies: {
180
+ oracledb: "latest"
181
+ }
182
+ },
183
+ [FeatureType.TYPEORM_MSSQL]: {
184
+ name: "MsSQL",
185
+ dependencies: {
186
+ mssql: "latest"
187
+ }
188
+ },
189
+ [FeatureType.TYPEORM_MONGODB]: {
190
+ name: "MongoDB",
191
+ dependencies: {
192
+ mongodb: "latest"
193
+ }
194
+ },
195
+ [FeatureType.TYPEORM_SQLJS]: {
196
+ name: "SQL.js"
197
+ },
198
+ [FeatureType.TYPEORM_REACTNATIVE]: {
199
+ name: "ReactNative"
200
+ },
201
+ [FeatureType.TYPEORM_EXPO]: {
202
+ name: "Expo"
203
+ },
204
+ [FeatureType.PRISMA]: {
205
+ name: "Prisma",
206
+ devDependencies: {
207
+ "@tsed/cli-plugin-prisma": "{{cliVersion}}"
208
+ }
209
+ },
210
+ [FeatureType.MONGOOSE]: {
211
+ name: "Mongoose",
212
+ devDependencies: {
213
+ "@tsed/cli-plugin-mongoose": "{{cliVersion}}"
214
+ }
215
+ },
216
+ [FeatureType.TYPEORM]: {
217
+ name: "TypeORM",
218
+ devDependencies: {
219
+ "@tsed/cli-plugin-typeorm": "{{cliVersion}}"
220
+ }
221
+ },
222
+ [FeatureType.JEST]: {
223
+ name: "Jest",
224
+ devDependencies: {
225
+ "@tsed/cli-plugin-jest": "{{cliVersion}}"
226
+ }
227
+ },
228
+ [FeatureType.MOCHA]: {
229
+ name: "Mocha + Chai + Sinon",
230
+ devDependencies: {
231
+ "@tsed/cli-plugin-mocha": "{{cliVersion}}"
232
+ }
233
+ },
234
+ [FeatureType.ESLINT]: {
235
+ name: "EsLint",
236
+ checked: true,
237
+ devDependencies: {
238
+ "@tsed/cli-plugin-eslint": "{{cliVersion}}"
239
+ }
240
+ },
241
+ [FeatureType.PRETTIER]: {
242
+ name: "Prettier"
243
+ },
244
+ [FeatureType.LINT_STAGED]: {
245
+ name: "Lint on commit"
246
+ },
247
+ [FeatureType.BABEL]: {
248
+ name: "Babel",
249
+ devDependencies: {
250
+ "@babel/cli": "latest",
251
+ "@babel/core": "latest",
252
+ "@babel/node": "latest",
253
+ "@babel/plugin-proposal-class-properties": "latest",
254
+ "@babel/plugin-proposal-decorators": "latest",
255
+ "@babel/preset-env": "latest",
256
+ "@babel/preset-typescript": "latest",
257
+ "babel-plugin-transform-typescript-metadata": "latest",
258
+ "babel-watch": "latest"
259
+ }
260
+ },
261
+ [FeatureType.WEBPACK]: {
262
+ name: "Webpack",
263
+ devDependencies: {
264
+ "@babel/cli": "latest",
265
+ "@babel/core": "latest",
266
+ "@babel/node": "latest",
267
+ "@babel/plugin-proposal-class-properties": "latest",
268
+ "@babel/plugin-proposal-decorators": "latest",
269
+ "@babel/preset-env": "latest",
270
+ "@babel/preset-typescript": "latest",
271
+ "babel-plugin-transform-typescript-metadata": "latest",
272
+ "babel-watch": "latest",
273
+ "babel-loader": "latest",
274
+ webpack: "latest",
275
+ "webpack-cli": "latest"
276
+ }
277
+ },
278
+ [cli_core_1.PackageManager.YARN]: {
279
+ name: "Yarn",
280
+ checked: true
281
+ },
282
+ [cli_core_1.PackageManager.NPM]: {
283
+ name: "NPM",
284
+ checked: false
285
+ },
286
+ [cli_core_1.PackageManager.PNPM]: {
287
+ name: "PNPM - experimental",
288
+ checked: false
289
+ }
290
+ };
291
+ const FeaturesPrompt = () => [
292
+ {
293
+ message: "Choose the target platform:",
294
+ type: "list",
295
+ name: "platform",
296
+ choices: [interfaces_1.PlatformType.EXPRESS, interfaces_1.PlatformType.KOA]
297
+ },
298
+ {
299
+ message: "Choose the architecture for your project:",
300
+ type: "list",
301
+ name: "architecture",
302
+ choices: [interfaces_1.ArchitectureConvention.DEFAULT, interfaces_1.ArchitectureConvention.FEATURE]
303
+ },
304
+ {
305
+ message: "Choose the convention file styling:",
306
+ type: "list",
307
+ name: "convention",
308
+ choices: [interfaces_1.ProjectConvention.DEFAULT, interfaces_1.ProjectConvention.ANGULAR]
309
+ },
310
+ {
311
+ type: "checkbox",
312
+ name: "features",
313
+ message: "Check the features needed for your project",
314
+ choices: [
315
+ FeatureType.GRAPHQL,
316
+ FeatureType.DB,
317
+ FeatureType.PASSPORTJS,
318
+ FeatureType.SOCKETIO,
319
+ FeatureType.SWAGGER,
320
+ FeatureType.OIDC,
321
+ FeatureType.TESTING,
322
+ FeatureType.LINTER,
323
+ FeatureType.BUNDLER,
324
+ FeatureType.COMMANDS
325
+ ]
326
+ },
327
+ {
328
+ message: "Choose a ORM manager",
329
+ type: "list",
330
+ name: "featuresDB",
331
+ when: (0, hasFeature_1.hasFeature)(FeatureType.DB),
332
+ choices: [FeatureType.PRISMA, FeatureType.MONGOOSE, FeatureType.TYPEORM]
333
+ },
334
+ {
335
+ type: "list",
336
+ name: "featuresTypeORM",
337
+ message: "Which TypeORM you want to install?",
338
+ choices: [
339
+ FeatureType.TYPEORM_MYSQL,
340
+ FeatureType.TYPEORM_MARIADB,
341
+ FeatureType.TYPEORM_POSTGRES,
342
+ FeatureType.TYPEORM_COCKROACHDB,
343
+ FeatureType.TYPEORM_SQLITE,
344
+ FeatureType.TYPEORM_BETTER_SQLITE3,
345
+ FeatureType.TYPEORM_CORDOVA,
346
+ FeatureType.TYPEORM_NATIVESCRIPT,
347
+ FeatureType.TYPEORM_ORACLE,
348
+ FeatureType.TYPEORM_MSSQL,
349
+ FeatureType.TYPEORM_MONGODB,
350
+ FeatureType.TYPEORM_SQLJS,
351
+ FeatureType.TYPEORM_REACTNATIVE,
352
+ FeatureType.TYPEORM_EXPO
353
+ ],
354
+ when: (0, hasFeature_1.hasValue)("featuresDB", FeatureType.TYPEORM)
355
+ },
356
+ // {
357
+ // type: "password",
358
+ // name: "GH_TOKEN",
359
+ // message:
360
+ // "Enter GH_TOKEN to use the premium @tsedio/prisma package or leave blank (see https://tsed.io/tutorials/prisma-client.html)",
361
+ // when: hasValue("featuresDB.type", "prisma")
362
+ // },
363
+ {
364
+ message: "Choose unit framework",
365
+ type: "list",
366
+ name: "featuresTesting",
367
+ when: (0, hasFeature_1.hasFeature)(FeatureType.TESTING),
368
+ choices: [FeatureType.JEST, FeatureType.MOCHA]
369
+ },
370
+ {
371
+ message: "Choose linter tools framework",
372
+ type: "list",
373
+ name: "featuresLinter",
374
+ when: (0, hasFeature_1.hasFeature)(FeatureType.LINTER),
375
+ choices: [FeatureType.ESLINT]
376
+ },
377
+ {
378
+ message: "Choose extra linter tools",
379
+ type: "checkbox",
380
+ name: "featuresExtraLinter",
381
+ when: (0, hasFeature_1.hasFeature)(FeatureType.LINTER),
382
+ choices: [FeatureType.PRETTIER, FeatureType.LINT_STAGED]
383
+ },
384
+ {
385
+ message: "Choose your bundler",
386
+ type: "list",
387
+ name: "featuresBundler",
388
+ when: (0, hasFeature_1.hasFeature)(FeatureType.BUNDLER),
389
+ choices: [FeatureType.BABEL, FeatureType.WEBPACK]
390
+ },
391
+ {
392
+ message: "Choose the OIDC base path server",
393
+ name: "oidcBasePath",
394
+ default: "/oidc",
395
+ when: (0, hasFeature_1.hasFeature)(FeatureType.OIDC),
396
+ type: "input"
397
+ },
398
+ {
399
+ message: "Choose the package manager:",
400
+ type: "list",
401
+ name: "packageManager",
402
+ choices: [cli_core_1.PackageManager.YARN, cli_core_1.PackageManager.NPM, cli_core_1.PackageManager.PNPM]
403
+ }
404
+ ];
405
+ exports.FeaturesPrompt = FeaturesPrompt;
406
+ //# sourceMappingURL=FeaturesPrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeaturesPrompt.js","sourceRoot":"","sources":["../../../../../src/commands/init/config/FeaturesPrompt.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAC9C,oDAA+C;AAC/C,oDAAyD;AAEzD,oDAA4F;AAW5F,IAAY,WA4CX;AA5CD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,wBAAS,CAAA;IAET,MAAM;IACN,gCAAiB,CAAA;IAEjB,oCAAqB,CAAA;IAErB,UAAU;IACV,kCAAmB,CAAA;I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AAO,CAAC;KAClD;IACD;QACE,OAAO,EAAE,kCAAkC;QAC3C,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,IAAA,uBAAU,EAAC,WAAW,CAAC,IAAI,CAAC;QAClC,IAAI,EAAE,OAAO;KACd;IACD;QACE,OAAO,EAAE,6BAA6B;QACtC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,CAAC,yBAAc,CAAC,IAAI,EAAE,yBAAc,CAAC,GAAG,EAAE,yBAAc,CAAC,IAAI,CAAC;KACxE;CACF,CAAC;AAjHW,QAAA,cAAc,kBAiHzB","sourcesContent":["import {PackageManager} from \"@tsed/cli-core\";\nimport {isPlatform} from \"../utils/isPlatform\";\nimport {hasFeature, hasValue} from \"../utils/hasFeature\";\nimport {InitOptions} from \"../interfaces/InitOptions\";\nimport {ArchitectureConvention, PlatformType, ProjectConvention} from \"../../../interfaces\";\n\nexport interface Feature {\n name: string;\n value?: any;\n checked?: boolean | ((opts: Partial<InitOptions>) => boolean);\n when?: (opts: any) => boolean;\n dependencies?: Record<string, any>;\n devDependencies?: Record<string, any>;\n}\n\nexport enum FeatureType {\n GRAPHQL = \"graphql\",\n SOCKETIO = \"socketio\",\n SWAGGER = \"swagger\",\n OIDC = \"oidc\",\n PASSPORTJS = \"passportjs\",\n COMMANDS = \"commands\",\n DB = \"db\",\n\n // ORM\n PRISMA = \"prisma\",\n\n MONGOOSE = \"mongoose\",\n\n // TYPEORM\n TYPEORM = \"typeorm\",\n TYPEORM_MYSQL = \"typeorm:mysql\",\n TYPEORM_MARIADB = \"typeorm:mariadb\",\n TYPEORM_POSTGRES = \"typeorm:postgres\",\n TYPEORM_COCKROACHDB = \"typeorm:cockroachdb\",\n TYPEORM_SQLITE = \"typeorm:sqlite\",\n TYPEORM_BETTER_SQLITE3 = \"typeorm:better-sqlite3\",\n TYPEORM_CORDOVA = \"typeorm:cordova\",\n TYPEORM_NATIVESCRIPT = \"typeorm:nativescript\",\n TYPEORM_ORACLE = \"typeorm:oracle\",\n TYPEORM_MSSQL = \"typeorm:mssql\",\n TYPEORM_MONGODB = \"typeorm:mongodb\",\n TYPEORM_SQLJS = \"typeorm:sqljs\",\n TYPEORM_REACTNATIVE = \"typeorm:reactnative\",\n TYPEORM_EXPO = \"typeorm:expo\",\n\n // TESTING\n TESTING = \"testing\",\n JEST = \"jest\",\n MOCHA = \"mocha\",\n LINTER = \"linter\",\n ESLINT = \"eslint\",\n LINT_STAGED = \"lintstaged\",\n PRETTIER = \"prettier\",\n\n // BUNDLER\n BUNDLER = \"bundler\",\n BABEL = \"babel\",\n WEBPACK = \"babel:webpack\"\n}\n\nexport const FeaturesMap: Record<string, Feature> = {\n [PlatformType.EXPRESS]: {\n name: \"Express.js\",\n checked: (options: any) => options.platform !== PlatformType.KOA\n },\n [PlatformType.KOA]: {\n name: \"Koa.js\",\n checked: (options: any) => options.platform === PlatformType.KOA\n },\n [FeatureType.GRAPHQL]: {\n name: \"TypeGraphQL\",\n dependencies: {\n \"@tsed/typegraphql\": \"{{tsedVersion}}\"\n },\n devDependencies: {\n \"@tsed/cli-plugin-typegraphql\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.DB]: {\n name: \"Database\"\n },\n [FeatureType.PASSPORTJS]: {\n name: \"Passport.js\",\n when: isPlatform(PlatformType.EXPRESS),\n devDependencies: {\n \"@tsed/cli-plugin-passport\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.SOCKETIO]: {\n name: \"Socket.io\",\n dependencies: {\n \"@tsed/socketio\": \"{{tsedVersion}}\",\n \"socket.io\": \"latest\"\n }\n },\n [FeatureType.SWAGGER]: {\n name: \"Swagger\",\n dependencies: {\n \"@tsed/swagger\": \"{{tsedVersion}}\"\n }\n },\n [FeatureType.OIDC]: {\n name: \"OpenID Connect provider\",\n devDependencies: {\n \"@tsed/cli-plugin-oidc-provider\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.TESTING]: {\n name: \"Testing\",\n dependencies: {},\n devDependencies: {\n \"@types/supertest\": \"latest\",\n supertest: \"latest\"\n }\n },\n [FeatureType.LINTER]: {\n name: \"Linter\"\n },\n [FeatureType.BUNDLER]: {\n name: \"Bundler\"\n },\n [FeatureType.COMMANDS]: {\n name: \"Commands\",\n dependencies: {\n \"@tsed/cli-core\": \"{{cliVersion}}\"\n },\n devDependencies: {\n \"@types/inquirer\": \"latest\"\n }\n },\n\n [ProjectConvention.DEFAULT]: {\n name: \"Ts.ED\",\n checked: true\n },\n [ProjectConvention.ANGULAR]: {\n name: \"Angular\",\n checked: false\n },\n [ArchitectureConvention.DEFAULT]: {\n name: \"Ts.ED\",\n checked: true\n },\n [ArchitectureConvention.FEATURE]: {\n name: \"feature\",\n checked: false\n },\n [FeatureType.TYPEORM_MYSQL]: {\n name: \"MySQL\",\n dependencies: {\n mysql2: \"latest\"\n }\n },\n [FeatureType.TYPEORM_MARIADB]: {\n name: \"MariaDB\",\n dependencies: {\n mariadb: \"latest\"\n }\n },\n [FeatureType.TYPEORM_POSTGRES]: {\n name: \"Postgres\",\n dependencies: {\n pg: \"latest\"\n }\n },\n [FeatureType.TYPEORM_COCKROACHDB]: {\n name: \"CockRoachDB\",\n dependencies: {\n cockroachdb: \"latest\"\n }\n },\n [FeatureType.TYPEORM_SQLITE]: {\n name: \"SQLite\",\n dependencies: {\n sqlite3: \"latest\"\n }\n },\n [FeatureType.TYPEORM_BETTER_SQLITE3]: {\n name: \"Better SQLite3\",\n dependencies: {\n \"better-sqlite3\": \"latest\"\n }\n },\n [FeatureType.TYPEORM_CORDOVA]: {\n name: \"Cordova\"\n },\n [FeatureType.TYPEORM_NATIVESCRIPT]: {\n name: \"NativeScript\"\n },\n [FeatureType.TYPEORM_ORACLE]: {\n name: \"Oracle\",\n dependencies: {\n oracledb: \"latest\"\n }\n },\n [FeatureType.TYPEORM_MSSQL]: {\n name: \"MsSQL\",\n\n dependencies: {\n mssql: \"latest\"\n }\n },\n [FeatureType.TYPEORM_MONGODB]: {\n name: \"MongoDB\",\n dependencies: {\n mongodb: \"latest\"\n }\n },\n [FeatureType.TYPEORM_SQLJS]: {\n name: \"SQL.js\"\n },\n [FeatureType.TYPEORM_REACTNATIVE]: {\n name: \"ReactNative\"\n },\n [FeatureType.TYPEORM_EXPO]: {\n name: \"Expo\"\n },\n [FeatureType.PRISMA]: {\n name: \"Prisma\",\n devDependencies: {\n \"@tsed/cli-plugin-prisma\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.MONGOOSE]: {\n name: \"Mongoose\",\n\n devDependencies: {\n \"@tsed/cli-plugin-mongoose\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.TYPEORM]: {\n name: \"TypeORM\",\n devDependencies: {\n \"@tsed/cli-plugin-typeorm\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.JEST]: {\n name: \"Jest\",\n devDependencies: {\n \"@tsed/cli-plugin-jest\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.MOCHA]: {\n name: \"Mocha + Chai + Sinon\",\n devDependencies: {\n \"@tsed/cli-plugin-mocha\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.ESLINT]: {\n name: \"EsLint\",\n checked: true,\n devDependencies: {\n \"@tsed/cli-plugin-eslint\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.PRETTIER]: {\n name: \"Prettier\"\n },\n [FeatureType.LINT_STAGED]: {\n name: \"Lint on commit\"\n },\n [FeatureType.BABEL]: {\n name: \"Babel\",\n devDependencies: {\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 },\n [FeatureType.WEBPACK]: {\n name: \"Webpack\",\n devDependencies: {\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 \"babel-loader\": \"latest\",\n webpack: \"latest\",\n \"webpack-cli\": \"latest\"\n }\n },\n [PackageManager.YARN]: {\n name: \"Yarn\",\n checked: true\n },\n [PackageManager.NPM]: {\n name: \"NPM\",\n checked: false\n },\n [PackageManager.PNPM]: {\n name: \"PNPM - experimental\",\n checked: false\n }\n};\n\nexport const FeaturesPrompt = () => [\n {\n message: \"Choose the target platform:\",\n type: \"list\",\n name: \"platform\",\n choices: [PlatformType.EXPRESS, PlatformType.KOA]\n },\n {\n message: \"Choose the architecture for your project:\",\n type: \"list\",\n name: \"architecture\",\n choices: [ArchitectureConvention.DEFAULT, ArchitectureConvention.FEATURE]\n },\n {\n message: \"Choose the convention file styling:\",\n type: \"list\",\n name: \"convention\",\n choices: [ProjectConvention.DEFAULT, ProjectConvention.ANGULAR]\n },\n {\n type: \"checkbox\",\n name: \"features\",\n message: \"Check the features needed for your project\",\n choices: [\n FeatureType.GRAPHQL,\n FeatureType.DB,\n FeatureType.PASSPORTJS,\n FeatureType.SOCKETIO,\n FeatureType.SWAGGER,\n FeatureType.OIDC,\n FeatureType.TESTING,\n FeatureType.LINTER,\n FeatureType.BUNDLER,\n FeatureType.COMMANDS\n ]\n },\n {\n message: \"Choose a ORM manager\",\n type: \"list\",\n name: \"featuresDB\",\n when: hasFeature(FeatureType.DB),\n choices: [FeatureType.PRISMA, FeatureType.MONGOOSE, FeatureType.TYPEORM]\n },\n {\n type: \"list\",\n name: \"featuresTypeORM\",\n message: \"Which TypeORM you want to install?\",\n choices: [\n FeatureType.TYPEORM_MYSQL,\n FeatureType.TYPEORM_MARIADB,\n FeatureType.TYPEORM_POSTGRES,\n FeatureType.TYPEORM_COCKROACHDB,\n FeatureType.TYPEORM_SQLITE,\n FeatureType.TYPEORM_BETTER_SQLITE3,\n FeatureType.TYPEORM_CORDOVA,\n FeatureType.TYPEORM_NATIVESCRIPT,\n FeatureType.TYPEORM_ORACLE,\n FeatureType.TYPEORM_MSSQL,\n FeatureType.TYPEORM_MONGODB,\n FeatureType.TYPEORM_SQLJS,\n FeatureType.TYPEORM_REACTNATIVE,\n FeatureType.TYPEORM_EXPO\n ],\n when: hasValue(\"featuresDB\", FeatureType.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(FeatureType.TESTING),\n choices: [FeatureType.JEST, FeatureType.MOCHA]\n },\n {\n message: \"Choose linter tools framework\",\n type: \"list\",\n name: \"featuresLinter\",\n when: hasFeature(FeatureType.LINTER),\n choices: [FeatureType.ESLINT]\n },\n {\n message: \"Choose extra linter tools\",\n type: \"checkbox\",\n name: \"featuresExtraLinter\",\n when: hasFeature(FeatureType.LINTER),\n choices: [FeatureType.PRETTIER, FeatureType.LINT_STAGED]\n },\n {\n message: \"Choose your bundler\",\n type: \"list\",\n name: \"featuresBundler\",\n when: hasFeature(FeatureType.BUNDLER),\n choices: [FeatureType.BABEL, FeatureType.WEBPACK]\n },\n {\n message: \"Choose the OIDC base path server\",\n name: \"oidcBasePath\",\n default: \"/oidc\",\n when: hasFeature(FeatureType.OIDC),\n type: \"input\"\n },\n {\n message: \"Choose the package manager:\",\n type: \"list\",\n name: \"packageManager\",\n choices: [PackageManager.YARN, PackageManager.NPM, PackageManager.PNPM]\n }\n];\n"]}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InitFileSchema = void 0;
4
+ const cli_core_1 = require("@tsed/cli-core");
5
+ const interfaces_1 = require("../../../interfaces");
6
+ const FeaturesPrompt_1 = require("./FeaturesPrompt");
7
+ exports.InitFileSchema = {
8
+ type: "object",
9
+ properties: {
10
+ tsedVersion: {
11
+ type: "string"
12
+ },
13
+ projectName: {
14
+ type: "string",
15
+ maxLength: 100
16
+ },
17
+ platform: {
18
+ type: "string",
19
+ description: "The project name. By default, the project is the same as the name directory.",
20
+ enum: Object.values(interfaces_1.PlatformType),
21
+ default: interfaces_1.PlatformType.EXPRESS
22
+ },
23
+ architecture: {
24
+ type: "string",
25
+ enum: Object.values(interfaces_1.ArchitectureConvention),
26
+ default: interfaces_1.ArchitectureConvention.DEFAULT
27
+ },
28
+ convention: {
29
+ type: "string",
30
+ enum: Object.values(interfaces_1.ProjectConvention),
31
+ default: interfaces_1.ProjectConvention.DEFAULT
32
+ },
33
+ features: {
34
+ type: "array",
35
+ items: {
36
+ type: "string",
37
+ enum: Object.values(FeaturesPrompt_1.FeatureType)
38
+ }
39
+ },
40
+ packageManager: {
41
+ type: "string",
42
+ enum: Object.values(cli_core_1.PackageManager),
43
+ default: cli_core_1.PackageManager.YARN
44
+ },
45
+ skipPrompt: {
46
+ type: "boolean",
47
+ default: false
48
+ }
49
+ },
50
+ required: ["features"],
51
+ additionalProperties: true
52
+ };
53
+ //# sourceMappingURL=InitFileSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitFileSchema.js","sourceRoot":"","sources":["../../../../../src/commands/init/config/InitFileSchema.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAC9C,oDAA4F;AAC5F,qDAA6C;AAEhC,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;SACf;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,GAAG;SACf;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,8EAA8E;YAC3F,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,yBAAY,CAAC;YACjC,OAAO,EAAE,yBAAY,CAAC,OAAO;SAC9B;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,mCAAsB,CAAC;YAC3C,OAAO,EAAE,mCAAsB,CAAC,OAAO;SACxC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,8BAAiB,CAAC;YACtC,OAAO,EAAE,8BAAiB,CAAC,OAAO;SACnC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,4BAAW,CAAC;aACjC;SACF;QACD,cAAc,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,yBAAc,CAAC;YACnC,OAAO,EAAE,yBAAc,CAAC,IAAI;SAC7B;QACD,UAAU,EAAE;YACV,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;SACf;KACF;IACD,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,oBAAoB,EAAE,IAAI;CAC3B,CAAC","sourcesContent":["import {PackageManager} from \"@tsed/cli-core\";\nimport {ArchitectureConvention, PlatformType, ProjectConvention} from \"../../../interfaces\";\nimport {FeatureType} from \"./FeaturesPrompt\";\n\nexport const InitFileSchema = {\n type: \"object\",\n properties: {\n tsedVersion: {\n type: \"string\"\n },\n projectName: {\n type: \"string\",\n maxLength: 100\n },\n platform: {\n type: \"string\",\n description: \"The project name. By default, the project is the same as the name directory.\",\n enum: Object.values(PlatformType),\n default: PlatformType.EXPRESS\n },\n architecture: {\n type: \"string\",\n enum: Object.values(ArchitectureConvention),\n default: ArchitectureConvention.DEFAULT\n },\n convention: {\n type: \"string\",\n enum: Object.values(ProjectConvention),\n default: ProjectConvention.DEFAULT\n },\n features: {\n type: \"array\",\n items: {\n type: \"string\",\n enum: Object.values(FeatureType)\n }\n },\n packageManager: {\n type: \"string\",\n enum: Object.values(PackageManager),\n default: PackageManager.YARN\n },\n skipPrompt: {\n type: \"boolean\",\n default: false\n }\n },\n required: [\"features\"],\n additionalProperties: true\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=InitCmdContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitCmdContext.js","sourceRoot":"","sources":["../../../../../src/commands/init/interfaces/InitCmdContext.ts"],"names":[],"mappings":"","sourcesContent":["import {CliDefaultOptions} from \"@tsed/cli-core\";\nimport {InitOptions} from \"./InitOptions\";\n\nexport interface InitCmdContext extends InitOptions, CliDefaultOptions, Record<string, any> {\n root: string;\n srcDir: string;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=InitOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitOptions.js","sourceRoot":"","sources":["../../../../../src/commands/init/interfaces/InitOptions.ts"],"names":[],"mappings":"","sourcesContent":["import {PackageManager} from \"@tsed/cli-core\";\nimport {PlatformType} from \"../../../interfaces/PlatformType\";\nimport {ArchitectureConvention} from \"../../../interfaces/ArchitectureConvention\";\nimport {ProjectConvention} from \"../../../interfaces/ProjectConvention\";\nimport {FeatureType} from \"../config/FeaturesPrompt\";\n\nexport interface InitOptions {\n root: string;\n projectName: string;\n features: FeatureType[];\n skipPrompt: boolean;\n platform: PlatformType;\n tsedVersion: string;\n cliVersion: string;\n architecture: ArchitectureConvention;\n convention: ProjectConvention;\n packageManager: PackageManager;\n oidcBasePath: string;\n file: string;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=InitPromptAnswers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitPromptAnswers.js","sourceRoot":"","sources":["../../../../../src/commands/init/interfaces/InitPromptAnswers.ts"],"names":[],"mappings":"","sourcesContent":["import {PackageManager} from \"@tsed/cli-core\";\nimport {ArchitectureConvention, PlatformType, ProjectConvention} from \"../../../interfaces\";\n\nexport interface InitPromptAnswers {\n projectName: string;\n platform: PlatformType;\n architecture: ArchitectureConvention;\n convention: ProjectConvention;\n features: string[];\n featuresDB: string[];\n featuresTypeORM: string;\n featuresTesting: string;\n featuresExtraLinter: string[];\n featuresBundler: string;\n oidcBasePath: string;\n packageManager: PackageManager;\n}\n"]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapToContext = void 0;
4
+ const change_case_1 = require("change-case");
5
+ const mapUniqFeatures_1 = require("./mapUniqFeatures");
6
+ function mapToContext(options) {
7
+ options = (0, mapUniqFeatures_1.mapUniqFeatures)(options);
8
+ options.features.forEach((feature) => {
9
+ feature.split(":").forEach((type) => {
10
+ options[(0, change_case_1.camelCase)(type)] = true;
11
+ });
12
+ });
13
+ return options;
14
+ }
15
+ exports.mapToContext = mapToContext;
16
+ //# sourceMappingURL=mapToContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapToContext.js","sourceRoot":"","sources":["../../../../../src/commands/init/mappers/mapToContext.ts"],"names":[],"mappings":";;;AAAA,6CAAsC;AAEtC,uDAAkD;AAElD,SAAgB,YAAY,CAAC,OAAY;IACvC,OAAO,GAAG,IAAA,iCAAe,EAAC,OAAO,CAAC,CAAC;IAEnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAe,EAAE,EAAE;QAC3C,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAClC,OAAO,CAAC,IAAA,uBAAS,EAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAVD,oCAUC","sourcesContent":["import {camelCase} from \"change-case\";\nimport {InitCmdContext} from \"../interfaces/InitCmdContext\";\nimport {mapUniqFeatures} from \"./mapUniqFeatures\";\n\nexport function mapToContext(options: any): InitCmdContext {\n options = mapUniqFeatures(options);\n\n options.features.forEach((feature: string) => {\n feature.split(\":\").forEach((type) => {\n options[camelCase(type)] = true;\n });\n });\n\n return options;\n}\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapUniqFeatures = void 0;
4
+ function mapUniqFeatures(answers) {
5
+ const features = [];
6
+ Object.entries(answers)
7
+ .filter(([key]) => key.startsWith("features"))
8
+ .forEach(([key, value]) => {
9
+ delete answers[key];
10
+ features.push(...[].concat(value));
11
+ });
12
+ return {
13
+ ...answers,
14
+ features: [...new Set(features).values()]
15
+ };
16
+ }
17
+ exports.mapUniqFeatures = mapUniqFeatures;
18
+ //# sourceMappingURL=mapUniqFeatures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapUniqFeatures.js","sourceRoot":"","sources":["../../../../../src/commands/init/mappers/mapUniqFeatures.ts"],"names":[],"mappings":";;;AAIA,SAAgB,eAAe,CAAC,OAAgC;IAC9D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;SAC7C,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAQ,EAAE,EAAE;QAC/B,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEL,OAAO;QACL,GAAG,OAAO;QACV,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAkB;KAC3D,CAAC;AACJ,CAAC;AAdD,0CAcC","sourcesContent":["import {InitPromptAnswers} from \"../interfaces/InitPromptAnswers\";\nimport {InitOptions} from \"../interfaces/InitOptions\";\nimport {FeatureType} from \"../config/FeaturesPrompt\";\n\nexport function mapUniqFeatures(answers: InitPromptAnswers & any): InitOptions {\n const features: string[] = [];\n\n Object.entries(answers)\n .filter(([key]) => key.startsWith(\"features\"))\n .forEach(([key, value]: any[]) => {\n delete answers[key];\n features.push(...[].concat(value));\n });\n\n return {\n ...answers,\n features: [...new Set(features).values()] as FeatureType[]\n };\n}\n"]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFeaturesPrompt = void 0;
4
+ const core_1 = require("@tsed/core");
5
+ const FeaturesPrompt_1 = require("../config/FeaturesPrompt");
6
+ function mapChoices(item, options) {
7
+ return item.choices.map((choice) => {
8
+ const { checked } = FeaturesPrompt_1.FeaturesMap[choice];
9
+ return (0, core_1.cleanObject)({
10
+ ...FeaturesPrompt_1.FeaturesMap[choice],
11
+ value: choice,
12
+ checked: (0, core_1.isFunction)(checked) ? checked(options) : checked
13
+ });
14
+ });
15
+ }
16
+ function getFeaturesPrompt(options) {
17
+ return (0, FeaturesPrompt_1.FeaturesPrompt)().map((item) => {
18
+ return (0, core_1.cleanObject)({
19
+ ...item,
20
+ choices: item.choices?.length ? mapChoices(item, options) : undefined
21
+ });
22
+ });
23
+ }
24
+ exports.getFeaturesPrompt = getFeaturesPrompt;
25
+ //# sourceMappingURL=getFeaturesPrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFeaturesPrompt.js","sourceRoot":"","sources":["../../../../../src/commands/init/prompts/getFeaturesPrompt.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,6DAAqE;AAGrE,SAAS,UAAU,CAAC,IAAS,EAAE,OAA6B;IAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE;QACzC,MAAM,EAAC,OAAO,EAAC,GAAG,4BAAW,CAAC,MAAM,CAAC,CAAC;QAEtC,OAAO,IAAA,kBAAW,EAAC;YACjB,GAAG,4BAAW,CAAC,MAAM,CAAC;YACtB,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,IAAA,iBAAU,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO;SAC1D,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,iBAAiB,CAAC,OAA6B;IAC7D,OAAO,IAAA,+BAAc,GAAE,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE;QACxC,OAAO,IAAA,kBAAW,EAAC;YACjB,GAAG,IAAI;YACP,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;SACtE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAPD,8CAOC","sourcesContent":["import {cleanObject, isFunction} from \"@tsed/core\";\nimport {FeaturesMap, FeaturesPrompt} from \"../config/FeaturesPrompt\";\nimport {InitOptions} from \"../interfaces/InitOptions\";\n\nfunction mapChoices(item: any, options: Partial<InitOptions>) {\n return item.choices.map((choice: string) => {\n const {checked} = FeaturesMap[choice];\n\n return cleanObject({\n ...FeaturesMap[choice],\n value: choice,\n checked: isFunction(checked) ? checked(options) : checked\n });\n });\n}\n\nexport function getFeaturesPrompt(options: Partial<InitOptions>) {\n return FeaturesPrompt().map((item: any) => {\n return cleanObject({\n ...item,\n choices: item.choices?.length ? mapChoices(item, options) : undefined\n });\n });\n}\n"]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasFeature = exports.hasValue = void 0;
4
+ const core_1 = require("@tsed/core");
5
+ function hasValue(expression, value) {
6
+ return (ctx) => (0, core_1.getValue)(expression, ctx) === value;
7
+ }
8
+ exports.hasValue = hasValue;
9
+ function hasFeature(feature) {
10
+ return (ctx) => !!ctx.features.find((item) => item === feature);
11
+ }
12
+ exports.hasFeature = hasFeature;
13
+ //# sourceMappingURL=hasFeature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasFeature.js","sourceRoot":"","sources":["../../../../../src/commands/init/utils/hasFeature.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAEpC,SAAgB,QAAQ,CAAC,UAAkB,EAAE,KAAU;IACrD,OAAO,CAAC,GAAQ,EAAE,EAAE,CAAC,IAAA,eAAQ,EAAC,UAAU,EAAE,GAAG,CAAC,KAAK,KAAK,CAAC;AAC3D,CAAC;AAFD,4BAEC;AAED,SAAgB,UAAU,CAAC,OAAe;IACxC,OAAO,CAAC,GAAQ,EAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;AACxF,CAAC;AAFD,gCAEC","sourcesContent":["import {getValue} from \"@tsed/core\";\n\nexport function hasValue(expression: string, value: any) {\n return (ctx: any) => getValue(expression, ctx) === value;\n}\n\nexport function hasFeature(feature: string) {\n return (ctx: any): boolean => !!ctx.features.find((item: string) => item === feature);\n}\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPlatform = void 0;
4
+ function isPlatform(...types) {
5
+ return (ctx) => [types].includes(ctx.platform);
6
+ }
7
+ exports.isPlatform = isPlatform;
8
+ //# sourceMappingURL=isPlatform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isPlatform.js","sourceRoot":"","sources":["../../../../../src/commands/init/utils/isPlatform.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,GAAG,KAAe;IAC3C,OAAO,CAAC,GAAQ,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC;AAFD,gCAEC","sourcesContent":["export function isPlatform(...types: string[]) {\n return (ctx: any) => [types].includes(ctx.platform);\n}\n"]}