nestia 4.1.0 → 4.2.0-dev.20230503
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/bin/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
declare const USAGE = "Wrong command has been detected. Use like below:\n\nnpx nestia [command] [options?]\n\n 1. npx nestia start <directory> --manager (npm|pnpm|yarn)\n - npx nestia start project\n - npx nestia start project --manager pnpm\n 2. npx nestia setup
|
|
2
|
+
declare const USAGE = "Wrong command has been detected. Use like below:\n\nnpx nestia [command] [options?]\n\n 1. npx nestia start <directory> --manager (npm|pnpm|yarn)\n - npx nestia start project\n - npx nestia start project --manager pnpm\n 2. npx nestia setup\n 3. npx nestia dependencies\n 4. npx nestia init\n 5. npx nestia sdk\n 6. npx nestia swagger\n 7. npx nestia e2e\n";
|
|
3
3
|
declare function halt(desc: string): never;
|
|
4
4
|
declare function main(): Promise<void>;
|
package/bin/index.js
CHANGED
|
@@ -39,24 +39,12 @@ npx nestia [command] [options?]
|
|
|
39
39
|
1. npx nestia start <directory> --manager (npm|pnpm|yarn)
|
|
40
40
|
- npx nestia start project
|
|
41
41
|
- npx nestia start project --manager pnpm
|
|
42
|
-
2. npx nestia setup
|
|
43
|
-
|
|
44
|
-
--project {tsconfig.json file path}
|
|
45
|
-
- npx nestia setup
|
|
46
|
-
- npx nestia setup --manager pnpm
|
|
47
|
-
- npx nestia setup --project tsconfig.test.json
|
|
48
|
-
3. npx nestia dependencies --manager (npm|pnpm|yarn)
|
|
49
|
-
- npx nestia dependencies
|
|
50
|
-
- npx nestia dependencies --manager yarn
|
|
42
|
+
2. npx nestia setup
|
|
43
|
+
3. npx nestia dependencies
|
|
51
44
|
4. npx nestia init
|
|
52
|
-
5. npx nestia sdk
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- npx nestia sdk src/**/*.controller.ts --out src/api
|
|
56
|
-
6. npx nestia swagger <input> --out <output>
|
|
57
|
-
- npx nestia swagger # when "nestia.config.ts" be configured
|
|
58
|
-
- npx nestia swagger src/controllers --out src/api
|
|
59
|
-
- npx nestia swagger src/**/*.controller.ts --out src/api
|
|
45
|
+
5. npx nestia sdk
|
|
46
|
+
6. npx nestia swagger
|
|
47
|
+
7. npx nestia e2e
|
|
60
48
|
`;
|
|
61
49
|
function halt(desc) {
|
|
62
50
|
console.error(desc);
|
|
@@ -83,7 +71,8 @@ function main() {
|
|
|
83
71
|
else if (type === "dependencies" ||
|
|
84
72
|
type === "init" ||
|
|
85
73
|
type === "sdk" ||
|
|
86
|
-
type === "swagger"
|
|
74
|
+
type === "swagger" ||
|
|
75
|
+
type === "e2e") {
|
|
87
76
|
try {
|
|
88
77
|
require.resolve("@nestia/sdk/lib/executable/sdk");
|
|
89
78
|
}
|
package/bin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,MAAM,KAAK,GAAG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,MAAM,KAAK,GAAG;;;;;;;;;;;;;CAab,CAAC;AAEF,SAAS,IAAI,CAAC,IAAY;IACtB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC;AAED,SAAe,IAAI;;QACf,MAAM,IAAI,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,IAAI,GAAa,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE7C,IAAI,IAAI,KAAK,OAAO,EAAE;YAClB,MAAM,CACF,wDAAa,iBAAiB,GAAC,CAClC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SAC5D;aAAM,IAAI,IAAI,KAAK,OAAO,EAAE;YACzB,IAAI;gBACA,wDAAa,cAAc,GAAC,CAAC;gBAC7B,wDAAa,UAAU,GAAC,CAAC;gBACzB,wDAAa,WAAW,GAAC,CAAC;aAC7B;YAAC,WAAM;gBACJ,IAAI,CACA,8DAA8D,CACjE,CAAC;aACL;YACD,MAAM,CAAC,wDAAa,qBAAqB,GAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;SACzE;aAAM,IACH,IAAI,KAAK,cAAc;YACvB,IAAI,KAAK,MAAM;YACf,IAAI,KAAK,KAAK;YACd,IAAI,KAAK,SAAS;YAClB,IAAI,KAAK,KAAK,EAChB;YACE,IAAI;gBACA,OAAO,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC;aACrD;YAAC,WAAM;gBACJ,IAAI,CACA,oEAAoE,CACvE,CAAC;aACL;YACD,wDAAa,gCAAgC,GAAC,CAAC;SAClD;;YAAM,IAAI,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;CAAA;AACD,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACjB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC,CAAC,CAAC"}
|
|
@@ -34,17 +34,23 @@ var PluginConfigurator;
|
|
|
34
34
|
return plugins;
|
|
35
35
|
})();
|
|
36
36
|
// CHECK WHETHER CONFIGURED
|
|
37
|
-
const strict = compilerOptions.strict
|
|
37
|
+
const strict = compilerOptions.strict;
|
|
38
|
+
const strictNullChecks = compilerOptions.strictNullChecks;
|
|
38
39
|
const core = plugins.find((p) => typeof p === "object" &&
|
|
39
40
|
p !== null &&
|
|
40
41
|
p.transform === "@nestia/core/lib/transform");
|
|
41
42
|
const typia = plugins.find((p) => typeof p === "object" &&
|
|
42
43
|
p !== null &&
|
|
43
44
|
p.transform === "typia/lib/transform");
|
|
44
|
-
if (
|
|
45
|
+
if (strictNullChecks !== false &&
|
|
46
|
+
(strict === true || strictNullChecks === true) &&
|
|
47
|
+
core !== undefined &&
|
|
48
|
+
typia !== undefined)
|
|
45
49
|
return;
|
|
46
50
|
// DO CONFIGURE
|
|
47
|
-
compilerOptions.
|
|
51
|
+
compilerOptions.strictNullChecks = true;
|
|
52
|
+
if (strict === undefined && strictNullChecks === undefined)
|
|
53
|
+
compilerOptions.strict = true;
|
|
48
54
|
compilerOptions.experimentalDecorators = true;
|
|
49
55
|
compilerOptions.emitDecoratorMetadata = true;
|
|
50
56
|
if (core === undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginConfigurator.js","sourceRoot":"","sources":["../../src/internal/PluginConfigurator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAoC;AACpC,4CAAoB;AAIpB,IAAiB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"PluginConfigurator.js","sourceRoot":"","sources":["../../src/internal/PluginConfigurator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAoC;AACpC,4CAAoB;AAIpB,IAAiB,kBAAkB,CAkGlC;AAlGD,WAAiB,kBAAkB;IAC/B,SAAsB,SAAS,CAC3B,IAA+B;;YAE/B,uBAAuB;YACvB,MAAM,MAAM,GAA2B,sBAAQ,CAAC,KAAK,CACjD,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAQ,EAAE,MAAM,CAAC,CAC1B,CAAC;YAC5B,MAAM,eAAe,GACjB,MAAM,CAAC,eAAqD,CAAC;YACjE,IAAI,eAAe,KAAK,SAAS;gBAC7B,MAAM,IAAI,KAAK,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AC;YAClC,eAAe,CAAC,sBAAsB,GAAG,IAAI,CAAC;YAC9C,eAAe,CAAC,qBAAqB,GAAG,IAAI,CAAC;YAE7C,IAAI,IAAI,KAAK,SAAS;gBAClB,OAAO,CAAC,IAAI,CACR,sBAAQ,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;kBAqBb,CAA2B,CAChC,CAAC;YACN,IAAI,KAAK,KAAK,SAAS;gBACnB,OAAO,CAAC,IAAI,CACR,sBAAQ,CAAC,KAAK,CACV,wCAAwC,CACjB,CAC9B,CAAC;YACN,MAAM,YAAE,CAAC,QAAQ,CAAC,SAAS,CACvB,IAAI,CAAC,OAAQ,EACb,sBAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CACtC,CAAC;QACN,CAAC;KAAA;IAhGqB,4BAAS,YAgG9B,CAAA;AACL,CAAC,EAlGgB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAkGlC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestia",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0-dev.20230503",
|
|
4
4
|
"description": "Nestia CLI tool",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "rimraf bin && tsc",
|
|
11
|
-
"prettier": "prettier
|
|
11
|
+
"prettier": "prettier ./src/**/*.ts --write",
|
|
12
|
+
"package:next": "npm publish --access public --tag next"
|
|
12
13
|
},
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@nestia/core": "^1.1.0",
|
|
39
40
|
"@nestia/sdk": "^1.1.0",
|
|
41
|
+
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
|
40
42
|
"@types/inquirer": "^9.0.3",
|
|
41
43
|
"@types/node": "^18.11.16",
|
|
42
44
|
"prettier": "^2.8.7",
|
package/src/index.ts
CHANGED
|
@@ -6,24 +6,12 @@ npx nestia [command] [options?]
|
|
|
6
6
|
1. npx nestia start <directory> --manager (npm|pnpm|yarn)
|
|
7
7
|
- npx nestia start project
|
|
8
8
|
- npx nestia start project --manager pnpm
|
|
9
|
-
2. npx nestia setup
|
|
10
|
-
|
|
11
|
-
--project {tsconfig.json file path}
|
|
12
|
-
- npx nestia setup
|
|
13
|
-
- npx nestia setup --manager pnpm
|
|
14
|
-
- npx nestia setup --project tsconfig.test.json
|
|
15
|
-
3. npx nestia dependencies --manager (npm|pnpm|yarn)
|
|
16
|
-
- npx nestia dependencies
|
|
17
|
-
- npx nestia dependencies --manager yarn
|
|
9
|
+
2. npx nestia setup
|
|
10
|
+
3. npx nestia dependencies
|
|
18
11
|
4. npx nestia init
|
|
19
|
-
5. npx nestia sdk
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- npx nestia sdk src/**/*.controller.ts --out src/api
|
|
23
|
-
6. npx nestia swagger <input> --out <output>
|
|
24
|
-
- npx nestia swagger # when "nestia.config.ts" be configured
|
|
25
|
-
- npx nestia swagger src/controllers --out src/api
|
|
26
|
-
- npx nestia swagger src/**/*.controller.ts --out src/api
|
|
12
|
+
5. npx nestia sdk
|
|
13
|
+
6. npx nestia swagger
|
|
14
|
+
7. npx nestia e2e
|
|
27
15
|
`;
|
|
28
16
|
|
|
29
17
|
function halt(desc: string): never {
|
|
@@ -54,7 +42,8 @@ async function main(): Promise<void> {
|
|
|
54
42
|
type === "dependencies" ||
|
|
55
43
|
type === "init" ||
|
|
56
44
|
type === "sdk" ||
|
|
57
|
-
type === "swagger"
|
|
45
|
+
type === "swagger" ||
|
|
46
|
+
type === "e2e"
|
|
58
47
|
) {
|
|
59
48
|
try {
|
|
60
49
|
require.resolve("@nestia/sdk/lib/executable/sdk");
|
|
@@ -33,7 +33,11 @@ export namespace PluginConfigurator {
|
|
|
33
33
|
})();
|
|
34
34
|
|
|
35
35
|
// CHECK WHETHER CONFIGURED
|
|
36
|
-
const strict: boolean = compilerOptions.strict
|
|
36
|
+
const strict: boolean | undefined = compilerOptions.strict as
|
|
37
|
+
| boolean
|
|
38
|
+
| undefined;
|
|
39
|
+
const strictNullChecks: boolean | undefined =
|
|
40
|
+
compilerOptions.strictNullChecks as boolean | undefined;
|
|
37
41
|
const core: comments.CommentObject | undefined = plugins.find(
|
|
38
42
|
(p) =>
|
|
39
43
|
typeof p === "object" &&
|
|
@@ -46,10 +50,18 @@ export namespace PluginConfigurator {
|
|
|
46
50
|
p !== null &&
|
|
47
51
|
p.transform === "typia/lib/transform",
|
|
48
52
|
);
|
|
49
|
-
if (
|
|
53
|
+
if (
|
|
54
|
+
strictNullChecks !== false &&
|
|
55
|
+
(strict === true || strictNullChecks === true) &&
|
|
56
|
+
core !== undefined &&
|
|
57
|
+
typia !== undefined
|
|
58
|
+
)
|
|
59
|
+
return;
|
|
50
60
|
|
|
51
61
|
// DO CONFIGURE
|
|
52
|
-
compilerOptions.
|
|
62
|
+
compilerOptions.strictNullChecks = true;
|
|
63
|
+
if (strict === undefined && strictNullChecks === undefined)
|
|
64
|
+
compilerOptions.strict = true;
|
|
53
65
|
compilerOptions.experimentalDecorators = true;
|
|
54
66
|
compilerOptions.emitDecoratorMetadata = true;
|
|
55
67
|
|