@nestia/migrate 11.0.0-dev.20260316 → 11.0.1
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 -21
- package/README.md +93 -93
- package/lib/NestiaMigrateApplication.js +341 -341
- package/lib/bundles/NEST_TEMPLATE.js +48 -48
- package/lib/bundles/NEST_TEMPLATE.js.map +1 -1
- package/lib/bundles/SDK_TEMPLATE.js +21 -21
- package/lib/bundles/SDK_TEMPLATE.js.map +1 -1
- package/lib/executable/migrate.js +0 -0
- package/lib/index.mjs +469 -469
- package/lib/index.mjs.map +1 -1
- package/package.json +10 -8
- package/src/NestiaMigrateApplication.ts +168 -168
- package/src/analyzers/NestiaMigrateControllerAnalyzer.ts +51 -51
- package/src/bundles/NEST_TEMPLATE.ts +48 -48
- package/src/bundles/SDK_TEMPLATE.ts +21 -21
- package/src/executable/NestiaMigrateCommander.ts +104 -104
- package/src/executable/NestiaMigrateInquirer.ts +106 -106
- package/src/executable/bundle.js +129 -125
- package/src/executable/migrate.ts +0 -0
- package/src/factories/TypeLiteralFactory.ts +57 -57
- package/src/module.ts +7 -7
- package/src/programmers/NestiaMigrateApiFileProgrammer.ts +55 -55
- package/src/programmers/NestiaMigrateApiFunctionProgrammer.ts +347 -347
- package/src/programmers/NestiaMigrateApiNamespaceProgrammer.ts +517 -517
- package/src/programmers/NestiaMigrateApiSimulationProgrammer.ts +308 -308
- package/src/programmers/NestiaMigrateApiStartProgrammer.ts +197 -197
- 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 -409
- package/src/programmers/NestiaMigrateSchemaProgrammer.ts +465 -465
- package/src/programmers/index.ts +15 -15
- package/src/structures/INestiaMigrateContext.ts +9 -9
- package/src/structures/INestiaMigrateController.ts +8 -8
- package/src/structures/INestiaMigrateDto.ts +8 -8
- package/src/structures/INestiaMigrateProgram.ts +11 -11
- package/src/structures/index.ts +4 -4
- package/src/utils/FilePrinter.ts +49 -49
- package/src/utils/StringUtil.ts +114 -114
package/src/executable/bundle.js
CHANGED
|
@@ -1,125 +1,129 @@
|
|
|
1
|
-
const { version } = require("../../../../package.json");
|
|
2
|
-
const cp = require("child_process");
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
|
|
5
|
-
const ROOT = `${__dirname}/../..`;
|
|
6
|
-
const ASSETS = `${ROOT}/assets`;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
await
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
await
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
1
|
+
const { version } = require("../../../../package.json");
|
|
2
|
+
const cp = require("child_process");
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
|
|
5
|
+
const ROOT = `${__dirname}/../..`;
|
|
6
|
+
const ASSETS = `${ROOT}/assets`;
|
|
7
|
+
const TYPIA = require("js-yaml").load(
|
|
8
|
+
fs.readFileSync(`${__dirname}/../../../../pnpm-lock.yaml`, "utf8"),
|
|
9
|
+
).catalogs.samchon;
|
|
10
|
+
|
|
11
|
+
const update = (content) => {
|
|
12
|
+
const parsed = JSON.parse(content);
|
|
13
|
+
for (const record of [
|
|
14
|
+
parsed.dependencies ?? {},
|
|
15
|
+
parsed.devDependencies ?? {},
|
|
16
|
+
])
|
|
17
|
+
for (const key of Object.keys(record))
|
|
18
|
+
if (key.startsWith("@nestia/") || key === "nestia")
|
|
19
|
+
record[key] = `^${version}`;
|
|
20
|
+
else if (TYPIA[key]) record[key] = TYPIA[key].specifier;
|
|
21
|
+
return JSON.stringify(parsed, null, 2);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const bundle = async ({ mode, repository, exceptions, transform }) => {
|
|
25
|
+
const root = `${__dirname}/../..`;
|
|
26
|
+
const assets = `${root}/assets`;
|
|
27
|
+
const template = `${assets}/${mode}`;
|
|
28
|
+
|
|
29
|
+
const clone = async () => {
|
|
30
|
+
// CLONE REPOSITORY
|
|
31
|
+
if (fs.existsSync(template))
|
|
32
|
+
await fs.promises.rm(template, { recursive: true });
|
|
33
|
+
else
|
|
34
|
+
try {
|
|
35
|
+
await fs.promises.mkdir(ASSETS);
|
|
36
|
+
} catch {}
|
|
37
|
+
|
|
38
|
+
cp.execSync(`git clone https://github.com/samchon/${repository} ${mode}`, {
|
|
39
|
+
cwd: ASSETS,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// REMOVE VULNERABLE FILES
|
|
43
|
+
for (const location of exceptions ?? [])
|
|
44
|
+
await fs.promises.rm(`${template}/${location}`, { recursive: true });
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const iterate = (collection) => async (location) => {
|
|
48
|
+
const directory = await fs.promises.readdir(location);
|
|
49
|
+
for (const file of directory) {
|
|
50
|
+
const absolute = location + "/" + file;
|
|
51
|
+
const stats = await fs.promises.stat(absolute);
|
|
52
|
+
if (stats.isDirectory()) await iterate(collection)(absolute);
|
|
53
|
+
else {
|
|
54
|
+
const content = await fs.promises.readFile(absolute, "utf-8");
|
|
55
|
+
collection[
|
|
56
|
+
(() => {
|
|
57
|
+
const str = absolute.replace(template, "");
|
|
58
|
+
return str[0] === "/" ? str.substring(1) : str;
|
|
59
|
+
})()
|
|
60
|
+
] = content;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const archive = async (collection) => {
|
|
66
|
+
const name = `${mode.toUpperCase()}_TEMPLATE`;
|
|
67
|
+
const body = JSON.stringify(collection, null, 2);
|
|
68
|
+
const content = `export const ${name}: Record<string, string> = ${body}`;
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
await fs.promises.mkdir(`${ROOT}/src/bundles`);
|
|
72
|
+
} catch {}
|
|
73
|
+
await fs.promises.writeFile(
|
|
74
|
+
`${ROOT}/src/bundles/${name}.ts`,
|
|
75
|
+
content,
|
|
76
|
+
"utf8",
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const collection = {};
|
|
81
|
+
await clone();
|
|
82
|
+
await iterate(collection)(template);
|
|
83
|
+
if (transform)
|
|
84
|
+
for (const [key, value] of Object.entries(collection))
|
|
85
|
+
collection[key] = transform(key, value);
|
|
86
|
+
await archive(collection);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const main = async () => {
|
|
90
|
+
await bundle({
|
|
91
|
+
mode: "nest",
|
|
92
|
+
repository: "nestia-start",
|
|
93
|
+
exceptions: [
|
|
94
|
+
".git",
|
|
95
|
+
".github/dependabot.yml",
|
|
96
|
+
".github/workflows/dependabot-automerge.yml",
|
|
97
|
+
"src/api/functional",
|
|
98
|
+
"src/controllers",
|
|
99
|
+
"src/MyModule.ts",
|
|
100
|
+
"src/providers",
|
|
101
|
+
"test/features",
|
|
102
|
+
],
|
|
103
|
+
transform: (key, value) => {
|
|
104
|
+
if (key.endsWith("package.json")) return update(value);
|
|
105
|
+
return value;
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
await bundle({
|
|
109
|
+
mode: "sdk",
|
|
110
|
+
repository: "nestia-sdk-template",
|
|
111
|
+
exceptions: [
|
|
112
|
+
".git",
|
|
113
|
+
".github/dependabot.yml",
|
|
114
|
+
".github/workflows/build.yml",
|
|
115
|
+
".github/workflows/dependabot-automerge.yml",
|
|
116
|
+
"src/functional",
|
|
117
|
+
"src/structures",
|
|
118
|
+
"test/features",
|
|
119
|
+
],
|
|
120
|
+
transform: (key, value) => {
|
|
121
|
+
if (key.endsWith("package.json")) return update(value);
|
|
122
|
+
return value;
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
main().catch((exp) => {
|
|
127
|
+
console.error(exp);
|
|
128
|
+
process.exit(-1);
|
|
129
|
+
});
|
|
File without changes
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { NamingConvention } from "@typia/utils";
|
|
2
|
-
import ts from "typescript";
|
|
3
|
-
|
|
4
|
-
export namespace TypeLiteralFactory {
|
|
5
|
-
export const generate = (value: any): ts.TypeNode =>
|
|
6
|
-
typeof value === "boolean"
|
|
7
|
-
? generateBoolean(value)
|
|
8
|
-
: typeof value === "number"
|
|
9
|
-
? generateNumber(value)
|
|
10
|
-
: typeof value === "string"
|
|
11
|
-
? generatestring(value)
|
|
12
|
-
: typeof value === "object"
|
|
13
|
-
? value === null
|
|
14
|
-
? generateNull()
|
|
15
|
-
: Array.isArray(value)
|
|
16
|
-
? generateTuple(value)
|
|
17
|
-
: generateObject(value)
|
|
18
|
-
: ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword);
|
|
19
|
-
|
|
20
|
-
const generatestring = (str: string) =>
|
|
21
|
-
ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(str));
|
|
22
|
-
|
|
23
|
-
const generateNumber = (num: number) =>
|
|
24
|
-
ts.factory.createLiteralTypeNode(
|
|
25
|
-
num < 0
|
|
26
|
-
? ts.factory.createPrefixUnaryExpression(
|
|
27
|
-
ts.SyntaxKind.MinusToken,
|
|
28
|
-
ts.factory.createNumericLiteral(-num),
|
|
29
|
-
)
|
|
30
|
-
: ts.factory.createNumericLiteral(num),
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const generateBoolean = (bool: boolean) =>
|
|
34
|
-
ts.factory.createLiteralTypeNode(
|
|
35
|
-
bool ? ts.factory.createTrue() : ts.factory.createFalse(),
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
const generateNull = () =>
|
|
39
|
-
ts.factory.createLiteralTypeNode(ts.factory.createNull());
|
|
40
|
-
|
|
41
|
-
const generateTuple = (items: any[]) =>
|
|
42
|
-
ts.factory.createTupleTypeNode(items.map(generate));
|
|
43
|
-
|
|
44
|
-
const generateObject = (obj: object) =>
|
|
45
|
-
ts.factory.createTypeLiteralNode(
|
|
46
|
-
Object.entries(obj).map(([key, value]) =>
|
|
47
|
-
ts.factory.createPropertySignature(
|
|
48
|
-
undefined,
|
|
49
|
-
NamingConvention.variable(key)
|
|
50
|
-
? ts.factory.createIdentifier(key)
|
|
51
|
-
: ts.factory.createStringLiteral(key),
|
|
52
|
-
undefined,
|
|
53
|
-
generate(value),
|
|
54
|
-
),
|
|
55
|
-
),
|
|
56
|
-
);
|
|
57
|
-
}
|
|
1
|
+
import { NamingConvention } from "@typia/utils";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
export namespace TypeLiteralFactory {
|
|
5
|
+
export const generate = (value: any): ts.TypeNode =>
|
|
6
|
+
typeof value === "boolean"
|
|
7
|
+
? generateBoolean(value)
|
|
8
|
+
: typeof value === "number"
|
|
9
|
+
? generateNumber(value)
|
|
10
|
+
: typeof value === "string"
|
|
11
|
+
? generatestring(value)
|
|
12
|
+
: typeof value === "object"
|
|
13
|
+
? value === null
|
|
14
|
+
? generateNull()
|
|
15
|
+
: Array.isArray(value)
|
|
16
|
+
? generateTuple(value)
|
|
17
|
+
: generateObject(value)
|
|
18
|
+
: ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword);
|
|
19
|
+
|
|
20
|
+
const generatestring = (str: string) =>
|
|
21
|
+
ts.factory.createLiteralTypeNode(ts.factory.createStringLiteral(str));
|
|
22
|
+
|
|
23
|
+
const generateNumber = (num: number) =>
|
|
24
|
+
ts.factory.createLiteralTypeNode(
|
|
25
|
+
num < 0
|
|
26
|
+
? ts.factory.createPrefixUnaryExpression(
|
|
27
|
+
ts.SyntaxKind.MinusToken,
|
|
28
|
+
ts.factory.createNumericLiteral(-num),
|
|
29
|
+
)
|
|
30
|
+
: ts.factory.createNumericLiteral(num),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const generateBoolean = (bool: boolean) =>
|
|
34
|
+
ts.factory.createLiteralTypeNode(
|
|
35
|
+
bool ? ts.factory.createTrue() : ts.factory.createFalse(),
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const generateNull = () =>
|
|
39
|
+
ts.factory.createLiteralTypeNode(ts.factory.createNull());
|
|
40
|
+
|
|
41
|
+
const generateTuple = (items: any[]) =>
|
|
42
|
+
ts.factory.createTupleTypeNode(items.map(generate));
|
|
43
|
+
|
|
44
|
+
const generateObject = (obj: object) =>
|
|
45
|
+
ts.factory.createTypeLiteralNode(
|
|
46
|
+
Object.entries(obj).map(([key, value]) =>
|
|
47
|
+
ts.factory.createPropertySignature(
|
|
48
|
+
undefined,
|
|
49
|
+
NamingConvention.variable(key)
|
|
50
|
+
? ts.factory.createIdentifier(key)
|
|
51
|
+
: ts.factory.createStringLiteral(key),
|
|
52
|
+
undefined,
|
|
53
|
+
generate(value),
|
|
54
|
+
),
|
|
55
|
+
),
|
|
56
|
+
);
|
|
57
|
+
}
|
package/src/module.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./NestiaMigrateApplication";
|
|
2
|
-
export * from "./structures/index";
|
|
3
|
-
|
|
4
|
-
export * from "./archivers/NestiaMigrateFileArchiver";
|
|
5
|
-
export * from "./executable/NestiaMigrateCommander";
|
|
6
|
-
|
|
7
|
-
export * from "./programmers/index";
|
|
1
|
+
export * from "./NestiaMigrateApplication";
|
|
2
|
+
export * from "./structures/index";
|
|
3
|
+
|
|
4
|
+
export * from "./archivers/NestiaMigrateFileArchiver";
|
|
5
|
+
export * from "./executable/NestiaMigrateCommander";
|
|
6
|
+
|
|
7
|
+
export * from "./programmers/index";
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { IHttpMigrateRoute, OpenApi } from "@typia/interface";
|
|
2
|
-
import ts from "typescript";
|
|
3
|
-
|
|
4
|
-
import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
|
|
5
|
-
import { FilePrinter } from "../utils/FilePrinter";
|
|
6
|
-
import { NestiaMigrateApiFunctionProgrammer } from "./NestiaMigrateApiFunctionProgrammer";
|
|
7
|
-
import { NestiaMigrateApiNamespaceProgrammer } from "./NestiaMigrateApiNamespaceProgrammer";
|
|
8
|
-
import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
|
|
9
|
-
|
|
10
|
-
export namespace NestiaMigrateApiFileProgrammer {
|
|
11
|
-
export interface IProps {
|
|
12
|
-
config: INestiaMigrateConfig;
|
|
13
|
-
components: OpenApi.IComponents;
|
|
14
|
-
namespace: string[];
|
|
15
|
-
routes: IHttpMigrateRoute[];
|
|
16
|
-
children: Set<string>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const write = (props: IProps): ts.Statement[] => {
|
|
20
|
-
const importer: NestiaMigrateImportProgrammer =
|
|
21
|
-
new NestiaMigrateImportProgrammer();
|
|
22
|
-
const statements: ts.Statement[] = props.routes
|
|
23
|
-
.map((route) => [
|
|
24
|
-
FilePrinter.newLine(),
|
|
25
|
-
NestiaMigrateApiFunctionProgrammer.write({
|
|
26
|
-
config: props.config,
|
|
27
|
-
components: props.components,
|
|
28
|
-
importer,
|
|
29
|
-
route,
|
|
30
|
-
}),
|
|
31
|
-
NestiaMigrateApiNamespaceProgrammer.write({
|
|
32
|
-
config: props.config,
|
|
33
|
-
components: props.components,
|
|
34
|
-
importer,
|
|
35
|
-
route,
|
|
36
|
-
}),
|
|
37
|
-
])
|
|
38
|
-
.flat();
|
|
39
|
-
return [
|
|
40
|
-
...importer.toStatements(
|
|
41
|
-
(ref) => `../${"../".repeat(props.namespace.length)}structures/${ref}`,
|
|
42
|
-
),
|
|
43
|
-
...[...props.children].map((child) =>
|
|
44
|
-
ts.factory.createExportDeclaration(
|
|
45
|
-
undefined,
|
|
46
|
-
false,
|
|
47
|
-
ts.factory.createNamespaceExport(ts.factory.createIdentifier(child)),
|
|
48
|
-
ts.factory.createStringLiteral(`./${child}/index`),
|
|
49
|
-
undefined,
|
|
50
|
-
),
|
|
51
|
-
),
|
|
52
|
-
...statements,
|
|
53
|
-
];
|
|
54
|
-
};
|
|
55
|
-
}
|
|
1
|
+
import { IHttpMigrateRoute, OpenApi } from "@typia/interface";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
import { INestiaMigrateConfig } from "../structures/INestiaMigrateConfig";
|
|
5
|
+
import { FilePrinter } from "../utils/FilePrinter";
|
|
6
|
+
import { NestiaMigrateApiFunctionProgrammer } from "./NestiaMigrateApiFunctionProgrammer";
|
|
7
|
+
import { NestiaMigrateApiNamespaceProgrammer } from "./NestiaMigrateApiNamespaceProgrammer";
|
|
8
|
+
import { NestiaMigrateImportProgrammer } from "./NestiaMigrateImportProgrammer";
|
|
9
|
+
|
|
10
|
+
export namespace NestiaMigrateApiFileProgrammer {
|
|
11
|
+
export interface IProps {
|
|
12
|
+
config: INestiaMigrateConfig;
|
|
13
|
+
components: OpenApi.IComponents;
|
|
14
|
+
namespace: string[];
|
|
15
|
+
routes: IHttpMigrateRoute[];
|
|
16
|
+
children: Set<string>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const write = (props: IProps): ts.Statement[] => {
|
|
20
|
+
const importer: NestiaMigrateImportProgrammer =
|
|
21
|
+
new NestiaMigrateImportProgrammer();
|
|
22
|
+
const statements: ts.Statement[] = props.routes
|
|
23
|
+
.map((route) => [
|
|
24
|
+
FilePrinter.newLine(),
|
|
25
|
+
NestiaMigrateApiFunctionProgrammer.write({
|
|
26
|
+
config: props.config,
|
|
27
|
+
components: props.components,
|
|
28
|
+
importer,
|
|
29
|
+
route,
|
|
30
|
+
}),
|
|
31
|
+
NestiaMigrateApiNamespaceProgrammer.write({
|
|
32
|
+
config: props.config,
|
|
33
|
+
components: props.components,
|
|
34
|
+
importer,
|
|
35
|
+
route,
|
|
36
|
+
}),
|
|
37
|
+
])
|
|
38
|
+
.flat();
|
|
39
|
+
return [
|
|
40
|
+
...importer.toStatements(
|
|
41
|
+
(ref) => `../${"../".repeat(props.namespace.length)}structures/${ref}`,
|
|
42
|
+
),
|
|
43
|
+
...[...props.children].map((child) =>
|
|
44
|
+
ts.factory.createExportDeclaration(
|
|
45
|
+
undefined,
|
|
46
|
+
false,
|
|
47
|
+
ts.factory.createNamespaceExport(ts.factory.createIdentifier(child)),
|
|
48
|
+
ts.factory.createStringLiteral(`./${child}/index`),
|
|
49
|
+
undefined,
|
|
50
|
+
),
|
|
51
|
+
),
|
|
52
|
+
...statements,
|
|
53
|
+
];
|
|
54
|
+
};
|
|
55
|
+
}
|