@nestia/core 1.0.10 → 1.0.12
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/README.md +15 -9
- package/lib/decorators/EncryptedBody.d.ts +1 -1
- package/lib/decorators/EncryptedBody.js +1 -1
- package/lib/decorators/EncryptedRoute.d.ts +4 -4
- package/lib/decorators/EncryptedRoute.js +4 -4
- package/lib/decorators/TypedRoute.d.ts +3 -2
- package/lib/decorators/TypedRoute.js +3 -2
- package/lib/decorators/TypedRoute.js.map +1 -1
- package/lib/executable/core.js +45 -23
- package/lib/executable/core.js.map +1 -1
- package/lib/executable/internal/ArgumentParser.d.ts +9 -0
- package/lib/executable/internal/ArgumentParser.js +246 -0
- package/lib/executable/internal/ArgumentParser.js.map +1 -0
- package/lib/executable/internal/CommandExecutor.d.ts +3 -0
- package/lib/executable/internal/CommandExecutor.js +17 -0
- package/lib/executable/internal/CommandExecutor.js.map +1 -0
- package/lib/executable/internal/FileRetriever.d.ts +5 -0
- package/lib/executable/internal/FileRetriever.js +109 -0
- package/lib/executable/internal/FileRetriever.js.map +1 -0
- package/lib/executable/internal/PackageManager.d.ts +27 -0
- package/lib/executable/internal/PackageManager.js +126 -0
- package/lib/executable/internal/PackageManager.js.map +1 -0
- package/lib/executable/internal/PluginConfigurator.d.ts +5 -0
- package/lib/executable/internal/PluginConfigurator.js +145 -0
- package/lib/executable/internal/PluginConfigurator.js.map +1 -0
- package/package.json +7 -3
- package/src/decorators/EncryptedBody.ts +1 -1
- package/src/decorators/EncryptedRoute.ts +4 -4
- package/src/decorators/TypedRoute.ts +3 -2
- package/src/executable/core.ts +39 -18
- package/src/executable/internal/ArgumentParser.ts +146 -0
- package/src/executable/internal/CommandExecutor.ts +8 -0
- package/src/executable/internal/FileRetriever.ts +33 -0
- package/src/executable/internal/PackageManager.ts +92 -0
- package/src/executable/internal/PluginConfigurator.ts +130 -0
- package/lib/executable/internal/CommandParser.d.ts +0 -3
- package/lib/executable/internal/CommandParser.js +0 -21
- package/lib/executable/internal/CommandParser.js.map +0 -1
- package/lib/executable/internal/CoreSetupWizard.d.ts +0 -8
- package/lib/executable/internal/CoreSetupWizard.js +0 -271
- package/lib/executable/internal/CoreSetupWizard.js.map +0 -1
- package/src/executable/internal/CommandParser.ts +0 -15
- package/src/executable/internal/CoreSetupWizard.ts +0 -225
package/README.md
CHANGED
|
@@ -58,24 +58,30 @@ npx nestia setup
|
|
|
58
58
|
npx @nestia/core setup
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
Just type `npx nestia setup`, that's all.
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
If you've installed [ttypescript](https://github.com/cevek/ttypescript) during setup, you should compile `@nestia/core` utilization code through `ttsc` command, instead of `tsc`.
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
+
# COMPILE THROUGH TTYPESCRIPT
|
|
66
67
|
npx ttsc
|
|
68
|
+
|
|
69
|
+
# RUN TS-NODE WITH TTYPESCRIPT
|
|
67
70
|
npx ts-node -C ttypescript src/index.ts
|
|
68
71
|
```
|
|
69
72
|
|
|
70
|
-
|
|
73
|
+
Otherwise, you've chosen [ts-patch](https://github.com/nonara/ts-patch), you can use original `tsc` command. However, [ts-patch](https://github.com/nonara/ts-patch) hacks `node_modules/typescript` source code. Also, whenever update `typescript` version, you've to run `npm run prepare` command repeatedly.
|
|
74
|
+
|
|
75
|
+
By the way, when using `@nest/cli`, you must just choose [ts-patch](https://github.com/nonara/ts-patch).
|
|
71
76
|
|
|
72
77
|
```bash
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
npx
|
|
78
|
+
# USE ORIGINAL TSC COMMAND
|
|
79
|
+
tsc
|
|
80
|
+
npx ts-node src/index.ts
|
|
76
81
|
|
|
77
|
-
|
|
78
|
-
|
|
82
|
+
# HOWEVER, WHENVER UPDATE
|
|
83
|
+
npm install --save-dev typescript@latest
|
|
84
|
+
npm run prepare
|
|
79
85
|
```
|
|
80
86
|
|
|
81
87
|
### Manual Setup
|
|
@@ -99,7 +105,7 @@ export class BbsArticlesController {
|
|
|
99
105
|
* @param inupt Content to store
|
|
100
106
|
* @returns Newly archived article
|
|
101
107
|
*/
|
|
102
|
-
@TypedRoute.Put(":id") //
|
|
108
|
+
@TypedRoute.Put(":id") // 50x faster and safer JSON.stringify()
|
|
103
109
|
public async store(
|
|
104
110
|
@TypedParam("section", "string") section: string,
|
|
105
111
|
@TypedParam("id", "uuid") id: string,
|
|
@@ -10,7 +10,7 @@ import { IRequestBodyValidator } from "../options/IRequestBodyValidator";
|
|
|
10
10
|
*
|
|
11
11
|
* For reference, when the request body data is not following the promised type `T`,
|
|
12
12
|
* `BadRequestException` error (status code: 400) would be thrown. Also,
|
|
13
|
-
* `EncryptedRoute` decrypts request body
|
|
13
|
+
* `EncryptedRoute` decrypts request body using those options.
|
|
14
14
|
*
|
|
15
15
|
* - AES-128/256
|
|
16
16
|
* - CBC mode
|
|
@@ -59,7 +59,7 @@ var validate_request_body_1 = require("./internal/validate_request_body");
|
|
|
59
59
|
*
|
|
60
60
|
* For reference, when the request body data is not following the promised type `T`,
|
|
61
61
|
* `BadRequestException` error (status code: 400) would be thrown. Also,
|
|
62
|
-
* `EncryptedRoute` decrypts request body
|
|
62
|
+
* `EncryptedRoute` decrypts request body using those options.
|
|
63
63
|
*
|
|
64
64
|
* - AES-128/256
|
|
65
65
|
* - CBC mode
|
|
@@ -3,13 +3,13 @@ import { IResponseBodyStringifier } from "../options/IResponseBodyStringifier";
|
|
|
3
3
|
* Encrypted router decorator functions.
|
|
4
4
|
*
|
|
5
5
|
* `EncryptedRoute` is a module containing router decorator functions which encrypts
|
|
6
|
-
* response body data through AES-128/
|
|
7
|
-
* up JSON string conversion speed about
|
|
8
|
-
* [typia](https://github.com/samchon/typia).
|
|
6
|
+
* response body data through AES-128/256 encryption. Furthermore, they can boost
|
|
7
|
+
* up JSON string conversion speed about 50x times faster than `class-transformer`,
|
|
8
|
+
* even type safe through [typia](https://github.com/samchon/typia).
|
|
9
9
|
*
|
|
10
10
|
* For reference, router functions of `EncryptedRoute` can convert custom error classes
|
|
11
11
|
* to regular {@link nest.HttpException} class automatically, through
|
|
12
|
-
* {@link ExceptionManager}. Also, `EncryptedRoute` encrypts response body
|
|
12
|
+
* {@link ExceptionManager}. Also, `EncryptedRoute` encrypts response body using those
|
|
13
13
|
* options.
|
|
14
14
|
*
|
|
15
15
|
* - AES-128/256
|
|
@@ -52,13 +52,13 @@ var route_error_1 = require("./internal/route_error");
|
|
|
52
52
|
* Encrypted router decorator functions.
|
|
53
53
|
*
|
|
54
54
|
* `EncryptedRoute` is a module containing router decorator functions which encrypts
|
|
55
|
-
* response body data through AES-128/
|
|
56
|
-
* up JSON string conversion speed about
|
|
57
|
-
* [typia](https://github.com/samchon/typia).
|
|
55
|
+
* response body data through AES-128/256 encryption. Furthermore, they can boost
|
|
56
|
+
* up JSON string conversion speed about 50x times faster than `class-transformer`,
|
|
57
|
+
* even type safe through [typia](https://github.com/samchon/typia).
|
|
58
58
|
*
|
|
59
59
|
* For reference, router functions of `EncryptedRoute` can convert custom error classes
|
|
60
60
|
* to regular {@link nest.HttpException} class automatically, through
|
|
61
|
-
* {@link ExceptionManager}. Also, `EncryptedRoute` encrypts response body
|
|
61
|
+
* {@link ExceptionManager}. Also, `EncryptedRoute` encrypts response body using those
|
|
62
62
|
* options.
|
|
63
63
|
*
|
|
64
64
|
* - AES-128/256
|
|
@@ -3,8 +3,9 @@ import { IResponseBodyStringifier } from "../options/IResponseBodyStringifier";
|
|
|
3
3
|
* Type safe router decorator functions.
|
|
4
4
|
*
|
|
5
5
|
* `TypedRoute` is a module containing router decorator functions which can boost up
|
|
6
|
-
* JSON string conversion speed about
|
|
7
|
-
* conversion is even type safe through
|
|
6
|
+
* JSON string conversion speed about 50x times faster than `class-transformer`.
|
|
7
|
+
* Furthermore, such JSON string conversion is even type safe through
|
|
8
|
+
* [typia](https://github.com/samchon/typia).
|
|
8
9
|
*
|
|
9
10
|
* For reference, router functions of `TypedRoute` can convert custom error classes to
|
|
10
11
|
* the regular {@link nest.HttpException} class automatically, through
|
|
@@ -47,8 +47,9 @@ var route_error_1 = require("./internal/route_error");
|
|
|
47
47
|
* Type safe router decorator functions.
|
|
48
48
|
*
|
|
49
49
|
* `TypedRoute` is a module containing router decorator functions which can boost up
|
|
50
|
-
* JSON string conversion speed about
|
|
51
|
-
* conversion is even type safe through
|
|
50
|
+
* JSON string conversion speed about 50x times faster than `class-transformer`.
|
|
51
|
+
* Furthermore, such JSON string conversion is even type safe through
|
|
52
|
+
* [typia](https://github.com/samchon/typia).
|
|
52
53
|
*
|
|
53
54
|
* For reference, router functions of `TypedRoute` can convert custom error classes to
|
|
54
55
|
* the regular {@link nest.HttpException} class automatically, through
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypedRoute.js","sourceRoot":"","sources":["../../src/decorators/TypedRoute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAWwB;AAGxB,6BAAmD;AAEnD,+BAKe;AAGf,4EAA2E;AAC3E,sDAAqD;AAErD
|
|
1
|
+
{"version":3,"file":"TypedRoute.js","sourceRoot":"","sources":["../../src/decorators/TypedRoute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAWwB;AAGxB,6BAAmD;AAEnD,+BAKe;AAGf,4EAA2E;AAC3E,sDAAqD;AAErD;;;;;;;;;;;;;GAaG;AACH,IAAiB,UAAU,CAiE1B;AAjED,WAAiB,UAAU;IACvB;;;;;OAKG;IACU,cAAG,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAEpC;;;;;OAKG;IACU,eAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAEtC;;;;;OAKG;IACU,gBAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAExC;;;;;OAKG;IACU,cAAG,GAAG,SAAS,CAA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C,cAAS,GAAT,SAAS,CAAwB;IAAG,CAAC;IAElE,yCAAS,GAAhB,UACI,OAAyB,EACzB,IAAiB;QAFrB,iBAYC;QARG,IAAM,IAAI,GAAsB,OAAO,CAAC,YAAY,EAAE,CAAC;QACvD,IAAM,QAAQ,GAAqB,IAAI,CAAC,WAAW,EAAE,CAAC;QACtD,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QAEpD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CACrB,IAAA,UAAG,EAAC,UAAC,KAAK,IAAK,OAAA,KAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAArB,CAAqB,CAAC,EACrC,IAAA,iBAAU,EAAC,UAAC,GAAG,IAAK,OAAA,IAAA,yBAAW,EAAC,IAAI,CAAC,UAAU,EAAE,EAAE,GAAG,CAAC,EAAnC,CAAmC,CAAC,CAC3D,CAAC;IACN,CAAC;IACL,4BAAC;AAAD,CAAC,AAhBD,IAgBC;AAED;;GAEG;AACH,IAAM,OAAO,GAAG;IACZ,GAAG,cAAA;IACH,IAAI,eAAA;IACJ,KAAK,gBAAA;IACL,GAAG,cAAA;IACH,MAAM,iBAAA;CACT,CAAC"}
|
package/lib/executable/core.js
CHANGED
|
@@ -37,40 +37,62 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
var
|
|
41
|
-
var
|
|
40
|
+
var ArgumentParser_1 = require("./internal/ArgumentParser");
|
|
41
|
+
var CommandExecutor_1 = require("./internal/CommandExecutor");
|
|
42
|
+
var PackageManager_1 = require("./internal/PackageManager");
|
|
43
|
+
var PluginConfigurator_1 = require("./internal/PluginConfigurator");
|
|
42
44
|
var USAGE = "Wrong command has been detected. Use like below:\n\n npx @nestia/core setup \\\n --compiler (ttypescript|ts-patch) \\\n --manager (npm|pnpm|yarn) \\\n --project {tsconfig.json file path}\n\n - npx @nestia/core setup\n - npx @nestia/core setup --compiler ts-patch\n - npx @nestia/core setup --manager pnpm\n - npx @nestia/core setup --project tsconfig.test.json";
|
|
43
45
|
function halt(desc) {
|
|
44
46
|
console.error(desc);
|
|
45
47
|
process.exit(-1);
|
|
46
48
|
}
|
|
47
49
|
function setup() {
|
|
48
|
-
var _a
|
|
50
|
+
var _a;
|
|
49
51
|
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
-
var
|
|
51
|
-
return __generator(this, function (
|
|
52
|
-
switch (
|
|
52
|
+
var pack, args;
|
|
53
|
+
return __generator(this, function (_b) {
|
|
54
|
+
switch (_b.label) {
|
|
53
55
|
case 0:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
console.log(options);
|
|
59
|
-
if (!((compiler !== "ttypescript" && compiler !== "ts-patch") ||
|
|
60
|
-
(manager !== "npm" && manager !== "pnpm" && manager !== "yarn"))) return [3 /*break*/, 1];
|
|
61
|
-
halt(USAGE);
|
|
62
|
-
return [3 /*break*/, 5];
|
|
56
|
+
console.log("----------------------------------------");
|
|
57
|
+
console.log(" Nestia Setup Wizard");
|
|
58
|
+
console.log("----------------------------------------");
|
|
59
|
+
return [4 /*yield*/, PackageManager_1.PackageManager.mount()];
|
|
63
60
|
case 1:
|
|
64
|
-
|
|
65
|
-
return [4 /*yield*/,
|
|
61
|
+
pack = _b.sent();
|
|
62
|
+
return [4 /*yield*/, ArgumentParser_1.ArgumentParser.parse(pack)];
|
|
66
63
|
case 2:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
args = _b.sent();
|
|
65
|
+
// INSTALL TYPESCRIPT
|
|
66
|
+
pack.install({ dev: true, modulo: "typescript" });
|
|
67
|
+
(_a = args.project) !== null && _a !== void 0 ? _a : (args.project = (function () {
|
|
68
|
+
CommandExecutor_1.CommandExecutor.run("npx tsc --init", false);
|
|
69
|
+
return (args.project = "tsconfig.json");
|
|
70
|
+
})());
|
|
71
|
+
pack.install({ dev: true, modulo: "ts-node" });
|
|
72
|
+
// INSTALL COMPILER
|
|
73
|
+
pack.install({ dev: true, modulo: args.compiler });
|
|
74
|
+
if (!(args.compiler === "ts-patch")) return [3 /*break*/, 4];
|
|
75
|
+
return [4 /*yield*/, pack.save(function (data) {
|
|
76
|
+
var _a;
|
|
77
|
+
(_a = data.scripts) !== null && _a !== void 0 ? _a : (data.scripts = {});
|
|
78
|
+
if (typeof data.scripts.prepare === "string")
|
|
79
|
+
data.scripts.prepare =
|
|
80
|
+
"ts-patch install && " + data.scripts.prepare;
|
|
81
|
+
else
|
|
82
|
+
data.scripts.prepare = "ts-patch install";
|
|
83
|
+
})];
|
|
84
|
+
case 3:
|
|
85
|
+
_b.sent();
|
|
86
|
+
CommandExecutor_1.CommandExecutor.run("npm run prepare", false);
|
|
87
|
+
_b.label = 4;
|
|
70
88
|
case 4:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
89
|
+
// INSTALL AND CONFIGURE TYPIA
|
|
90
|
+
pack.install({ dev: false, modulo: "typia" });
|
|
91
|
+
pack.install({ dev: false, modulo: "@nestia/core" });
|
|
92
|
+
return [4 /*yield*/, PluginConfigurator_1.PluginConfigurator.configure(pack, args)];
|
|
93
|
+
case 5:
|
|
94
|
+
_b.sent();
|
|
95
|
+
return [2 /*return*/];
|
|
74
96
|
}
|
|
75
97
|
});
|
|
76
98
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/executable/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/executable/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAA2D;AAC3D,8DAA6D;AAC7D,4DAA2D;AAC3D,oEAAmE;AAEnE,IAAM,KAAK,GAAG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-patch" | "ttypescript";
|
|
5
|
+
manager: "npm" | "pnpm" | "yarn";
|
|
6
|
+
project: string | null;
|
|
7
|
+
}
|
|
8
|
+
function parse(pack: PackageManager): Promise<IArguments>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.ArgumentParser = void 0;
|
|
43
|
+
var fs_1 = __importDefault(require("fs"));
|
|
44
|
+
var path_1 = __importDefault(require("path"));
|
|
45
|
+
var FileRetriever_1 = require("./FileRetriever");
|
|
46
|
+
var ArgumentParser;
|
|
47
|
+
(function (ArgumentParser) {
|
|
48
|
+
function parse(pack) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
var newbie, output;
|
|
51
|
+
var _this = this;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
switch (_a.label) {
|
|
54
|
+
case 0:
|
|
55
|
+
newbie = {
|
|
56
|
+
commander: pack.install({
|
|
57
|
+
dev: true,
|
|
58
|
+
modulo: "commander",
|
|
59
|
+
version: "10.0.0",
|
|
60
|
+
silent: true,
|
|
61
|
+
}),
|
|
62
|
+
inquirer: pack.install({
|
|
63
|
+
dev: true,
|
|
64
|
+
modulo: "inquirer",
|
|
65
|
+
version: "8.2.5",
|
|
66
|
+
silent: true,
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
return [4 /*yield*/, (function () { return __awaiter(_this, void 0, void 0, function () {
|
|
70
|
+
var error_1;
|
|
71
|
+
return __generator(this, function (_a) {
|
|
72
|
+
switch (_a.label) {
|
|
73
|
+
case 0:
|
|
74
|
+
_a.trys.push([0, 2, , 3]);
|
|
75
|
+
return [4 /*yield*/, _Parse(pack)];
|
|
76
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
77
|
+
case 2:
|
|
78
|
+
error_1 = _a.sent();
|
|
79
|
+
return [2 /*return*/, error_1];
|
|
80
|
+
case 3: return [2 /*return*/];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}); })()];
|
|
84
|
+
case 1:
|
|
85
|
+
output = _a.sent();
|
|
86
|
+
// REMOVE TEMPORARY PACKAGES
|
|
87
|
+
if (newbie.commander)
|
|
88
|
+
pack.erase({ modulo: "commander", silent: true });
|
|
89
|
+
if (newbie.inquirer)
|
|
90
|
+
pack.erase({ modulo: "inquirer", silent: true });
|
|
91
|
+
// RETURNS
|
|
92
|
+
if (output instanceof Error)
|
|
93
|
+
throw output;
|
|
94
|
+
return [2 /*return*/, output];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
ArgumentParser.parse = parse;
|
|
100
|
+
function _Parse(pack) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
+
var createPromptModule, program, questioned, action, select, configure;
|
|
103
|
+
var _this = this;
|
|
104
|
+
return __generator(this, function (_a) {
|
|
105
|
+
switch (_a.label) {
|
|
106
|
+
case 0: return [4 /*yield*/, FileRetriever_1.FileRetriever.require(path_1.default.join("node_modules", "inquirer"))(pack.directory)];
|
|
107
|
+
case 1:
|
|
108
|
+
createPromptModule = (_a.sent()).createPromptModule;
|
|
109
|
+
return [4 /*yield*/, FileRetriever_1.FileRetriever.require(path_1.default.join("node_modules", "commander"))(pack.directory)];
|
|
110
|
+
case 2:
|
|
111
|
+
program = (_a.sent()).program;
|
|
112
|
+
program.option("--compiler [compiler]", "compiler type");
|
|
113
|
+
program.option("--manager [manager", "package manager");
|
|
114
|
+
program.option("--project [project]", "tsconfig.json file location");
|
|
115
|
+
questioned = { value: false };
|
|
116
|
+
action = function (closure) {
|
|
117
|
+
return new Promise(function (resolve, reject) {
|
|
118
|
+
program.action(function (options) { return __awaiter(_this, void 0, void 0, function () {
|
|
119
|
+
var _a, exp_1;
|
|
120
|
+
return __generator(this, function (_b) {
|
|
121
|
+
switch (_b.label) {
|
|
122
|
+
case 0:
|
|
123
|
+
_b.trys.push([0, 2, , 3]);
|
|
124
|
+
_a = resolve;
|
|
125
|
+
return [4 /*yield*/, closure(options)];
|
|
126
|
+
case 1:
|
|
127
|
+
_a.apply(void 0, [_b.sent()]);
|
|
128
|
+
return [3 /*break*/, 3];
|
|
129
|
+
case 2:
|
|
130
|
+
exp_1 = _b.sent();
|
|
131
|
+
reject(exp_1);
|
|
132
|
+
return [3 /*break*/, 3];
|
|
133
|
+
case 3: return [2 /*return*/];
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}); });
|
|
137
|
+
program.parseAsync().catch(reject);
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
select = function (name) {
|
|
141
|
+
return function (message) {
|
|
142
|
+
return function (choices) { return __awaiter(_this, void 0, void 0, function () {
|
|
143
|
+
return __generator(this, function (_a) {
|
|
144
|
+
switch (_a.label) {
|
|
145
|
+
case 0:
|
|
146
|
+
questioned.value = true;
|
|
147
|
+
return [4 /*yield*/, createPromptModule()({
|
|
148
|
+
type: "list",
|
|
149
|
+
name: name,
|
|
150
|
+
message: message,
|
|
151
|
+
choices: choices,
|
|
152
|
+
})];
|
|
153
|
+
case 1: return [2 /*return*/, (_a.sent())[name]];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}); };
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
configure = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
160
|
+
var fileList;
|
|
161
|
+
return __generator(this, function (_a) {
|
|
162
|
+
switch (_a.label) {
|
|
163
|
+
case 0: return [4 /*yield*/, fs_1.default.promises.readdir(process.cwd())];
|
|
164
|
+
case 1: return [4 /*yield*/, (_a.sent()).filter(function (str) {
|
|
165
|
+
return str.substring(0, 8) === "tsconfig" &&
|
|
166
|
+
str.substring(str.length - 5) === ".json";
|
|
167
|
+
})];
|
|
168
|
+
case 2:
|
|
169
|
+
fileList = _a.sent();
|
|
170
|
+
if (fileList.length === 0) {
|
|
171
|
+
if (process.cwd() !== pack.directory)
|
|
172
|
+
throw new Error("Unable to find \"tsconfig.json\" file.");
|
|
173
|
+
return [2 /*return*/, null];
|
|
174
|
+
}
|
|
175
|
+
else if (fileList.length === 1)
|
|
176
|
+
return [2 /*return*/, fileList[0]];
|
|
177
|
+
return [2 /*return*/, select("tsconfig")("TS Config File")(fileList)];
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}); };
|
|
181
|
+
// DO CONSTRUCT
|
|
182
|
+
return [2 /*return*/, action(function (options) { return __awaiter(_this, void 0, void 0, function () {
|
|
183
|
+
var _a, _b, _c, _d, _e;
|
|
184
|
+
var _f, _g, _h;
|
|
185
|
+
return __generator(this, function (_j) {
|
|
186
|
+
switch (_j.label) {
|
|
187
|
+
case 0:
|
|
188
|
+
if (!(options.compiler === undefined)) return [3 /*break*/, 2];
|
|
189
|
+
console.log(COMPILER_DESCRIPTION);
|
|
190
|
+
_a = options;
|
|
191
|
+
return [4 /*yield*/, select("compiler")("Compiler")(((_f = pack.data.scripts) === null || _f === void 0 ? void 0 : _f.build) === "nest build"
|
|
192
|
+
? ["ts-patch", "ttypescript"]
|
|
193
|
+
: ["ttypescript", "ts-patch"])];
|
|
194
|
+
case 1:
|
|
195
|
+
_a.compiler = _j.sent();
|
|
196
|
+
_j.label = 2;
|
|
197
|
+
case 2:
|
|
198
|
+
if (!((_g = options.manager) !== null && _g !== void 0)) return [3 /*break*/, 3];
|
|
199
|
+
_b = _g;
|
|
200
|
+
return [3 /*break*/, 5];
|
|
201
|
+
case 3:
|
|
202
|
+
_c = options;
|
|
203
|
+
return [4 /*yield*/, select("manager")("Package Manager")([
|
|
204
|
+
"npm",
|
|
205
|
+
"pnpm",
|
|
206
|
+
"yarn",
|
|
207
|
+
])];
|
|
208
|
+
case 4:
|
|
209
|
+
_b = (_c.manager = _j.sent());
|
|
210
|
+
_j.label = 5;
|
|
211
|
+
case 5:
|
|
212
|
+
_b;
|
|
213
|
+
pack.manager = options.manager;
|
|
214
|
+
if (!((_h = options.project) !== null && _h !== void 0)) return [3 /*break*/, 6];
|
|
215
|
+
_d = _h;
|
|
216
|
+
return [3 /*break*/, 8];
|
|
217
|
+
case 6:
|
|
218
|
+
_e = options;
|
|
219
|
+
return [4 /*yield*/, configure()];
|
|
220
|
+
case 7:
|
|
221
|
+
_d = (_e.project = _j.sent());
|
|
222
|
+
_j.label = 8;
|
|
223
|
+
case 8:
|
|
224
|
+
_d;
|
|
225
|
+
if (questioned.value)
|
|
226
|
+
console.log("");
|
|
227
|
+
return [2 /*return*/, options];
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}); })];
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
})(ArgumentParser = exports.ArgumentParser || (exports.ArgumentParser = {}));
|
|
236
|
+
var COMPILER_DESCRIPTION = [
|
|
237
|
+
"About compiler, if you adapt \"ttypescript\", you should use \"ttsc\" instead.",
|
|
238
|
+
"",
|
|
239
|
+
"Otherwise, you choose \"ts-patch\", you can use the original \"tsc\" command.",
|
|
240
|
+
"However, the \"ts-patch\" hacks \"node_modules/typescript\" source code.",
|
|
241
|
+
"Also, whenever update \"typescript\", you've to run \"npm run prepare\" command.",
|
|
242
|
+
"",
|
|
243
|
+
"By the way, when using \"@nest/cli\", you must just choose \"ts-patch\".",
|
|
244
|
+
"",
|
|
245
|
+
].join("\n");
|
|
246
|
+
//# sourceMappingURL=ArgumentParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArgumentParser.js","sourceRoot":"","sources":["../../../src/executable/internal/ArgumentParser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAAoB;AAEpB,8CAAwB;AACxB,iDAAgD;AAIhD,IAAiB,cAAc,CA8H9B;AA9HD,WAAiB,cAAc;IAO3B,SAAsB,KAAK,CAAC,IAAoB;;;;;;;wBAEtC,MAAM,GAAG;4BACX,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC;gCACpB,GAAG,EAAE,IAAI;gCACT,MAAM,EAAE,WAAW;gCACnB,OAAO,EAAE,QAAQ;gCACjB,MAAM,EAAE,IAAI;6BACf,CAAC;4BACF,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC;gCACnB,GAAG,EAAE,IAAI;gCACT,MAAM,EAAE,UAAU;gCAClB,OAAO,EAAE,OAAO;gCAChB,MAAM,EAAE,IAAI;6BACf,CAAC;yBACL,CAAC;wBAGiC,qBAAM,CAAC;;;;;;4CAE3B,qBAAM,MAAM,CAAC,IAAI,CAAC,EAAA;gDAAzB,sBAAO,SAAkB,EAAC;;;4CAE1B,sBAAO,OAAc,EAAC;;;;iCAE7B,CAAC,EAAE,EAAA;;wBANE,MAAM,GAAuB,SAM/B;wBAEJ,4BAA4B;wBAC5B,IAAI,MAAM,CAAC,SAAS;4BAAE,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;wBACxE,IAAI,MAAM,CAAC,QAAQ;4BAAE,IAAI,CAAC,KAAK,CAAC,EAAE,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 -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CommandExecutor = void 0;
|
|
7
|
+
var child_process_1 = __importDefault(require("child_process"));
|
|
8
|
+
var CommandExecutor;
|
|
9
|
+
(function (CommandExecutor) {
|
|
10
|
+
function run(str, silent) {
|
|
11
|
+
if (silent === false)
|
|
12
|
+
console.log(str);
|
|
13
|
+
child_process_1.default.execSync(str, { stdio: "ignore" });
|
|
14
|
+
}
|
|
15
|
+
CommandExecutor.run = run;
|
|
16
|
+
})(CommandExecutor = exports.CommandExecutor || (exports.CommandExecutor = {}));
|
|
17
|
+
//# sourceMappingURL=CommandExecutor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandExecutor.js","sourceRoot":"","sources":["../../../src/executable/internal/CommandExecutor.ts"],"names":[],"mappings":";;;;;;AAAA,gEAA+B;AAE/B,IAAiB,eAAe,CAK/B;AALD,WAAiB,eAAe;IAC5B,SAAgB,GAAG,CAAC,GAAW,EAAE,MAAe;QAC5C,IAAI,MAAM,KAAK,KAAK;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACvC,uBAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1C,CAAC;IAHe,mBAAG,MAGlB,CAAA;AACL,CAAC,EALgB,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK/B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare namespace FileRetriever {
|
|
2
|
+
const directory: (name: string) => (directory: string, depth?: number) => string | null;
|
|
3
|
+
const file: (name: string) => (directory: string, depth?: number) => string | null;
|
|
4
|
+
const require: (name: string) => (directory: string, depth?: number) => Promise<any>;
|
|
5
|
+
}
|