@nestia/migrate 10.0.1 → 11.0.0-dev.20260305
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/LICENSE +21 -0
- package/README.md +93 -93
- package/package.json +32 -46
- package/src/NestiaMigrateApplication.ts +161 -159
- package/src/analyzers/NestiaMigrateControllerAnalyzer.ts +51 -51
- package/src/archivers/NestiaMigrateFileArchiver.ts +28 -28
- package/src/bundles/NEST_TEMPLATE.ts +48 -48
- package/src/bundles/SDK_TEMPLATE.ts +21 -21
- package/src/executable/NestiaMigrateCommander.ts +98 -98
- package/src/executable/NestiaMigrateInquirer.ts +106 -106
- package/src/executable/bundle.js +125 -125
- package/src/executable/migrate.ts +7 -7
- package/src/factories/TypeLiteralFactory.ts +57 -57
- package/src/index.ts +4 -4
- package/src/module.ts +6 -2
- package/src/programmers/NestiaMigrateApiFileProgrammer.ts +55 -55
- package/src/programmers/NestiaMigrateApiFunctionProgrammer.ts +347 -344
- package/src/programmers/NestiaMigrateApiNamespaceProgrammer.ts +517 -514
- package/src/programmers/NestiaMigrateApiProgrammer.ts +107 -107
- package/src/programmers/NestiaMigrateApiSimulationProgrammer.ts +308 -309
- package/src/programmers/NestiaMigrateApiStartProgrammer.ts +197 -198
- package/src/programmers/NestiaMigrateDtoProgrammer.ts +98 -98
- package/src/programmers/NestiaMigrateE2eFileProgrammer.ts +153 -153
- package/src/programmers/NestiaMigrateE2eProgrammer.ts +48 -48
- package/src/programmers/NestiaMigrateImportProgrammer.ts +118 -118
- package/src/programmers/NestiaMigrateNestControllerProgrammer.ts +69 -69
- package/src/programmers/NestiaMigrateNestMethodProgrammer.ts +409 -406
- package/src/programmers/NestiaMigrateNestModuleProgrammer.ts +65 -65
- package/src/programmers/NestiaMigrateNestProgrammer.ts +88 -88
- package/src/programmers/NestiaMigrateSchemaProgrammer.ts +465 -522
- package/src/structures/INestiaMigrateConfig.ts +19 -19
- package/src/structures/INestiaMigrateContext.ts +9 -9
- package/src/structures/INestiaMigrateController.ts +8 -8
- package/src/structures/INestiaMigrateDto.ts +8 -8
- package/src/structures/INestiaMigrateFile.ts +5 -5
- package/src/structures/INestiaMigrateProgram.ts +11 -11
- package/src/structures/INestiaMigrateSchema.ts +4 -4
- package/src/utils/FilePrinter.ts +49 -49
- package/src/utils/MapUtil.ts +13 -13
- package/src/utils/SetupWizard.ts +12 -12
- package/src/utils/StringUtil.ts +114 -113
- package/src/utils/openapi-down-convert/RefVisitor.ts +134 -134
- package/src/utils/openapi-down-convert/converter.ts +536 -536
- package/lib/NestiaMigrateApplication.d.ts +0 -24
- package/lib/NestiaMigrateApplication.js +0 -18757
- package/lib/NestiaMigrateApplication.js.map +0 -1
- package/lib/analyzers/NestiaMigrateControllerAnalyzer.d.ts +0 -5
- package/lib/analyzers/NestiaMigrateControllerAnalyzer.js +0 -46
- package/lib/analyzers/NestiaMigrateControllerAnalyzer.js.map +0 -1
- package/lib/archivers/NestiaMigrateFileArchiver.d.ts +0 -8
- package/lib/archivers/NestiaMigrateFileArchiver.js +0 -36
- package/lib/archivers/NestiaMigrateFileArchiver.js.map +0 -1
- package/lib/bundles/NEST_TEMPLATE.d.ts +0 -1
- package/lib/bundles/NEST_TEMPLATE.js +0 -55
- package/lib/bundles/NEST_TEMPLATE.js.map +0 -1
- package/lib/bundles/SDK_TEMPLATE.d.ts +0 -1
- package/lib/bundles/SDK_TEMPLATE.js +0 -27
- package/lib/bundles/SDK_TEMPLATE.js.map +0 -1
- package/lib/executable/NestiaMigrateCommander.d.ts +0 -4
- package/lib/executable/NestiaMigrateCommander.js +0 -125
- package/lib/executable/NestiaMigrateCommander.js.map +0 -1
- package/lib/executable/NestiaMigrateInquirer.d.ts +0 -12
- package/lib/executable/NestiaMigrateInquirer.js +0 -94
- package/lib/executable/NestiaMigrateInquirer.js.map +0 -1
- package/lib/executable/migrate.d.ts +0 -2
- package/lib/executable/migrate.js +0 -9
- package/lib/executable/migrate.js.map +0 -1
- package/lib/factories/TypeLiteralFactory.d.ts +0 -4
- package/lib/factories/TypeLiteralFactory.js +0 -35
- package/lib/factories/TypeLiteralFactory.js.map +0 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -42
- package/lib/index.js.map +0 -1
- package/lib/index.mjs +0 -19399
- package/lib/index.mjs.map +0 -1
- package/lib/module.d.ts +0 -2
- package/lib/module.js +0 -19
- package/lib/module.js.map +0 -1
- package/lib/programmers/NestiaMigrateApiFileProgrammer.d.ts +0 -13
- package/lib/programmers/NestiaMigrateApiFileProgrammer.js +0 -40
- package/lib/programmers/NestiaMigrateApiFileProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateApiFunctionProgrammer.d.ts +0 -14
- package/lib/programmers/NestiaMigrateApiFunctionProgrammer.js +0 -179
- package/lib/programmers/NestiaMigrateApiFunctionProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.d.ts +0 -14
- package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.js +0 -226
- package/lib/programmers/NestiaMigrateApiNamespaceProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateApiProgrammer.d.ts +0 -4
- package/lib/programmers/NestiaMigrateApiProgrammer.js +0 -82
- package/lib/programmers/NestiaMigrateApiProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateApiSimulationProgrammer.d.ts +0 -14
- package/lib/programmers/NestiaMigrateApiSimulationProgrammer.js +0 -142
- package/lib/programmers/NestiaMigrateApiSimulationProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateApiStartProgrammer.d.ts +0 -4
- package/lib/programmers/NestiaMigrateApiStartProgrammer.js +0 -80
- package/lib/programmers/NestiaMigrateApiStartProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateDtoProgrammer.d.ts +0 -15
- package/lib/programmers/NestiaMigrateDtoProgrammer.js +0 -65
- package/lib/programmers/NestiaMigrateDtoProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateE2eFileProgrammer.d.ts +0 -14
- package/lib/programmers/NestiaMigrateE2eFileProgrammer.js +0 -81
- package/lib/programmers/NestiaMigrateE2eFileProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateE2eProgrammer.d.ts +0 -4
- package/lib/programmers/NestiaMigrateE2eProgrammer.js +0 -32
- package/lib/programmers/NestiaMigrateE2eProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateImportProgrammer.d.ts +0 -18
- package/lib/programmers/NestiaMigrateImportProgrammer.js +0 -65
- package/lib/programmers/NestiaMigrateImportProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateNestControllerProgrammer.d.ts +0 -12
- package/lib/programmers/NestiaMigrateNestControllerProgrammer.js +0 -46
- package/lib/programmers/NestiaMigrateNestControllerProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateNestMethodProgrammer.d.ts +0 -15
- package/lib/programmers/NestiaMigrateNestMethodProgrammer.js +0 -224
- package/lib/programmers/NestiaMigrateNestMethodProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateNestModuleProgrammer.d.ts +0 -5
- package/lib/programmers/NestiaMigrateNestModuleProgrammer.js +0 -29
- package/lib/programmers/NestiaMigrateNestModuleProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateNestProgrammer.d.ts +0 -4
- package/lib/programmers/NestiaMigrateNestProgrammer.js +0 -65
- package/lib/programmers/NestiaMigrateNestProgrammer.js.map +0 -1
- package/lib/programmers/NestiaMigrateSchemaProgrammer.d.ts +0 -10
- package/lib/programmers/NestiaMigrateSchemaProgrammer.js +0 -469
- package/lib/programmers/NestiaMigrateSchemaProgrammer.js.map +0 -1
- package/lib/structures/INestiaMigrateConfig.d.ts +0 -15
- package/lib/structures/INestiaMigrateConfig.js +0 -3
- package/lib/structures/INestiaMigrateConfig.js.map +0 -1
- package/lib/structures/INestiaMigrateContext.d.ts +0 -7
- package/lib/structures/INestiaMigrateContext.js +0 -3
- package/lib/structures/INestiaMigrateContext.js.map +0 -1
- package/lib/structures/INestiaMigrateController.d.ts +0 -7
- package/lib/structures/INestiaMigrateController.js +0 -3
- package/lib/structures/INestiaMigrateController.js.map +0 -1
- package/lib/structures/INestiaMigrateDto.d.ts +0 -7
- package/lib/structures/INestiaMigrateDto.js +0 -3
- package/lib/structures/INestiaMigrateDto.js.map +0 -1
- package/lib/structures/INestiaMigrateFile.d.ts +0 -5
- package/lib/structures/INestiaMigrateFile.js +0 -3
- package/lib/structures/INestiaMigrateFile.js.map +0 -1
- package/lib/structures/INestiaMigrateProgram.d.ts +0 -9
- package/lib/structures/INestiaMigrateProgram.js +0 -3
- package/lib/structures/INestiaMigrateProgram.js.map +0 -1
- package/lib/structures/INestiaMigrateSchema.d.ts +0 -4
- package/lib/structures/INestiaMigrateSchema.js +0 -3
- package/lib/structures/INestiaMigrateSchema.js.map +0 -1
- package/lib/utils/FilePrinter.d.ts +0 -9
- package/lib/utils/FilePrinter.js +0 -35
- package/lib/utils/FilePrinter.js.map +0 -1
- package/lib/utils/MapUtil.d.ts +0 -3
- package/lib/utils/MapUtil.js +0 -15
- package/lib/utils/MapUtil.js.map +0 -1
- package/lib/utils/SetupWizard.d.ts +0 -3
- package/lib/utils/SetupWizard.js +0 -18
- package/lib/utils/SetupWizard.js.map +0 -1
- package/lib/utils/StringUtil.d.ts +0 -6
- package/lib/utils/StringUtil.js +0 -108
- package/lib/utils/StringUtil.js.map +0 -1
- package/lib/utils/openapi-down-convert/RefVisitor.d.ts +0 -52
- package/lib/utils/openapi-down-convert/RefVisitor.js +0 -102
- package/lib/utils/openapi-down-convert/RefVisitor.js.map +0 -1
- package/lib/utils/openapi-down-convert/converter.d.ts +0 -146
- package/lib/utils/openapi-down-convert/converter.js +0 -441
- package/lib/utils/openapi-down-convert/converter.js.map +0 -1
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { OpenApi } from "@
|
|
2
|
-
import ts from "typescript";
|
|
3
|
-
|
|
4
|
-
import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
|
|
5
|
-
import { INestiaMigrateController } from "../structures/INestiaMigrateController";
|
|
6
|
-
import { FilePrinter } from "../utils/FilePrinter";
|
|
7
|
-
import { StringUtil } from "../utils/StringUtil";
|
|
8
|
-
import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
|
|
9
|
-
import { NestiaMigrateNestMethodProgrammer } from "./NestiaMigrateNestMethodProgrammer";
|
|
10
|
-
|
|
11
|
-
export namespace NestiaMigrateNestControllerProgrammer {
|
|
12
|
-
export interface IProps {
|
|
13
|
-
config: INestiaMigrateConfig;
|
|
14
|
-
components: OpenApi.IComponents;
|
|
15
|
-
controller: INestiaMigrateController;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const write = (props: IProps): ts.Statement[] => {
|
|
19
|
-
const importer: NestiaMigrateImportProgrammer =
|
|
20
|
-
new NestiaMigrateImportProgrammer();
|
|
21
|
-
const $class = ts.factory.createClassDeclaration(
|
|
22
|
-
[
|
|
23
|
-
ts.factory.createDecorator(
|
|
24
|
-
ts.factory.createCallExpression(
|
|
25
|
-
ts.factory.createIdentifier(
|
|
26
|
-
importer.external({
|
|
27
|
-
type: "instance",
|
|
28
|
-
library: "@nestjs/common",
|
|
29
|
-
name: "Controller",
|
|
30
|
-
}),
|
|
31
|
-
),
|
|
32
|
-
[],
|
|
33
|
-
[ts.factory.createStringLiteral(props.controller.path)],
|
|
34
|
-
),
|
|
35
|
-
),
|
|
36
|
-
ts.factory.createToken(ts.SyntaxKind.ExportKeyword),
|
|
37
|
-
],
|
|
38
|
-
props.controller.name,
|
|
39
|
-
[],
|
|
40
|
-
[],
|
|
41
|
-
props.controller.routes
|
|
42
|
-
.map((route, index) => [
|
|
43
|
-
...(index !== 0 ? [FilePrinter.newLine() as any] : []),
|
|
44
|
-
(
|
|
45
|
-
props.config.programmer?.controllerMethod ??
|
|
46
|
-
NestiaMigrateNestMethodProgrammer.write
|
|
47
|
-
)({
|
|
48
|
-
config: props.config,
|
|
49
|
-
components: props.components,
|
|
50
|
-
controller: props.controller,
|
|
51
|
-
importer,
|
|
52
|
-
route,
|
|
53
|
-
}),
|
|
54
|
-
])
|
|
55
|
-
.flat(),
|
|
56
|
-
);
|
|
57
|
-
return [
|
|
58
|
-
...importer.toStatements(
|
|
59
|
-
(ref) =>
|
|
60
|
-
`${"../".repeat(
|
|
61
|
-
StringUtil.splitWithNormalization(props.controller.location)
|
|
62
|
-
.length - 1,
|
|
63
|
-
)}api/structures/${ref}`,
|
|
64
|
-
),
|
|
65
|
-
...(importer.empty() ? [] : [FilePrinter.newLine()]),
|
|
66
|
-
$class,
|
|
67
|
-
];
|
|
68
|
-
};
|
|
69
|
-
}
|
|
1
|
+
import { OpenApi } from "@typia/interface";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
|
|
5
|
+
import { INestiaMigrateController } from "../structures/INestiaMigrateController";
|
|
6
|
+
import { FilePrinter } from "../utils/FilePrinter";
|
|
7
|
+
import { StringUtil } from "../utils/StringUtil";
|
|
8
|
+
import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
|
|
9
|
+
import { NestiaMigrateNestMethodProgrammer } from "./NestiaMigrateNestMethodProgrammer";
|
|
10
|
+
|
|
11
|
+
export namespace NestiaMigrateNestControllerProgrammer {
|
|
12
|
+
export interface IProps {
|
|
13
|
+
config: INestiaMigrateConfig;
|
|
14
|
+
components: OpenApi.IComponents;
|
|
15
|
+
controller: INestiaMigrateController;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const write = (props: IProps): ts.Statement[] => {
|
|
19
|
+
const importer: NestiaMigrateImportProgrammer =
|
|
20
|
+
new NestiaMigrateImportProgrammer();
|
|
21
|
+
const $class = ts.factory.createClassDeclaration(
|
|
22
|
+
[
|
|
23
|
+
ts.factory.createDecorator(
|
|
24
|
+
ts.factory.createCallExpression(
|
|
25
|
+
ts.factory.createIdentifier(
|
|
26
|
+
importer.external({
|
|
27
|
+
type: "instance",
|
|
28
|
+
library: "@nestjs/common",
|
|
29
|
+
name: "Controller",
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
[],
|
|
33
|
+
[ts.factory.createStringLiteral(props.controller.path)],
|
|
34
|
+
),
|
|
35
|
+
),
|
|
36
|
+
ts.factory.createToken(ts.SyntaxKind.ExportKeyword),
|
|
37
|
+
],
|
|
38
|
+
props.controller.name,
|
|
39
|
+
[],
|
|
40
|
+
[],
|
|
41
|
+
props.controller.routes
|
|
42
|
+
.map((route, index) => [
|
|
43
|
+
...(index !== 0 ? [FilePrinter.newLine() as any] : []),
|
|
44
|
+
(
|
|
45
|
+
props.config.programmer?.controllerMethod ??
|
|
46
|
+
NestiaMigrateNestMethodProgrammer.write
|
|
47
|
+
)({
|
|
48
|
+
config: props.config,
|
|
49
|
+
components: props.components,
|
|
50
|
+
controller: props.controller,
|
|
51
|
+
importer,
|
|
52
|
+
route,
|
|
53
|
+
}),
|
|
54
|
+
])
|
|
55
|
+
.flat(),
|
|
56
|
+
);
|
|
57
|
+
return [
|
|
58
|
+
...importer.toStatements(
|
|
59
|
+
(ref) =>
|
|
60
|
+
`${"../".repeat(
|
|
61
|
+
StringUtil.splitWithNormalization(props.controller.location)
|
|
62
|
+
.length - 1,
|
|
63
|
+
)}api/structures/${ref}`,
|
|
64
|
+
),
|
|
65
|
+
...(importer.empty() ? [] : [FilePrinter.newLine()]),
|
|
66
|
+
$class,
|
|
67
|
+
];
|
|
68
|
+
};
|
|
69
|
+
}
|