@nestia/migrate 12.0.0-rc.2 → 12.0.0-rc.3
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/lib/_virtual/_tstl.mjs +2 -2
- package/lib/_virtual/index.mjs +2 -2
- package/lib/_virtual/index2.mjs +2 -2
- package/lib/_virtual/index3.mjs +2 -2
- package/lib/archivers/NestiaMigrateFileArchiver2.mjs +2 -2
- package/lib/archivers/NestiaMigrateFileArchiver2.mjs.map +1 -1
- package/lib/bundles/NEST_TEMPLATE.js +47 -47
- package/lib/bundles/NEST_TEMPLATE.js.map +1 -1
- package/lib/bundles/NEST_TEMPLATE2.mjs +47 -47
- package/lib/bundles/NEST_TEMPLATE2.mjs.map +1 -1
- package/lib/bundles/SDK_TEMPLATE.js +20 -20
- package/lib/bundles/SDK_TEMPLATE.js.map +1 -1
- package/lib/bundles/SDK_TEMPLATE2.mjs +20 -20
- package/lib/bundles/SDK_TEMPLATE2.mjs.map +1 -1
- package/lib/index2.mjs +1 -1
- package/lib/module2.mjs +2 -2
- package/lib/programmers/NestiaMigrateApiProgrammer2.mjs +4 -4
- package/lib/programmers/NestiaMigrateApiProgrammer2.mjs.map +1 -1
- package/lib/programmers/index2.mjs +1 -1
- package/lib/structures/index2.mjs +1 -1
- package/package.json +6 -6
- package/src/NestiaMigrateApplication.ts +196 -196
- package/src/analyzers/NestiaMigrateControllerAnalyzer.ts +51 -51
- package/src/archivers/NestiaMigrateFileArchiver.ts +28 -28
- package/src/bundles/NEST_TEMPLATE.ts +47 -47
- package/src/bundles/SDK_TEMPLATE.ts +20 -20
- package/src/executable/NestiaMigrateCommander.ts +115 -115
- package/src/executable/NestiaMigrateInquirer.ts +106 -106
- package/src/executable/bundle.js +323 -349
- package/src/executable/migrate.ts +7 -7
- package/src/factories/ExpressionFactory.ts +23 -23
- package/src/factories/FormatCheatSheet.ts +71 -71
- package/src/factories/IdentifierFactory.ts +84 -84
- package/src/factories/LiteralFactory.ts +54 -54
- package/src/factories/StatementFactory.ts +56 -56
- package/src/factories/TypeFactory.ts +27 -27
- package/src/factories/TypeLiteralFactory.ts +62 -62
- package/src/index.ts +4 -4
- package/src/internal/ts.ts +75 -75
- package/src/module.ts +6 -6
- package/src/programmers/NestiaMigrateApiFileProgrammer.ts +55 -55
- package/src/programmers/NestiaMigrateApiFunctionProgrammer.ts +358 -358
- package/src/programmers/NestiaMigrateApiNamespaceProgrammer.ts +511 -511
- package/src/programmers/NestiaMigrateApiProgrammer.ts +108 -108
- package/src/programmers/NestiaMigrateApiSimulationProgrammer.ts +309 -309
- package/src/programmers/NestiaMigrateApiStartProgrammer.ts +198 -198
- package/src/programmers/NestiaMigrateDtoProgrammer.ts +117 -117
- package/src/programmers/NestiaMigrateE2eFileProgrammer.ts +155 -155
- package/src/programmers/NestiaMigrateE2eProgrammer.ts +48 -48
- package/src/programmers/NestiaMigrateImportProgrammer.ts +119 -119
- package/src/programmers/NestiaMigrateNestControllerProgrammer.ts +70 -70
- package/src/programmers/NestiaMigrateNestMethodProgrammer.ts +402 -402
- package/src/programmers/NestiaMigrateNestModuleProgrammer.ts +64 -64
- package/src/programmers/NestiaMigrateNestProgrammer.ts +89 -89
- package/src/programmers/NestiaMigrateSchemaProgrammer.ts +475 -475
- package/src/programmers/index.ts +15 -15
- package/src/structures/INestiaMigrateConfig.ts +19 -19
- package/src/structures/INestiaMigrateContext.ts +9 -9
- package/src/structures/INestiaMigrateController.ts +8 -8
- package/src/structures/INestiaMigrateFile.ts +5 -5
- package/src/structures/index.ts +4 -4
- package/src/utils/FilePrinter.ts +44 -44
- package/src/utils/MapUtil.ts +13 -13
- package/src/utils/StringUtil.ts +109 -109
- package/README.md +0 -93
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { VariadicSingleton } from "tstl";
|
|
2
|
-
|
|
3
|
-
export namespace NestiaMigrateFileArchiver {
|
|
4
|
-
export const archive = async (props: {
|
|
5
|
-
mkdir: (path: string) => Promise<void>;
|
|
6
|
-
writeFile: (path: string, content: string) => Promise<void>;
|
|
7
|
-
root: string;
|
|
8
|
-
files: Record<string, string>;
|
|
9
|
-
}): Promise<void> => {
|
|
10
|
-
const mkdir = new VariadicSingleton(
|
|
11
|
-
async (location: string): Promise<void> => {
|
|
12
|
-
try {
|
|
13
|
-
await props.mkdir(`${props.root}/${location}`);
|
|
14
|
-
} catch {}
|
|
15
|
-
},
|
|
16
|
-
);
|
|
17
|
-
const iterate = async (location: string): Promise<void> => {
|
|
18
|
-
const sequence: string[] = location
|
|
19
|
-
.split("/")
|
|
20
|
-
.map((_str, i, entire) => entire.slice(0, i + 1).join("/"));
|
|
21
|
-
for (const s of sequence) await mkdir.get(s);
|
|
22
|
-
};
|
|
23
|
-
for (const [key, value] of Object.entries(props.files)) {
|
|
24
|
-
await iterate(key.split("/").slice(0, -1).join("/"));
|
|
25
|
-
await props.writeFile(`${props.root}/${key}`, value);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
1
|
+
import { VariadicSingleton } from "tstl";
|
|
2
|
+
|
|
3
|
+
export namespace NestiaMigrateFileArchiver {
|
|
4
|
+
export const archive = async (props: {
|
|
5
|
+
mkdir: (path: string) => Promise<void>;
|
|
6
|
+
writeFile: (path: string, content: string) => Promise<void>;
|
|
7
|
+
root: string;
|
|
8
|
+
files: Record<string, string>;
|
|
9
|
+
}): Promise<void> => {
|
|
10
|
+
const mkdir = new VariadicSingleton(
|
|
11
|
+
async (location: string): Promise<void> => {
|
|
12
|
+
try {
|
|
13
|
+
await props.mkdir(`${props.root}/${location}`);
|
|
14
|
+
} catch {}
|
|
15
|
+
},
|
|
16
|
+
);
|
|
17
|
+
const iterate = async (location: string): Promise<void> => {
|
|
18
|
+
const sequence: string[] = location
|
|
19
|
+
.split("/")
|
|
20
|
+
.map((_str, i, entire) => entire.slice(0, i + 1).join("/"));
|
|
21
|
+
for (const s of sequence) await mkdir.get(s);
|
|
22
|
+
};
|
|
23
|
+
for (const [key, value] of Object.entries(props.files)) {
|
|
24
|
+
await iterate(key.split("/").slice(0, -1).join("/"));
|
|
25
|
+
await props.writeFile(`${props.root}/${key}`, value);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|