nestia 3.1.6 → 4.0.0-dev.20221217

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 (123) hide show
  1. package/README.md +170 -612
  2. package/bin/CommandParser.d.ts +3 -0
  3. package/bin/CommandParser.js +21 -0
  4. package/bin/CommandParser.js.map +1 -0
  5. package/bin/NestiaSetupWizard.d.ts +5 -0
  6. package/bin/NestiaSetupWizard.js +90 -0
  7. package/bin/NestiaSetupWizard.js.map +1 -0
  8. package/bin/NestiaStarter.d.ts +3 -0
  9. package/{lib/executable/internal → bin}/NestiaStarter.js +25 -26
  10. package/bin/NestiaStarter.js.map +1 -0
  11. package/{lib/executable/nestia.d.ts → bin/index.d.ts} +0 -0
  12. package/bin/index.js +113 -0
  13. package/bin/index.js.map +1 -0
  14. package/package.json +38 -76
  15. package/CONTRIBUTING.md +0 -72
  16. package/bundle/HttpError.ts +0 -1
  17. package/bundle/IConnection.ts +0 -1
  18. package/bundle/Primitive.ts +0 -1
  19. package/bundle/__internal/AesPkcs5.ts +0 -1
  20. package/bundle/__internal/Fetcher.ts +0 -1
  21. package/lib/IConfiguration.d.ts +0 -110
  22. package/lib/IConfiguration.js +0 -3
  23. package/lib/IConfiguration.js.map +0 -1
  24. package/lib/NestiaApplication.d.ts +0 -11
  25. package/lib/NestiaApplication.js +0 -156
  26. package/lib/NestiaApplication.js.map +0 -1
  27. package/lib/analyses/ControllerAnalyzer.d.ts +0 -6
  28. package/lib/analyses/ControllerAnalyzer.js +0 -106
  29. package/lib/analyses/ControllerAnalyzer.js.map +0 -1
  30. package/lib/analyses/GenericAnalyzer.d.ts +0 -5
  31. package/lib/analyses/GenericAnalyzer.js +0 -41
  32. package/lib/analyses/GenericAnalyzer.js.map +0 -1
  33. package/lib/analyses/ImportAnalyzer.d.ts +0 -13
  34. package/lib/analyses/ImportAnalyzer.js +0 -86
  35. package/lib/analyses/ImportAnalyzer.js.map +0 -1
  36. package/lib/analyses/PathAnalyzer.d.ts +0 -5
  37. package/lib/analyses/PathAnalyzer.js +0 -51
  38. package/lib/analyses/PathAnalyzer.js.map +0 -1
  39. package/lib/analyses/ReflectAnalyzer.d.ts +0 -4
  40. package/lib/analyses/ReflectAnalyzer.js +0 -230
  41. package/lib/analyses/ReflectAnalyzer.js.map +0 -1
  42. package/lib/analyses/SourceFinder.d.ts +0 -4
  43. package/lib/analyses/SourceFinder.js +0 -70
  44. package/lib/analyses/SourceFinder.js.map +0 -1
  45. package/lib/executable/internal/CompilerOptions.d.ts +0 -11
  46. package/lib/executable/internal/CompilerOptions.js +0 -18
  47. package/lib/executable/internal/CompilerOptions.js.map +0 -1
  48. package/lib/executable/internal/NestiaCommand.d.ts +0 -4
  49. package/lib/executable/internal/NestiaCommand.js +0 -128
  50. package/lib/executable/internal/NestiaCommand.js.map +0 -1
  51. package/lib/executable/internal/NestiaConfig.d.ts +0 -4
  52. package/lib/executable/internal/NestiaConfig.js +0 -536
  53. package/lib/executable/internal/NestiaConfig.js.map +0 -1
  54. package/lib/executable/internal/NestiaStarter.d.ts +0 -3
  55. package/lib/executable/internal/NestiaStarter.js.map +0 -1
  56. package/lib/executable/internal/nestia.config.getter.d.ts +0 -1
  57. package/lib/executable/internal/nestia.config.getter.js +0 -24
  58. package/lib/executable/internal/nestia.config.getter.js.map +0 -1
  59. package/lib/executable/nestia.js +0 -86
  60. package/lib/executable/nestia.js.map +0 -1
  61. package/lib/generates/FileGenerator.d.ts +0 -5
  62. package/lib/generates/FileGenerator.js +0 -137
  63. package/lib/generates/FileGenerator.js.map +0 -1
  64. package/lib/generates/FunctionGenerator.d.ts +0 -5
  65. package/lib/generates/FunctionGenerator.js +0 -204
  66. package/lib/generates/FunctionGenerator.js.map +0 -1
  67. package/lib/generates/SdkGenerator.d.ts +0 -7
  68. package/lib/generates/SdkGenerator.js +0 -47
  69. package/lib/generates/SdkGenerator.js.map +0 -1
  70. package/lib/generates/SwaggerGenerator.d.ts +0 -6
  71. package/lib/generates/SwaggerGenerator.js +0 -244
  72. package/lib/generates/SwaggerGenerator.js.map +0 -1
  73. package/lib/index.d.ts +0 -2
  74. package/lib/index.js +0 -28
  75. package/lib/index.js.map +0 -1
  76. package/lib/module.d.ts +0 -2
  77. package/lib/module.js +0 -19
  78. package/lib/module.js.map +0 -1
  79. package/lib/structures/IController.d.ts +0 -23
  80. package/lib/structures/IController.js +0 -3
  81. package/lib/structures/IController.js.map +0 -1
  82. package/lib/structures/IRoute.d.ts +0 -24
  83. package/lib/structures/IRoute.js +0 -3
  84. package/lib/structures/IRoute.js.map +0 -1
  85. package/lib/structures/ISwagger.d.ts +0 -48
  86. package/lib/structures/ISwagger.js +0 -3
  87. package/lib/structures/ISwagger.js.map +0 -1
  88. package/lib/structures/ITypeTuple.d.ts +0 -5
  89. package/lib/structures/ITypeTuple.js +0 -3
  90. package/lib/structures/ITypeTuple.js.map +0 -1
  91. package/lib/structures/MethodType.d.ts +0 -4
  92. package/lib/structures/MethodType.js +0 -14
  93. package/lib/structures/MethodType.js.map +0 -1
  94. package/lib/structures/ParamCategory.d.ts +0 -1
  95. package/lib/structures/ParamCategory.js +0 -3
  96. package/lib/structures/ParamCategory.js.map +0 -1
  97. package/lib/structures/TypeEntry.d.ts +0 -9
  98. package/lib/structures/TypeEntry.js +0 -21
  99. package/lib/structures/TypeEntry.js.map +0 -1
  100. package/lib/test/TestBuilder.d.ts +0 -4
  101. package/lib/test/TestBuilder.js +0 -60
  102. package/lib/test/TestBuilder.js.map +0 -1
  103. package/lib/test/index.d.ts +0 -1
  104. package/lib/test/index.js +0 -62
  105. package/lib/test/index.js.map +0 -1
  106. package/lib/test/test.builder.executor.d.ts +0 -1
  107. package/lib/test/test.builder.executor.js +0 -24
  108. package/lib/test/test.builder.executor.js.map +0 -1
  109. package/lib/utils/ArrayUtil.d.ts +0 -5
  110. package/lib/utils/ArrayUtil.js +0 -39
  111. package/lib/utils/ArrayUtil.js.map +0 -1
  112. package/lib/utils/DirectoryUtil.d.ts +0 -5
  113. package/lib/utils/DirectoryUtil.js +0 -62
  114. package/lib/utils/DirectoryUtil.js.map +0 -1
  115. package/lib/utils/ImportDictionary.d.ts +0 -6
  116. package/lib/utils/ImportDictionary.js +0 -50
  117. package/lib/utils/ImportDictionary.js.map +0 -1
  118. package/lib/utils/MapUtil.d.ts +0 -3
  119. package/lib/utils/MapUtil.js +0 -16
  120. package/lib/utils/MapUtil.js.map +0 -1
  121. package/lib/utils/StripEnums.d.ts +0 -3
  122. package/lib/utils/StripEnums.js +0 -3
  123. package/lib/utils/StripEnums.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ export declare namespace CommandParser {
2
+ function parse(argList: string[]): Record<string, string>;
3
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommandParser = void 0;
4
+ var CommandParser;
5
+ (function (CommandParser) {
6
+ function parse(argList) {
7
+ const output = {};
8
+ argList.forEach((arg, i) => {
9
+ if (arg.startsWith("--") === false)
10
+ return;
11
+ const key = arg.slice(2);
12
+ const value = argList[i + 1];
13
+ if (value === undefined || value.startsWith("--"))
14
+ return;
15
+ output[key] = value;
16
+ });
17
+ return output;
18
+ }
19
+ CommandParser.parse = parse;
20
+ })(CommandParser = exports.CommandParser || (exports.CommandParser = {}));
21
+ //# sourceMappingURL=CommandParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandParser.js","sourceRoot":"","sources":["../src/CommandParser.ts"],"names":[],"mappings":";;;AAAA,IAAiB,aAAa,CAc7B;AAdD,WAAiB,aAAa;IAC1B,SAAgB,KAAK,CAAC,OAAiB;QACnC,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YACvB,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,KAAK;gBAAE,OAAO;YAE3C,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACzB,MAAM,KAAK,GAAuB,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACjD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;gBAAE,OAAO;YAE1D,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACxB,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAClB,CAAC;IAZe,mBAAK,QAYpB,CAAA;AACL,CAAC,EAdgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAc7B"}
@@ -0,0 +1,5 @@
1
+ export declare namespace NestiaSetupWizard {
2
+ function ttypescript(manager: string): Promise<void>;
3
+ function tsPatch(manager: string): Promise<void>;
4
+ function prepare(manager: string): Promise<any>;
5
+ }
@@ -0,0 +1,90 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
35
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36
+ };
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.NestiaSetupWizard = void 0;
39
+ const child_process_1 = __importDefault(require("child_process"));
40
+ const fs_1 = __importDefault(require("fs"));
41
+ var NestiaSetupWizard;
42
+ (function (NestiaSetupWizard) {
43
+ function ttypescript(manager) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ yield prepare(manager);
46
+ const { CoreSetupWizard } = yield Promise.resolve().then(() => __importStar(require("@nestia/core/lib/executable/internal/CoreSetupWizard")));
47
+ CoreSetupWizard.ttypescript(manager);
48
+ });
49
+ }
50
+ NestiaSetupWizard.ttypescript = ttypescript;
51
+ function tsPatch(manager) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ yield prepare(manager);
54
+ const { CoreSetupWizard } = yield Promise.resolve().then(() => __importStar(require("@nestia/core/lib/executable/internal/CoreSetupWizard")));
55
+ CoreSetupWizard.tsPatch(manager);
56
+ });
57
+ }
58
+ NestiaSetupWizard.tsPatch = tsPatch;
59
+ function prepare(manager) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ if (fs_1.default.existsSync("package.json") === false)
62
+ halt(() => { })("make package.json file or move to it.");
63
+ const pack = JSON.parse(yield fs_1.default.promises.readFile("package.json", "utf8"));
64
+ add(manager)(pack)("@nestia/core", false);
65
+ add(manager)(pack)("@nestia/sdk", false);
66
+ });
67
+ }
68
+ NestiaSetupWizard.prepare = prepare;
69
+ })(NestiaSetupWizard = exports.NestiaSetupWizard || (exports.NestiaSetupWizard = {}));
70
+ const add = (manager) => (pack) => (modulo, devOnly) => {
71
+ const exists = (devOnly === false
72
+ ? !!pack.dependencies && !!pack.dependencies[modulo]
73
+ : !!pack.devDependencies && !!pack.devDependencies[modulo]) &&
74
+ fs_1.default.existsSync("node_modules/" + modulo);
75
+ const middle = manager === "yarn"
76
+ ? `add${devOnly ? " -D" : ""}`
77
+ : `install ${devOnly ? "--save-dev" : "--save"}`;
78
+ if (exists === false)
79
+ execute(`${manager} ${middle} ${modulo}`);
80
+ };
81
+ const halt = (closer) => (desc) => {
82
+ closer();
83
+ console.error(desc);
84
+ process.exit(-1);
85
+ };
86
+ function execute(command) {
87
+ console.log(command);
88
+ child_process_1.default.execSync(command, { stdio: "inherit" });
89
+ }
90
+ //# sourceMappingURL=NestiaSetupWizard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NestiaSetupWizard.js","sourceRoot":"","sources":["../src/NestiaSetupWizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAA+B;AAC/B,4CAAoB;AAEpB,IAAiB,iBAAiB,CA2BjC;AA3BD,WAAiB,iBAAiB;IAC9B,SAAsB,WAAW,CAAC,OAAe;;YAC7C,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;YACvB,MAAM,EAAE,eAAe,EAAE,GAAG,wDACxB,sDAAsD,GACzD,CAAC;YACF,eAAe,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;KAAA;IANqB,6BAAW,cAMhC,CAAA;IAED,SAAsB,OAAO,CAAC,OAAe;;YACzC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;YACvB,MAAM,EAAE,eAAe,EAAE,GAAG,wDACxB,sDAAsD,GACzD,CAAC;YACF,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;KAAA;IANqB,yBAAO,UAM5B,CAAA;IAED,SAAsB,OAAO,CAAC,OAAe;;YACzC,IAAI,YAAE,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,KAAK;gBACvC,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,uCAAuC,CAAC,CAAC;YAE5D,MAAM,IAAI,GAAQ,IAAI,CAAC,KAAK,CACxB,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC,CACrD,CAAC;YACF,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;YAC1C,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;KAAA;IATqB,yBAAO,UAS5B,CAAA;AACL,CAAC,EA3BgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QA2BjC;AAED,MAAM,GAAG,GACL,CAAC,OAAe,EAAE,EAAE,CACpB,CAAC,IAAS,EAAE,EAAE,CACd,CAAC,MAAc,EAAE,OAAgB,EAAQ,EAAE;IACvC,MAAM,MAAM,GACR,CAAC,OAAO,KAAK,KAAK;QACd,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;QACpD,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC/D,YAAE,CAAC,UAAU,CAAC,eAAe,GAAG,MAAM,CAAC,CAAC;IAC5C,MAAM,MAAM,GACR,OAAO,KAAK,MAAM;QACd,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QAC9B,CAAC,CAAC,WAAW,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IACzD,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,CAAC,GAAG,OAAO,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC,CAAC;AACpE,CAAC,CAAC;AAEN,MAAM,IAAI,GACN,CAAC,MAAiB,EAAE,EAAE,CACtB,CAAC,IAAY,EAAS,EAAE;IACpB,MAAM,EAAE,CAAC;IACT,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC,CAAC;AAEN,SAAS,OAAO,CAAC,OAAe;IAC5B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrB,uBAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare namespace NestiaStarter {
2
+ const start: (halter: (msg?: string) => never) => (argv: string[]) => Promise<void>;
3
+ }
@@ -17,35 +17,34 @@ const child_process_1 = __importDefault(require("child_process"));
17
17
  const fs_1 = __importDefault(require("fs"));
