@nestia/migrate 0.5.0 → 0.6.0
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/NestiaMigrateApplication.js +15 -15
- package/lib/NestiaMigrateApplication.js.map +1 -1
- package/lib/archivers/FileArchiver.js.map +1 -1
- package/lib/bundles/TEMPLATE.js +11 -11
- package/lib/bundles/TEMPLATE.js.map +1 -1
- package/lib/executable/bundle.js.map +1 -1
- package/lib/executable/migrate.js +5 -5
- package/lib/executable/migrate.js.map +1 -1
- package/lib/programmers/ControllerProgrammer.d.ts +2 -1
- package/lib/programmers/ControllerProgrammer.js +21 -18
- package/lib/programmers/ControllerProgrammer.js.map +1 -1
- package/lib/programmers/DtoProgrammer.d.ts +8 -4
- package/lib/programmers/DtoProgrammer.js +36 -77
- package/lib/programmers/DtoProgrammer.js.map +1 -1
- package/lib/programmers/ImportProgrammer.d.ts +5 -5
- package/lib/programmers/ImportProgrammer.js +27 -19
- package/lib/programmers/ImportProgrammer.js.map +1 -1
- package/lib/programmers/MigrateProgrammer.d.ts +1 -2
- package/lib/programmers/MigrateProgrammer.js +52 -36
- package/lib/programmers/MigrateProgrammer.js.map +1 -1
- package/lib/programmers/ModuleProgrammer.d.ts +5 -0
- package/lib/programmers/ModuleProgrammer.js +29 -0
- package/lib/programmers/ModuleProgrammer.js.map +1 -0
- package/lib/programmers/RouteProgrammer.d.ts +2 -2
- package/lib/programmers/RouteProgrammer.js +108 -111
- package/lib/programmers/RouteProgrammer.js.map +1 -1
- package/lib/programmers/SchemaProgrammer.d.ts +2 -1
- package/lib/programmers/SchemaProgrammer.js +122 -189
- package/lib/programmers/SchemaProgrammer.js.map +1 -1
- package/lib/structures/IMigrateProgram.d.ts +2 -2
- package/lib/structures/ISwaggerInfo.d.ts +3 -3
- package/lib/utils/FilePrinter.d.ts +9 -0
- package/lib/utils/FilePrinter.js +25 -0
- package/lib/utils/FilePrinter.js.map +1 -0
- package/lib/utils/JsonTypeChecker.d.ts +3 -1
- package/lib/utils/JsonTypeChecker.js +31 -18
- package/lib/utils/JsonTypeChecker.js.map +1 -1
- package/lib/utils/MapUtil.js.map +1 -1
- package/lib/utils/SetupWizard.js.map +1 -1
- package/lib/utils/StringUtil.js.map +1 -1
- package/package.json +11 -9
- package/src/NestiaMigrateApplication.ts +68 -73
- package/src/archivers/FileArchiver.ts +35 -38
- package/src/bundles/TEMPLATE.ts +11 -11
- package/src/executable/bundle.ts +72 -78
- package/src/executable/migrate.ts +59 -60
- package/src/index.ts +4 -4
- package/src/module.ts +4 -4
- package/src/programmers/ControllerProgrammer.ts +155 -157
- package/src/programmers/DtoProgrammer.ts +74 -118
- package/src/programmers/ImportProgrammer.ts +98 -60
- package/src/programmers/MigrateProgrammer.ts +75 -62
- package/src/programmers/ModuleProgrammer.ts +62 -0
- package/src/programmers/RouteProgrammer.ts +486 -466
- package/src/programmers/SchemaProgrammer.ts +247 -339
- package/src/structures/IMigrateController.ts +8 -8
- package/src/structures/IMigrateDto.ts +8 -8
- package/src/structures/IMigrateFile.ts +5 -5
- package/src/structures/IMigrateProgram.ts +7 -7
- package/src/structures/IMigrateRoute.ts +36 -36
- package/src/structures/IMigrateSchema.ts +4 -4
- package/src/structures/ISwaggeSchema.ts +82 -82
- package/src/structures/ISwagger.ts +20 -20
- package/src/structures/ISwaggerComponents.ts +7 -7
- package/src/structures/ISwaggerInfo.ts +57 -57
- package/src/structures/ISwaggerRoute.ts +52 -52
- package/src/structures/ISwaggerSecurity.ts +47 -47
- package/src/utils/FilePrinter.ts +36 -0
- package/src/utils/JsonTypeChecker.ts +67 -52
- package/src/utils/MapUtil.ts +13 -13
- package/src/utils/SetupWizard.ts +15 -15
- package/src/utils/StringUtil.ts +51 -51
@@ -13,7 +13,7 @@ class NestiaMigrateApplication {
|
|
13
13
|
constructor(swagger) {
|
14
14
|
this.generate = (archiver) => (output) => {
|
15
15
|
const program = this.analyze();
|
16
|
-
const files = MigrateProgrammer_1.MigrateProgrammer.write(
|
16
|
+
const files = MigrateProgrammer_1.MigrateProgrammer.write(program);
|
17
17
|
try {
|
18
18
|
child_process_1.default.execSync(`git clone https://github.com/samchon/nestia-template "${output}"`, { stdio: "ignore" });
|
19
19
|
for (const path of [
|
@@ -35,9 +35,9 @@ class NestiaMigrateApplication {
|
|
35
35
|
this.swagger = (input => {
|
36
36
|
const __is = input => {
|
37
37
|
const $io0 = input => "string" === typeof input.openapi && RegExp(/^3\.0\.[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/).test(input.openapi) && ("object" === typeof input.info && null !== input.info && $io1(input.info)) && (Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && $io4(elem))) && ("object" === typeof input.components && null !== input.components && false === Array.isArray(input.components) && $io5(input.components)) && ("object" === typeof input.paths && null !== input.paths && false === Array.isArray(input.paths) && $io30(input.paths)) && (undefined === input.security || Array.isArray(input.security) && input.security.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io42(elem)));
|
38
|
-
const $io1 = input => "string" === typeof input.title && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService && /^[a-
|
39
|
-
const $io2 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url && /^[a-
|
40
|
-
const $io3 = input => "string" === typeof input.name && (undefined === input.url || "string" === typeof input.url && /^[a-
|
38
|
+
const $io1 = input => "string" === typeof input.title && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService && (/\/|:/.test(input.termsOfService) && /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i.test(input.termsOfService))) && (undefined === input.contact || "object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) && $io2(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && $io3(input.license)) && "string" === typeof input.version;
|
39
|
+
const $io2 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url && (/\/|:/.test(input.url) && /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i.test(input.url))) && (undefined === input.email || "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email));
|
40
|
+
const $io3 = input => "string" === typeof input.name && (undefined === input.url || "string" === typeof input.url && (/\/|:/.test(input.url) && /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i.test(input.url)));
|
41
41
|
const $io4 = input => "string" === typeof input.url && (undefined === input.description || "string" === typeof input.description);
|
42
42
|
const $io5 = input => (undefined === input.schemas || "object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) && $io6(input.schemas)) && (undefined === input.securitySchemes || "object" === typeof input.securitySchemes && null !== input.securitySchemes && false === Array.isArray(input.securitySchemes) && $io19(input.securitySchemes));
|
43
43
|
const $io6 = input => Object.keys(input).every(key => {
|
@@ -241,13 +241,13 @@ class NestiaMigrateApplication {
|
|
241
241
|
path: _path + ".description",
|
242
242
|
expected: "(string | undefined)",
|
243
243
|
value: input.description
|
244
|
-
})) && (undefined === input.termsOfService || "string" === typeof input.termsOfService && (/^[a-
|
244
|
+
})) && (undefined === input.termsOfService || "string" === typeof input.termsOfService && (/\/|:/.test(input.termsOfService) && /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i.test(input.termsOfService) || $guard(_exceptionable, {
|
245
245
|
path: _path + ".termsOfService",
|
246
|
-
expected: "string & Format<\"
|
246
|
+
expected: "string & Format<\"uri\">",
|
247
247
|
value: input.termsOfService
|
248
248
|
})) || $guard(_exceptionable, {
|
249
249
|
path: _path + ".termsOfService",
|
250
|
-
expected: "((string & Format<\"
|
250
|
+
expected: "((string & Format<\"uri\">) | undefined)",
|
251
251
|
value: input.termsOfService
|
252
252
|
})) && (undefined === input.contact || ("object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) || $guard(_exceptionable, {
|
253
253
|
path: _path + ".contact",
|
@@ -274,15 +274,15 @@ class NestiaMigrateApplication {
|
|
274
274
|
path: _path + ".name",
|
275
275
|
expected: "(string | undefined)",
|
276
276
|
value: input.name
|
277
|
-
})) && (undefined === input.url || "string" === typeof input.url && (/^[a-
|
277
|
+
})) && (undefined === input.url || "string" === typeof input.url && (/\/|:/.test(input.url) && /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i.test(input.url) || $guard(_exceptionable, {
|
278
278
|
path: _path + ".url",
|
279
|
-
expected: "string & Format<\"
|
279
|
+
expected: "string & Format<\"uri\">",
|
280
280
|
value: input.url
|
281
281
|
})) || $guard(_exceptionable, {
|
282
282
|
path: _path + ".url",
|
283
|
-
expected: "((string & Format<\"
|
283
|
+
expected: "((string & Format<\"uri\">) | undefined)",
|
284
284
|
value: input.url
|
285
|
-
})) && (undefined === input.email || "string" === typeof input.email && (/^
|
285
|
+
})) && (undefined === input.email || "string" === typeof input.email && (/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) || $guard(_exceptionable, {
|
286
286
|
path: _path + ".email",
|
287
287
|
expected: "string & Format<\"email\">",
|
288
288
|
value: input.email
|
@@ -295,13 +295,13 @@ class NestiaMigrateApplication {
|
|
295
295
|
path: _path + ".name",
|
296
296
|
expected: "string",
|
297
297
|
value: input.name
|
298
|
-
})) && (undefined === input.url || "string" === typeof input.url && (/^[a-
|
298
|
+
})) && (undefined === input.url || "string" === type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*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i.test(input.url) || $guard(_exceptionable, {
|
299
299
|
path: _path + ".url",
|
300
|
-
expected: "string & Format<\"
|
300
|
+
expected: "string & Format<\"uri\">",
|
301
301
|
value: input.url
|
302
302
|
})) || $guard(_exceptionable, {
|
303
303
|
path: _path + ".url",
|
304
|
-
expected: "((string & Format<\"
|
304
|
+
expected: "((string & Format<\"uri\">) | undefined)",
|
305
305
|
value: input.url
|
306
306
|
}));
|
307
307
|
const $ao4 = (input, _path, _exceptionable = true) => ("string" === typeof input.url || $guard(_exceptionable, {
|
@@ -1495,7 +1495,7 @@ class NestiaMigrateApplication {
|
|
1495
1495
|
write() {
|
1496
1496
|
if (this.files === null) {
|
1497
1497
|
const program = this.analyze();
|
1498
|
-
this.files = MigrateProgrammer_1.MigrateProgrammer.write(
|
1498
|
+
this.files = MigrateProgrammer_1.MigrateProgrammer.write(program);
|
1499
1499
|
}
|
1500
1500
|
return this.files;
|
1501
1501
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NestiaMigrateApplication.js","sourceRoot":"","sources":["../src/NestiaMigrateApplication.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA+B;
|
1
|
+
{"version":3,"file":"NestiaMigrateApplication.js","sourceRoot":"","sources":["../src/NestiaMigrateApplication.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA+B;AAC/B,kDAA0B;AAE1B,2DAAwD;AACxD,iDAA8C;AAC9C,uEAAoE;AAKpE,MAAa,wBAAwB;IAKnC,YAAmB,OAAiB;QAoB7B,aAAQ,GACb,CAAC,QAA4C,EAAE,EAAE,CACjD,CAAC,MAAc,EAAQ,EAAE;YACvB,MAAM,OAAO,GAAoB,IAAI,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM,KAAK,GAAmB,qCAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAE/D,IA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CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAEM,OAAO;QACZ,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI;YACvB,IAAI,CAAC,OAAO,GAAG,qCAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,KAAK;QACV,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,MAAM,OAAO,GAAoB,IAAI,CAAC,OAAO,EAAE,CAAC;YAChD,IAAI,CAAC,KAAK,GAAG,qCAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CA4BF;AAnDD,4DAmDC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FileArchiver.js","sourceRoot":"","sources":["../../src/archivers/FileArchiver.ts"],"names":[],"mappings":";;;AAEA,IAAiB,YAAY,
|
1
|
+
{"version":3,"file":"FileArchiver.js","sourceRoot":"","sources":["../../src/archivers/FileArchiver.ts"],"names":[],"mappings":";;;AAEA,IAAiB,YAAY,CAgC5B;AAhCD,WAAiB,YAAY;IAMd,oBAAO,GAClB,CAAC,QAAmB,EAAE,EAAE,CACxB,CAAC,MAAc,EAAE,EAAE,CACnB,CAAC,KAAqB,EAAQ,EAAE;QAC9B,MAAM,OAAO,GAAgB,IAAI,GAAG,EAAE,CAAC;QACvC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YACnD,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QACxE,CAAC;IACH,CAAC,CAAC;IAEJ,MAAM,KAAK,GACT,CAAC,OAA+B,EAAE,EAAE,CACpC,CAAC,MAAc,EAAE,EAAE,CACnB,CAAC,OAAoB,EAAE,EAAE,CACzB,CAAC,IAAY,EAAQ,EAAE;QACrB,MAAM,QAAQ,GAAa,IAAI;aAC5B,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,KAAK,MAAM,CAAC,IAAI,QAAQ;YACtB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,KAAK;gBAC1B,IAAI,CAAC;oBACH,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;oBAC/B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACjB,CAAC;gBAAC,WAAM,CAAC,CAAA,CAAC;IAChB,CAAC,CAAC;AACN,CAAC,EAhCgB,YAAY,4BAAZ,YAAY,QAgC5B"}
|
package/lib/bundles/TEMPLATE.js
CHANGED
@@ -10,12 +10,12 @@ exports.TEMPLATE = [
|
|
10
10
|
{
|
11
11
|
"location": "",
|
12
12
|
"file": ".eslintrc.cjs",
|
13
|
-
"content": "module.exports = {\r\n
|
13
|
+
"content": "module.exports = {\r\n root: true,\r\n plugins: [\"@typescript-eslint\", \"deprecation\"],\r\n extends: [\"plugin:@typescript-eslint/recommended\"],\r\n parser: \"@typescript-eslint/parser\",\r\n parserOptions: {\r\n project: [\"tsconfig.json\", \"test/tsconfig.json\"],\r\n },\r\n overrides: [\r\n {\r\n files: [\"src/**/*.ts\", \"test/**/*.ts\"],\r\n rules: {\r\n \"@typescript-eslint/no-explicit-any\": \"off\",\r\n \"@typescript-eslint/no-floating-promises\": \"error\",\r\n \"@typescript-eslint/no-inferrable-types\": \"off\",\r\n \"@typescript-eslint/no-namespace\": \"off\",\r\n \"@typescript-eslint/no-non-null-assertion\": \"off\",\r\n \"@typescript-eslint/no-var-requires\": \"off\",\r\n \"deprecation/deprecation\": \"error\",\r\n },\r\n },\r\n ],\r\n};\r\n"
|
14
14
|
},
|
15
15
|
{
|
16
16
|
"location": "/.github",
|
17
17
|
"file": "dependabot.yml",
|
18
|
-
"content": "version: 2\r\nupdates:\r\n#######################################################\r\n - package-ecosystem: 'npm'\r\n directory: '/'\r\n schedule:\r\n interval: 'daily'\r\n open-pull-requests-limit: 25\r\n
|
18
|
+
"content": "version: 2\r\nupdates:\r\n#######################################################\r\n - package-ecosystem: 'npm'\r\n directory: '/'\r\n schedule:\r\n interval: 'daily'\r\n open-pull-requests-limit: 25\r\n allow:\r\n - dependency-name: \"@nestjs/*\"\r\n - dependency-name: \"@nestia/*\"\r\n - dependency-name: \"nestia\"\r\n - dependency-name: \"tstl\"\r\n - dependency-name: \"typia\"\r\n#######################################################\r\n - package-ecosystem: 'npm'\r\n directory: '/packages/api'\r\n schedule:\r\n interval: 'daily'\r\n open-pull-requests-limit: 25\r\n#######################################################"
|
19
19
|
},
|
20
20
|
{
|
21
21
|
"location": "/.github/workflows",
|
@@ -25,7 +25,7 @@ exports.TEMPLATE = [
|
|
25
25
|
{
|
26
26
|
"location": "",
|
27
27
|
"file": ".gitignore",
|
28
|
-
"content": ".git/\r\nbin/\r\ndist/\r\nlib/\r\nnode_modules/\r\npackages/api/lib/\r\n\r\npackage-lock.json"
|
28
|
+
"content": ".git/\r\nbin/\r\ndist/\r\nlib/\r\nnode_modules/\r\npackages/api/lib/\r\n\r\npackage-lock.json\r\npnpm-lock.yaml"
|
29
29
|
},
|
30
30
|
{
|
31
31
|
"location": "",
|
@@ -40,7 +40,7 @@ exports.TEMPLATE = [
|
|
40
40
|
{
|
41
41
|
"location": "/.vscode",
|
42
42
|
"file": "settings.json",
|
43
|
-
"content": "{\r\n \"editor.tabSize\": 2,\r\n \"
|
43
|
+
"content": "{\r\n \"editor.tabSize\": 2,\r\n \"editor.formatOnSave\": true,\r\n \"[javascript][typescript]\": {\r\n \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\r\n \"editor.codeActionsOnSave\": {\r\n \"source.fixAll.eslint\": \"explicit\"\r\n },\r\n }\r\n}"
|
44
44
|
},
|
45
45
|
{
|
46
46
|
"location": "",
|
@@ -55,7 +55,7 @@ exports.TEMPLATE = [
|
|
55
55
|
{
|
56
56
|
"location": "",
|
57
57
|
"file": "package.json",
|
58
|
-
"content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"test\": \"node bin/test\",\r\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\r\n \"------------------------BUILDS------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"------------------------WEBPACK------------------------\": \"\",\r\n \"webpack\": \"rimraf dist && webpack\",\r\n \"webpack:start\": \"cd dist && node dist/server\",\r\n \"------------------------DEPLOYS------------------------\": \"\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"start\": \"node lib/executable/server\",\r\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-
|
58
|
+
"content": "{\r\n \"private\": true,\r\n \"name\": \"@ORGANIZATION/PROJECT\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"Starter kit of Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"scripts\": {\r\n \"test\": \"node bin/test\",\r\n \"test:webpack\": \"npm run webpack && node bin/test/webpack.js\",\r\n \"------------------------BUILDS------------------------\": \"\",\r\n \"build\": \"npm run build:sdk && npm run build:main && npm run build:test\",\r\n \"build:api\": \"rimraf packages/api/lib && npm run build:sdk && tsc -p packages/api/tsconfig.json\",\r\n \"build:main\": \"rimraf lib && tsc\",\r\n \"build:sdk\": \"rimraf src/api/functional && nestia sdk\",\r\n \"build:swagger\": \"npx nestia swagger\",\r\n \"build:test\": \"rimraf bin && tsc -p test/tsconfig.json\",\r\n \"dev\": \"npm run build:test -- --watch\",\r\n \"eslint\": \"eslint src && eslint test\",\r\n \"eslint:fix\": \"eslint --fix src && eslint --fix test\",\r\n \"prepare\": \"ts-patch install && typia patch\",\r\n \"prettier\": \"prettier src --write && prettier test --write\",\r\n \"------------------------WEBPACK------------------------\": \"\",\r\n \"webpack\": \"rimraf dist && webpack\",\r\n \"webpack:start\": \"cd dist && node dist/server\",\r\n \"------------------------DEPLOYS------------------------\": \"\",\r\n \"package:api\": \"npm run build:swagger && npm run build:api && cd packages/api && npm publish\",\r\n \"start\": \"node lib/executable/server\",\r\n \"start:swagger\": \"ts-node src/executable/swagger.ts\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia-start\"\r\n },\r\n \"keywords\": [\r\n \"nestia\",\r\n \"template\",\r\n \"boilerplate\"\r\n ],\r\n \"author\": \"AUTHOR\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia-start/issues\"\r\n },\r\n \"homepage\": \"https://github.com/samchon/nestia-start#readme\",\r\n \"devDependencies\": {\r\n \"@nestia/e2e\": \"^0.4.1\",\r\n \"@nestia/sdk\": \"^2.4.5\",\r\n \"@trivago/prettier-plugin-sort-imports\": \"^4.3.0\",\r\n \"@types/cli\": \"^0.11.21\",\r\n \"@types/express\": \"^4.17.21\",\r\n \"@types/inquirer\": \"^8.2.5\",\r\n \"@types/node\": \"^18.11.0\",\r\n \"@types/uuid\": \"^8.3.4\",\r\n \"@typescript-eslint/eslint-plugin\": \"^6.19.1\",\r\n \"@typescript-eslint/parser\": \"^6.19.1\",\r\n \"chalk\": \"^4.1.0\",\r\n \"cli\": \"^1.0.1\",\r\n \"copy-webpack-plugin\": \"^11.0.0\",\r\n \"eslint-plugin-deprecation\": \"^2.0.0\",\r\n \"express\": \"^4.18.2\",\r\n \"nestia\": \"^5.1.2\",\r\n \"prettier\": \"^3.2.4\",\r\n \"prettier-plugin-prisma\": \"^5.0.0\",\r\n \"rimraf\": \"^3.0.2\",\r\n \"source-map-support\": \"^0.5.21\",\r\n \"swagger-ui-express\": \"^5.0.0\",\r\n \"ts-loader\": \"^9.5.1\",\r\n \"ts-node\": \"^10.9.1\",\r\n \"ts-patch\": \"^3.0.2\",\r\n \"typescript\": \"^5.3.2\",\r\n \"typescript-transform-paths\": \"^3.4.6\",\r\n \"webpack\": \"^5.89.0\",\r\n \"webpack-cli\": \"^5.1.4\",\r\n \"write-file-webpack-plugin\": \"^4.5.1\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/core\": \"^2.4.5\",\r\n \"@nestia/fetcher\": \"^2.4.5\",\r\n \"@nestjs/common\": \"^10.3.0\",\r\n \"@nestjs/core\": \"^10.3.0\",\r\n \"@nestjs/platform-fastify\": \"^10.3.0\",\r\n \"commander\": \"10.0.0\",\r\n \"dotenv\": \"^16.3.1\",\r\n \"dotenv-expand\": \"^10.0.0\",\r\n \"inquirer\": \"8.2.5\",\r\n \"serialize-error\": \"^4.1.0\",\r\n \"tstl\": \"^2.5.13\",\r\n \"typia\": \"^5.3.12\",\r\n \"uuid\": \"^9.0.0\"\r\n },\r\n \"stackblitz\": {\r\n \"startCommand\": \"npm run prepare && npm run build:test && npm run test\"\r\n }\r\n}"
|
59
59
|
},
|
60
60
|
{
|
61
61
|
"location": "/packages/api",
|
@@ -70,7 +70,7 @@ exports.TEMPLATE = [
|
|
70
70
|
{
|
71
71
|
"location": "/packages/api",
|
72
72
|
"file": "package.json",
|
73
|
-
"content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.
|
73
|
+
"content": "{\r\n \"name\": \"@ORGANIZATION/PROJECT-api\",\r\n \"version\": \"0.1.0\",\r\n \"description\": \"SDK library generated by Nestia\",\r\n \"main\": \"lib/index.js\",\r\n \"typings\": \"lib/index.d.ts\",\r\n \"scripts\": {\r\n \"build\": \"npm run build:sdk && npm run compile\",\r\n \"build:sdk\": \"rimraf ../../src/api/functional && cd ../.. && npx nestia sdk && cd packages/api\",\r\n \"compile\": \"rimraf lib && tsc\",\r\n \"deploy\": \"npm run build && npm publish\",\r\n \"prepare\": \"ts-patch install && typia patch\"\r\n },\r\n \"repository\": {\r\n \"type\": \"git\",\r\n \"url\": \"https://github.com/samchon/nestia\"\r\n },\r\n \"author\": \"Jeongho Nam\",\r\n \"license\": \"MIT\",\r\n \"bugs\": {\r\n \"url\": \"https://github.com/samchon/nestia/issues\"\r\n },\r\n \"homepage\": \"https://nestia.io\",\r\n \"files\": [\r\n \"lib\",\r\n \"swagger.json\",\r\n \"package.json\",\r\n \"README.md\"\r\n ],\r\n \"devDependencies\": {\r\n \"rimraf\": \"^5.0.5\",\r\n \"ts-node\": \"^10.9.2\",\r\n \"ts-patch\": \"^3.1.2\",\r\n \"typescript\": \"^5.3.3\"\r\n },\r\n \"dependencies\": {\r\n \"@nestia/fetcher\": \"^2.4.5\",\r\n \"typia\": \"^5.3.12\"\r\n }\r\n}"
|
74
74
|
},
|
75
75
|
{
|
76
76
|
"location": "/packages/api",
|
@@ -85,12 +85,12 @@ exports.TEMPLATE = [
|
|
85
85
|
{
|
86
86
|
"location": "",
|
87
87
|
"file": "prettier.config.js",
|
88
|
-
"content": "module.exports = {\r\n
|
88
|
+
"content": "module.exports = {\r\n // DEFAULT CONFIGURATIONS\r\n parser: \"typescript\",\r\n printWidth: 80,\r\n semi: true,\r\n tabWidth: 2,\r\n trailingComma: \"all\",\r\n\r\n // PLUG-IN CONFIGURATIONS\r\n plugins: [\"@trivago/prettier-plugin-sort-imports\"],\r\n importOrder: [\r\n \"<THIRD_PARTY_MODULES>\",\r\n \"^@ORGANIZATION/PROJECT-api(.*)$\",\r\n \"^[./]\",\r\n ],\r\n importOrderSeparation: true,\r\n importOrderSortSpecifiers: true,\r\n importOrderParserPlugins: [\"decorators-legacy\", \"typescript\"],\r\n};\r\n"
|
89
89
|
},
|
90
90
|
{
|
91
91
|
"location": "",
|
92
92
|
"file": "README.md",
|
93
|
-
"content": "# Nestia Template\r\n## Outline\r\n[](https://github.com/samchon/nestia-start/actions?query=workflow%3Abuild)\r\n\r\nA template repository for backend projects using [nestia](https://github.com/samchon/nestia).\r\n\r\nYou can create a new project from this boilerplate by running below command:\r\n\r\n```bash\r\nnpx nestia start <directory>\r\n```\r\n\r\nFor reference, this is a minimal boilerplate project concentrating only on [nestia](https://github.com/samchon/nestia) SDK generation. \r\n\r\nIf you wanna much detailed boilerplate project, visit [`@samchon/backend`](https://github.com/samchon/backend).\r\n\r\n\r\n\r\n\r\n## Directories and Files\r\nThis template project has categorized directories like below.\r\n\r\nAs you can see from the below, all of the Backend source files are placed into the [src](src/) directory. When you build the TypeScript source files, compiled files would be placed into the `lib` directory following the [tsconfig.json](tsconfig.json) configuration. Otherwise you build client [SDK](#32-sdk) library for npm publishing and their compiled files would be placed into the [packages](packages) directory.\r\n\r\n - [packages/api/](packages/api): SDK module built by `npm run build:api`\r\n - [src/](src): Backend source directory\r\n - [src/api/](src/api/): Client SDK that would be published to the `@ORGANIZATION/PROJECT-api`\r\n - [**src/api/functional/**](src/api/functional/): API functions generated by the [`nestia`](https://github.com/samchon/nestia)\r\n - [**src/api/structures/**](src/api/structures/): DTO structures\r\n - [src/controllers/](src/controllers/): Controller classes of the Main Program\r\n - [**test/**](test): Test Automation Program\r\n - [nestia.config.ts](nestia.config.ts): Configuration file of [`nestia`](https://github.com/samchon/nestia)\r\n - [package.json](package.json): NPM configuration\r\n - [tsconfig.json](tsconfig.json): TypeScript configuration for the main program\r\n - [tsconfig.api.json](tsconfig.api.json): TypeScript configuration for the SDK generation\r\n\r\n\r\n\r\n\r\n## NPM Run Commands\r\nList of the run commands defined in the [package.json](package.json) are like below:\r\n\r\n - `build`: Build everything\r\n - `build:api`: Build client SDK libray for the client developers\r\n - `build:main`: Build main program (`src` directory)\r\n - `build:sdk`: Build SDK into main program only\r\n - `build:swagger`: Build Swagger Documents\r\n - `build:test` Build test automation program (`test` directory)\r\n - `dev`: Incremental build for development (test program)\r\n - `eslint` & `eslint:fix` & `prettier`: Prettier and ESLint execution\r\n - `start`: Start local NestJS server\r\n - `test`: Run test automation program\r\n\r\n\r\n\r\n\r\n## Specialization\r\nTransform this template project to be yours.\r\n\r\nWhen you've created a new backend project through this template project, you can specialize it to be suitable for you by changing some words. Replace below words through IDE specific function like `Edit > Replace in Files` (*Ctrl + Shift + H*), who've been supported by the VSCode.\r\n\r\n| Before | After\r\n|-----------------|----------------------------------------\r\n| ORGANIZATION | Your account or corporation name\r\n| PROJECT | Your own project name\r\n| AUTHOR | Author name\r\n| https://github.com/samchon/nestia-start | Your repository URL\r\n\r\n\r\n\r\n\r\n## Test Driven Development\r\nWith [nestia](https://github.com/samchon/nestia) helps to accomplish TDD (Test Driven Development). \r\n\r\nJust define DTOs and API controllers' methods (only declarations) first. After the definitions, and build SDK (Software Development Kit) through [nestia](https://github.com/samchon/nestia) (`npm run build:sdk`). After buildling those SDK, develop test automation program using the SDK, following use-case scenarios in the framework of client side.\r\n\r\nDuring the test automation program development, you can find that which API is mis-designed or which requirement analysis is not exact. Development of the main program must be the last step after such validation process during TDD.\r\n\r\n> Visit the [samchon/backend](https://github.com/samchon/backend), then you may find much detailed story about this TDD.\r\n>\r\n> 1. Definitions\r\n> 2. SDK\r\n> 3. Test Automation Program\r\n> 4. Main Program\r\n\r\n```typescript\r\nimport typia from \"typia\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api/lib/index\";\r\nimport { IBbsArticle } from \"@ORGANIZATION/PROJECT-api/lib/structures/bbs/IBbsArticle\";\r\n\r\nimport { ArrayUtil } from \"../../../../utils/ArrayUtil\";\r\nimport { GaffComparator } from \"../../../internal/GaffComparator\";\r\nimport { RandomGenerator } from \"../../../internal/RandomGenerator\";\r\nimport { validate_index_sort } from \"../../../internal/validate_index_sort\";\r\n\r\nexport async function test_api_bbs_article_index_sort(\r\n connection: api.IConnection,\r\n): Promise<void> {\r\n // GENERATE 100 ARTICLES\r\n const section: string = \"general\";\r\n const articles: IBbsArticle[] = await ArrayUtil.asyncRepeat(100, () =>\r\n api.functional.bbs.articles.store(connection, section, {\r\n writer: RandomGenerator.name(),\r\n title: RandomGenerator.paragraph(),\r\n body: RandomGenerator.content(),\r\n format: \"txt\",\r\n files: [],\r\n password: RandomGenerator.alphabets(8),\r\n }),\r\n );\r\n typia.assertEquals(articles);\r\n\r\n // PREPARE VALIDATOR\r\n const validator = validate_index_sort(\"BbsArticleProvider.index()\")(\r\n (input: IBbsArticle.IRequest) =>\r\n api.functional.bbs.articles.index(connection, section, input),\r\n );\r\n\r\n // DO VALIDATE\r\n const components = [\r\n validator(\"created_at\")(GaffComparator.dates((x) => x.created_at)),\r\n validator(\"updated_at\")(GaffComparator.dates((x) => x.updated_at)),\r\n validator(\"title\")(GaffComparator.strings((x) => x.title)),\r\n validator(\"writer\")(GaffComparator.strings((x) => x.writer)),\r\n validator(\r\n \"writer\",\r\n \"title\",\r\n )(GaffComparator.strings((x) => [x.writer, x.title])),\r\n ];\r\n for (const comp of components) {\r\n await comp(\"+\");\r\n await comp(\"-\");\r\n }\r\n}\r\n```"
|
94
94
|
},
|
95
95
|
{
|
96
96
|
"location": "/src/executable",
|
@@ -110,7 +110,7 @@ exports.TEMPLATE = [
|
|
110
110
|
{
|
111
111
|
"location": "/src",
|
112
112
|
"file": "MyConfiguration.ts",
|
113
|
-
"content": "import fs from \"fs\";\r\nimport path from \"path\";\r\n\r\nimport { MyGlobal } from \"./MyGlobal\";\r\n\r\nexport namespace MyConfiguration {\r\n export const API_PORT = () => Number(MyGlobal.env.PROJECT_API_PORT);\r\n\r\n export const ROOT = (() => {\r\n const splitted: string[] = __dirname.split(path.sep);\r\n return splitted.at(-1) === \"src\" && splitted.at(-2) === \"bin\"\r\n ? path.resolve(__dirname + \"/../..\")\r\n : fs.existsSync(__dirname + \"/.env\")\r\n
|
113
|
+
"content": "import fs from \"fs\";\r\nimport path from \"path\";\r\n\r\nimport { MyGlobal } from \"./MyGlobal\";\r\n\r\nexport namespace MyConfiguration {\r\n export const API_PORT = () => Number(MyGlobal.env.PROJECT_API_PORT);\r\n\r\n export const ROOT = (() => {\r\n const splitted: string[] = __dirname.split(path.sep);\r\n return splitted.at(-1) === \"src\" && splitted.at(-2) === \"bin\"\r\n ? path.resolve(__dirname + \"/../..\")\r\n : fs.existsSync(__dirname + \"/.env\")\r\n ? __dirname\r\n : path.resolve(__dirname + \"/..\");\r\n })();\r\n}\r\n"
|
114
114
|
},
|
115
115
|
{
|
116
116
|
"location": "/src",
|
@@ -140,7 +140,7 @@ exports.TEMPLATE = [
|
|
140
140
|
{
|
141
141
|
"location": "/test",
|
142
142
|
"file": "index.ts",
|
143
|
-
"content": "import { DynamicExecutor } from \"@nestia/e2e\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api\";\r\n\r\nimport { MyBackend } from \"../src/MyBackend\";\r\nimport { MyConfiguration } from \"../src/MyConfiguration\";\r\nimport { MyGlobal } from \"../src/MyGlobal\";\r\nimport { ArgumentParser } from \"./helpers/ArgumentParser\";\r\n\r\ninterface IOptions {\r\n include?: string[];\r\n exclude?: string[];\r\n}\r\n\r\nconst getOptions = () =>\r\n ArgumentParser.parse<IOptions>(async (command, prompt, action) => {\r\n // command.option(\"--mode <string>\", \"target mode\");\r\n // command.option(\"--reset <true|false>\", \"reset local DB or not\");\r\n command.option(\"--include <string...>\", \"include feature files\");\r\n command.option(\"--exclude <string...>\", \"exclude feature files\");\r\n\r\n prompt;\r\n\r\n return action(async (options) => {\r\n // if (typeof options.reset === \"string\")\r\n // options.reset = options.reset === \"true\";\r\n // options.mode ??= await prompt.select(\"mode\")(\"Select mode\")([\r\n // \"LOCAL\",\r\n // \"DEV\",\r\n // \"REAL\",\r\n // ]);\r\n // options.reset ??= await prompt.boolean(\"reset\")(\"Reset local DB\");\r\n return options as IOptions;\r\n });\r\n });\r\n\r\nasync function main(): Promise<void> {\r\n const options: IOptions = await getOptions();\r\n MyGlobal.testing = true;\r\n\r\n // BACKEND SERVER\r\n const backend: MyBackend = new MyBackend();\r\n await backend.open();\r\n\r\n //----\r\n // CLINET CONNECTOR\r\n //----\r\n // DO TEST\r\n const connection: api.IConnection = {\r\n host: `http://127.0.0.1:${MyConfiguration.API_PORT()}`,\r\n };\r\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\r\n prefix: \"test\",\r\n parameters: () => [\r\n {\r\n host: connection.host,\r\n encryption: connection.encryption,\r\n },\r\n ],\r\n filter: (func) =>\r\n (!options.include?.length ||\r\n (options.include ?? []).some((str) => func.includes(str))) &&\r\n (!options.exclude?.length ||\r\n (options.exclude ?? []).every((str) => !func.includes(str))),\r\n })(__dirname + \"/features\");\r\n\r\n await backend.close();\r\n\r\n const failures: DynamicExecutor.IReport.IExecution[] =\r\n report.executions.filter((exec) => exec.error !== null);\r\n if (failures.length === 0) {\r\n console.log(\"Success\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n } else {\r\n for (const f of failures) console.log(f.error);\r\n process.exit(-1);\r\n }\r\n
|
143
|
+
"content": "import { DynamicExecutor } from \"@nestia/e2e\";\r\n\r\nimport api from \"@ORGANIZATION/PROJECT-api\";\r\n\r\nimport { MyBackend } from \"../src/MyBackend\";\r\nimport { MyConfiguration } from \"../src/MyConfiguration\";\r\nimport { MyGlobal } from \"../src/MyGlobal\";\r\nimport { ArgumentParser } from \"./helpers/ArgumentParser\";\r\n\r\ninterface IOptions {\r\n include?: string[];\r\n exclude?: string[];\r\n}\r\n\r\nconst getOptions = () =>\r\n ArgumentParser.parse<IOptions>(async (command, prompt, action) => {\r\n // command.option(\"--mode <string>\", \"target mode\");\r\n // command.option(\"--reset <true|false>\", \"reset local DB or not\");\r\n command.option(\"--include <string...>\", \"include feature files\");\r\n command.option(\"--exclude <string...>\", \"exclude feature files\");\r\n\r\n prompt;\r\n\r\n return action(async (options) => {\r\n // if (typeof options.reset === \"string\")\r\n // options.reset = options.reset === \"true\";\r\n // options.mode ??= await prompt.select(\"mode\")(\"Select mode\")([\r\n // \"LOCAL\",\r\n // \"DEV\",\r\n // \"REAL\",\r\n // ]);\r\n // options.reset ??= await prompt.boolean(\"reset\")(\"Reset local DB\");\r\n return options as IOptions;\r\n });\r\n });\r\n\r\nasync function main(): Promise<void> {\r\n const options: IOptions = await getOptions();\r\n MyGlobal.testing = true;\r\n\r\n // BACKEND SERVER\r\n const backend: MyBackend = new MyBackend();\r\n await backend.open();\r\n\r\n //----\r\n // CLINET CONNECTOR\r\n //----\r\n // DO TEST\r\n const connection: api.IConnection = {\r\n host: `http://127.0.0.1:${MyConfiguration.API_PORT()}`,\r\n };\r\n const report: DynamicExecutor.IReport = await DynamicExecutor.validate({\r\n prefix: \"test\",\r\n parameters: () => [\r\n {\r\n host: connection.host,\r\n encryption: connection.encryption,\r\n },\r\n ],\r\n filter: (func) =>\r\n (!options.include?.length ||\r\n (options.include ?? []).some((str) => func.includes(str))) &&\r\n (!options.exclude?.length ||\r\n (options.exclude ?? []).every((str) => !func.includes(str))),\r\n })(__dirname + \"/features\");\r\n\r\n await backend.close();\r\n\r\n const failures: DynamicExecutor.IReport.IExecution[] =\r\n report.executions.filter((exec) => exec.error !== null);\r\n if (failures.length === 0) {\r\n console.log(\"Success\");\r\n console.log(\"Elapsed time\", report.time.toLocaleString(), `ms`);\r\n } else {\r\n for (const f of failures) console.log(f.error);\r\n process.exit(-1);\r\n }\r\n\r\n console.log(\r\n [\r\n `All: #${report.executions.length}`,\r\n `Success: #${report.executions.length - failures.length}`,\r\n `Failed: #${failures.length}`,\r\n ].join(\"\\n\"),\r\n );\r\n}\r\nmain().catch((exp) => {\r\n console.log(exp);\r\n process.exit(-1);\r\n});\r\n"
|
144
144
|
},
|
145
145
|
{
|
146
146
|
"location": "/test",
|
@@ -160,7 +160,7 @@ exports.TEMPLATE = [
|
|
160
160
|
{
|
161
161
|
"location": "",
|
162
162
|
"file": "webpack.config.js",
|
163
|
-
"content": "const path = require(\"path\");\r\n\r\nconst CopyWebpackPlugin = require(\"copy-webpack-plugin\");\r\nconst WriteFilePlugin = require(\"write-file-webpack-plugin\");\r\nconst { IgnorePlugin } = require(\"webpack\");\r\n\r\nconst lazyImports = [\r\n \"@fastify/static\",\r\n \"@fastify/view\",\r\n \"@nestjs/microservices\",\r\n \"@nestjs/websockets\",\r\n \"class-transformer\",\r\n \"class-validator\",\r\n];\r\n\r\n// @reference https://tech-blog.s-yoshiki.com/entry/297\r\nmodule.exports = {\r\n // CUSTOMIZE HERE\r\n entry: {\r\n server: \"./src/executable/server.ts\",\r\n },\r\n output: {\r\n path: path.join(__dirname, \"dist\"),\r\n filename: \"[name].js\",\r\n },\r\n optimization: {\r\n minimize: true,\r\n },\r\n\r\n // JUST KEEP THEM\r\n mode: \"production\",\r\n target: \"node\",\r\n module: {\r\n rules: [\r\n {\r\n test: /\\.ts$/,\r\n exclude: /node_modules/,\r\n loader: \"ts-loader\",\r\n },\r\n ],\r\n },\r\n resolve: {\r\n extensions: [\".tsx\", \".ts\", \".js\"],\r\n },\r\n plugins: [\r\n new CopyWebpackPlugin({\r\n patterns: [\r\n {\r\n from: \".env\",\r\n to: \"[name][ext]\",\r\n },\r\n // {\r\n // from: \"./node_modules/.prisma/client/*.node\",\r\n // to: () => Promise.resolve(\"[path][name][ext]\"),\r\n // },\r\n ],\r\n }),\r\n new WriteFilePlugin(),\r\n new IgnorePlugin({\r\n checkResource: (resource) => {\r\n if (lazyImports.some((modulo) => resource.startsWith(modulo))) {\r\n try {\r\n require.resolve(resource);\r\n } catch (err) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n }),\r\n ],\r\n};\r\n"
|
163
|
+
"content": "const path = require(\"path\");\r\n\r\nconst CopyWebpackPlugin = require(\"copy-webpack-plugin\");\r\nconst WriteFilePlugin = require(\"write-file-webpack-plugin\");\r\nconst { IgnorePlugin } = require(\"webpack\");\r\n\r\nconst lazyImports = [\r\n \"@fastify/static\",\r\n \"@fastify/view\",\r\n \"@nestjs/microservices\",\r\n \"@nestjs/websockets\",\r\n \"class-transformer\",\r\n \"class-validator\",\r\n];\r\n\r\n// @reference https://tech-blog.s-yoshiki.com/entry/297\r\nmodule.exports = {\r\n // CUSTOMIZE HERE\r\n entry: {\r\n server: \"./src/executable/server.ts\",\r\n },\r\n output: {\r\n path: path.join(__dirname, \"dist\"),\r\n filename: \"[name].js\",\r\n },\r\n optimization: {\r\n minimize: true,\r\n },\r\n\r\n // JUST KEEP THEM\r\n mode: \"production\",\r\n target: \"node\",\r\n module: {\r\n rules: [\r\n {\r\n test: /\\.ts$/,\r\n exclude: /node_modules/,\r\n loader: \"ts-loader\",\r\n },\r\n ],\r\n },\r\n resolve: {\r\n extensions: [\".tsx\", \".ts\", \".js\"],\r\n },\r\n plugins: [\r\n new CopyWebpackPlugin({\r\n patterns: [\r\n {\r\n from: \".env\",\r\n to: \"[name][ext]\",\r\n },\r\n // {\r\n // from: \"./node_modules/.prisma/client/*.node\",\r\n // to: () => Promise.resolve(\"[path][name][ext]\"),\r\n // globOptions: {\r\n // dot: true,\r\n // },\r\n // },\r\n ],\r\n }),\r\n new WriteFilePlugin(),\r\n new IgnorePlugin({\r\n checkResource: (resource) => {\r\n if (lazyImports.some((modulo) => resource.startsWith(modulo))) {\r\n try {\r\n require.resolve(resource);\r\n } catch (err) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n }),\r\n ],\r\n};\r\n"
|
164
164
|
}
|
165
165
|
];
|
166
166
|
//# sourceMappingURL=TEMPLATE.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TEMPLATE.js","sourceRoot":"","sources":["../../src/bundles/TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACpB;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,+CAA+C;KAC7D;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,
|
1
|
+
{"version":3,"file":"TEMPLATE.js","sourceRoot":"","sources":["../../src/bundles/TEMPLATE.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACpB;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,+CAA+C;KAC7D;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,m1BAAm1B;KACj2B;IACD;QACI,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,gBAAgB;QACxB,SAAS,EAAE,qrBAAqrB;KACnsB;IACD;QACI,UAAU,EAAE,oBAAoB;QAChC,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,yrBAAyrB;KACvsB;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,iHAAiH;KAC/H;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,iBAAiB;QACzB,SAAS,EAAE,iIAAiI;KAC/I;IACD;QACI,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,irCAAirC;KAC/rC;IACD;QACI,UAAU,EAAE,UAAU;QACtB,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,qRAAqR;KACnS;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,inCAAinC;KAC/nC;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,kBAAkB;QAC1B,SAAS,EAAE,oqBAAoqB;KAClrB;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE,mvHAAmvH;KACjwH;IACD;QACI,UAAU,EAAE,eAAe;QAC3B,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,2CAA2C;KACzD;IACD;QACI,UAAU,EAAE,eAAe;QAC3B,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,8mCAA8mC;KAC5nC;IACD;QACI,U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ACD;QACI,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,UAAU;QAClB,SAAS,EAAE,64FAA64F;KAC35F;IACD;QACI,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,yJAAyJ;KACvK;IACD;QACI,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,80CAA80C;KAC51C;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,y8XAAy8X;KACv9X;IACD;QACI,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,mBAAmB;QAC3B,SAAS,EAAE,g1DAAg1D;KAC91D;CACJ,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/executable/bundle.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kEAA+B;AAC/B,4CAAoB;AAIpB,MAAM,IAAI,GAAG,SAAS,GAAG,QAAQ,CAAC;AAClC,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAChC,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAEtC,MAAM,KAAK,GAAG,GAAwB,EAAE;
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../src/executable/bundle.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kEAA+B;AAC/B,4CAAoB;AAIpB,MAAM,IAAI,GAAG,SAAS,GAAG,QAAQ,CAAC;AAClC,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAChC,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAEtC,MAAM,KAAK,GAAG,GAAwB,EAAE;IACtC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAEpC,mBAAmB;IACnB,IAAI,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QACzB,MAAM,YAAE,CAAC,QAAQ,CA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AAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACxC,IAAI;gBACJ,OAAO;aACR,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAG,CAAO,UAA0B,EAAiB,EAAE;IAClE,MAAM,IAAI,GAAW,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACzD,MAAM,OAAO,GAAW,2BAA2B,IAAI,EAAE,CAAC;IAE1D,IAAI,CAAC;QACH,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,cAAc,CAAC,CAAC;IACjD,CAAC;IAAC,WAAM,CAAC,CAAA,CAAC;IACV,MAAM,YAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,0BAA0B,EAAE,OAAO,CAAC,CAAC;AAC1E,CAAC,CAAA,CAAC;AAEF,MAAM,IAAI,GAAG,GAAwB,EAAE;IACrC,MAAM,UAAU,GAAmB,EAAE,CAAC;IACtC,MAAM,KAAK,EAAE,CAAC;IACd,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC;IACpC,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC,CAAA,CAAC;AACF,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC,CAAC"}
|
@@ -8,11 +8,11 @@ const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
9
9
|
const NestiaMigrateApplication_1 = require("../NestiaMigrateApplication");
|
10
10
|
const SetupWizard_1 = require("../utils/SetupWizard");
|
11
|
-
const USAGE = `Wrong command has been detected. Use like below:
|
12
|
-
|
13
|
-
npx @nestia/migrate [input] [output]
|
14
|
-
|
15
|
-
ex) npx @nestia/migrate swagger.json my-new-project
|
11
|
+
const USAGE = `Wrong command has been detected. Use like below:
|
12
|
+
|
13
|
+
npx @nestia/migrate [input] [output]
|
14
|
+
|
15
|
+
ex) npx @nestia/migrate swagger.json my-new-project
|
16
16
|
`;
|
17
17
|
function halt(desc) {
|
18
18
|
console.error(desc);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/executable/migrate.ts"],"names":[],"mappings":";;;;;;AACA,4CAAoB;AACpB,gDAAwB;AAExB,0EAAuE;AAEvE,sDAAmD;AAEnD,MAAM,KAAK,GAAG;;;;;CAKb,CAAC;AAEF,SAAS,IAAI,CAAC,IAAY;
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/executable/migrate.ts"],"names":[],"mappings":";;;;;;AACA,4CAAoB;AACpB,gDAAwB;AAExB,0EAAuE;AAEvE,sDAAmD;AAEnD,MAAM,KAAK,GAAG;;;;;CAKb,CAAC;AAEF,SAAS,IAAI,CAAC,IAAY;IACxB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,IAAI,GAAG,CAAC,IAAc,EAAE,EAAE;IAC9B,MAAM,OAAO,GAAG,CAAC,GAAuB,EAAE,EAAE,CAC1C,GAAG,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5D,MAAM,KAAK,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,MAAM,MAAM,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpD,qBAAq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AAE,MAAM,CAAC;KACtE,CAAC,CAAC,MAAM,CAAC,CAAC;IAEX,cAAc;IACd,yBAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC,CAAC;AACF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
@@ -1,7 +1,8 @@
|
|
1
|
+
import ts from "typescript";
|
1
2
|
import { IMigrateController } from "../structures/IMigrateController";
|
2
3
|
import { ISwagger } from "../structures/ISwagger";
|
3
4
|
import { ISwaggerComponents } from "../structures/ISwaggerComponents";
|
4
5
|
export declare namespace ControllerProgrammer {
|
5
6
|
const analyze: (swagger: ISwagger) => IMigrateController[];
|
6
|
-
const write: (components: ISwaggerComponents) => (controller: IMigrateController) =>
|
7
|
+
const write: (components: ISwaggerComponents) => (controller: IMigrateController) => ts.Statement[];
|
7
8
|
}
|
@@ -1,12 +1,20 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
exports.ControllerProgrammer = void 0;
|
7
|
+
const typescript_1 = __importDefault(require("typescript"));
|
8
|
+
const FilePrinter_1 = require("../utils/FilePrinter");
|
4
9
|
const MapUtil_1 = require("../utils/MapUtil");
|
5
10
|
const StringUtil_1 = require("../utils/StringUtil");
|
6
11
|
const ImportProgrammer_1 = require("./ImportProgrammer");
|
7
12
|
const RouteProgrammer_1 = require("./RouteProgrammer");
|
8
13
|
var ControllerProgrammer;
|
9
14
|
(function (ControllerProgrammer) {
|
15
|
+
/* -----------------------------------------------------------
|
16
|
+
ANALYZERS
|
17
|
+
----------------------------------------------------------- */
|
10
18
|
ControllerProgrammer.analyze = (swagger) => {
|
11
19
|
const dict = new Map();
|
12
20
|
// GATHER ROUTES
|
@@ -90,28 +98,23 @@ var ControllerProgrammer;
|
|
90
98
|
}
|
91
99
|
}
|
92
100
|
};
|
101
|
+
/* -----------------------------------------------------------
|
102
|
+
WRITERS
|
103
|
+
----------------------------------------------------------- */
|
93
104
|
ControllerProgrammer.write = (components) => (controller) => {
|
94
|
-
const importer = new ImportProgrammer_1.ImportProgrammer(
|
95
|
-
const
|
96
|
-
|
97
|
-
`@${importer.external({
|
105
|
+
const importer = new ImportProgrammer_1.ImportProgrammer();
|
106
|
+
const $class = typescript_1.default.factory.createClassDeclaration([
|
107
|
+
typescript_1.default.factory.createDecorator(typescript_1.default.factory.createCallExpression(typescript_1.default.factory.createIdentifier(importer.external({
|
98
108
|
library: "@nestjs/common",
|
99
109
|
instance: "Controller",
|
100
|
-
})
|
101
|
-
|
102
|
-
|
103
|
-
.map((r) => RouteProgrammer_1.RouteProgrammer.write(components)(references)(importer)(r)
|
104
|
-
.split("\n")
|
105
|
-
.map((l) => ` ${l}`)
|
106
|
-
.join("\n"))
|
107
|
-
.join("\n\n"),
|
108
|
-
`}`,
|
109
|
-
].join("\n");
|
110
|
+
})), [], [typescript_1.default.factory.createStringLiteral(controller.path)])),
|
111
|
+
typescript_1.default.factory.createToken(typescript_1.default.SyntaxKind.ExportKeyword),
|
112
|
+
], controller.name, [], [], controller.routes.map(RouteProgrammer_1.RouteProgrammer.write(components)(importer)));
|
110
113
|
return [
|
111
|
-
...importer.
|
112
|
-
...(importer.empty() ? [] : [
|
113
|
-
|
114
|
-
]
|
114
|
+
...importer.toStatements((ref) => `${"../".repeat(StringUtil_1.StringUtil.splitWithNormalization(controller.location).length - 1)}api/structures/${ref}`),
|
115
|
+
...(importer.empty() ? [] : [FilePrinter_1.FilePrinter.enter()]),
|
116
|
+
$class,
|
117
|
+
];
|
115
118
|
};
|
116
119
|
})(ControllerProgrammer || (exports.ControllerProgrammer = ControllerProgrammer = {}));
|
117
120
|
//# sourceMappingURL=ControllerProgrammer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ControllerProgrammer.js","sourceRoot":"","sources":["../../src/programmers/ControllerProgrammer.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ControllerProgrammer.js","sourceRoot":"","sources":["../../src/programmers/ControllerProgrammer.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAM5B,sDAAmD;AACnD,8CAA2C;AAC3C,oDAAiD;AACjD,yDAAsD;AACtD,uDAAoD;AAEpD,IAAiB,oBAAoB,CA8IpC;AA9ID,WAAiB,oBAAoB;IACnC;;kEAE8D;IACjD,4BAAO,GAAG,CAAC,OAAiB,EAAwB,EAAE;QACjE,MAAM,IAAI,GAAiC,IAAI,GAAG,EAAE,CAAC;QAErD,gBAAgB;QAChB,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC/D,sBAAsB;YACtB,MAAM,QAAQ,GAAW,uBAAU,CAAC,sBAAsB,CAAC,IAAI,CAAC;iBAC7D,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;iBACjD,IAAI,CAAC,GAAG,CAAC,CAAC;YACb,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC;gBAAE,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YAEpE,sCAAsC;YACtC,MAAM,MAAM,GAAoB,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YACvE,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;gBACzD,MAAM,CAAC,GAAyB,iCAAe,CAAC,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ISwagger } from "../structures/ISwagger";
|
1
|
+
import ts from "typescript";
|
3
2
|
import { ISwaggerComponents } from "../structures/ISwaggerComponents";
|
3
|
+
import { ImportProgrammer } from "./ImportProgrammer";
|
4
4
|
export declare namespace DtoProgrammer {
|
5
|
-
|
6
|
-
|
5
|
+
interface IModule {
|
6
|
+
name: string;
|
7
|
+
children: Map<string, IModule>;
|
8
|
+
programmer: null | ((importer: ImportProgrammer) => ts.TypeAliasDeclaration);
|
9
|
+
}
|
10
|
+
const write: (components: ISwaggerComponents) => Map<string, IModule>;
|
7
11
|
}
|