@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
@@ -1,118 +1,74 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
const
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
};
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
`}`,
|
76
|
-
);
|
77
|
-
}
|
78
|
-
return content.join("\n");
|
79
|
-
};
|
80
|
-
|
81
|
-
const describe = (schema: ISwaggerSchema): string | undefined => {
|
82
|
-
const content: string[] = [];
|
83
|
-
const add = (text: string) => {
|
84
|
-
if (schema.description && !schema.description.includes(text))
|
85
|
-
content.push(text);
|
86
|
-
};
|
87
|
-
if (schema.description) {
|
88
|
-
content.push(...schema.description.split("\n"));
|
89
|
-
if (!schema.description.split("\n").at(-1)?.startsWith("@"))
|
90
|
-
content.push("");
|
91
|
-
}
|
92
|
-
if (schema.deprecated) add("@deprecated");
|
93
|
-
if (schema.title) add(`@title ${schema.title}`);
|
94
|
-
return content.length ? content.join("\n") : undefined;
|
95
|
-
};
|
96
|
-
}
|
97
|
-
|
98
|
-
class Modulo {
|
99
|
-
public readonly dto: IMigrateDto;
|
100
|
-
public readonly children: Map<string, Modulo>;
|
101
|
-
|
102
|
-
public constructor(name: string) {
|
103
|
-
this.dto = {
|
104
|
-
name,
|
105
|
-
location: "src/api/structures",
|
106
|
-
schema: null,
|
107
|
-
children: [],
|
108
|
-
};
|
109
|
-
this.children = new Map();
|
110
|
-
}
|
111
|
-
|
112
|
-
public toDto(): IMigrateDto {
|
113
|
-
this.dto.children = Array.from(this.children.values()).map((modulo) =>
|
114
|
-
modulo.toDto(),
|
115
|
-
);
|
116
|
-
return this.dto;
|
117
|
-
}
|
118
|
-
}
|
1
|
+
import { IPointer } from "tstl";
|
2
|
+
import ts from "typescript";
|
3
|
+
|
4
|
+
import { ISwaggerSchema } from "../structures/ISwaggeSchema";
|
5
|
+
import { ISwaggerComponents } from "../structures/ISwaggerComponents";
|
6
|
+
import { FilePrinter } from "../utils/FilePrinter";
|
7
|
+
import { MapUtil } from "../utils/MapUtil";
|
8
|
+
import { ImportProgrammer } from "./ImportProgrammer";
|
9
|
+
import { SchemaProgrammer } from "./SchemaProgrammer";
|
10
|
+
|
11
|
+
export namespace DtoProgrammer {
|
12
|
+
export interface IModule {
|
13
|
+
name: string;
|
14
|
+
children: Map<string, IModule>;
|
15
|
+
programmer:
|
16
|
+
| null
|
17
|
+
| ((importer: ImportProgrammer) => ts.TypeAliasDeclaration);
|
18
|
+
}
|
19
|
+
|
20
|
+
export const write = (
|
21
|
+
components: ISwaggerComponents,
|
22
|
+
): Map<string, IModule> => {
|
23
|
+
const dict: Map<string, IModule> = new Map();
|
24
|
+
for (const [key, value] of Object.entries(components.schemas ?? {}))
|
25
|
+
prepare(dict)(key)((importer) =>
|
26
|
+
writeAlias(importer)(components)(key, value),
|
27
|
+
);
|
28
|
+
return dict;
|
29
|
+
};
|
30
|
+
|
31
|
+
const prepare =
|
32
|
+
(dict: Map<string, IModule>) =>
|
33
|
+
(name: string) =>
|
34
|
+
(programmer: (importer: ImportProgrammer) => ts.TypeAliasDeclaration) => {
|
35
|
+
const accessors: string[] = name.split(".");
|
36
|
+
const modulo: IPointer<IModule> = { value: null! };
|
37
|
+
|
38
|
+
accessors.forEach((acc, i) => {
|
39
|
+
modulo.value = MapUtil.take(dict)(acc)(() => ({
|
40
|
+
name: acc,
|
41
|
+
children: new Map(),
|
42
|
+
programmer: null,
|
43
|
+
}));
|
44
|
+
if (i === accessors.length - 1) modulo.value.programmer = programmer;
|
45
|
+
dict = modulo.value.children;
|
46
|
+
});
|
47
|
+
return modulo!;
|
48
|
+
};
|
49
|
+
|
50
|
+
const writeAlias =
|
51
|
+
(importer: ImportProgrammer) =>
|
52
|
+
(components: ISwaggerComponents) =>
|
53
|
+
(key: string, value: ISwaggerSchema) =>
|
54
|
+
FilePrinter.description(
|
55
|
+
ts.factory.createTypeAliasDeclaration(
|
56
|
+
[ts.factory.createToken(ts.SyntaxKind.ExportKeyword)],
|
57
|
+
key.split(".").at(-1)!,
|
58
|
+
[],
|
59
|
+
SchemaProgrammer.write(importer)(components)(value),
|
60
|
+
),
|
61
|
+
writeComment(value),
|
62
|
+
);
|
63
|
+
}
|
64
|
+
|
65
|
+
const writeComment = (schema: ISwaggerSchema): string =>
|
66
|
+
[
|
67
|
+
...(schema.description?.length ? [schema.description] : []),
|
68
|
+
...(schema.description?.length &&
|
69
|
+
(schema.title !== undefined || schema.deprecated === true)
|
70
|
+
? [""]
|
71
|
+
: []),
|
72
|
+
...(schema.title !== undefined ? [`@title ${schema.title}`] : []),
|
73
|
+
...(schema.deprecated === true ? [`@deprecated`] : []),
|
74
|
+
].join("\n");
|
@@ -1,60 +1,98 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
1
|
+
import ts from "typescript";
|
2
|
+
import { ExpressionFactory } from "typia/lib/factories/ExpressionFactory";
|
3
|
+
|
4
|
+
import { FilePrinter } from "../utils/FilePrinter";
|
5
|
+
import { MapUtil } from "../utils/MapUtil";
|
6
|
+
|
7
|
+
export class ImportProgrammer {
|
8
|
+
private external_: Map<string, Set<string>> = 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: ImportProgrammer.IProps): string {
|
18
|
+
MapUtil.take(this.external_)(props.library)(() => new Set()).add(
|
19
|
+
props.instance.split(".")[0],
|
20
|
+
);
|
21
|
+
return props.instance;
|
22
|
+
}
|
23
|
+
|
24
|
+
public dto(name: string): ts.TypeReferenceNode {
|
25
|
+
const file: string = name.split(".")[0];
|
26
|
+
this.dtos_.add(file);
|
27
|
+
return ts.factory.createTypeReferenceNode(name);
|
28
|
+
}
|
29
|
+
|
30
|
+
public tag(type: string, arg: number | string): ts.TypeReferenceNode {
|
31
|
+
this.external({
|
32
|
+
library: "typia",
|
33
|
+
instance: "tags",
|
34
|
+
});
|
35
|
+
return ts.factory.createTypeReferenceNode(`tags.${type}`, [
|
36
|
+
ts.factory.createLiteralTypeNode(
|
37
|
+
typeof arg === "string"
|
38
|
+
? ts.factory.createStringLiteral(arg)
|
39
|
+
: ExpressionFactory.number(arg),
|
40
|
+
),
|
41
|
+
]);
|
42
|
+
}
|
43
|
+
|
44
|
+
public toStatements(
|
45
|
+
dtoPath: (name: string) => string,
|
46
|
+
current?: string,
|
47
|
+
): ts.Statement[] {
|
48
|
+
return [
|
49
|
+
...[...this.external_.entries()].map(([library, properties]) =>
|
50
|
+
ts.factory.createImportDeclaration(
|
51
|
+
undefined,
|
52
|
+
ts.factory.createImportClause(
|
53
|
+
false,
|
54
|
+
undefined,
|
55
|
+
ts.factory.createNamedImports(
|
56
|
+
[...properties].map((i) =>
|
57
|
+
ts.factory.createImportSpecifier(
|
58
|
+
false,
|
59
|
+
undefined,
|
60
|
+
ts.factory.createIdentifier(i),
|
61
|
+
),
|
62
|
+
),
|
63
|
+
),
|
64
|
+
),
|
65
|
+
ts.factory.createStringLiteral(library),
|
66
|
+
),
|
67
|
+
),
|
68
|
+
...(this.external_.size && this.dtos_.size ? [FilePrinter.enter()] : []),
|
69
|
+
...[...this.dtos_]
|
70
|
+
.filter(
|
71
|
+
current ? (name) => name !== current!.split(".")[0] : () => true,
|
72
|
+
)
|
73
|
+
.map((i) =>
|
74
|
+
ts.factory.createImportDeclaration(
|
75
|
+
undefined,
|
76
|
+
ts.factory.createImportClause(
|
77
|
+
false,
|
78
|
+
undefined,
|
79
|
+
ts.factory.createNamedImports([
|
80
|
+
ts.factory.createImportSpecifier(
|
81
|
+
false,
|
82
|
+
undefined,
|
83
|
+
ts.factory.createIdentifier(i),
|
84
|
+
),
|
85
|
+
]),
|
86
|
+
),
|
87
|
+
ts.factory.createStringLiteral(dtoPath(i)),
|
88
|
+
),
|
89
|
+
),
|
90
|
+
];
|
91
|
+
}
|
92
|
+
}
|
93
|
+
export namespace ImportProgrammer {
|
94
|
+
export interface IProps {
|
95
|
+
library: string;
|
96
|
+
instance: string;
|
97
|
+
}
|
98
|
+
}
|
@@ -1,62 +1,75 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
import { IMigrateFile } from "../structures/IMigrateFile";
|
4
|
-
import { IMigrateProgram } from "../structures/IMigrateProgram";
|
5
|
-
import { ISwagger } from "../structures/ISwagger";
|
6
|
-
import {
|
7
|
-
import { ControllerProgrammer } from "./ControllerProgrammer";
|
8
|
-
import { DtoProgrammer } from "./DtoProgrammer";
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
(program
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
const
|
45
|
-
[
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
1
|
+
import ts from "typescript";
|
2
|
+
|
3
|
+
import { IMigrateFile } from "../structures/IMigrateFile";
|
4
|
+
import { IMigrateProgram } from "../structures/IMigrateProgram";
|
5
|
+
import { ISwagger } from "../structures/ISwagger";
|
6
|
+
import { FilePrinter } from "../utils/FilePrinter";
|
7
|
+
import { ControllerProgrammer } from "./ControllerProgrammer";
|
8
|
+
import { DtoProgrammer } from "./DtoProgrammer";
|
9
|
+
import { ImportProgrammer } from "./ImportProgrammer";
|
10
|
+
import { ModuleProgrammer } from "./ModuleProgrammer";
|
11
|
+
|
12
|
+
export namespace MigrateProgrammer {
|
13
|
+
export const analyze = (swagger: ISwagger): IMigrateProgram => ({
|
14
|
+
swagger,
|
15
|
+
controllers: ControllerProgrammer.analyze(swagger),
|
16
|
+
});
|
17
|
+
|
18
|
+
export const write = (program: IMigrateProgram): IMigrateFile[] =>
|
19
|
+
[
|
20
|
+
{
|
21
|
+
location: "src",
|
22
|
+
file: "MyModule.ts",
|
23
|
+
statements: ModuleProgrammer.write(program.controllers),
|
24
|
+
},
|
25
|
+
...program.controllers.map((c) => ({
|
26
|
+
location: c.location,
|
27
|
+
file: `${c.name}.ts`,
|
28
|
+
statements: ControllerProgrammer.write(program.swagger.components)(c),
|
29
|
+
})),
|
30
|
+
...[...DtoProgrammer.write(program.swagger.components).entries()].map(
|
31
|
+
([key, value]) => ({
|
32
|
+
location: "src/api/structures",
|
33
|
+
file: `${key}.ts`,
|
34
|
+
statements: writeDtoFile(key, value),
|
35
|
+
}),
|
36
|
+
),
|
37
|
+
].map((o) => ({
|
38
|
+
location: o.location,
|
39
|
+
file: o.file,
|
40
|
+
content: FilePrinter.write({ statements: o.statements }),
|
41
|
+
}));
|
42
|
+
|
43
|
+
const writeDtoFile = (key: string, modulo: DtoProgrammer.IModule): ts.Statement[] => {
|
44
|
+
const importer = new ImportProgrammer();
|
45
|
+
const statements: ts.Statement[] = iterate(importer)(modulo);
|
46
|
+
if (statements.length === 0) return [];
|
47
|
+
|
48
|
+
return [
|
49
|
+
...importer.toStatements((name) => `./${name}`, key),
|
50
|
+
...(importer.empty() ? [] : [FilePrinter.enter()]),
|
51
|
+
...statements,
|
52
|
+
];
|
53
|
+
};
|
54
|
+
|
55
|
+
const iterate =
|
56
|
+
(importer: ImportProgrammer) =>
|
57
|
+
(modulo: DtoProgrammer.IModule): ts.Statement[] => {
|
58
|
+
const output: ts.Statement[] = [];
|
59
|
+
if (modulo.programmer !== null) output.push(modulo.programmer(importer));
|
60
|
+
if (modulo.children.size) {
|
61
|
+
const internal: ts.Statement[] = [];
|
62
|
+
for (const child of modulo.children.values())
|
63
|
+
internal.push(...iterate(importer)(child));
|
64
|
+
output.push(
|
65
|
+
ts.factory.createModuleDeclaration(
|
66
|
+
[ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)],
|
67
|
+
ts.factory.createIdentifier(modulo.name),
|
68
|
+
ts.factory.createModuleBlock(internal),
|
69
|
+
ts.NodeFlags.Namespace,
|
70
|
+
),
|
71
|
+
);
|
72
|
+
}
|
73
|
+
return output;
|
74
|
+
};
|
75
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import ts from "typescript";
|
2
|
+
|
3
|
+
import { IMigrateController } from "../structures/IMigrateController";
|
4
|
+
import { FilePrinter } from "../utils/FilePrinter";
|
5
|
+
|
6
|
+
export namespace ModuleProgrammer {
|
7
|
+
export const write = (controllers: IMigrateController[]): ts.Statement[] => [
|
8
|
+
$import("@nestjs/common")("Module"),
|
9
|
+
...(controllers.length ? [FilePrinter.enter()] : []),
|
10
|
+
...controllers.map((c) =>
|
11
|
+
$import(`${c.location.replace("src/", "./")}/${c.name}`)(c.name),
|
12
|
+
),
|
13
|
+
...(controllers.length ? [FilePrinter.enter()] : []),
|
14
|
+
ts.factory.createClassDeclaration(
|
15
|
+
[
|
16
|
+
ts.factory.createDecorator(
|
17
|
+
ts.factory.createCallExpression(
|
18
|
+
ts.factory.createIdentifier("Module"),
|
19
|
+
undefined,
|
20
|
+
[
|
21
|
+
ts.factory.createObjectLiteralExpression(
|
22
|
+
[
|
23
|
+
ts.factory.createPropertyAssignment(
|
24
|
+
ts.factory.createIdentifier("controllers"),
|
25
|
+
ts.factory.createArrayLiteralExpression(
|
26
|
+
controllers.map((c) =>
|
27
|
+
ts.factory.createIdentifier(c.name),
|
28
|
+
),
|
29
|
+
),
|
30
|
+
),
|
31
|
+
],
|
32
|
+
true,
|
33
|
+
),
|
34
|
+
],
|
35
|
+
),
|
36
|
+
),
|
37
|
+
ts.factory.createToken(ts.SyntaxKind.ExportKeyword),
|
38
|
+
],
|
39
|
+
"MyModule",
|
40
|
+
undefined,
|
41
|
+
undefined,
|
42
|
+
[],
|
43
|
+
),
|
44
|
+
];
|
45
|
+
}
|
46
|
+
|
47
|
+
const $import = (file: string) => (instance: string) =>
|
48
|
+
ts.factory.createImportDeclaration(
|
49
|
+
undefined,
|
50
|
+
ts.factory.createImportClause(
|
51
|
+
false,
|
52
|
+
undefined,
|
53
|
+
ts.factory.createNamedImports([
|
54
|
+
ts.factory.createImportSpecifier(
|
55
|
+
false,
|
56
|
+
undefined,
|
57
|
+
ts.factory.createIdentifier(instance),
|
58
|
+
),
|
59
|
+
]),
|
60
|
+
),
|
61
|
+
ts.factory.createStringLiteral(file),
|
62
|
+
);
|