@nestia/migrate 11.0.0-dev.20260316 → 11.0.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.
Files changed (39) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +93 -93
  3. package/lib/NestiaMigrateApplication.js +341 -341
  4. package/lib/bundles/NEST_TEMPLATE.js +48 -48
  5. package/lib/bundles/NEST_TEMPLATE.js.map +1 -1
  6. package/lib/bundles/SDK_TEMPLATE.js +21 -21
  7. package/lib/bundles/SDK_TEMPLATE.js.map +1 -1
  8. package/lib/index.mjs +469 -469
  9. package/lib/index.mjs.map +1 -1
  10. package/package.json +5 -5
  11. package/src/NestiaMigrateApplication.ts +168 -168
  12. package/src/analyzers/NestiaMigrateControllerAnalyzer.ts +51 -51
  13. package/src/bundles/NEST_TEMPLATE.ts +48 -48
  14. package/src/bundles/SDK_TEMPLATE.ts +21 -21
  15. package/src/executable/NestiaMigrateCommander.ts +104 -104
  16. package/src/executable/NestiaMigrateInquirer.ts +106 -106
  17. package/src/executable/bundle.js +125 -125
  18. package/src/factories/TypeLiteralFactory.ts +57 -57
  19. package/src/module.ts +7 -7
  20. package/src/programmers/NestiaMigrateApiFileProgrammer.ts +55 -55
  21. package/src/programmers/NestiaMigrateApiFunctionProgrammer.ts +347 -347
  22. package/src/programmers/NestiaMigrateApiNamespaceProgrammer.ts +517 -517
  23. package/src/programmers/NestiaMigrateApiSimulationProgrammer.ts +308 -308
  24. package/src/programmers/NestiaMigrateApiStartProgrammer.ts +197 -197
  25. package/src/programmers/NestiaMigrateDtoProgrammer.ts +98 -98
  26. package/src/programmers/NestiaMigrateE2eFileProgrammer.ts +153 -153
  27. package/src/programmers/NestiaMigrateE2eProgrammer.ts +48 -48
  28. package/src/programmers/NestiaMigrateImportProgrammer.ts +118 -118
  29. package/src/programmers/NestiaMigrateNestControllerProgrammer.ts +69 -69
  30. package/src/programmers/NestiaMigrateNestMethodProgrammer.ts +409 -409
  31. package/src/programmers/NestiaMigrateSchemaProgrammer.ts +465 -465
  32. package/src/programmers/index.ts +15 -15
  33. package/src/structures/INestiaMigrateContext.ts +9 -9
  34. package/src/structures/INestiaMigrateController.ts +8 -8
  35. package/src/structures/INestiaMigrateDto.ts +8 -8
  36. package/src/structures/INestiaMigrateProgram.ts +11 -11
  37. package/src/structures/index.ts +4 -4
  38. package/src/utils/FilePrinter.ts +49 -49
  39. package/src/utils/StringUtil.ts +114 -114
@@ -1,69 +1,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
- }
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
+ }