@nestia/migrate 0.1.3 → 0.1.5
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.d.ts +3 -3
- package/lib/NestiaMigrateApplication.js +3 -15
- package/lib/NestiaMigrateApplication.js.map +1 -1
- package/lib/archivers/FileArchiver.d.ts +3 -3
- package/lib/archivers/FileArchiver.js +8 -17
- package/lib/archivers/FileArchiver.js.map +1 -1
- package/lib/bundles/TEMPLATE.js +2 -132
- package/lib/bundles/TEMPLATE.js.map +1 -1
- package/lib/executable/bundle.js +2 -1
- package/lib/executable/bundle.js.map +1 -1
- package/lib/executable/migrate.js +19 -27
- package/lib/executable/migrate.js.map +1 -1
- package/lib/test/index.js +11 -23
- package/lib/test/index.js.map +1 -1
- package/package.json +1 -1
- package/src/NestiaMigrateApplication.ts +4 -7
- package/src/archivers/FileArchiver.ts +9 -9
- package/src/bundles/TEMPLATE.ts +2 -132
- package/src/executable/bundle.ts +2 -1
- package/src/executable/migrate.ts +19 -17
- package/src/test/index.ts +10 -16
@@ -8,11 +8,11 @@ export declare class NestiaMigrateApplication {
|
|
8
8
|
constructor(swagger: ISwagger);
|
9
9
|
analyze(): IMigrateProgram;
|
10
10
|
write(): IMigrateFile[];
|
11
|
-
generate: (archiver: NestiaMigrateApplication.IArchiver) => (output: string) =>
|
11
|
+
generate: (archiver: NestiaMigrateApplication.IArchiver) => (output: string) => void;
|
12
12
|
}
|
13
13
|
export declare namespace NestiaMigrateApplication {
|
14
14
|
interface IArchiver {
|
15
|
-
mkdir: (path: string) =>
|
16
|
-
writeFile: (path: string, content: string) =>
|
15
|
+
mkdir: (path: string) => void;
|
16
|
+
writeFile: (path: string, content: string) => void;
|
17
17
|
}
|
18
18
|
}
|
@@ -1,13 +1,4 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
4
|
};
|
@@ -19,14 +10,11 @@ const TEMPLATE_1 = require("./bundles/TEMPLATE");
|
|
19
10
|
const MigrateProgrammer_1 = require("./programmers/MigrateProgrammer");
|
20
11
|
class NestiaMigrateApplication {
|
21
12
|
constructor(swagger) {
|
22
|
-
this.generate = (archiver) => (output) =>
|
13
|
+
this.generate = (archiver) => (output) => {
|
23
14
|
const program = this.analyze();
|
24
15
|
const files = MigrateProgrammer_1.MigrateProgrammer.write(program);
|
25
|
-
|
26
|
-
|
27
|
-
...TEMPLATE_1.TEMPLATE,
|
28
|
-
]);
|
29
|
-
});
|
16
|
+
FileArchiver_1.FileArchiver.archive(archiver)(output)([...files, ...TEMPLATE_1.TEMPLATE]);
|
17
|
+
};
|
30
18
|
this.swagger = (input => {
|
31
19
|
const __is = input => {
|
32
20
|
const $join = typia_1.default.assert.join;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NestiaMigrateApplication.js","sourceRoot":"","sources":["../src/NestiaMigrateApplication.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"NestiaMigrateApplication.js","sourceRoot":"","sources":["../src/NestiaMigrateApplication.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,2DAAwD;AACxD,iDAA8C;AAC9C,uEAAoE;AAKpE,MAAa,wBAAwB;IAKjC,YAAmB,OAAiB;QAoB7B,a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CAAC,CAAC;SACjD;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;CASJ;AAhCD,4DAgCC"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { IMigrateFile } from "../structures/IMigrateFile";
|
2
2
|
export declare namespace FileArchiver {
|
3
3
|
interface IOperator {
|
4
|
-
mkdir(path: string):
|
5
|
-
writeFile(path: string, content: string):
|
4
|
+
mkdir(path: string): void;
|
5
|
+
writeFile(path: string, content: string): void;
|
6
6
|
}
|
7
|
-
const archive: (operator: IOperator) => (output: string) => (files: IMigrateFile[]) =>
|
7
|
+
const archive: (operator: IOperator) => (output: string) => (files: IMigrateFile[]) => void;
|
8
8
|
}
|
@@ -1,36 +1,27 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
3
|
exports.FileArchiver = void 0;
|
13
4
|
var FileArchiver;
|
14
5
|
(function (FileArchiver) {
|
15
|
-
FileArchiver.archive = (operator) => (output) => (files) =>
|
16
|
-
|
6
|
+
FileArchiver.archive = (operator) => (output) => (files) => {
|
7
|
+
operator.mkdir(output);
|
17
8
|
const visited = new Set();
|
18
9
|
for (const f of files) {
|
19
|
-
|
20
|
-
|
10
|
+
mkdir(operator.mkdir)(output)(visited)(f.location);
|
11
|
+
operator.writeFile([output, f.location, f.file].join("/"), f.content);
|
21
12
|
}
|
22
|
-
}
|
23
|
-
const mkdir = (creator) => (output) => (visited) => (path) =>
|
13
|
+
};
|
14
|
+
const mkdir = (creator) => (output) => (visited) => (path) => {
|
24
15
|
const sequence = path
|
25
16
|
.split("/")
|
26
17
|
.map((_str, i, entire) => entire.slice(0, i + 1).join("/"));
|
27
18
|
for (const s of sequence)
|
28
19
|
if (visited.has(s) === false)
|
29
20
|
try {
|
30
|
-
|
21
|
+
creator([output, s].join("/"));
|
31
22
|
visited.add(s);
|
32
23
|
}
|
33
24
|
catch (_a) { }
|
34
|
-
}
|
25
|
+
};
|
35
26
|
})(FileArchiver || (exports.FileArchiver = FileArchiver = {}));
|
36
27
|
//# sourceMappingURL=FileArchiver.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FileArchiver.js","sourceRoot":"","sources":["../../src/archivers/FileArchiver.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"FileArchiver.js","sourceRoot":"","sources":["../../src/archivers/FileArchiver.ts"],"names":[],"mappings":";;;AAEA,IAAiB,YAAY,CAoC5B;AApCD,WAAiB,YAAY;IAMZ,oBAAO,GAChB,CAAC,QAAmB,EAAE,EAAE,CACxB,CAAC,MAAc,EAAE,EAAE,CACnB,CAAC,KAAqB,EAAQ,EAAE;QAC5B,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACvB,MAAM,OAAO,GAAgB,IAAI,GAAG,EAAE,CAAC;QACvC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE;YACnB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YACnD,QAAQ,CAAC,SAAS,CACd,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACtC,CAAC,CAAC,OAAO,CACZ,CAAC;SACL;IACL,CAAC,CA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