18
18
  var NestiaStarter;
19
19
  (function (NestiaStarter) {
20
- function start(dest) {
21
- return __awaiter(this, void 0, void 0, function* () {
22
- // VALIDATION
23
- if (dest === undefined)
24
- throw new Error(message("is not specified."));
25
- else if (fs_1.default.existsSync(dest) === true)
26
- throw new Error(message("already exists"));
27
- console.log("-----------------------------------------");
28
- console.log(" Nestia Starter Kit");
29
- console.log("-----------------------------------------");
30
- // COPY PROJECTS
31
- execute(`git clone https://github.com/samchon/nestia-template ${dest}`);
32
- console.log(`cd "${dest}"`);
33
- process.chdir(dest);
34
- // INSTALL DEPENDENCIES
35
- execute("npm install");
36
- // BUILD TYPESCRIPT
37
- execute("npm run build");
38
- // DO TEST
39
- execute("npm run test");
40
- // REMOVE .GIT DIRECTORY
41
- child_process_1.default.execSync("npx rimraf .git");
42
- });
43
- }
44
- NestiaStarter.start = start;
20
+ NestiaStarter.start = (halter) => (argv) => __awaiter(this, void 0, void 0, function* () {
21
+ var _a;
22
+ // VALIDATION
23
+ const dest = argv[0];
24
+ const manager = (_a = argv[1]) !== null && _a !== void 0 ? _a : "npm";
25
+ if (dest === undefined)
26
+ halter();
27
+ else if (fs_1.default.existsSync(dest) === true)
28
+ halter("The target directory already exists.");
29
+ console.log("-----------------------------------------");
30
+ console.log(" Nestia Starter Kit");
31
+ console.log("-----------------------------------------");
32
+ // COPY PROJECTS
33
+ execute(`git clone https://github.com/samchon/nestia-template ${dest}`);
34
+ console.log(`cd "${dest}"`);
35
+ process.chdir(dest);
36
+ // INSTALL DEPENDENCIES
37
+ execute(`${manager} install`);
38
+ // BUILD TYPESCRIPT
39
+ execute("npm run build");
40
+ // DO TEST
41
+ execute("npm run test");
42
+ // REMOVE .GIT DIRECTORY
43
+ child_process_1.default.execSync("npx rimraf .git");
44
+ });
45
45
  function execute(command) {
46
46
  console.log(command);
47
47
  child_process_1.default.execSync(command, { stdio: "inherit" });
48
48
  }
49
49
  })(NestiaStarter = exports.NestiaStarter || (exports.NestiaStarter = {}));
