nestia 2.0.12 → 2.0.14

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 (82) hide show
  1. package/README.md +18 -3
  2. package/lib/IConfiguration.d.ts +54 -0
  3. package/lib/IConfiguration.d.ts.map +1 -0
  4. package/{bin → lib}/IConfiguration.js +0 -0
  5. package/{bin → lib}/NestiaApplication.d.ts +0 -0
  6. package/{bin → lib}/NestiaApplication.d.ts.map +0 -0
  7. package/{bin → lib}/NestiaApplication.js +0 -0
  8. package/{bin → lib}/analyses/ControllerAnalyzer.d.ts +0 -0
  9. package/{bin → lib}/analyses/ControllerAnalyzer.d.ts.map +0 -0
  10. package/{bin → lib}/analyses/ControllerAnalyzer.js +0 -0
  11. package/{bin → lib}/analyses/GenericAnalyzer.d.ts +0 -0
  12. package/{bin → lib}/analyses/GenericAnalyzer.d.ts.map +0 -0
  13. package/{bin → lib}/analyses/GenericAnalyzer.js +0 -0
  14. package/{bin → lib}/analyses/ImportAnalyzer.d.ts +0 -0
  15. package/{bin → lib}/analyses/ImportAnalyzer.d.ts.map +0 -0
  16. package/{bin → lib}/analyses/ImportAnalyzer.js +0 -0
  17. package/{bin → lib}/analyses/ReflectAnalyzer.d.ts +0 -0
  18. package/{bin → lib}/analyses/ReflectAnalyzer.d.ts.map +0 -0
  19. package/{bin → lib}/analyses/ReflectAnalyzer.js +0 -0
  20. package/{bin → lib}/analyses/SourceFinder.d.ts +0 -0
  21. package/{bin → lib}/analyses/SourceFinder.d.ts.map +0 -0
  22. package/{bin → lib}/analyses/SourceFinder.js +0 -0
  23. package/{bin → lib}/executable/internal/CompilerOptions.d.ts +0 -0
  24. package/{bin → lib}/executable/internal/CompilerOptions.d.ts.map +0 -0
  25. package/{bin → lib}/executable/internal/CompilerOptions.js +0 -0
  26. package/{bin → lib}/executable/internal/NestiaConfig.d.ts +0 -0
  27. package/{bin → lib}/executable/internal/NestiaConfig.d.ts.map +1 -1
  28. package/{bin → lib}/executable/internal/NestiaConfig.js +12 -2
  29. package/{bin → lib}/executable/internal/NestiaSdkCli.d.ts +0 -0
  30. package/{bin → lib}/executable/internal/NestiaSdkCli.d.ts.map +0 -0
  31. package/{bin → lib}/executable/internal/NestiaSdkCli.js +0 -0
  32. package/{bin → lib}/executable/internal/nestia.config.getter.d.ts +0 -0
  33. package/{bin → lib}/executable/internal/nestia.config.getter.d.ts.map +0 -0
  34. package/{bin → lib}/executable/internal/nestia.config.getter.js +0 -0
  35. package/{bin → lib}/executable/nestia.d.ts +0 -0
  36. package/{bin → lib}/executable/nestia.d.ts.map +0 -0
  37. package/{bin → lib}/executable/nestia.js +1 -1
  38. package/{bin → lib}/generates/FileGenerator.d.ts +0 -0
  39. package/{bin → lib}/generates/FileGenerator.d.ts.map +0 -0
  40. package/{bin → lib}/generates/FileGenerator.js +0 -0
  41. package/{bin → lib}/generates/FunctionGenerator.d.ts +0 -0
  42. package/{bin → lib}/generates/FunctionGenerator.d.ts.map +0 -0
  43. package/{bin → lib}/generates/FunctionGenerator.js +0 -0
  44. package/{bin → lib}/generates/SdkGenerator.d.ts +0 -0
  45. package/{bin → lib}/generates/SdkGenerator.d.ts.map +0 -0
  46. package/{bin → lib}/generates/SdkGenerator.js +0 -0
  47. package/{bin → lib}/index.d.ts +0 -0
  48. package/{bin → lib}/index.d.ts.map +0 -0
  49. package/{bin → lib}/index.js +0 -0
  50. package/{bin → lib}/module.d.ts +0 -0
  51. package/{bin → lib}/module.d.ts.map +0 -0
  52. package/{bin → lib}/module.js +0 -0
  53. package/{bin → lib}/structures/IController.d.ts +0 -0
  54. package/{bin → lib}/structures/IController.d.ts.map +0 -0
  55. package/{bin → lib}/structures/IController.js +0 -0
  56. package/{bin → lib}/structures/IRoute.d.ts +0 -0
  57. package/{bin → lib}/structures/IRoute.d.ts.map +0 -0
  58. package/{bin → lib}/structures/IRoute.js +0 -0
  59. package/{bin → lib}/structures/MethodType.d.ts +0 -0
  60. package/{bin → lib}/structures/MethodType.d.ts.map +0 -0
  61. package/{bin → lib}/structures/MethodType.js +0 -0
  62. package/{bin → lib}/structures/ParamCategory.d.ts +0 -0
  63. package/{bin → lib}/structures/ParamCategory.d.ts.map +0 -0
  64. package/{bin → lib}/structures/ParamCategory.js +0 -0
  65. package/{bin → lib}/utils/ArrayUtil.d.ts +0 -0
  66. package/{bin → lib}/utils/ArrayUtil.d.ts.map +0 -0
  67. package/{bin → lib}/utils/ArrayUtil.js +0 -0
  68. package/{bin → lib}/utils/DirectoryUtil.d.ts +0 -0
  69. package/{bin → lib}/utils/DirectoryUtil.d.ts.map +0 -0
  70. package/{bin → lib}/utils/DirectoryUtil.js +0 -0
  71. package/{bin → lib}/utils/ImportDictionary.d.ts +0 -0
  72. package/{bin → lib}/utils/ImportDictionary.d.ts.map +0 -0
  73. package/{bin → lib}/utils/ImportDictionary.js +0 -0
  74. package/{bin → lib}/utils/StringUtil.d.ts +0 -0
  75. package/{bin → lib}/utils/StringUtil.d.ts.map +0 -0
  76. package/{bin → lib}/utils/StringUtil.js +0 -0
  77. package/{bin → lib}/utils/stripJsonComments.d.ts +0 -0
  78. package/{bin → lib}/utils/stripJsonComments.d.ts.map +0 -0
  79. package/{bin → lib}/utils/stripJsonComments.js +0 -0
  80. package/package.json +4 -4
  81. package/bin/IConfiguration.d.ts +0 -15
  82. package/bin/IConfiguration.d.ts.map +0 -1
