@nestia/sdk 1.3.9 → 1.3.10
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/lib/NestiaSdkApplication.d.ts +1 -1
- package/lib/NestiaSdkApplication.js +15 -9
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/analyses/ControllerAnalyzer.js +3 -3
- package/lib/analyses/ControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ImportAnalyzer.js +2 -6
- package/lib/analyses/ImportAnalyzer.js.map +1 -1
- package/lib/executable/internal/NestiaConfigCompilerOptions.d.ts +1 -0
- package/lib/executable/internal/NestiaConfigCompilerOptions.js +1 -1
- package/lib/executable/internal/NestiaConfigCompilerOptions.js.map +1 -1
- package/lib/executable/internal/NestiaSdkCommand.js +2 -2
- package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
- package/lib/executable/sdk.js +11 -11
- package/lib/generates/SdkGenerator.js +28 -0
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.js +9 -9
- package/lib/generates/internal/E2eFileProgrammer.js +12 -12
- package/lib/structures/IRoute.d.ts +1 -0
- package/package.json +2 -2
- package/src/NestiaSdkApplication.ts +273 -262
- package/src/analyses/ControllerAnalyzer.ts +266 -261
- package/src/analyses/GenericAnalyzer.ts +53 -53
- package/src/analyses/ImportAnalyzer.ts +158 -164
- package/src/analyses/PathAnalyzer.ts +58 -58
- package/src/analyses/ReflectAnalyzer.ts +321 -321
- package/src/executable/internal/CommandParser.ts +15 -15
- package/src/executable/internal/NestiaConfigCompilerOptions.ts +19 -18
- package/src/executable/internal/NestiaSdkCommand.ts +157 -156
- package/src/executable/internal/NestiaSdkConfig.ts +36 -36
- package/src/executable/internal/nestia.config.getter.ts +12 -12
- package/src/executable/sdk.ts +70 -70
- package/src/generates/E2eGenerator.ts +67 -67
- package/src/generates/SdkGenerator.ts +94 -65
- package/src/generates/SwaggerGenerator.ts +504 -504
- package/src/generates/internal/E2eFileProgrammer.ts +135 -135
- package/src/generates/internal/SdkRouteDirectory.ts +21 -21
- package/src/index.ts +4 -4
- package/src/module.ts +2 -2
- package/src/structures/IController.ts +31 -31
- package/src/structures/IRoute.ts +40 -39
- package/src/structures/ISwaggerDocument.ts +120 -120
- package/src/structures/ITypeTuple.ts +6 -6
- package/src/structures/MethodType.ts +11 -11
- package/src/structures/ParamCategory.ts +1 -1
- package/src/structures/TypeEntry.ts +22 -22
- package/src/utils/ArrayUtil.ts +26 -26
- package/src/utils/FileRetriever.ts +22 -22
- package/src/utils/ImportDictionary.ts +56 -56
- package/src/utils/MapUtil.ts +14 -14
- package/src/utils/NestiaConfigUtil.ts +21 -21
- package/src/utils/SourceFinder.ts +60 -60
- package/src/utils/StripEnums.ts +10 -10
|
@@ -1,262 +1,273 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import * as runner from "ts-node";
|
|
4
|
-
import { Pair, Singleton } from "tstl";
|
|
5
|
-
import ts from "typescript";
|
|
6
|
-
|
|
7
|
-
import { INestiaConfig } from "./INestiaConfig";
|
|
8
|
-
import { ControllerAnalyzer } from "./analyses/ControllerAnalyzer";
|
|
9
|
-
import { ReflectAnalyzer } from "./analyses/ReflectAnalyzer";
|
|
10
|
-
import { NestiaConfigCompilerOptions } from "./executable/internal/NestiaConfigCompilerOptions";
|
|
11
|
-
import { E2eGenerator } from "./generates/E2eGenerator";
|
|
12
|
-
import { SdkGenerator } from "./generates/SdkGenerator";
|
|
13
|
-
import { SwaggerGenerator } from "./generates/SwaggerGenerator";
|
|
14
|
-
import { IController } from "./structures/IController";
|
|
15
|
-
import { IRoute } from "./structures/IRoute";
|
|
16
|
-
import { ArrayUtil } from "./utils/ArrayUtil";
|
|
17
|
-
import { NestiaConfigUtil } from "./utils/NestiaConfigUtil";
|
|
18
|
-
import { SourceFinder } from "./utils/SourceFinder";
|
|
19
|
-
|
|
20
|
-
export class NestiaSdkApplication {
|
|
21
|
-
private readonly
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
(config) =>
|
|
87
|
-
|
|
88
|
-
await
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
(config) => config,
|
|
110
|
-
() => SdkGenerator.generate,
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
public async swagger(): Promise<void> {
|
|
115
|
-
if (!this.config_.swagger?.output)
|
|
116
|
-
throw new Error(
|
|
117
|
-
`Error on NestiaApplication.swagger(): output path of the "swagger.json" is not specified.`,
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
const parsed: path.ParsedPath = path.parse(this.config_.swagger.output);
|
|
121
|
-
const directory: string = !!parsed.ext
|
|
122
|
-
? path.resolve(parsed.dir)
|
|
123
|
-
: this.config_.swagger.output;
|
|
124
|
-
const stats: fs.Stats = await fs.promises.lstat(directory);
|
|
125
|
-
if (stats.isDirectory() === false)
|
|
126
|
-
throw new Error(
|
|
127
|
-
"Error on NestiaApplication.swagger(): output directory does not exists.",
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
title("Nestia Swagger Generator");
|
|
131
|
-
await this.generate(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
console.log(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
)
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import * as runner from "ts-node";
|
|
4
|
+
import { Pair, Singleton } from "tstl";
|
|
5
|
+
import ts from "typescript";
|
|
6
|
+
|
|
7
|
+
import { INestiaConfig } from "./INestiaConfig";
|
|
8
|
+
import { ControllerAnalyzer } from "./analyses/ControllerAnalyzer";
|
|
9
|
+
import { ReflectAnalyzer } from "./analyses/ReflectAnalyzer";
|
|
10
|
+
import { NestiaConfigCompilerOptions } from "./executable/internal/NestiaConfigCompilerOptions";
|
|
11
|
+
import { E2eGenerator } from "./generates/E2eGenerator";
|
|
12
|
+
import { SdkGenerator } from "./generates/SdkGenerator";
|
|
13
|
+
import { SwaggerGenerator } from "./generates/SwaggerGenerator";
|
|
14
|
+
import { IController } from "./structures/IController";
|
|
15
|
+
import { IRoute } from "./structures/IRoute";
|
|
16
|
+
import { ArrayUtil } from "./utils/ArrayUtil";
|
|
17
|
+
import { NestiaConfigUtil } from "./utils/NestiaConfigUtil";
|
|
18
|
+
import { SourceFinder } from "./utils/SourceFinder";
|
|
19
|
+
|
|
20
|
+
export class NestiaSdkApplication {
|
|
21
|
+
private readonly bundle_checker_: Singleton<
|
|
22
|
+
Promise<(str: string) => boolean>
|
|
23
|
+
>;
|
|
24
|
+
|
|
25
|
+
public constructor(private readonly config_: INestiaConfig) {
|
|
26
|
+
this.bundle_checker_ = new Singleton(async () => {
|
|
27
|
+
if (!this.config_.output) return () => false;
|
|
28
|
+
|
|
29
|
+
const bundles: string[] = await fs.promises.readdir(
|
|
30
|
+
SdkGenerator.BUNDLE_PATH,
|
|
31
|
+
);
|
|
32
|
+
const tuples: Pair<string, boolean>[] = await ArrayUtil.asyncMap(
|
|
33
|
+
bundles,
|
|
34
|
+
async (file) => {
|
|
35
|
+
const relative: string = path.join(
|
|
36
|
+
this.config_.output!,
|
|
37
|
+
file,
|
|
38
|
+
);
|
|
39
|
+
const location: string = path.join(
|
|
40
|
+
SdkGenerator.BUNDLE_PATH,
|
|
41
|
+
file,
|
|
42
|
+
);
|
|
43
|
+
const stats: fs.Stats = await fs.promises.stat(location);
|
|
44
|
+
|
|
45
|
+
return new Pair(relative, stats.isDirectory());
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return (file: string): boolean => {
|
|
50
|
+
for (const it of tuples)
|
|
51
|
+
if (it.second === false && file === it.first) return true;
|
|
52
|
+
else if (it.second === true && file.indexOf(it.first) === 0)
|
|
53
|
+
return true;
|
|
54
|
+
return false;
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public async e2e(): Promise<void> {
|
|
60
|
+
if (!this.config_.output)
|
|
61
|
+
throw new Error(
|
|
62
|
+
"Error on NestiaApplication.e2e(): output path of SDK is not specified.",
|
|
63
|
+
);
|
|
64
|
+
else if (!this.config_.e2e)
|
|
65
|
+
throw new Error(
|
|
66
|
+
"Error on NestiaApplication.e2e(): output path of e2e test files is not specified.",
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const validate =
|
|
70
|
+
(title: string) =>
|
|
71
|
+
async (location: string): Promise<void> => {
|
|
72
|
+
const parent: string = path.resolve(location + "/..");
|
|
73
|
+
const stats: fs.Stats = await fs.promises.lstat(parent);
|
|
74
|
+
if (stats.isDirectory() === false)
|
|
75
|
+
throw new Error(
|
|
76
|
+
`Error on NestiaApplication.e2e(): output directory of ${title} does not exists.`,
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
await validate("sdk")(this.config_.output);
|
|
80
|
+
await validate("e2e")(this.config_.e2e);
|
|
81
|
+
|
|
82
|
+
title("Nestia E2E Generator");
|
|
83
|
+
await this.generate(
|
|
84
|
+
"e2e",
|
|
85
|
+
(config) => config,
|
|
86
|
+
() => (config) => async (routes) => {
|
|
87
|
+
await SdkGenerator.generate(config)(routes);
|
|
88
|
+
await E2eGenerator.generate(config)(routes);
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public async sdk(): Promise<void> {
|
|
94
|
+
if (!this.config_.output)
|
|
95
|
+
throw new Error(
|
|
96
|
+
"Error on NestiaApplication.sdk(): output path is not specified.",
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
const parent: string = path.resolve(this.config_.output + "/..");
|
|
100
|
+
const stats: fs.Stats = await fs.promises.lstat(parent);
|
|
101
|
+
if (stats.isDirectory() === false)
|
|
102
|
+
throw new Error(
|
|
103
|
+
"Error on NestiaApplication.sdk(): output directory does not exists.",
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
title("Nestia SDK Generator");
|
|
107
|
+
await this.generate(
|
|
108
|
+
"sdk",
|
|
109
|
+
(config) => config,
|
|
110
|
+
() => SdkGenerator.generate,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public async swagger(): Promise<void> {
|
|
115
|
+
if (!this.config_.swagger?.output)
|
|
116
|
+
throw new Error(
|
|
117
|
+
`Error on NestiaApplication.swagger(): output path of the "swagger.json" is not specified.`,
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const parsed: path.ParsedPath = path.parse(this.config_.swagger.output);
|
|
121
|
+
const directory: string = !!parsed.ext
|
|
122
|
+
? path.resolve(parsed.dir)
|
|
123
|
+
: this.config_.swagger.output;
|
|
124
|
+
const stats: fs.Stats = await fs.promises.lstat(directory);
|
|
125
|
+
if (stats.isDirectory() === false)
|
|
126
|
+
throw new Error(
|
|
127
|
+
"Error on NestiaApplication.swagger(): output directory does not exists.",
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
title("Nestia Swagger Generator");
|
|
131
|
+
await this.generate(
|
|
132
|
+
"swagger",
|
|
133
|
+
(config) => config.swagger!,
|
|
134
|
+
SwaggerGenerator.generate,
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private async generate<Config>(
|
|
139
|
+
method: string,
|
|
140
|
+
config: (entire: INestiaConfig) => Config,
|
|
141
|
+
archiver: (
|
|
142
|
+
checker: ts.TypeChecker,
|
|
143
|
+
) => (config: Config) => (routes: IRoute[]) => Promise<void>,
|
|
144
|
+
): Promise<void> {
|
|
145
|
+
// MOUNT TS-NODE
|
|
146
|
+
this.prepare(method);
|
|
147
|
+
|
|
148
|
+
// LOAD CONTROLLER FILES
|
|
149
|
+
const input: INestiaConfig.IInput = NestiaConfigUtil.input(
|
|
150
|
+
this.config_.input,
|
|
151
|
+
);
|
|
152
|
+
const fileList: string[] = await ArrayUtil.asyncFilter(
|
|
153
|
+
await SourceFinder.find({
|
|
154
|
+
include: input.include,
|
|
155
|
+
exclude: input.exclude,
|
|
156
|
+
filter: (file) =>
|
|
157
|
+
file.substring(file.length - 3) === ".ts" &&
|
|
158
|
+
file.substring(file.length - 5) !== ".d.ts",
|
|
159
|
+
}),
|
|
160
|
+
(file) => this.is_not_excluded(file),
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
// ANALYZE REFLECTS
|
|
164
|
+
const unique: WeakSet<any> = new WeakSet();
|
|
165
|
+
const controllers: IController[] = [];
|
|
166
|
+
|
|
167
|
+
console.log("Analyzing reflections");
|
|
168
|
+
for (const file of fileList)
|
|
169
|
+
controllers.push(...(await ReflectAnalyzer.analyze(unique, file)));
|
|
170
|
+
|
|
171
|
+
const agg: number = (() => {
|
|
172
|
+
const set: Set<string> = new Set();
|
|
173
|
+
for (const c of controllers)
|
|
174
|
+
for (const cPath of c.paths)
|
|
175
|
+
for (const f of c.functions)
|
|
176
|
+
for (const fPath of f.paths)
|
|
177
|
+
set.add(`${f.method}::${cPath}/${fPath}`);
|
|
178
|
+
return set.size;
|
|
179
|
+
})();
|
|
180
|
+
|
|
181
|
+
console.log(` - controllers: #${controllers.length}`);
|
|
182
|
+
console.log(` - paths: #${agg}`);
|
|
183
|
+
console.log(
|
|
184
|
+
` - routes: #${controllers
|
|
185
|
+
.map(
|
|
186
|
+
(c) =>
|
|
187
|
+
c.paths.length *
|
|
188
|
+
c.functions
|
|
189
|
+
.map((f) => f.paths.length)
|
|
190
|
+
.reduce((a, b) => a + b, 0),
|
|
191
|
+
)
|
|
192
|
+
.reduce((a, b) => a + b, 0)}`,
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
// ANALYZE TYPESCRIPT CODE
|
|
196
|
+
console.log("Analyzing source codes");
|
|
197
|
+
const program: ts.Program = ts.createProgram(
|
|
198
|
+
controllers.map((c) => c.file),
|
|
199
|
+
this.config_.compilerOptions || { noEmit: true },
|
|
200
|
+
);
|
|
201
|
+
const checker: ts.TypeChecker = program.getTypeChecker();
|
|
202
|
+
|
|
203
|
+
const routeList: IRoute[] = [];
|
|
204
|
+
for (const c of controllers) {
|
|
205
|
+
const file: ts.SourceFile | undefined = program.getSourceFile(
|
|
206
|
+
c.file,
|
|
207
|
+
);
|
|
208
|
+
if (file === undefined) continue;
|
|
209
|
+
routeList.push(...ControllerAnalyzer.analyze(checker, file, c));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// DO GENERATE
|
|
213
|
+
await archiver(checker)(config(this.config_))(routeList);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
private prepare(method: string): void {
|
|
217
|
+
// CONSTRUCT OPTIONS
|
|
218
|
+
if (!this.config_.compilerOptions)
|
|
219
|
+
this.config_.compilerOptions =
|
|
220
|
+
NestiaConfigCompilerOptions.DEFAULT_OPTIONS as any;
|
|
221
|
+
const absoluted: boolean = !!this.config_.compilerOptions?.baseUrl;
|
|
222
|
+
|
|
223
|
+
// CHECK STRICT OPTION
|
|
224
|
+
const strict: boolean =
|
|
225
|
+
this.config_.compilerOptions?.strictNullChecks !== undefined
|
|
226
|
+
? !!this.config_.compilerOptions.strictNullChecks
|
|
227
|
+
: !!this.config_.compilerOptions?.strict;
|
|
228
|
+
if (strict === false)
|
|
229
|
+
throw new Error(
|
|
230
|
+
`Error on NestiaSdkApplication.${method}(): nestia requires \`compilerOptions.strictNullChecks\` to be true.`,
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
const ttsc: boolean =
|
|
234
|
+
ts.version < "5.0.0" &&
|
|
235
|
+
(() => {
|
|
236
|
+
try {
|
|
237
|
+
require.resolve("ttypescript");
|
|
238
|
+
return true;
|
|
239
|
+
} catch (e) {
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
})();
|
|
243
|
+
|
|
244
|
+
// MOUNT TS-NODE
|
|
245
|
+
runner.register({
|
|
246
|
+
emit: false,
|
|
247
|
+
compiler: ttsc ? "ttypescript" : undefined,
|
|
248
|
+
compilerOptions: this.config_.compilerOptions,
|
|
249
|
+
require: absoluted ? ["tsconfig-paths/register"] : undefined,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
private async is_not_excluded(file: string): Promise<boolean> {
|
|
254
|
+
if (this.config_.output)
|
|
255
|
+
return (
|
|
256
|
+
file.indexOf(path.join(this.config_.output, "functional")) ===
|
|
257
|
+
-1 && (await this.bundle_checker_.get())(file) === false
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
const content: string = await fs.promises.readFile(file, "utf8");
|
|
261
|
+
return (
|
|
262
|
+
content.indexOf(
|
|
263
|
+
" * @nestia Generated by Nestia - https://github.com/samchon/nestia",
|
|
264
|
+
) === -1
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const title = (str: string): void => {
|
|
270
|
+
console.log("-----------------------------------------------------------");
|
|
271
|
+
console.log(` ${str}`);
|
|
272
|
+
console.log("-----------------------------------------------------------");
|
|
273
|
+
};
|