@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,153 +1,153 @@
1
- import { IdentifierFactory, LiteralFactory } from "@typia/core";
2
- import { IHttpMigrateRoute } from "@typia/interface";
3
- import ts from "typescript";
4
- import { OpenApi } from "typia";
5
-
6
- import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
7
- import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
8
- import { NestiaMigrateSchemaProgrammer } from "./NestiaMigrateSchemaProgrammer";
9
-
10
- export namespace NestiaMigrateE2eFunctionProgrammer {
11
- export interface IContext {
12
- config: INestiaMigrateConfig;
13
- components: OpenApi.IComponents;
14
- importer: NestiaMigrateImportProgrammer;
15
- route: IHttpMigrateRoute;
16
- }
17
-
18
- export const write = (ctx: IContext): ts.FunctionDeclaration =>
19
- ts.factory.createFunctionDeclaration(
20
- [
21
- ts.factory.createModifier(ts.SyntaxKind.ExportKeyword),
22
- ts.factory.createModifier(ts.SyntaxKind.AsyncKeyword),
23
- ],
24
- undefined,
25
- ["test", "api", ...ctx.route.accessor].join("_"),
26
- undefined,
27
- [
28
- IdentifierFactory.parameter(
29
- "connection",
30
- ts.factory.createTypeReferenceNode(
31
- ts.factory.createQualifiedName(
32
- ts.factory.createIdentifier(
33
- ctx.importer.external({
34
- type: "default",
35
- library: "@ORGANIZATION/PROJECT-api",
36
- name: "api",
37
- }),
38
- ),
39
- ts.factory.createIdentifier("IConnection"),
40
- ),
41
- ),
42
- ),
43
- ],
44
- undefined,
45
- ts.factory.createBlock(writeBody(ctx), true),
46
- );
47
-
48
- export const writeBody = (ctx: IContext): ts.Statement[] => [
49
- ts.factory.createVariableStatement(
50
- [],
51
- ts.factory.createVariableDeclarationList(
52
- [
53
- ts.factory.createVariableDeclaration(
54
- "output",
55
- undefined,
56
- ctx.route.success
57
- ? NestiaMigrateSchemaProgrammer.write({
58
- components: ctx.components,
59
- importer: ctx.importer,
60
- schema: ctx.route.success.schema,
61
- })
62
- : undefined,
63
- ts.factory.createAwaitExpression(writeCallExpressionn(ctx)),
64
- ),
65
- ],
66
- ts.NodeFlags.Const,
67
- ),
68
- ),
69
- ts.factory.createExpressionStatement(
70
- ts.factory.createCallExpression(
71
- ts.factory.createPropertyAccessExpression(
72
- ts.factory.createIdentifier(
73
- ctx.importer.external({
74
- type: "default",
75
- library: "typia",
76
- name: "typia",
77
- }),
78
- ),
79
- "assert",
80
- ),
81
- undefined,
82
- [ts.factory.createIdentifier("output")],
83
- ),
84
- ),
85
- ];
86
-
87
- const writeCallExpressionn = (ctx: IContext): ts.CallExpression => {
88
- const fetch = ts.factory.createPropertyAccessExpression(
89
- ts.factory.createIdentifier("api.functional"),
90
- ts.factory.createIdentifier(ctx.route.accessor.join(".")),
91
- );
92
- const connection = ts.factory.createIdentifier("connection");
93
- if (
94
- ctx.route.parameters.length === 0 &&
95
- ctx.route.query === null &&
96
- ctx.route.body === null
97
- )
98
- return ts.factory.createCallExpression(fetch, undefined, [connection]);
99
-
100
- const random = ts.factory.createPropertyAccessExpression(
101
- ts.factory.createIdentifier(
102
- ctx.importer.external({
103
- type: "default",
104
- library: "typia",
105
- name: "typia",
106
- }),
107
- ),
108
- "random",
109
- );
110
- if (ctx.config.keyword === true)
111
- return ts.factory.createCallExpression(fetch, undefined, [
112
- connection,
113
- LiteralFactory.write(
114
- Object.fromEntries(
115
- [...ctx.route.parameters, ctx.route.query, ctx.route.body]
116
- .filter((x) => x !== null)
117
- .map(({ key, schema: value }) => [
118
- key,
119
- ts.factory.createCallExpression(
120
- random,
121
- [
122
- NestiaMigrateSchemaProgrammer.write({
123
- components: ctx.components,
124
- importer: ctx.importer,
125
- schema: value,
126
- }),
127
- ],
128
- undefined,
129
- ),
130
- ]),
131
- ),
132
- ),
133
- ]);
134
- return ts.factory.createCallExpression(fetch, undefined, [
135
- connection,
136
- ...[...ctx.route.parameters, ctx.route.query, ctx.route.body]
137
- .filter((p) => !!p)
138
- .map((p) =>
139
- ts.factory.createCallExpression(
140
- random,
141
- [
142
- NestiaMigrateSchemaProgrammer.write({
143
- components: ctx.components,
144
- importer: ctx.importer,
145
- schema: p.schema,
146
- }),
147
- ],
148
- undefined,
149
- ),
150
- ),
151
- ]);
152
- };
153
- }
1
+ import { IdentifierFactory, LiteralFactory } from "@typia/core";
2
+ import { IHttpMigrateRoute } from "@typia/interface";
3
+ import ts from "typescript";
4
+ import { OpenApi } from "typia";
5
+
6
+ import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
7
+ import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
8
+ import { NestiaMigrateSchemaProgrammer } from "./NestiaMigrateSchemaProgrammer";
9
+
10
+ export namespace NestiaMigrateE2eFunctionProgrammer {
11
+ export interface IContext {
12
+ config: INestiaMigrateConfig;
13
+ components: OpenApi.IComponents;
14
+ importer: NestiaMigrateImportProgrammer;
15
+ route: IHttpMigrateRoute;
16
+ }
17
+
18
+ export const write = (ctx: IContext): ts.FunctionDeclaration =>
19
+ ts.factory.createFunctionDeclaration(
20
+ [
21
+ ts.factory.createModifier(ts.SyntaxKind.ExportKeyword),
22
+ ts.factory.createModifier(ts.SyntaxKind.AsyncKeyword),
23
+ ],
24
+ undefined,
25
+ ["test", "api", ...ctx.route.accessor].join("_"),
26
+ undefined,
27
+ [
28
+ IdentifierFactory.parameter(
29
+ "connection",
30
+ ts.factory.createTypeReferenceNode(
31
+ ts.factory.createQualifiedName(
32
+ ts.factory.createIdentifier(
33
+ ctx.importer.external({
34
+ type: "default",
35
+ library: "@ORGANIZATION/PROJECT-api",
36
+ name: "api",
37
+ }),
38
+ ),
39
+ ts.factory.createIdentifier("IConnection"),
40
+ ),
41
+ ),
42
+ ),
43
+ ],
44
+ undefined,
45
+ ts.factory.createBlock(writeBody(ctx), true),
46
+ );
47
+
48
+ export const writeBody = (ctx: IContext): ts.Statement[] => [
49
+ ts.factory.createVariableStatement(
50
+ [],
51
+ ts.factory.createVariableDeclarationList(
52
+ [
53
+ ts.factory.createVariableDeclaration(
54
+ "output",
55
+ undefined,
56
+ ctx.route.success
57
+ ? NestiaMigrateSchemaProgrammer.write({
58
+ components: ctx.components,
59
+ importer: ctx.importer,
60
+ schema: ctx.route.success.schema,
61
+ })
62
+ : undefined,
63
+ ts.factory.createAwaitExpression(writeCallExpressionn(ctx)),
64
+ ),
65
+ ],
66
+ ts.NodeFlags.Const,
67
+ ),
68
+ ),
69
+ ts.factory.createExpressionStatement(
70
+ ts.factory.createCallExpression(
71
+ ts.factory.createPropertyAccessExpression(
72
+ ts.factory.createIdentifier(
73
+ ctx.importer.external({
74
+ type: "default",
75
+ library: "typia",
76
+ name: "typia",
77
+ }),
78
+ ),
79
+ "assert",
80
+ ),
81
+ undefined,
82
+ [ts.factory.createIdentifier("output")],
83
+ ),
84
+ ),
85
+ ];
86
+
87
+ const writeCallExpressionn = (ctx: IContext): ts.CallExpression => {
88
+ const fetch = ts.factory.createPropertyAccessExpression(
89
+ ts.factory.createIdentifier("api.functional"),
90
+ ts.factory.createIdentifier(ctx.route.accessor.join(".")),
91
+ );
92
+ const connection = ts.factory.createIdentifier("connection");
93
+ if (
94
+ ctx.route.parameters.length === 0 &&
95
+ ctx.route.query === null &&
96
+ ctx.route.body === null
97
+ )
98
+ return ts.factory.createCallExpression(fetch, undefined, [connection]);
99
+
100
+ const random = ts.factory.createPropertyAccessExpression(
101
+ ts.factory.createIdentifier(
102
+ ctx.importer.external({
103
+ type: "default",
104
+ library: "typia",
105
+ name: "typia",
106
+ }),
107
+ ),
108
+ "random",
109
+ );
110
+ if (ctx.config.keyword === true)
111
+ return ts.factory.createCallExpression(fetch, undefined, [
112
+ connection,
113
+ LiteralFactory.write(
114
+ Object.fromEntries(
115
+ [...ctx.route.parameters, ctx.route.query, ctx.route.body]
116
+ .filter((x) => x !== null)
117
+ .map(({ key, schema: value }) => [
118
+ key,
119
+ ts.factory.createCallExpression(
120
+ random,
121
+ [
122
+ NestiaMigrateSchemaProgrammer.write({
123
+ components: ctx.components,
124
+ importer: ctx.importer,
125
+ schema: value,
126
+ }),
127
+ ],
128
+ undefined,
129
+ ),
130
+ ]),
131
+ ),
132
+ ),
133
+ ]);
134
+ return ts.factory.createCallExpression(fetch, undefined, [
135
+ connection,
136
+ ...[...ctx.route.parameters, ctx.route.query, ctx.route.body]
137
+ .filter((p) => !!p)
138
+ .map((p) =>
139
+ ts.factory.createCallExpression(
140
+ random,
141
+ [
142
+ NestiaMigrateSchemaProgrammer.write({
143
+ components: ctx.components,
144
+ importer: ctx.importer,
145
+ schema: p.schema,
146
+ }),
147
+ ],
148
+ undefined,
149
+ ),
150
+ ),
151
+ ]);
152
+ };
153
+ }
@@ -1,48 +1,48 @@
1
- import { IHttpMigrateRoute, OpenApi } from "@typia/interface";
2
- import ts from "typescript";
3
-
4
- import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
5
- import { INestiaMigrateContext } from "../structures/INestiaMigrateContext";
6
- import { INestiaMigrateFile } from "../structures/INestiaMigrateFile";
7
- import { FilePrinter } from "../utils/FilePrinter";
8
- import { NestiaMigrateE2eFunctionProgrammer } from "./NestiaMigrateE2eFileProgrammer";
9
- import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
10
-
11
- export namespace NestiaMigrateE2eProgrammer {
12
- export const write = (ctx: INestiaMigrateContext): Record<string, string> =>
13
- Object.fromEntries(
14
- ctx.application.routes
15
- .map((r) =>
16
- writeFile(ctx.config, ctx.application.document().components, r),
17
- )
18
- .map((r) => [`${r.location}/${r.file}`, r.content]),
19
- );
20
-
21
- const writeFile = (
22
- config: INestiaMigrateConfig,
23
- components: OpenApi.IComponents,
24
- route: IHttpMigrateRoute,
25
- ): INestiaMigrateFile => {
26
- const importer: NestiaMigrateImportProgrammer =
27
- new NestiaMigrateImportProgrammer();
28
- const func: ts.FunctionDeclaration =
29
- NestiaMigrateE2eFunctionProgrammer.write({
30
- config,
31
- components,
32
- importer,
33
- route,
34
- });
35
- const statements: ts.Statement[] = [
36
- ...importer.toStatements(
37
- (name) => `@ORGANIZATION/PROJECT-api/lib/structures/${name}`,
38
- ),
39
- FilePrinter.newLine(),
40
- func,
41
- ];
42
- return {
43
- location: `test/features/api`,
44
- file: `${["test", "api", ...route.accessor].join("_")}.ts`,
45
- content: FilePrinter.write({ statements }),
46
- };
47
- };
48
- }
1
+ import { IHttpMigrateRoute, OpenApi } from "@typia/interface";
2
+ import ts from "typescript";
3
+
4
+ import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
5
+ import { INestiaMigrateContext } from "../structures/INestiaMigrateContext";
6
+ import { INestiaMigrateFile } from "../structures/INestiaMigrateFile";
7
+ import { FilePrinter } from "../utils/FilePrinter";
8
+ import { NestiaMigrateE2eFunctionProgrammer } from "./NestiaMigrateE2eFileProgrammer";
9
+ import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
10
+
11
+ export namespace NestiaMigrateE2eProgrammer {
12
+ export const write = (ctx: INestiaMigrateContext): Record<string, string> =>
13
+ Object.fromEntries(
14
+ ctx.application.routes
15
+ .map((r) =>
16
+ writeFile(ctx.config, ctx.application.document().components, r),
17
+ )
18
+ .map((r) => [`${r.location}/${r.file}`, r.content]),
19
+ );
20
+
21
+ const writeFile = (
22
+ config: INestiaMigrateConfig,
23
+ components: OpenApi.IComponents,
24
+ route: IHttpMigrateRoute,
25
+ ): INestiaMigrateFile => {
26
+ const importer: NestiaMigrateImportProgrammer =
27
+ new NestiaMigrateImportProgrammer();
28
+ const func: ts.FunctionDeclaration =
29
+ NestiaMigrateE2eFunctionProgrammer.write({
30
+ config,
31
+ components,
32
+ importer,
33
+ route,
34
+ });
35
+ const statements: ts.Statement[] = [
36
+ ...importer.toStatements(
37
+ (name) => `@ORGANIZATION/PROJECT-api/lib/structures/${name}`,
38
+ ),
39
+ FilePrinter.newLine(),
40
+ func,
41
+ ];
42
+ return {
43
+ location: `test/features/api`,
44
+ file: `${["test", "api", ...route.accessor].join("_")}.ts`,
45
+ content: FilePrinter.write({ statements }),
46
+ };
47
+ };
48
+ }
@@ -1,118 +1,118 @@
1
- import ts from "typescript";
2
-
3
- import { TypeLiteralFactory } from "../factories/TypeLiteralFactory";
4
- import { FilePrinter } from "../utils/FilePrinter";
5
- import { MapUtil } from "../utils/MapUtil";
6
-
7
- export class NestiaMigrateImportProgrammer {
8
- private external_: Map<string, IClause> = new Map();
9
- private dtos_: Set<string> = new Set();
10
-
11
- public constructor() {}
12
-
13
- public empty(): boolean {
14
- return this.external_.size === 0 && this.dtos_.size === 0;
15
- }
16
-
17
- public external(props: MigrateImportProgrammer.IProps): string {
18
- const clause: IClause = MapUtil.take(this.external_)(props.library)(() => ({
19
- default: null,
20
- instances: new Set(),
21
- }));
22
- const name: string = props.name.split(".")[0]!;
23
- if (props.type === "default") clause.default = props.name;
24
- else clause.instances.add(name);
25
- return name;
26
- }
27
-
28
- public dto(name: string, namespace?: string): ts.TypeReferenceNode {
29
- const file: string = name.split(".")[0]!;
30
- this.dtos_.add(file);
31
- return ts.factory.createTypeReferenceNode(
32
- namespace?.length
33
- ? ts.factory.createQualifiedName(
34
- ts.factory.createIdentifier(namespace),
35
- ts.factory.createIdentifier(file),
36
- )
37
- : name,
38
- );
39
- }
40
-
41
- public tag(type: string, arg?: any): ts.TypeReferenceNode {
42
- const instance: string = this.external({
43
- type: "instance",
44
- library: "typia",
45
- name: "tags",
46
- });
47
- return ts.factory.createTypeReferenceNode(
48
- `${instance}.${type}`,
49
- arg === undefined ? [] : [TypeLiteralFactory.generate(arg)],
50
- );
51
- }
52
-
53
- public toStatements(
54
- dtoPath: (name: string) => string,
55
- current?: string,
56
- ): ts.Statement[] {
57
- return [
58
- ...[...this.external_.entries()].map(([library, props]) =>
59
- ts.factory.createImportDeclaration(
60
- undefined,
61
- ts.factory.createImportClause(
62
- false,
63
- props.default !== null
64
- ? ts.factory.createIdentifier(props.default)
65
- : undefined,
66
- props.instances.size
67
- ? ts.factory.createNamedImports(
68
- [...props.instances].map((i) =>
69
- ts.factory.createImportSpecifier(
70
- false,
71
- undefined,
72
- ts.factory.createIdentifier(i),
73
- ),
74
- ),
75
- )
76
- : undefined,
77
- ),
78
- ts.factory.createStringLiteral(library),
79
- ),
80
- ),
81
- ...(this.external_.size && this.dtos_.size
82
- ? [FilePrinter.newLine()]
83
- : []),
84
- ...[...this.dtos_]
85
- .filter(
86
- current ? (name) => name !== current!.split(".")[0] : () => true,
87
- )
88
- .map((i) =>
89
- ts.factory.createImportDeclaration(
90
- undefined,
91
- ts.factory.createImportClause(
92
- false,
93
- undefined,
94
- ts.factory.createNamedImports([
95
- ts.factory.createImportSpecifier(
96
- false,
97
- undefined,
98
- ts.factory.createIdentifier(i),
99
- ),
100
- ]),
101
- ),
102
- ts.factory.createStringLiteral(dtoPath(i)),
103
- ),
104
- ),
105
- ];
106
- }
107
- }
108
- export namespace MigrateImportProgrammer {
109
- export interface IProps {
110
- type: "default" | "instance";
111
- library: string;
112
- name: string;
113
- }
114
- }
115
- interface IClause {
116
- default: string | null;
117
- instances: Set<string>;
118
- }
1
+ import ts from "typescript";
2
+
3
+ import { TypeLiteralFactory } from "../factories/TypeLiteralFactory";
4
+ import { FilePrinter } from "../utils/FilePrinter";
5
+ import { MapUtil } from "../utils/MapUtil";
6
+
7
+ export class NestiaMigrateImportProgrammer {
8
+ private external_: Map<string, IClause> = new Map();
9
+ private dtos_: Set<string> = new Set();
10
+
11
+ public constructor() {}
12
+
13
+ public empty(): boolean {
14
+ return this.external_.size === 0 && this.dtos_.size === 0;
15
+ }
16
+
17
+ public external(props: MigrateImportProgrammer.IProps): string {
18
+ const clause: IClause = MapUtil.take(this.external_)(props.library)(() => ({
19
+ default: null,
20
+ instances: new Set(),
21
+ }));
22
+ const name: string = props.name.split(".")[0]!;
23
+ if (props.type === "default") clause.default = props.name;
24
+ else clause.instances.add(name);
25
+ return name;
26
+ }
27
+
28
+ public dto(name: string, namespace?: string): ts.TypeReferenceNode {
29
+ const file: string = name.split(".")[0]!;
30
+ this.dtos_.add(file);
31
+ return ts.factory.createTypeReferenceNode(
32
+ namespace?.length
33
+ ? ts.factory.createQualifiedName(
34
+ ts.factory.createIdentifier(namespace),
35
+ ts.factory.createIdentifier(file),
36
+ )
37
+ : name,
38
+ );
39
+ }
40
+
41
+ public tag(type: string, arg?: any): ts.TypeReferenceNode {
42
+ const instance: string = this.external({
43
+ type: "instance",
44
+ library: "typia",
45
+ name: "tags",
46
+ });
47
+ return ts.factory.createTypeReferenceNode(
48
+ `${instance}.${type}`,
49
+ arg === undefined ? [] : [TypeLiteralFactory.generate(arg)],
50
+ );
51
+ }
52
+
53
+ public toStatements(
54
+ dtoPath: (name: string) => string,
55
+ current?: string,
56
+ ): ts.Statement[] {
57
+ return [
58
+ ...[...this.external_.entries()].map(([library, props]) =>
59
+ ts.factory.createImportDeclaration(
60
+ undefined,
61
+ ts.factory.createImportClause(
62
+ false,
63
+ props.default !== null
64
+ ? ts.factory.createIdentifier(props.default)
65
+ : undefined,
66
+ props.instances.size
67
+ ? ts.factory.createNamedImports(
68
+ [...props.instances].map((i) =>
69
+ ts.factory.createImportSpecifier(
70
+ false,
71
+ undefined,
72
+ ts.factory.createIdentifier(i),
73
+ ),
74
+ ),
75
+ )
76
+ : undefined,
77
+ ),
78
+ ts.factory.createStringLiteral(library),
79
+ ),
80
+ ),
81
+ ...(this.external_.size && this.dtos_.size
82
+ ? [FilePrinter.newLine()]
83
+ : []),
84
+ ...[...this.dtos_]
85
+ .filter(
86
+ current ? (name) => name !== current!.split(".")[0] : () => true,
87
+ )
88
+ .map((i) =>
89
+ ts.factory.createImportDeclaration(
90
+ undefined,
91
+ ts.factory.createImportClause(
92
+ false,
93
+ undefined,
94
+ ts.factory.createNamedImports([
95
+ ts.factory.createImportSpecifier(
96
+ false,
97
+ undefined,
98
+ ts.factory.createIdentifier(i),
99
+ ),
100
+ ]),
101
+ ),
102
+ ts.factory.createStringLiteral(dtoPath(i)),
103
+ ),
104
+ ),
105
+ ];
106
+ }
107
+ }
108
+ export namespace MigrateImportProgrammer {
109
+ export interface IProps {
110
+ type: "default" | "instance";
111
+ library: string;
112
+ name: string;
113
+ }
114
+ }
115
+ interface IClause {
116
+ default: string | null;
117
+ instances: Set<string>;
118
+ }