package/README.md CHANGED
@@ -102,19 +102,27 @@ The `npx nestia install` command installs those dependencies with `package.json`
102
102
  ## Advanced
103
103
  ### `nestia.config.ts`
104
104
  ```typescript
105
+ /**
106
+ * Definition for the `nestia.config.ts` file.
107
+ *
108
+ * @author Samchon
109
+ */
105
110
  export interface IConfiguration
106
111
  {
107
112
  /**
108
113
  * Whether to assert parameter types or not.
114
+ *
115
+ * If you configure this option to be `true`, all of the function parameters would be
116
+ * checked through the [typescript-is](https://github.com/woutervh-/typescript-is).
109
117
  */
110
118
  assert?: boolean;
111
119
 
112
120
  /**
113
- * Whether to optimize JSON string conversion or not.
121
+ * Whether to optimize JSON string conversion 2x faster or not.
114
122
  *
115
123
  * If you configure this option to be `true`, the SDK library would utilize the
116
124
  * [typescript-json](https://github.com/samchon/typescript-json) and the JSON string
117
- * conversion speed really be two times faster.
125
+ * conversion speed really be 2x faster.
118
126
  */
119
127
  json?: boolean;
120
128
 
@@ -137,6 +145,10 @@ export interface IConfiguration
137
145
  }
138
146
  export namespace IConfiguration
139
147
  {
148
+ /**
149
+ * List of files or directories to include or exclude to specifying the NestJS
150
+ * controllers.
151
+ */
140
152
  export interface IInput
141
153
  {
142
154
  /**
@@ -157,11 +169,14 @@ Instead of specifying `input` and `output` directories using the cli options, yo
157
169
  Write below content as the `nestia.config.ts` file and place it onto the root directory of your backend project. After the configuration, you can generate the SDK only with the `npx nestia sdk` command, without any directory specification.
158
170
 
159
171
  ```typescript