50
- const message = (content) => `Error on nestia.start(): target directory ${content}.`;
51
50
  //# sourceMappingURL=NestiaStarter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NestiaStarter.js","sourceRoot":"","sources":["../src/NestiaStarter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kEAA+B;AAC/B,4CAAoB;AAEpB,IAAiB,aAAa,CAwC7B;AAxCD,WAAiB,aAAa;IACb,mBAAK,GACd,CAAC,MAA+B,EAAE,EAAE,CACpC,CAAO,IAAc,EAAiB,EAAE;;QACpC,aAAa;QACb,MAAM,IAAI,GAAuB,IAAI,CAAC,CAAC,CAAC,CAAC;QACzC,MAAM,OAAO,GAAW,MAAA,IAAI,CAAC,CAAC,CAAC,mCAAI,KAAK,CAAC;QAEzC,IAAI,IAAI,KAAK,SAAS;YAAE,MAAM,EAAE,CAAC;aAC5B,IAAI,YAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI;YACjC,MAAM,CAAC,sCAAsC,CAAC,CAAC;QAEnD,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QAEzD,gBAAgB;QAChB,OAAO,CACH,wDAAwD,IAAI,EAAE,CACjE,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;QAC5B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEpB,uBAAuB;QACvB,OAAO,CAAC,GAAG,OAAO,UAAU,CAAC,CAAC;QAE9B,mBAAmB;QACnB,OAAO,CAAC,eAAe,CAAC,CAAC;QAEzB,UAAU;QACV,OAAO,CAAC,cAAc,CAAC,CAAC;QAExB,wBAAwB;QACxB,uBAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACnC,CAAC,CAAA,CAAC;IAEN,SAAS,OAAO,CAAC,OAAe;QAC5B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,uBAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAC/C,CAAC;AACL,CAAC,EAxCgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAwC7B"}
