@tsed/cli 6.0.4 → 6.1.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/lib/esm/commands/init/config/FeaturesPrompt.js +21 -2
- package/lib/esm/constants/index.js +1 -1
- package/lib/esm/utils/fillImports.js +1 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/commands/init/config/FeaturesPrompt.d.ts +3 -1
- package/lib/types/constants/index.d.ts +1 -1
- package/package.json +3 -3
- package/templates/generate/server.hbs +6 -0
- package/templates/init/README.md.hbs +5 -5
|
@@ -5,11 +5,14 @@ export var FeatureType;
|
|
|
5
5
|
(function (FeatureType) {
|
|
6
6
|
FeatureType["GRAPHQL"] = "graphql";
|
|
7
7
|
FeatureType["SOCKETIO"] = "socketio";
|
|
8
|
-
FeatureType["SWAGGER"] = "swagger";
|
|
9
8
|
FeatureType["OIDC"] = "oidc";
|
|
10
9
|
FeatureType["PASSPORTJS"] = "passportjs";
|
|
11
10
|
FeatureType["COMMANDS"] = "commands";
|
|
12
11
|
FeatureType["DB"] = "db";
|
|
12
|
+
FeatureType["DOC"] = "doc";
|
|
13
|
+
// DOC
|
|
14
|
+
FeatureType["SWAGGER"] = "swagger";
|
|
15
|
+
FeatureType["SCALAR"] = "scalar";
|
|
13
16
|
// ORM
|
|
14
17
|
FeatureType["PRISMA"] = "prisma";
|
|
15
18
|
FeatureType["MONGOOSE"] = "mongoose";
|
|
@@ -56,6 +59,9 @@ export const FeaturesMap = {
|
|
|
56
59
|
"@tsed/cli-plugin-typegraphql": "{{cliVersion}}"
|
|
57
60
|
}
|
|
58
61
|
},
|
|
62
|
+
[FeatureType.DOC]: {
|
|
63
|
+
name: "Documentation"
|
|
64
|
+
},
|
|
59
65
|
[FeatureType.DB]: {
|
|
60
66
|
name: "Database"
|
|
61
67
|
},
|
|
@@ -79,6 +85,12 @@ export const FeaturesMap = {
|
|
|
79
85
|
"@tsed/swagger": "{{tsedVersion}}"
|
|
80
86
|
}
|
|
81
87
|
},
|
|
88
|
+
[FeatureType.SCALAR]: {
|
|
89
|
+
name: "Scalar",
|
|
90
|
+
dependencies: {
|
|
91
|
+
"@tsed/scalar": "{{tsedVersion}}"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
82
94
|
[FeatureType.OIDC]: {
|
|
83
95
|
name: "OpenID Connect provider",
|
|
84
96
|
devDependencies: {
|
|
@@ -295,13 +307,20 @@ export const FeaturesPrompt = (availableRuntimes, availablePackageManagers) => [
|
|
|
295
307
|
FeatureType.DB,
|
|
296
308
|
FeatureType.PASSPORTJS,
|
|
297
309
|
FeatureType.SOCKETIO,
|
|
298
|
-
FeatureType.
|
|
310
|
+
FeatureType.DOC,
|
|
299
311
|
FeatureType.OIDC,
|
|
300
312
|
FeatureType.TESTING,
|
|
301
313
|
FeatureType.LINTER,
|
|
302
314
|
FeatureType.COMMANDS
|
|
303
315
|
]
|
|
304
316
|
},
|
|
317
|
+
{
|
|
318
|
+
type: "checkbox",
|
|
319
|
+
message: "Choose a documentation plugin",
|
|
320
|
+
name: "featuresDoc",
|
|
321
|
+
when: hasFeature(FeatureType.DOC),
|
|
322
|
+
choices: [FeatureType.SWAGGER, FeatureType.SCALAR]
|
|
323
|
+
},
|
|
305
324
|
{
|
|
306
325
|
message: "Choose a ORM manager",
|
|
307
326
|
type: "list",
|
|
@@ -5,7 +5,7 @@ const { path, packageJson } = readPackageUpSync({
|
|
|
5
5
|
});
|
|
6
6
|
export const PKG = packageJson;
|
|
7
7
|
export const MINIMAL_TSED_VERSION = "8";
|
|
8
|
-
export const DEFAULT_TSED_TAGS = "
|
|
8
|
+
export const DEFAULT_TSED_TAGS = "latest";
|
|
9
9
|
export const IGNORE_VERSIONS = ["6.0.0"];
|
|
10
10
|
export const IGNORE_TAGS = false; // /alpha|beta/
|
|
11
11
|
export const TEMPLATE_DIR = join(dirname(path), "templates");
|
|
@@ -18,6 +18,7 @@ export function fillImports(ctx) {
|
|
|
18
18
|
ctx.koa && { from: "@tsed/platform-koa", comment: " // /!\\ keep this import" },
|
|
19
19
|
{ from: "@tsed/ajv" },
|
|
20
20
|
ctx.swagger && { from: "@tsed/swagger" },
|
|
21
|
+
ctx.scalar && { from: "@tsed/scalar" },
|
|
21
22
|
ctx.mongoose && { from: "@tsed/mongoose" },
|
|
22
23
|
ctx.oidc && { from: "@tsed/oidc-provider" },
|
|
23
24
|
ctx.passportjs && { from: "@tsed/passport" },
|