160
- export = {
172
+ import type nestia from "nestia";
173
+
174
+ const config: nestia.IConfiguration = {
161
175
  input: "src/controllers",
162
176
  output: "src/api",
163
177
  assert: false
164
178
  };
179
+ export default config;
165
180
  ```
166
181
 
167
182
  > Alternative options for the regular NestJS project:
@@ -0,0 +1,54 @@
1
+ import * as tsc from "typescript";
2
+ /**
3
+ * Definition for the `nestia.config.ts` file.
4
+ *
5
+ * @author Samchon
6
+ */
7
+ export interface IConfiguration {
8
+ /**
9
+ * List of files or directories containing the NestJS controller classes.
10
+ */
11
+ input: string | string[] | IConfiguration.IInput;
12
+ /**
13
+ * Output directory that SDK would be placed in.
14
+ */
15
+ output: string;
16
+ /**
17
+ * Compiler options for the TypeScript.
18
+ *
19
+ * If omitted, the configuration would follow the `tsconfig.json`.
20
+ */
21
+ compilerOptions?: tsc.CompilerOptions;
22
+ /**
23
+ * Whether to assert parameter types or not.
24
+ *
25
+ * If you configure this option to be `true`, all of the function parameters would be
26
+ * checked through the [typescript-is](https://github.com/woutervh-/typescript-is).
27
+ */
28
+ assert?: boolean;
29
+ /**
30
+ * Whether to optimize JSON string conversion 2x faster or not.
31
+ *
32
+ * If you configure this option to be `true`, the SDK library would utilize the
33
+ * [typescript-json](https://github.com/samchon/typescript-json) and the JSON string
34
+ * conversion speed really be 2x faster.
35
+ */
36
+ json?: boolean;
37
+ }
38
+ export declare namespace IConfiguration {
39
+ /**
40
+ * List of files or directories to include or exclude to specifying the NestJS
41
+ * controllers.
42
+ */
43
+ interface IInput {
44
+ /**
45
+ * List of files or directories containing the NestJS controller classes.
46
+ */
47
+ include: string[];
48
+ /**
49
+ * List of files or directories to be excluded.
50
+ */
51
+ exclude?: string[];
52
+ }
53
+ }
54
+ //# sourceMappingURL=IConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IConfiguration.d.ts","sourceRoot":"","sources":["../src/IConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAE3B;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC;IAEjD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,eAAe,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC;IAEtC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AACD,yBAAiB,cAAc,CAC/B;IACI;;;OAGG;IACH,UAAiB,MAAM;QAEnB;;WAEG;QACH,OAAO,EAAE,MAAM,EAAE,CAAC;QAElB;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACtB;CACJ"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaConfig.d.ts","sourceRoot":"","sources":["../../../src/executable/internal/NestiaConfig.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,yBAAiB,YAAY,CAC7B;IACI,SAAgB,GAAG,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAGpD;CA4BJ"}
1
+ {"version":3,"file":"NestiaConfig.d.ts","sourceRoot":"","sources":["../../../src/executable/internal/NestiaConfig.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,yBAAiB,YAAY,CAC7B;IACI,SAAgB,GAAG,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAGpD;CAuCJ"}
@@ -186,7 +186,7 @@ var NestiaConfig;
186
186
  return config;
187
187
  }
188
188
  var singleton = new Singleton_1.Singleton(function () { return __awaiter(_this, void 0, void 0, function () {
189
- var config;
189
+ var config, trial;
190
190
  return __generator(this, function (_a) {
191
191
  switch (_a.label) {
192
192
  case 0:
@@ -201,7 +201,17 @@ var NestiaConfig;
201
201
  return [4 /*yield*/, Promise.resolve().then(function () { return __importStar(require(path.resolve("nestia.config.ts"))); })];
202
202
  case 1:
203
203
  config = _a.sent();
204
- return [2 /*return*/, assert(nestia_fetcher_1.Primitive.clone(config))];
204
+ try {
205
+ return [2 /*return*/, assert(nestia_fetcher_1.Primitive.clone(config))];
206
+ }
207
+ catch (exp) {
208
+ trial = config;
209
+ if (trial.default && typeof trial.default === "object")
210
+ return [2 /*return*/, assert(nestia_fetcher_1.Primitive.clone(trial.default))];
211
+ else
212
+ throw exp;
213
+ }
214
+ return [2 /*return*/];
205
215
  }
206
216
  });
207
217
  }); });
File without changes
File without changes
File without changes
@@ -78,7 +78,7 @@ function install() {
78
78
  var e_1, _a;
79
79
  try {
80
80
  // INSTALL DEPENDENCIES
81
- for (var _b = __values(["nestia-fetcher", "typescript-is"]), _c = _b.next(); !_c.done; _c = _b.next()) {
81
+ for (var _b = __values(["nestia-fetcher", "typescript-is", "typescript-json"]), _c = _b.next(); !_c.done; _c = _b.next()) {
82
82
  var lib = _c.value;
83
83
  var command = "npm install ".concat(lib);
84
84
  cp.execSync(command, { stdio: "inherit" });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "nestia",
3
- "version": "2.0.12",
3
+ "version": "2.0.14",
4
4
  "description": "Automatic SDK and Document generator for the NestJS",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "bin": {
8
- "nestia": "./bin/executable/nestia.js"
8
+ "nestia": "./lib/executable/nestia.js"
9
9
  },
10
10
  "scripts": {
11
- "build": "rimraf bin && ttsc",
11
+ "build": "rimraf lib && ttsc",
12
12
  "dev": "npm run build -- --watch",
13
- "test": "node bin/test"
13
+ "test": "node lib/test"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",
@@ -1,15 +0,0 @@
1
- import * as tsc from "typescript";
2
- export interface IConfiguration {
3
- input: string | string[] | IConfiguration.IInput;
4
- output: string;
5
- compilerOptions?: tsc.CompilerOptions;
6
- assert?: boolean;
7
- json?: boolean;
8
- }
9
- export declare namespace IConfiguration {
10
- interface IInput {
11
- include: string[];
12
- exclude?: string[];
13
- }
14
- }
15
- //# sourceMappingURL=IConfiguration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IConfiguration.d.ts","sourceRoot":"","sources":["../src/IConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAElC,MAAM,WAAW,cAAc;IAE3B,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AACD,yBAAiB,cAAc,CAC/B;IACI,UAAiB,MAAM;QAEnB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACtB;CACJ"}