@nestia/core 1.0.18 → 1.0.19

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 CHANGED
@@ -7,11 +7,11 @@
7
7
 
8
8
  Super-fast validation decorators for NestJS.
9
9
 
10
- - 15,000x faster request body validation
11
- - 50x faster JSON response, even type safe
10
+ - 20,000x faster request body validation
11
+ - 200x faster JSON response, even type safe
12
12
  - Do not need DTO class definition, just fine with interface
13
13
 
14
- `@nestia/core` is a transformer library of NestJS, supporting super-fast validation decorators, by wrapping [typia](https://github.com/samchon/typia). Comparing validation speed with `class-validator`, [typia](https://github.com/samchon/typia) is maximum **15,000x times faster** and it is even much safer.
14
+ `@nestia/core` is a transformer library of NestJS, supporting super-fast validation decorators, by wrapping [typia](https://github.com/samchon/typia). Comparing validation speed with `class-validator`, [typia](https://github.com/samchon/typia) is maximum **20,000x faster** and it is even much safer.
15
15
 
16
16
  Furthermore, `@nestia/core` can use pure interface typed DTO with **only one line**. With `@nestia/core`, you don't need any extra dedication like defining JSON schema (`@nestjs/swagger`), or using class definition with decorator function calls (`class-validator`). Just enjoy the superfast decorators with pure TypeScript type.
17
17
 
@@ -29,7 +29,7 @@ export class BbsArticlesController {
29
29
  * @param inupt Content to store
30
30
  * @returns Newly archived article
31
31
  */
32
- @TypedRoute.Post() // 50x faster and safer JSON.stringify()
32
+ @TypedRoute.Post() // 200x faster and safer JSON serialization
33
33
  public async store(
34
34
  @TypedBody() input: IBbsArticle.IStore // super-fast validator
35
35
  ): Promise<IBbsArticle>;
@@ -51,15 +51,10 @@ Just run above command, then boilerplate project would be constructed.
51
51
 
52
52
  ### Setup Wizard
53
53
  ```bash
54
- # setup both @nestia/core and @nestia/sdk
54
+ npm install --save-dev nestia
55
55
  npx nestia setup
56
-
57
- # setup @nestia/core only
58
- npx @nestia/core setup
59
56
  ```
60
57
 
61
- Just type `npx nestia setup`, that's all.
62
-
63
58
  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
59
 
65
60
  ```bash
@@ -105,7 +100,7 @@ export class BbsArticlesController {
105
100
  * @param inupt Content to store
106
101
  * @returns Newly archived article
107
102
  */
108
- @TypedRoute.Put(":id") // 50x faster and safer JSON.stringify()
103
+ @TypedRoute.Put(":id") // 200x faster and safer JSON serialization
109
104
  public async store(
110
105
  @TypedParam("section", "string") section: string,
111
106
  @TypedParam("id", "uuid") id: string,
package/package.json CHANGED
@@ -1,12 +1,9 @@
1
1
  {
2
2
  "name": "@nestia/core",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "Super-fast validation decorators of NestJS",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
- "bin": {
8
- "@nestia/core": "lib/executable/core.js"
9
- },
10
7
  "scripts": {
11
8
  "build": "rimraf lib && tsc",
12
9
  "build:test": "rimraf bin && ttsc -p test/tsconfig.json",
@@ -63,7 +60,7 @@
63
60
  "raw-body": "*",
64
61
  "reflect-metadata": "*",
65
62
  "rxjs": "*",
66
- "typia": "^3.6.8"
63
+ "typia": "^3.7.4"
67
64
  },
68
65
  "peerDependencies": {
69
66
  "typescript": ">= 4.5.2 && < 5.0.0"
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,124 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
- var __generator = (this && this.__generator) || function (thisArg, body) {
13
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
14
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
15
- function verb(n) { return function (v) { return step([n, v]); }; }
16
- function step(op) {
17
- if (f) throw new TypeError("Generator is already executing.");
18
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
19
- 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;
20
- if (y = 0, t) op = [op[0] & 2, t.value];
21
- switch (op[0]) {
22
- case 0: case 1: t = op; break;
23
- case 4: _.label++; return { value: op[1], done: false };
24
- case 5: _.label++; y = op[1]; op = [0]; continue;
25
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
26
- default:
27
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
28
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
29
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
30
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
31
- if (t[2]) _.ops.pop();
32
- _.trys.pop(); continue;
33
- }
34
- op = body.call(thisArg, _);
35
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
36
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
37
- }
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
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");
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";
45
- function halt(desc) {
46
- console.error(desc);
47
- process.exit(-1);
48
- }
49
- function setup() {
50
- var _a;
51
- return __awaiter(this, void 0, void 0, function () {
52
- var pack, args;
53
- return __generator(this, function (_b) {
54
- switch (_b.label) {
55
- case 0:
56
- console.log("----------------------------------------");
57
- console.log(" Nestia Setup Wizard");
58
- console.log("----------------------------------------");
59
- return [4 /*yield*/, PackageManager_1.PackageManager.mount()];
60
- case 1:
61
- pack = _b.sent();
62
- return [4 /*yield*/, ArgumentParser_1.ArgumentParser.parse(pack)];
63
- case 2:
64
- args = _b.sent();
65
- // INSTALL TYPESCRIPT
66
- pack.install({ dev: true, modulo: "typescript", version: "4.9.5" });
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;
88
- case 4:
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*/];
96
- }
97
- });
98
- });
99
- }
100
- function main() {
101
- return __awaiter(this, void 0, void 0, function () {
102
- var type;
103
- return __generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0:
106
- type = process.argv[2];
107
- if (!(type === "setup")) return [3 /*break*/, 2];
108
- return [4 /*yield*/, setup()];
109
- case 1:
110
- _a.sent();
111
- return [3 /*break*/, 3];
112
- case 2:
113
- halt(USAGE);
114
- _a.label = 3;
115
- case 3: return [2 /*return*/];
116
- }
117
- });
118
- });
119
- }
120
- main().catch(function (exp) {
121
- console.error(exp);
122
- process.exit(-1);
123
- });
124
- //# sourceMappingURL=core.js.map
@@ -1 +0,0 @@
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,wXAU0C,CAAC;AAEzD,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,KAAK;;;;;;;oBAChB,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;oBACxD,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;oBACpC,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;oBAG3B,qBAAM,+BAAc,CAAC,KAAK,EAAE,EAAA;;oBAAnD,IAAI,GAAmB,SAA4B;oBAGjB,qBAAM,+BAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAA;;oBAAlE,IAAI,GAA8B,SAAgC;oBAExE,qBAAqB;oBACrB,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,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AAE,CAAC,CAAC;oBACrD,qBAAM,uCAAkB,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,EAAA;;oBAA9C,SAA8C,CAAC;;;;;CAClD;AAED,SAAe,IAAI;;;;;;oBACT,IAAI,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;yBAC7C,CAAA,IAAI,KAAK,OAAO,CAAA,EAAhB,wBAAgB;oBAAE,qBAAM,KAAK,EAAE,EAAA;;oBAAb,SAAa,CAAC;;;oBAC/B,IAAI,CAAC,KAAK,CAAC,CAAC;;;;;;CACpB;AACD,IAAI,EAAE,CAAC,KAAK,CAAC,UAAC,GAAG;IACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- import { PackageManager } from "./PackageManager";
2
- export declare namespace ArgumentParser {
3
- interface IArguments {
4
- compiler: "ts-patch" | "ttypescript";
5
- manager: "npm" | "pnpm" | "yarn";
6
- project: string | null;
7
- }
8
- function parse(pack: PackageManager): Promise<IArguments>;
9
- }
@@ -1,256 +0,0 @@
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())
165
- .filter(function (str) {
166
- return str.substring(0, 8) === "tsconfig" &&
167
- str.substring(str.length - 5) === ".json";
168
- })
169
- .sort(function (x, y) {
170
- return x === "tsconfig.json"
171
- ? -1
172
- : y === "tsconfig.json"
173
- ? 1
174
- : x < y
175
- ? -1
176
- : 1;
177
- })];
178
- case 2:
179
- fileList = _a.sent();
180
- if (fileList.length === 0) {
181
- if (process.cwd() !== pack.directory)
182
- throw new Error("Unable to find \"tsconfig.json\" file.");
183
- return [2 /*return*/, null];
184
- }
185
- else if (fileList.length === 1)
186
- return [2 /*return*/, fileList[0]];
187
- return [2 /*return*/, select("tsconfig")("TS Config File")(fileList)];
188
- }
189
- });
190
- }); };
191
- // DO CONSTRUCT
192
- return [2 /*return*/, action(function (options) { return __awaiter(_this, void 0, void 0, function () {
193
- var _a, _b, _c, _d, _e;
194
- var _f, _g, _h;
195
- return __generator(this, function (_j) {
196
- switch (_j.label) {
197
- case 0:
198
- if (!(options.compiler === undefined)) return [3 /*break*/, 2];
199
- console.log(COMPILER_DESCRIPTION);
200
- _a = options;
201
- return [4 /*yield*/, select("compiler")("Compiler")(((_f = pack.data.scripts) === null || _f === void 0 ? void 0 : _f.build) === "nest build"
202
- ? ["ts-patch", "ttypescript"]
203
- : ["ttypescript", "ts-patch"])];
204
- case 1:
205
- _a.compiler = _j.sent();
206
- _j.label = 2;
207
- case 2:
208
- if (!((_g = options.manager) !== null && _g !== void 0)) return [3 /*break*/, 3];
209
- _b = _g;
210
- return [3 /*break*/, 5];
211
- case 3:
212
- _c = options;
213
- return [4 /*yield*/, select("manager")("Package Manager")([
214
- "npm",
215
- "pnpm",
216
- "yarn",
217
- ])];
218
- case 4:
219
- _b = (_c.manager = _j.sent());
220
- _j.label = 5;
221
- case 5:
222
- _b;
223
- pack.manager = options.manager;
224
- if (!((_h = options.project) !== null && _h !== void 0)) return [3 /*break*/, 6];
225
- _d = _h;
226
- return [3 /*break*/, 8];
227
- case 6:
228
- _e = options;
229
- return [4 /*yield*/, configure()];
230
- case 7:
231
- _d = (_e.project = _j.sent());
232
- _j.label = 8;
233
- case 8:
234
- _d;
235
- if (questioned.value)
236
- console.log("");
237
- return [2 /*return*/, options];
238
- }
239
- });
240
- }); })];
241
- }
242
- });
243
- });
244
- }
245
- })(ArgumentParser = exports.ArgumentParser || (exports.ArgumentParser = {}));
246
- var COMPILER_DESCRIPTION = [
247
- "About compiler, if you adapt \"ttypescript\", you should use \"ttsc\" instead.",
248
- "",
249
- "Otherwise, you choose \"ts-patch\", you can use the original \"tsc\" command.",
250
- "However, the \"ts-patch\" hacks \"node_modules/typescript\" source code.",
251
- "Also, whenever update \"typescript\", you've to run \"npm run prepare\" command.",
252
- "",
253
- "By the way, when using \"@nest/cli\", you must just choose \"ts-patch\".",
254
- "",
255
- ].join("\n");
256
- //# sourceMappingURL=ArgumentParser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ArgumentParser.js","sourceRoot":"","sources":["../../../src/executable/internal/ArgumentParser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAAoB;AAEpB,8CAAwB;AAExB,iDAAgD;AAGhD,IAAiB,cAAc,CAwI9B;AAxID,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,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;wBAEtE,UAAU;wBACV,IAAI,MAAM,YAAY,KAAK;4BAAE,MAAM,MAAM,CAAC;wBAC1C,sBAAO,MAAM,EAA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E;IAC3E,0EAAsE;IACtE,kFAA8E;IAC9E,EAAE;IACF,0EAAsE;IACtE,EAAE;CACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare namespace CommandExecutor {
2
- function run(str: string, silent: boolean): void;
3
- }
@@ -1,17 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,5 +0,0 @@
1
- export declare namespace FileRetriever {
2
- const directory: (name: string) => (dir: 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
- }
@@ -1,109 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
- function verb(n) { return function (v) { return step([n, v]); }; }
38
- function step(op) {
39
- if (f) throw new TypeError("Generator is already executing.");
40
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
- 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;
42
- if (y = 0, t) op = [op[0] & 2, t.value];
43
- switch (op[0]) {
44
- case 0: case 1: t = op; break;
45
- case 4: _.label++; return { value: op[1], done: false };
46
- case 5: _.label++; y = op[1]; op = [0]; continue;
47
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
- default:
49
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
- if (t[2]) _.ops.pop();
54
- _.trys.pop(); continue;
55
- }
56
- op = body.call(thisArg, _);
57
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
- }
60
- };
61
- var __importDefault = (this && this.__importDefault) || function (mod) {
62
- return (mod && mod.__esModule) ? mod : { "default": mod };
63
- };
64
- Object.defineProperty(exports, "__esModule", { value: true });
65
- exports.FileRetriever = void 0;
66
- var fs_1 = __importDefault(require("fs"));
67
- var path_1 = __importDefault(require("path"));
68
- var FileRetriever;
69
- (function (FileRetriever) {
70
- var _this = this;
71
- FileRetriever.directory = function (name) {
72
- return function (dir, depth) {
73
- if (depth === void 0) { depth = 0; }
74
- var location = path_1.default.join(dir, name);
75
- if (fs_1.default.existsSync(location))
76
- return dir;
77
- else if (depth > 2)
78
- return null;
79
- return FileRetriever.directory(name)(path_1.default.join(dir, ".."), depth + 1);
80
- };
81
- };
82
- FileRetriever.file = function (name) {
83
- return function (directory, depth) {
84
- if (depth === void 0) { depth = 0; }
85
- var location = path_1.default.join(directory, name);
86
- if (fs_1.default.existsSync(location))
87
- return location;
88
- else if (depth > 2)
89
- return null;
90
- return FileRetriever.file(name)(path_1.default.join(directory, ".."), depth + 1);
91
- };
92
- };
93
- FileRetriever.require = function (name) {
94
- return function (directory, depth) {
95
- if (depth === void 0) { depth = 0; }
96
- return __awaiter(_this, void 0, void 0, function () {
97
- var location;
98
- return __generator(this, function (_a) {
99
- var _b;
100
- location = FileRetriever.file(name)(directory, depth);
101
- if (location === null)
102
- throw new Error("Unable to find installed module. Please report to the nestia - https://github.com/samchon/nestia/issues");
103
- return [2 /*return*/, (_b = location, Promise.resolve().then(function () { return __importStar(require(_b)); }))];
104
- });
105
- });
106
- };
107
- };
108
- })(FileRetriever = exports.FileRetriever || (exports.FileRetriever = {}));
109
- //# sourceMappingURL=FileRetriever.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileRetriever.js","sourceRoot":"","sources":["../../../src/executable/internal/FileRetriever.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAoB;AACpB,8CAAwB;AAExB,IAAiB,aAAa,CA6B7B;AA7BD,WAAiB,aAAa;;IACb,uBAAS,GAClB,UAAC,IAAY;QACb,OAAA,UAAC,GAAW,EAAE,KAAiB;YAAjB,sBAAA,EAAA,SAAiB;YAC3B,IAAM,QAAQ,GAAW,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAC9C,IAAI,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;gBAAE,OAAO,GAAG,CAAC;iBACnC,IAAI,KAAK,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YAChC,OAAO,cAAA,SAAS,CAAC,IAAI,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;QA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