typia 3.7.4-dev.20230410-5 → 3.7.4-dev.20230410-7

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.
@@ -1,2 +1,4 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ declare const USAGE = "Wrong command has been detected. Use like below:\n\n npx typia setup \\\n --compiler (ttypescript|ts-patch) \\\n --manager (npm|pnpm|yarn) \\\n --project {tsconfig.json file path}\n\n - npx typia setup\n - npx typia setup --compiler ts-patch\n - npx typia setup --manager pnpm\n - npx typia setup --project tsconfig.test.json\n\n npx typia generate \n --input {directory} \\\n --output {directory}\n\n --npx typia generate --input src/templates --output src/functinoal\n";
3
+ declare function halt(desc: string): never;
4
+ declare function main(): Promise<void>;
@@ -59,8 +59,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
59
59
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
60
60
  }
61
61
  };
62
- Object.defineProperty(exports, "__esModule", { value: true });
63
- var TypiaSetupWizard_1 = require("./TypiaSetupWizard");
64
62
  var USAGE = "Wrong command has been detected. Use like below:\n\n npx typia setup \\\n --compiler (ttypescript|ts-patch) \\\n --manager (npm|pnpm|yarn) \\\n --project {tsconfig.json file path}\n\n - npx typia setup\n - npx typia setup --compiler ts-patch\n - npx typia setup --manager pnpm\n - npx typia setup --project tsconfig.test.json\n\n npx typia generate \n --input {directory} \\\n --output {directory}\n\n --npx typia generate --input src/templates --output src/functinoal\n";