File without changes
package/bin/index.js ADDED
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
+ return new (P || (P = Promise))(function (resolve, reject) {
29
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
33
+ });
34
+ };
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const CommandParser_1 = require("./CommandParser");
37
+ const NestiaSetupWizard_1 = require("./NestiaSetupWizard");
38
+ const NestiaStarter_1 = require("./NestiaStarter");
39
+ const USAGE = `Wrong command has been detected. Use like below:
40
+
41
+ npx nestia [command] [options?]
42
+
43
+ 1. npx nestia start <directory> ---manager (npm|pnpm|yarn)
44
+ - npx nestia start project
45
+ - npx nestia start project --manager pnpm
46
+ 2. npx nestia setup \
47
+ --compiler (ttypescript|ts-patch) \
48
+ --manager (npm|pnpm|yarn)
49
+ - npx nestia setup
50
+ - npx nestia setup --compiler ttypescript
51
+ - npx nestia setup --compiler ts-patch
52
+ - npx nestia setup --manager pnpm
53
+ 3. npx nestia dependencies --manager (npm|pnpm|yarn)
54
+ - npx nestia dependencies
55
+ - npx nestia dependencies --manager yarn
56
+ 4. npx nestia init
57
+ 5. npx nestia sdk <input> --out <output>
58
+ - npx nestia sdk # when "nestia.config.ts" be configured
59
+ - npx nestia sdk src/controllers --out src/api
60
+ - npx nestia sdk src/**/*.controller.ts --out src/api
61
+ 6. npx nestia swagger <input> --out <output>
62
+ - npx nestia swagger # when "nestia.config.ts" be configured
63
+ - npx nestia swagger src/controllers --out src/api
64
+ - npx nestia swagger src/**/*.controller.ts --out src/api
65
+ `;
66
+ function halt(desc) {
67
+ console.error(desc);
68
+ process.exit(-1);
69
+ }
70
+ function setup() {
71
+ var _a, _b;
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ const options = CommandParser_1.CommandParser.parse(process.argv.slice(3));
74
+ const manager = (_a = options.manager) !== null && _a !== void 0 ? _a : "npm";
75
+ const compiler = (_b = options.compiler) !== null && _b !== void 0 ? _b : "ttypescript";
76
+ if ((compiler !== "ttypescript" && compiler !== "ts-patch") ||
77
+ (manager !== "npm" && manager !== "pnpm" && manager !== "yarn"))
78
+ halt(USAGE);
79
+ else if (compiler === "ttypescript")
80
+ yield NestiaSetupWizard_1.NestiaSetupWizard.ttypescript(manager);
81
+ else
82
+ yield NestiaSetupWizard_1.NestiaSetupWizard.tsPatch(manager);
83
+ });
84
+ }
85
+ function main() {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ const type = process.argv[2];
88
+ const argv = process.argv.slice(3);
89
+ if (type === "start")
90
+ yield NestiaStarter_1.NestiaStarter.start((msg) => halt(msg !== null && msg !== void 0 ? msg : USAGE))(argv);
91
+ else if (type === "setup")
92
+ yield setup();
93
+ else if (type === "dependencies" ||
94
+ type === "init" ||
95
+ type === "sdk" ||
96
+ type === "swagger") {
97
+ try {
98
+ yield Promise.resolve().then(() => __importStar(require("@nestia/sdk")));
99
+ }
100
+ catch (_a) {
101
+ halt(`@nestia/sdk has not been installed. Run "npx nestia setup" before.`);
102
+ }
103
+ yield Promise.resolve().then(() => __importStar(require("@nestia/sdk/lib/executable/sdk")));
104
+ }
105
+ else
106
+ halt(USAGE);
107
+ });
108
+ }
109
+ main().catch((exp) => {
110
+ console.log(exp.message);
111
+ process.exit(-1);
112
+ });
113
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mDAAgD;AAChD,2DAAwD;AACxD,mDAAgD;AAEhD,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Bb,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,KAAK;;;QAChB,MAAM,OAAO,GAA2B,6BAAa,CAAC,KAAK,CACvD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACxB,CAAC;QACF,MAAM,OAAO,GAAW,MAAA,OAAO,CAAC,OAAO,mCAAI,KAAK,CAAC;QACjD,MAAM,QAAQ,GAAW,MAAA,OAAO,CAAC,QAAQ,mCAAI,aAAa,CAAC;QAE3D,IACI,CAAC,QAAQ,KAAK,aAAa,IAAI,QAAQ,KAAK,UAAU,CAAC;YACvD,CAAC,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,MAAM,CAAC;YAE/D,IAAI,CAAC,KAAK,CAAC,CAAC;aACX,IAAI,QAAQ,KAAK,aAAa;YAC/B,MAAM,qCAAiB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;;YAC5C,MAAM,qCAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;;CACjD;AAED,SAAe,IAAI;;QACf,MAAM,IAAI,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,IAAI,GAAa,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE7C,IAAI,IAAI,KAAK,OAAO;YAChB,MAAM,6BAAa,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aAC5D,IAAI,IAAI,KAAK,OAAO;YAAE,MAAM,KAAK,EAAE,CAAC;aACpC,IACD,IAAI,KAAK,cAAc;YACvB,IAAI,KAAK,MAAM;YACf,IAAI,KAAK,KAAK;YACd,IAAI,KAAK,SAAS,EACpB;YACE,IAAI;gBACA,wDAAa,aAAa,GAAC,CAAC;aAC/B;YAAC,WAAM;gBACJ,IAAI,CACA,oEAAoE,CACvE,CAAC;aACL;YACD,wDAAa,gCAAgC,GAAC,CAAC;SAClD;;YAAM,IAAI,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;CAAA;AACD,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACjB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,76 +1,38 @@
1
- {
2
- "name": "nestia",
3
- "version": "3.1.6",
4
- "description": "Automatic SDK and Document generator for the NestJS",
5
- "main": "lib/index.js",
6
- "typings": "lib/index.d.ts",
7
- "bin": {
8
- "nestia": "./lib/executable/nestia.js"
9
- },
10
- "scripts": {
11
- "build": "rimraf lib && ttsc",
12
- "dev": "npm run build -- --watch",
13
- "eslint": "eslint src",
14
- "eslint:fix": "eslint src --fix",
15
- "prettier": "prettier --write ./**/*.ts",
16
- "test": "node lib/test"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/samchon/nestia"
21
- },
22
- "keywords": [
23
- "nestjs",
24
- "sdk",
25
- "restapi",
26
- "document",
27
- "swagger",
28
- "generator"
29
- ],
30
- "author": "Jeongho Nam",
31
- "license": "MIT",
32
- "bugs": {
33
- "url": "https://github.com/samchon/nestia/issues"
34
- },
35
- "homepage": "https://github.com/samchon/nestia#readme",
36
- "dependencies": {
37
- "cli": "^1.0.1",
38
- "del": "^6.0.0",
39
- "glob": "^7.2.0",
40
- "nestia-fetcher": "^2.0.4",
41
- "path-to-regexp": "^6.2.1",
42
- "tgrid": "^0.8.7",
43
- "tsconfck": "^2.0.1",
44
- "tsconfig-paths": "^4.0.0",
45
- "tstl": "^2.5.13",
46
- "typescript-json": "^3.3.26"
47
- },
48
- "devDependencies": {
49
- "@types/cli": "^0.11.19",
50
- "@types/express": "^4.17.14",
51
- "@types/glob": "^7.2.0",
52
- "@types/node": "^17.0.23",
53
- "@types/reflect-metadata": "^0.1.0",
54
- "@types/uuid": "^8.3.4",
55
- "@typescript-eslint/eslint-plugin": "^5.26.0",
56
- "@typescript-eslint/parser": "^5.26.0",
57
- "eslint": "^8.16.0",
58
- "nestia-helper": "^3.1.10",
59
- "prettier": "^2.6.2",
60
- "rimraf": "^3.0.2",
61
- "ts-node": "10.8.x",
62
- "ttypescript": "^1.5.13",
63
- "typescript": "^4.8.4",
64
- "typescript-transform-paths": "^3.4.4",
65
- "uuid": "^8.3.2"
66
- },
67
- "files": [
68
- "README.md",
69
- "LICENSE",
70
- "CONTRIBUTING.md",
71
- "CODE_OF_CONDUCT",
72
- "template",
73
- "bundle",
74
- "lib"
75
- ]
76
- }
1
+ {
2
+ "name": "nestia",
3
+ "version": "4.0.0-dev.20221217",
4
+ "description": "Nestia CLI",
5
+ "main": "bin/index.js",
6
+ "bin": {
7
+ "nestia": "bin/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "rimraf bin && tsc"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/samchon/nestia"
15
+ },
16
+ "keywords": [
17
+ "nestia"
18
+ ],
19
+ "author": "Jeongho Nam",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/samchon/nestia/issues"
23
+ },
24
+ "homepage": "https://github.com/samchon/nestia",
25
+ "devDependencies": {
26
+ "@nestia/core": "^0.1.6",
27
+ "@nestia/sdk": "^0.1.0",
28
+ "@types/node": "^18.11.16",
29
+ "rimraf": "^3.0.2",
30
+ "typescript": "^4.9.4"
31
+ },
32
+ "files": [
33
+ "bin",
34
+ "README.md",
35
+ "LICENSE",
36
+ "package-json"
37
+ ]
38
+ }
package/CONTRIBUTING.md DELETED
@@ -1,72 +0,0 @@
1
- # Contribution Guide
2
- ## To Publish an issue
3
- Thanks for your advise. Before publishing an issue, please check some components.
4
-
5
- ### 1. Search for duplicates
6
- Before publishing an issue, please check whether the duplicated issue exists or not.
7
-
8
- - [Ordinary Issues](https://github.com/samchon/nestia/issues)
9
-
10
- ### 2. Did you find a bug?
11
- When you reporting a bug, then please write about those items:
12
-
13
- - What version you're using
14
- - If possible, give me an isolated way to reproduce the behavior.
15
- - The behavior your expect to see, and the actual behavior.
16
-
17
- ### 3. Do you have a suggestion?
18
- I always welcome your suggestion. When you publishing a suggestion, then please write such items:
19
-
20
- - A description of the problem you're trying to solve.
21
- - An overview of the suggested solution.
22
- - Examples of how the suggestion whould work in various places.
23
- - Code examples showing the expected behavior.
24
-
25
-
26
-
27
-
28
- ## Contributing Code
29
- ### Test your code
30
- Before sending a pull request, please test your new code. You type the command `npm run build &&& npm run test`, then compiling your code and test-automation will be all processed.
31
-
32
- ```bash
33
- # COMPILE
34
- npm run build
35
-
36
- # DO TEST
37
- npm run test
38
- ```
39
-
40
- If you succeeded to compile, but failed to pass the test-automation, then *debug* the test-automation module. I've configured the `.vscode/launch.json`. You just run the `VSCode` and click the `Start Debugging` button or press `F5` key. By the *debugging*, find the reason why the *test* is failed and fix it.
41
-
42
- ### Adding a Test
43
- As this `nestia` is not a typical library who being used by the `import` statement but a executable program generating the SDK (Software Development Kit), adding a test means that adding a demonstration project.
44
-
45
- I know that adding a demonstration project is much difficult than adding a test function, but there's no way if newly contributed code requires a new type of testing tool. Looking at the [src/test/demonstratios](demo) directory and traveling the demonstration projects, create a new demonstration project following their structures and styles.
46
-
47
- Of course, if your contribution code does not require a test new project, don't mind this.
48
-
49
-
50
-
51
-
52
- ## Sending a Pull Request
53
- Thanks for your contributing. Before sending a pull request to me, please check those components.
54
-
55
- ### 1. Include enough descriptions
56
- When you send a pull request, please include a description, of what your change intends to do, on the content. Title, make it clear and simple such below:
57
-
58
- - Refactor features
59
- - Fix #17
60
- - Add tests for #28
61
-
62
- ### 2. Include adequate tests
63
- As I've mentioned in the `Contributing Code` section, your PR should pass the test-automation module. Your PR includes *new features* that have not being handled in the ordinary test-automation module, then also update *add the testing unit* please.
64
-
65
- If there're some specific reasons that could not pass the test-automation (not error but *intended*), then please update the ordinary test-automation module or write the reasons on your PR content and *const me update the test-automation module*.
66
-
67
-
68
-
69
-
70
- ## References
71
- I've referenced contribution guidance of the TypeScript.
72
- - https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md
@@ -1 +0,0 @@
1
- export { HttpError } from "nestia-fetcher";
@@ -1 +0,0 @@
1
- export { IConnection } from "nestia-fetcher";
@@ -1 +0,0 @@
1
- export { Primitive } from "nestia-fetcher";
@@ -1 +0,0 @@
1
- export { AesPkcs5 } from "nestia-fetcher";
@@ -1 +0,0 @@
1
- export { Fetcher } from "nestia-fetcher";
@@ -1,110 +0,0 @@
1
- import ts from "typescript";
2
- import type { StripEnums } from "./utils/StripEnums";
3
- /**
4
- * Definition for the `nestia.config.ts` file.
5
- *
6
- * @author Jeongho Nam - https://github.com/samchon
7
- */
8
- export interface IConfiguration {
9
- /**
10
- * List of files or directories containing the NestJS controller classes.
11
- */
12
- input: string | string[] | IConfiguration.IInput;
13
- /**
14
- * Output directory that SDK would be placed in.
15
- *
16
- * If not configured, you can't build the SDK library.
17
- */
18
- output?: string;
19
- /**
20
- * Compiler options for the TypeScript.
21
- *
22
- * If you've omitted this property or the assigned property cannot fully cover the
23
- * `tsconfig.json`, the properties from the `tsconfig.json` would be assigned to here.
24
- * Otherwise, this property has been configured and it's detailed values are different
25
- * with the `tsconfig.json`, this property values would be used instead.
26
- *
27
- * ```typescript
28
- * import ts from "typescript";
29
- *
30
- * const tsconfig: ts.TsConfig;
31
- * const nestiaConfig: IConfiguration;
32
- *
33
- * const compilerOptions: ts.CompilerOptions = {
34
- * ...tsconfig.compilerOptions,
35
- * ...(nestiaConfig.compilerOptions || {})
36
- * }
37
- * ```
38
- */
39
- compilerOptions?: StripEnums<ts.CompilerOptions>;
40
- /**
41
- * Whether to assert parameter types or not.
42
- *
43
- * If you configure this property to be `true`, all of the function parameters would be
44
- * checked through the [typescript-json](https://github.com/samchon/typescript-json#runtime-type-checkers).
45
- * This option would make your SDK library slower, but would enahcne the type safety even
46
- * in the runtime level.
47
- *
48
- * @default false
49
- */
50
- assert?: boolean;
51
- /**
52
- * Whether to optimize JSON string conversion 2x faster or not.
53
- *
54
- * If you configure this property to be `true`, the SDK library would utilize the
55
- * [typescript-json](https://github.com/samchon/typescript-json#fastest-json-string-converter)
56
- * and the JSON string conversion speed really be 2x faster.
57
- *
58
- * @default false
59
- */
60
- json?: boolean;
61
- /**
62
- * Whether to wrap DTO by primitive type.
63
- *
64
- * If you don't configure this property as `false`, all of DTOs in the
65
- * SDK library would be automatically wrapped by {@link Primitive} type.
66
- *
67
- * For refenrece, if a DTO type be capsuled by the {@link Primitive} type,
68
- * all of methods in the DTO type would be automatically erased. Also, if
69
- * the DTO has a `toJSON()` method, the DTO type would be automatically
70
- * converted to return type of the `toJSON()` method.
71
- *
72
- * @default true
73
- */
74
- primitive?: boolean;
75
- /**
76
- * Building `swagger.json` is also possible.
77
- *
78
- * If not specified, you can't build the `swagger.json`.
79
- */
80
- swagger?: IConfiguration.ISwagger;
81
- }
82
- export declare namespace IConfiguration {
83
- /**
84
- * List of files or directories to include or exclude to specifying the NestJS
85
- * controllers.
86
- */
87
- interface IInput {
88
- /**
89
- * List of files or directories containing the NestJS controller classes.
90
- */
91
- include: string[];
92
- /**
93
- * List of files or directories to be excluded.
94
- */
95
- exclude?: string[];
96
- }
97
- /**
98
- * Building `swagger.json` is also possible.
99
- */
100
- interface ISwagger {
101
- /**
102
- * Output path of the `swagger.json`.
103
- *
104
- * If you've configured only directory, the file name would be the `swagger.json`.
105
- * Otherwise you've configured the full path with file name and extension, the
106
- * `swagger.json` file would be renamed to it.
107
- */
108
- output: string;
109
- }
110
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IConfiguration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IConfiguration.js","sourceRoot":"","sources":["../src/IConfiguration.ts"],"names":[],"mappings":""}