@nestia/core 1.0.10 → 1.0.11

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 (39) hide show
  1. package/README.md +15 -9
  2. package/lib/decorators/EncryptedBody.d.ts +1 -1
  3. package/lib/decorators/EncryptedBody.js +1 -1
  4. package/lib/decorators/EncryptedRoute.d.ts +4 -4
  5. package/lib/decorators/EncryptedRoute.js +4 -4
  6. package/lib/decorators/TypedRoute.d.ts +3 -2
  7. package/lib/decorators/TypedRoute.js +3 -2
  8. package/lib/decorators/TypedRoute.js.map +1 -1
  9. package/lib/executable/core.js +45 -23
  10. package/lib/executable/core.js.map +1 -1
  11. package/lib/executable/internal/ArgumentParser.d.ts +9 -0
  12. package/lib/executable/internal/ArgumentParser.js +269 -0
  13. package/lib/executable/internal/ArgumentParser.js.map +1 -0
  14. package/lib/executable/internal/CommandExecutor.d.ts +3 -0
  15. package/lib/executable/internal/CommandExecutor.js +17 -0
  16. package/lib/executable/internal/CommandExecutor.js.map +1 -0
  17. package/lib/executable/internal/PackageManager.d.ts +27 -0
  18. package/lib/executable/internal/PackageManager.js +140 -0
  19. package/lib/executable/internal/PackageManager.js.map +1 -0
  20. package/lib/executable/internal/PluginConfigurator.d.ts +5 -0
  21. package/lib/executable/internal/PluginConfigurator.js +168 -0
  22. package/lib/executable/internal/PluginConfigurator.js.map +1 -0
  23. package/package.json +7 -3
  24. package/src/decorators/EncryptedBody.ts +1 -1
  25. package/src/decorators/EncryptedRoute.ts +4 -4
  26. package/src/decorators/TypedRoute.ts +3 -2
  27. package/src/executable/core.ts +39 -18
  28. package/src/executable/internal/ArgumentParser.ts +144 -0
  29. package/src/executable/internal/CommandExecutor.ts +8 -0
  30. package/src/executable/internal/PackageManager.ts +99 -0
  31. package/src/executable/internal/PluginConfigurator.ts +128 -0
  32. package/lib/executable/internal/CommandParser.d.ts +0 -3
  33. package/lib/executable/internal/CommandParser.js +0 -21
  34. package/lib/executable/internal/CommandParser.js.map +0 -1
  35. package/lib/executable/internal/CoreSetupWizard.d.ts +0 -8
  36. package/lib/executable/internal/CoreSetupWizard.js +0 -271
  37. package/lib/executable/internal/CoreSetupWizard.js.map +0 -1
  38. package/src/executable/internal/CommandParser.ts +0 -15
  39. 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
- When you run `npx nestia setup` command, all installation and configuration processes would be automatically done. If you want to setup `@nestia/core` only, run `npx @nestia/core setup` command instead.
61
+ Just type `npx nestia setup`, that's all.
62
62
 
63
- After the setup has been fully completed, you can compile your backend server code by using `ttsc` command. If you want to run your TypeScript file directly through `ts-node`, add `-C ttypescript` argument like below:
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
- Also, you can specify package manager or target `tsconfig.json` file like below:
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
- npx @nestia/core setup --manager npm
74
- npx @nestia/core setup --manager pnpm
75
- npx @nestia/core setup --manager yarn
78
+ # USE ORIGINAL TSC COMMAND
79
+ tsc
80
+ npx ts-node src/index.ts
76
81
 