65
63
  function halt(desc) {
66
64
  console.error(desc);
@@ -68,47 +66,63 @@ function halt(desc) {
68
66
  }
69
67
  function main() {
70
68
  return __awaiter(this, void 0, void 0, function () {
71
- var _a, type, TypiaGenerateWizard;
72
- return __generator(this, function (_b) {
73
- switch (_b.label) {
69
+ var _a, type, TypiaSetupWizard, _b, TypiaGenerateWizard;
70
+ return __generator(this, function (_c) {
71
+ switch (_c.label) {
74
72
  case 0:
75
- _b.trys.push([0, 4, , 5]);
73
+ _c.trys.push([0, 4, , 5]);
76
74
  return [4, Promise.resolve().then(function () { return __importStar(require("comment-json")); })];
77
75
  case 1:
78
- _b.sent();
76
+ _c.sent();
79
77
  return [4, Promise.resolve().then(function () { return __importStar(require("inquirer")); })];
80
78
  case 2:
81
- _b.sent();
79
+ _c.sent();
82
80
  return [4, Promise.resolve().then(function () { return __importStar(require("commander")); })];
83
81
  case 3:
84
- _b.sent();
82
+ _c.sent();
85
83
  return [3, 5];
86
84
  case 4:
87
- _a = _b.sent();
88
- halt("Please install typia first.\n\nnpm install --save typia");
85
+ _a = _c.sent();
86
+ halt(["Please install typia.", "", " - npm install typia"].join("\n"));
89
87
  return [3, 5];
90
88
  case 5:
91
- console.log("process", process);
92
- console.log("process.argv", process.argv);
93
89
  type = process.argv[2];
94
- if (!(type === "setup")) return [3, 7];
95
- return [4, TypiaSetupWizard_1.TypiaSetupWizard.setup()];
90
+ if (!(type === "setup")) return [3, 8];
91
+ return [4, Promise.resolve().then(function () { return __importStar(require("./TypiaSetupWizard")); })];
96
92
  case 6:
97
- _b.sent();
98
- return [3, 11];
93
+ TypiaSetupWizard = (_c.sent()).TypiaSetupWizard;
94
+ return [4, TypiaSetupWizard.setup()];
99
95
  case 7:
100
- if (!(type === "generate")) return [3, 10];
101
- return [4, Promise.resolve().then(function () { return __importStar(require("./TypiaGenerateWizard")); })];
96
+ _c.sent();
97
+ return [3, 16];
102
98
  case 8:
103
- TypiaGenerateWizard = (_b.sent()).TypiaGenerateWizard;
104
- return [4, TypiaGenerateWizard.generate()];
99
+ if (!(type === "generate")) return [3, 15];
100
+ _c.label = 9;
105
101
  case 9:
106
- _b.sent();
107
- return [3, 11];
102
+ _c.trys.push([9, 11, , 12]);
103
+ return [4, Promise.resolve().then(function () { return __importStar(require("typescript")); })];
108
104
  case 10:
105
+ _c.sent();
106
+ return [3, 12];
107
+ case 11:
108
+ _b = _c.sent();
109
+ halt([
110
+ "Please install typescript.",
111
+ "",
112
+ " - npm install --save-dev typescript",
113
+ ].join("\n"));
114
+ return [3, 12];
115
+ case 12: return [4, Promise.resolve().then(function () { return __importStar(require("./TypiaGenerateWizard")); })];
116
+ case 13:
117
+ TypiaGenerateWizard = (_c.sent()).TypiaGenerateWizard;
118
+ return [4, TypiaGenerateWizard.generate()];
119
+ case 14:
120
+ _c.sent();
121
+ return [3, 16];
122
+ case 15:
109
123
  halt(USAGE);
110
- _b.label = 11;
111
- case 11: return [2];
124
+ _c.label = 16;
125
+ case 16: return [2];
112
126
  }
113
127
  });
114
128
  });
@@ -1 +1 @@
1
- {"version":3,"file":"typia.js","sourceRoot":"","sources":["../../src/executable/typia.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uDAAsD;AAEtD,IAAM,KAAK,GAAG,wfAiBb,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;;;;;;;oBAEX,4EAAa,cAAc,QAAC;;oBAA5B,SAA4B,CAAC;oBAC7B,4EAAa,UAAU,QAAC;;oBAAxB,SAAwB,CAAC;oBACzB,4EAAa,WAAW,QAAC;;oBAAzB,SAAyB,CAAC;;;;oBAE1B,IAAI,CAAC,yDAAyD,CAAC,CAAC;;;oBAGpE,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;oBAChC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;oBAEpC,IAAI,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;yBAC7C,CAAA,IAAI,KAAK,OAAO,CAAA,EAAhB,cAAgB;oBAAE,WAAM,mCAAgB,CAAC,KAAK,EAAE,EAAA;;oBAA9B,SAA8B,CAAC;;;yBAC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oBACxB,WAAM,gBAAgB,CAAC,KAAK,EAAE,EAAA;;oBAA9B,SAA8B,CAAC;;;yBACxB,CAAA,IAAI,KAAK,UAAU,CAAA,EAAnB,eAAmB;;;;oBAEtB,4EAAa,YAAY,QAAC;;oBAA1B,SAA0B,CAAC;;;;oBAE3B,IAAI,CACA;wBACI,4BAA4B;wBAC5B,EAAE;wBACF,uCAAuC;qBAC1C,CAAC,IAAI,CAAC,IAAI,CAAC,CACf,CAAC;;yBAE0B,4EAAa,uBAAuB,QAAC;;oBAA7D,mBAAmB,GAAK,CAAA,SAAqC,CAAA,oBAA1C;oBAC3B,WAAM,mBAAmB,CAAC,QAAQ,EAAE,EAAA;;oBAApC,SAAoC,CAAC;;;oBAClC,IAAI,CAAC,KAAK,CAAC,CAAC;;;;;;CACtB;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typia",
3
- "version": "3.7.4-dev.20230410-5",
3
+ "version": "3.7.4-dev.20230410-7",
4
4
  "description": "Superfast runtime validators with only one line",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { TypiaSetupWizard } from "./TypiaSetupWizard";
3
-
4
2
  const USAGE = `Wrong command has been detected. Use like below:
5
3
 
6
4
  npx typia setup \\
@@ -31,15 +29,25 @@ async function main(): Promise<void> {
31
29
  await import("inquirer");
32
30
  await import("commander");
33
31
  } catch {
34
- halt("Please install typia first.\n\nnpm install --save typia");
32
+ halt(["Please install typia.", "", " - npm install typia"].join("\n"));
35
33
  }
36
34
 
37
- console.log("process", process);
38
- console.log("process.argv", process.argv);
39
-
40
35
  const type: string | undefined = process.argv[2];
41
- if (type === "setup") await TypiaSetupWizard.setup();
42
- else if (type === "generate") {
36
+ if (type === "setup") {
37
+ const { TypiaSetupWizard } = await import("./TypiaSetupWizard");
38
+ await TypiaSetupWizard.setup();
39
+ } else if (type === "generate") {
40
+ try {
41
+ await import("typescript");
42
+ } catch {
43
+ halt(
44
+ [
45
+ "Please install typescript.",
46
+ "",
47
+ " - npm install --save-dev typescript",
48
+ ].join("\n"),
49
+ );
50
+ }
43
51
  const { TypiaGenerateWizard } = await import("./TypiaGenerateWizard");
44
52
  await TypiaGenerateWizard.generate();
45
53
  } else halt(USAGE);