77
- npx @nestia/core setup --project tsconfig.json
78
- npx @nestia/core setup --project tsconfig.test.json
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") // 10x faster and safer JSON.stringify()
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 usnig those options.
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 usnig those options.
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/250 encryption. Furthermore, they can boost
7
- * up JSON string conversion speed about 10x times faster, even type safe through
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 usnig those
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/250 encryption. Furthermore, they can boost
56
- * up JSON string conversion speed about 10x times faster, even type safe through
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 usnig those
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 10x times faster. Furthermore, such JSON string
7
- * conversion is even type safe through [typia](https://github.com/samchon/typia).
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 10x times faster. Furthermore, such JSON string
51
- * conversion is even type safe through [typia](https://github.com/samchon/typia).
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;;;;;;;;;;;;GAYG;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,CAAC,KAAK,CAAC,CAAC;IAEpC;;;;;OAKG;IACU,iBAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,SAAS,CAAC,MAAmD;QAUlE,SAAS,KAAK;YAAC,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YACnB,IAAA,KAAA,OAAoB,IAAA,+CAAsB,EAC5C,qBAAc,MAAM,CAAE,CACzB,wCAAI,IAAI,cAAC,EAFH,IAAI,QAAA,EAAE,SAAS,QAEZ,CAAC;YACX,OAAO,IAAA,wBAAe,EAClB,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EACrB,IAAA,wBAAe,EAAC,IAAI,qBAAqB,CAAC,SAAS,CAAC,CAAC,CACxD,CAAC;QACN,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC,EAjEgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAiE1B;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C;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"}
@@ -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 CommandParser_1 = require("./internal/CommandParser");
41
- var CoreSetupWizard_1 = require("./internal/CoreSetupWizard");
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, _b, _c;
50
+ var _a;
49
51
  return __awaiter(this, void 0, void 0, function () {
50
- var options, manager, compiler, project;
51
- return __generator(this, function (_d) {
52
- switch (_d.label) {
52
+ var pack, args;
53
+ return __generator(this, function (_b) {
54
+ switch (_b.label) {
53
55
  case 0:
54
- options = CommandParser_1.CommandParser.parse(process.argv.slice(3));
55
- manager = (_a = options.manager) !== null && _a !== void 0 ? _a : "npm";
56
- compiler = (_b = options.compiler) !== null && _b !== void 0 ? _b : "ttypescript";
57
- project = (_c = options.project) !== null && _c !== void 0 ? _c : "tsconfig.json";
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
- if (!(compiler === "ttypescript")) return [3 /*break*/, 3];
65
- return [4 /*yield*/, CoreSetupWizard_1.CoreSetupWizard.ttypescript({ manager: manager, project: project })];
61
+ pack = _b.sent();
62
+ return [4 /*yield*/, ArgumentParser_1.ArgumentParser.parse(pack)];
66
63
  case 2:
67
- _d.sent();
68
- return [3 /*break*/, 5];
69
- case 3: return [4 /*yield*/, CoreSetupWizard_1.CoreSetupWizard.tsPatch({ manager: manager, project: project })];
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
- _d.sent();
72
- _d.label = 5;
73
- case 5: return [2 /*return*/];
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,0DAAyD;AACzD,8DAA6D;AAE7D,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;;;;;;;oBACV,OAAO,GAA2B,6BAAa,CAAC,KAAK,CACvD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACxB,CAAC;oBACI,OAAO,GAAW,MAAA,OAAO,CAAC,OAAO,mCAAI,KAAK,CAAC;oBAC3C,QAAQ,GAAW,MAAA,OAAO,CAAC,QAAQ,mCAAI,aAAa,CAAC;oBACrD,OAAO,GAAW,MAAA,OAAO,CAAC,OAAO,mCAAI,eAAe,CAAC;oBAC3D,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;yBAGjB,CAAA,CAAC,QAAQ,KAAK,aAAa,IAAI,QAAQ,KAAK,UAAU,CAAC;wBACvD,CAAC,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,MAAM,CAAC,CAAA,EAD/D,wBAC+D;oBAE/D,IAAI,CAAC,KAAK,CAAC,CAAC;;;yBACP,CAAA,QAAQ,KAAK,aAAa,CAAA,EAA1B,wBAA0B;oBAC/B,qBAAM,iCAAe,CAAC,WAAW,CAAC,EAAE,OAAO,SAAA,EAAE,OAAO,SAAA,EAAE,CAAC,EAAA;;oBAAvD,SAAuD,C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C9C,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,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"}
@@ -0,0 +1,9 @@
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
+ }
@@ -0,0 +1,269 @@
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.ArgumentParser = void 0;
66
+ var fs_1 = __importDefault(require("fs"));
67
+ var path_1 = __importDefault(require("path"));
68
+ var ArgumentParser;
69
+ (function (ArgumentParser) {
70
+ function parse(pack) {
71
+ return __awaiter(this, void 0, void 0, function () {
72
+ var newbie, output;
73
+ var _this = this;
74
+ return __generator(this, function (_a) {
75
+ switch (_a.label) {
76
+ case 0:
77
+ newbie = {
78
+ commander: pack.install({
79
+ dev: true,
80
+ modulo: "commander",
81
+ version: "10.0.0",
82
+ silent: true,
83
+ }),
84
+ inquirer: pack.install({
85
+ dev: true,
86
+ modulo: "inquirer",
87
+ version: "8.2.5",
88
+ silent: true,
89
+ }),
90
+ };
91
+ return [4 /*yield*/, (function () { return __awaiter(_this, void 0, void 0, function () {
92
+ var error_1;
93
+ return __generator(this, function (_a) {
94
+ switch (_a.label) {
95
+ case 0:
96
+ _a.trys.push([0, 2, , 3]);
97
+ return [4 /*yield*/, _Parse(pack)];
98
+ case 1: return [2 /*return*/, _a.sent()];
99
+ case 2:
100
+ error_1 = _a.sent();
101
+ return [2 /*return*/, error_1];
102
+ case 3: return [2 /*return*/];
103
+ }
104
+ });
105
+ }); })()];
106
+ case 1:
107
+ output = _a.sent();
108
+ // REMOVE TEMPORARY PACKAGES
109
+ if (newbie.commander)
110
+ pack.erase({ modulo: "commander", silent: true });
111
+ if (newbie.inquirer)
112
+ pack.erase({ modulo: "inquirer", silent: true });
113
+ // RETURNS
114
+ if (output instanceof Error)
115
+ throw output;
116
+ return [2 /*return*/, output];
117
+ }
118
+ });
119
+ });
120
+ }
121
+ ArgumentParser.parse = parse;
122
+ function _Parse(pack) {
123
+ return __awaiter(this, void 0, void 0, function () {
124
+ var createPromptModule, program, questioned, action, select, configure;
125
+ var _this = this;
126
+ return __generator(this, function (_a) {
127
+ var _b, _c;
128
+ switch (_a.label) {
129
+ case 0: return [4 /*yield*/, (_b = path_1.default.join(pack.directory, "node_modules", "inquirer"), Promise.resolve().then(function () { return __importStar(require(_b)); }))];
130
+ case 1:
131
+ createPromptModule = (_a.sent()).createPromptModule;
132
+ return [4 /*yield*/, (_c = path_1.default.join(pack.directory, "node_modules", "commander"), Promise.resolve().then(function () { return __importStar(require(_c)); }))];
133
+ case 2:
134
+ program = (_a.sent()).program;
135
+ program.option("--compiler [compiler]", "compiler type");
136
+ program.option("--manager [manager", "package manager");
137
+ program.option("--project [project]", "tsconfig.json file location");
138
+ questioned = { value: false };
139
+ action = function (closure) {
140
+ return new Promise(function (resolve, reject) {
141
+ program.action(function (options) { return __awaiter(_this, void 0, void 0, function () {
142
+ var _a, exp_1;
143
+ return __generator(this, function (_b) {
144
+ switch (_b.label) {
145
+ case 0:
146
+ _b.trys.push([0, 2, , 3]);
147
+ _a = resolve;
148
+ return [4 /*yield*/, closure(options)];
149
+ case 1:
150
+ _a.apply(void 0, [_b.sent()]);
151
+ return [3 /*break*/, 3];
152
+ case 2:
153
+ exp_1 = _b.sent();
154
+ reject(exp_1);
155
+ return [3 /*break*/, 3];
156
+ case 3: return [2 /*return*/];
157
+ }
158
+ });
159
+ }); });
160
+ program.parseAsync().catch(reject);
161
+ });
162
+ };
163
+ select = function (name) {
164
+ return function (message) {
165
+ return function (choices) { return __awaiter(_this, void 0, void 0, function () {
166
+ return __generator(this, function (_a) {
167
+ switch (_a.label) {
168
+ case 0:
169
+ questioned.value = true;
170
+ return [4 /*yield*/, createPromptModule()({
171
+ type: "list",
172
+ name: name,
173
+ message: message,
174
+ choices: choices,
175
+ })];
176
+ case 1: return [2 /*return*/, (_a.sent())[name]];
177
+ }
178
+ });
179
+ }); };
180
+ };
181
+ };
182
+ configure = function () { return __awaiter(_this, void 0, void 0, function () {
183
+ var fileList;
184
+ return __generator(this, function (_a) {
185
+ switch (_a.label) {
186
+ case 0: return [4 /*yield*/, fs_1.default.promises.readdir(process.cwd())];
187
+ case 1: return [4 /*yield*/, (_a.sent()).filter(function (str) {
188
+ return str.substring(0, 8) === "tsconfig" &&
189
+ str.substring(str.length - 5) === ".json";
190
+ })];
191
+ case 2:
192
+ fileList = _a.sent();
193
+ if (fileList.length === 0) {
194
+ if (process.cwd() !== pack.directory)
195
+ throw new Error("Unable to find \"tsconfig.json\" file.");
196
+ return [2 /*return*/, null];
197
+ }
198
+ else if (fileList.length === 1)
199
+ return [2 /*return*/, fileList[0]];
200
+ return [2 /*return*/, select("tsconfig")("TS Config File")(fileList)];
201
+ }
202
+ });
203
+ }); };
204
+ // DO CONSTRUCT
205
+ return [2 /*return*/, action(function (options) { return __awaiter(_this, void 0, void 0, function () {
206
+ var _a, _b, _c, _d, _e;
207
+ var _f, _g, _h;
208
+ return __generator(this, function (_j) {
209
+ switch (_j.label) {
210
+ case 0:
211
+ if (!(options.compiler === undefined)) return [3 /*break*/, 2];
212
+ console.log(COMPILER_DESCRIPTION);
213
+ _a = options;
214
+ return [4 /*yield*/, select("compiler")("Compiler")(((_f = pack.data.scripts) === null || _f === void 0 ? void 0 : _f.build) === "nest build"
215
+ ? ["ts-patch", "ttypescript"]
216
+ : ["ttypescript", "ts-patch"])];
217
+ case 1:
218
+ _a.compiler = _j.sent();
219
+ _j.label = 2;
220
+ case 2:
221
+ if (!((_g = options.manager) !== null && _g !== void 0)) return [3 /*break*/, 3];
222
+ _b = _g;
223
+ return [3 /*break*/, 5];
224
+ case 3:
225
+ _c = options;
226
+ return [4 /*yield*/, select("manager")("Package Manager")([
227
+ "npm",
228
+ "pnpm",
229
+ "yarn",
230
+ ])];
231
+ case 4:
232
+ _b = (_c.manager = _j.sent());
233
+ _j.label = 5;
234
+ case 5:
235
+ _b;
236
+ pack.manager = options.manager;
237
+ if (!((_h = options.project) !== null && _h !== void 0)) return [3 /*break*/, 6];
238
+ _d = _h;
239
+ return [3 /*break*/, 8];
240
+ case 6:
241
+ _e = options;
242
+ return [4 /*yield*/, configure()];
243
+ case 7:
244
+ _d = (_e.project = _j.sent());
245
+ _j.label = 8;
246
+ case 8:
247
+ _d;
248
+ if (questioned.value)
249
+ console.log("");
250
+ return [2 /*return*/, options];
251
+ }
252
+ });
253
+ }); })];
254
+ }
255
+ });
256
+ });
257
+ }
258
+ })(ArgumentParser = exports.ArgumentParser || (exports.ArgumentParser = {}));
259
+ var COMPILER_DESCRIPTION = [
260
+ "About compiler, if you adapt \"ttypescript\", you should use \"ttsc\" instead.",
261
+ "",
262
+ "Otherwise, you choose \"ts-patch\", you can use the original \"tsc\" command.",
263
+ "However, the \"ts-patch\" hacks \"node_modules/typescript\" source code.",
264
+ "Also, whenever update \"typescript\", you've to run \"npm run prepare\" command.",
265
+ "",
266
+ "By the way, when using \"@nest/cli\", you must just choose \"ts-patch\".",
267
+ "",
268
+ ].join("\n");
269
+ //# 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;AAIxB,IAAiB,cAAc,CA6H9B;AA7HD,WAAiB,cAAc;IAO3B,SAA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S,CAAC,CAAC,iBAAiB,CAAC,CAAC;oDAC3D,KAAc;oDACd,MAAe;oDACf,MAAe;iDAClB,CAAC,EAAA;;qDAJM,OAAO,GAAK,SAIlB;;;4CAJF,GAIG;4CACH,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;wDAC/B,OAAO,CAAC,OAAO;;;;4CAAf,KAAA,OAAO,CAAA;4CAAa,qBAAM,SAAS,EAAE,EAAA;;qDAA7B,OAAO,GAAK,SAAiB;;;4CAArC,GAAsC;4CAEtC,IAAI,UAAU,CAAC,KAAK;gDAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;4CACtC,sBAAO,OAAqB,EAAC;;;iCAChC,CAAC,EAAC;;;;KACN;AACL,CAAC,EA7HgB,cAAc,GAAd,sBAAc,KAAd,sBAAc,QA6H9B;AAED,IAAM,oBAAoB,GAAG;IACzB,gFAA4E;IAC5E,EAAE;IACF,+EAA2E;IAC3E,0EAAsE;IACtE,kFAA8E;IAC9E,EAAE;IACF,0EAAsE;IACtE,EAAE;CACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare namespace CommandExecutor {
2
+ function run(str: string, silent: boolean): void;
3
+ }
@@ -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,27 @@
1
+ export declare class PackageManager {
2
+ readonly directory: string;
3
+ data: Package.Data;
4
+ manager: string;
5
+ get file(): string;
6
+ static mount(): Promise<PackageManager>;
7
+ save(modifier: (data: Package.Data) => void): Promise<void>;
8
+ install(props: {
9
+ dev: boolean;
10
+ silent?: boolean;
11
+ modulo: string;
12
+ version?: string;
13
+ }): boolean;
14
+ erase(props: {
15
+ modulo: string;
16
+ silent?: boolean;
17
+ }): void;
18
+ private constructor();
19
+ private static load;
20
+ }
21
+ export declare namespace Package {
22
+ interface Data {
23
+ scripts?: Record<string, string>;
24
+ dependencies?: Record<string, string>;
25
+ devDependencies?: Record<string, string>;
26
+ }
27
+ }