@riao/cli 2.0.0 → 3.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/README.md +2 -35
- package/bin/database-create-command.d.ts +21 -21
- package/bin/database-create-command.js +68 -82
- package/bin/database-create-command.js.map +1 -1
- package/bin/index.d.ts +2 -2
- package/bin/index.js +20 -22
- package/bin/index.js.map +1 -1
- package/bin/migration-create-command.d.ts +13 -13
- package/bin/migration-create-command.js +37 -51
- package/bin/migration-create-command.js.map +1 -1
- package/bin/migration-run-command.d.ts +14 -14
- package/bin/migration-run-command.js +19 -33
- package/bin/migration-run-command.js.map +1 -1
- package/bin/schema-build-command.d.ts +12 -12
- package/bin/schema-build-command.js +17 -31
- package/bin/schema-build-command.js.map +1 -1
- package/bin/seed-create-command.d.ts +13 -13
- package/bin/seed-create-command.js +35 -49
- package/bin/seed-create-command.js.map +1 -1
- package/bin/seed-run-command.d.ts +15 -15
- package/bin/seed-run-command.js +28 -37
- package/bin/seed-run-command.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +4 -4
- package/name-class-and-file.d.ts +10 -10
- package/name-class-and-file.js +45 -45
- package/name-class-and-file.js.map +1 -1
- package/options/database-option.d.ts +2 -2
- package/options/database-option.js +9 -9
- package/options/database-option.js.map +1 -1
- package/options/db-type-option.d.ts +13 -13
- package/options/db-type-option.js +57 -57
- package/options/db-type-option.js.map +1 -1
- package/options/direction-option.d.ts +2 -2
- package/options/direction-option.js +10 -10
- package/options/direction-option.js.map +1 -1
- package/options/index.d.ts +6 -6
- package/options/index.js +16 -16
- package/options/name-option.d.ts +2 -2
- package/options/name-option.js +8 -8
- package/options/name-option.js.map +1 -1
- package/options/seed-option.d.ts +2 -2
- package/options/seed-option.js +8 -8
- package/options/seed-option.js.map +1 -1
- package/options/steps-option.d.ts +2 -2
- package/options/steps-option.js +9 -9
- package/options/steps-option.js.map +1 -1
- package/package.json +9 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Command } from 'ts-commands';
|
|
2
|
-
interface Args {
|
|
3
|
-
name: string;
|
|
4
|
-
database: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class SeedCreateCommand extends Command {
|
|
7
|
-
|
|
8
|
-
description: string;
|
|
9
|
-
positional: import("ts-commands").
|
|
10
|
-
options: import("ts-commands").
|
|
11
|
-
handle(args: Args): Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
1
|
+
import { Command, ParsedArguments } from 'ts-commands';
|
|
2
|
+
interface Args extends ParsedArguments {
|
|
3
|
+
name: string;
|
|
4
|
+
database: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class SeedCreateCommand extends Command {
|
|
7
|
+
key: string;
|
|
8
|
+
description: string;
|
|
9
|
+
positional: import("ts-commands").CommandOption[];
|
|
10
|
+
options: import("ts-commands").CommandOption[];
|
|
11
|
+
handle(args: Args): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -1,50 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
'',
|
|
37
|
-
'\tpublic async down(): Promise<void> {',
|
|
38
|
-
'\t}',
|
|
39
|
-
'}',
|
|
40
|
-
'',
|
|
41
|
-
];
|
|
42
|
-
const databaseDir = (0, database_1.getDatabasePath)();
|
|
43
|
-
const db = yield (0, database_1.loadDatabase)(databaseDir, args.database);
|
|
44
|
-
const path = (0, path_1.join)(db.getSeedsDirectory(), fileName);
|
|
45
|
-
(0, fs_1.writeFileSync)(path, file.join('\n'));
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.SeedCreateCommand = SeedCreateCommand;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SeedCreateCommand = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const database_1 = require("@riao/dbal/database");
|
|
7
|
+
const options_1 = require("../options");
|
|
8
|
+
const ts_commands_1 = require("ts-commands");
|
|
9
|
+
const name_class_and_file_1 = require("../name-class-and-file");
|
|
10
|
+
class SeedCreateCommand extends ts_commands_1.Command {
|
|
11
|
+
key = 'seed:create';
|
|
12
|
+
description = 'Create a new seed file';
|
|
13
|
+
positional = [options_1.nameOption];
|
|
14
|
+
options = [options_1.databaseOption];
|
|
15
|
+
async handle(args) {
|
|
16
|
+
const { fileName, className } = (0, name_class_and_file_1.nameClassAndFile)(args.name);
|
|
17
|
+
const file = [
|
|
18
|
+
'import { Seed } from \'@riao/dbal/seed\';',
|
|
19
|
+
'',
|
|
20
|
+
`export default class ${className} extends Seed {`,
|
|
21
|
+
'\toverride async up(): Promise<void> {',
|
|
22
|
+
'\t}',
|
|
23
|
+
'',
|
|
24
|
+
'\toverride async down(): Promise<void> {',
|
|
25
|
+
'\t}',
|
|
26
|
+
'}',
|
|
27
|
+
'',
|
|
28
|
+
];
|
|
29
|
+
const databaseDir = (0, database_1.getDatabasePath)();
|
|
30
|
+
const db = await (0, database_1.loadDatabase)(databaseDir, args.database);
|
|
31
|
+
const path = (0, path_1.join)(db.getSeedsDirectory(), fileName);
|
|
32
|
+
(0, fs_1.writeFileSync)(path, file.join('\n'));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.SeedCreateCommand = SeedCreateCommand;
|
|
50
36
|
//# sourceMappingURL=seed-create-command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed-create-command.js","sourceRoot":"","sources":["../../../src/bin/seed-create-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seed-create-command.js","sourceRoot":"","sources":["../../../src/bin/seed-create-command.ts"],"names":[],"mappings":";;;AAAA,+BAAwC;AACxC,2BAAmC;AACnC,kDAAoE;AACpE,wCAAwD;AACxD,6CAAuD;AACvD,gEAA0D;AAO1D,MAAa,iBAAkB,SAAQ,qBAAO;IACpC,GAAG,GAAG,aAAa,CAAC;IACpB,WAAW,GAAG,wBAAwB,CAAC;IAEvC,UAAU,GAAG,CAAC,oBAAU,CAAC,CAAC;IAE1B,OAAO,GAAG,CAAC,wBAAc,CAAC,CAAC;IAE3B,KAAK,CAAC,MAAM,CAAC,IAAU;QAC/B,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAA,sCAAgB,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5D,MAAM,IAAI,GAAG;YACZ,2CAA2C;YAC3C,EAAE;YACF,wBAAwB,SAAS,iBAAiB;YAClD,wCAAwC;YACxC,KAAK;YACL,EAAE;YACF,0CAA0C;YAC1C,KAAK;YACL,GAAG;YACH,EAAE;SACF,CAAC;QAEF,MAAM,WAAW,GAAG,IAAA,0BAAe,GAAE,CAAC;QACtC,MAAM,EAAE,GAAG,MAAM,IAAA,uBAAY,EAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE1D,MAAM,IAAI,GAAG,IAAA,WAAQ,EAAC,EAAE,CAAC,iBAAiB,EAAE,EAAE,QAAQ,CAAC,CAAC;QAExD,IAAA,kBAAa,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC;CACD;AA/BD,8CA+BC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Command } from 'ts-commands';
|
|
2
|
-
interface Args {
|
|
3
|
-
database: string;
|
|
4
|
-
direction: 'up' | 'down';
|
|
5
|
-
seed: string;
|
|
6
|
-
steps: number;
|
|
7
|
-
}
|
|
8
|
-
export declare class SeedRunCommand extends Command {
|
|
9
|
-
|
|
10
|
-
description: string;
|
|
11
|
-
positional:
|
|
12
|
-
options: import("ts-commands").
|
|
13
|
-
handle(args: Args): Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
1
|
+
import { Command, ParsedArguments } from 'ts-commands';
|
|
2
|
+
interface Args extends ParsedArguments {
|
|
3
|
+
database: string;
|
|
4
|
+
direction: 'up' | 'down';
|
|
5
|
+
seed: string;
|
|
6
|
+
steps: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class SeedRunCommand extends Command {
|
|
9
|
+
key: string;
|
|
10
|
+
description: string;
|
|
11
|
+
positional: never[];
|
|
12
|
+
options: import("ts-commands").CommandOption[];
|
|
13
|
+
handle(args: Args): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
package/bin/seed-run-command.js
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
yield runner.run(undefined, undefined, args.direction, args.steps, args.seed
|
|
30
|
-
? args.seed.includes('.ts')
|
|
31
|
-
? args.seed
|
|
32
|
-
: args.seed + '.ts'
|
|
33
|
-
: undefined);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.SeedRunCommand = SeedRunCommand;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SeedRunCommand = void 0;
|
|
4
|
+
const ts_commands_1 = require("ts-commands");
|
|
5
|
+
const seed_1 = require("@riao/dbal/seed");
|
|
6
|
+
const database_1 = require("@riao/dbal/database");
|
|
7
|
+
const options_1 = require("../options");
|
|
8
|
+
class SeedRunCommand extends ts_commands_1.Command {
|
|
9
|
+
key = 'seed:run';
|
|
10
|
+
description = 'Run seeds';
|
|
11
|
+
positional = [];
|
|
12
|
+
options = [
|
|
13
|
+
options_1.databaseOption,
|
|
14
|
+
options_1.directionOption,
|
|
15
|
+
options_1.seedOption,
|
|
16
|
+
options_1.stepsOption
|
|
17
|
+
];
|
|
18
|
+
async handle(args) {
|
|
19
|
+
const db = await (0, database_1.loadDatabase)(undefined, args.database);
|
|
20
|
+
const runner = new seed_1.SeedRunner(db);
|
|
21
|
+
await runner.run(undefined, undefined, args.direction, args.steps, args.seed
|
|
22
|
+
? args.seed.includes('.ts')
|
|
23
|
+
? args.seed
|
|
24
|
+
: args.seed + '.ts'
|
|
25
|
+
: undefined);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.SeedRunCommand = SeedRunCommand;
|
|
38
29
|
//# sourceMappingURL=seed-run-command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed-run-command.js","sourceRoot":"","sources":["../../../src/bin/seed-run-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seed-run-command.js","sourceRoot":"","sources":["../../../src/bin/seed-run-command.ts"],"names":[],"mappings":";;;AAAA,6CAAuD;AACvD,0CAA6C;AAC7C,kDAAmD;AACnD,wCAKoB;AASpB,MAAa,cAAe,SAAQ,qBAAO;IACjC,GAAG,GAAG,UAAU,CAAC;IACjB,WAAW,GAAG,WAAW,CAAC;IAE1B,UAAU,GAAG,EAAE,CAAC;IAEhB,OAAO,GAAG;QAClB,wBAAc;QACd,yBAAe;QACf,oBAAU;QACV,qBAAW;KACX,CAAC;IAEO,KAAK,CAAC,MAAM,CAAC,IAAU;QAC/B,MAAM,EAAE,GAAG,MAAM,IAAA,uBAAY,EAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxD,MAAM,MAAM,GAAG,IAAI,iBAAU,CAAC,EAAE,CAAC,CAAC;QAElC,MAAM,MAAM,CAAC,GAAG,CACf,SAAS,EACT,SAAS,EACT,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,IAAI;YACR,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAC1B,CAAC,CAAC,IAAI,CAAC,IAAI;gBACX,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK;YACpB,CAAC,CAAC,SAAS,CACZ,CAAC;IACH,CAAC;CACD;AA7BD,wCA6BC"}
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const a = true;
|
|
1
|
+
export declare const a = true;
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.a = void 0;
|
|
4
|
-
exports.a = true;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.a = void 0;
|
|
4
|
+
exports.a = true;
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/name-class-and-file.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a class & filename
|
|
3
|
-
*
|
|
4
|
-
* @param name Input name, in either kebab-case or pascal-case
|
|
5
|
-
* @return Returns the file & class name
|
|
6
|
-
*/
|
|
7
|
-
export declare function nameClassAndFile(name: string): {
|
|
8
|
-
fileName: string;
|
|
9
|
-
className: string;
|
|
10
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Create a class & filename
|
|
3
|
+
*
|
|
4
|
+
* @param name Input name, in either kebab-case or pascal-case
|
|
5
|
+
* @return Returns the file & class name
|
|
6
|
+
*/
|
|
7
|
+
export declare function nameClassAndFile(name: string): {
|
|
8
|
+
fileName: string;
|
|
9
|
+
className: string;
|
|
10
|
+
};
|
package/name-class-and-file.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nameClassAndFile = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Create a class & filename
|
|
6
|
-
*
|
|
7
|
-
* @param name Input name, in either kebab-case or pascal-case
|
|
8
|
-
* @return Returns the file & class name
|
|
9
|
-
*/
|
|
10
|
-
function nameClassAndFile(name) {
|
|
11
|
-
let kebabCase;
|
|
12
|
-
let pascalCase;
|
|
13
|
-
if (name.includes('-')) {
|
|
14
|
-
// Kebab case
|
|
15
|
-
kebabCase = name;
|
|
16
|
-
// Pascal case
|
|
17
|
-
pascalCase = name
|
|
18
|
-
// Convert to pascal case
|
|
19
|
-
.replace(/-([a-z])/gi, (g) => g[1].toLocaleUpperCase())
|
|
20
|
-
// Remove any remaining hyphens
|
|
21
|
-
.replace(/-/g, '')
|
|
22
|
-
// Capitalize first letter
|
|
23
|
-
.replace(/^([a-z])/, (g) => g.toLocaleUpperCase());
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
const seperateByDash = (g) => g[0] + '-' + g[1];
|
|
27
|
-
// Kebab case
|
|
28
|
-
kebabCase = name
|
|
29
|
-
// Convert to kebab case
|
|
30
|
-
.replace(/([a-z0-9][A-Z0-9])/g, seperateByDash)
|
|
31
|
-
// Fix numbers followed by letters
|
|
32
|
-
.replace(/([0-9][a-zA-Z])/g, seperateByDash)
|
|
33
|
-
// To lowercase
|
|
34
|
-
.toLocaleLowerCase();
|
|
35
|
-
// Pascal case
|
|
36
|
-
pascalCase = name
|
|
37
|
-
// Capitalize first letter
|
|
38
|
-
.replace(/^([a-z])/, (g) => g.toLocaleUpperCase());
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
fileName: `${kebabCase}.ts`,
|
|
42
|
-
className: pascalCase,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
exports.nameClassAndFile = nameClassAndFile;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nameClassAndFile = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Create a class & filename
|
|
6
|
+
*
|
|
7
|
+
* @param name Input name, in either kebab-case or pascal-case
|
|
8
|
+
* @return Returns the file & class name
|
|
9
|
+
*/
|
|
10
|
+
function nameClassAndFile(name) {
|
|
11
|
+
let kebabCase;
|
|
12
|
+
let pascalCase;
|
|
13
|
+
if (name.includes('-')) {
|
|
14
|
+
// Kebab case
|
|
15
|
+
kebabCase = name;
|
|
16
|
+
// Pascal case
|
|
17
|
+
pascalCase = name
|
|
18
|
+
// Convert to pascal case
|
|
19
|
+
.replace(/-([a-z])/gi, (g) => g[1].toLocaleUpperCase())
|
|
20
|
+
// Remove any remaining hyphens
|
|
21
|
+
.replace(/-/g, '')
|
|
22
|
+
// Capitalize first letter
|
|
23
|
+
.replace(/^([a-z])/, (g) => g.toLocaleUpperCase());
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
const seperateByDash = (g) => g[0] + '-' + g[1];
|
|
27
|
+
// Kebab case
|
|
28
|
+
kebabCase = name
|
|
29
|
+
// Convert to kebab case
|
|
30
|
+
.replace(/([a-z0-9][A-Z0-9])/g, seperateByDash)
|
|
31
|
+
// Fix numbers followed by letters
|
|
32
|
+
.replace(/([0-9][a-zA-Z])/g, seperateByDash)
|
|
33
|
+
// To lowercase
|
|
34
|
+
.toLocaleLowerCase();
|
|
35
|
+
// Pascal case
|
|
36
|
+
pascalCase = name
|
|
37
|
+
// Capitalize first letter
|
|
38
|
+
.replace(/^([a-z])/, (g) => g.toLocaleUpperCase());
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
fileName: `${kebabCase}.ts`,
|
|
42
|
+
className: pascalCase,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.nameClassAndFile = nameClassAndFile;
|
|
46
46
|
//# sourceMappingURL=name-class-and-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name-class-and-file.js","sourceRoot":"","sources":["../../src/name-class-and-file.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC5C,IAAI,SAAiB,CAAC;IACtB,IAAI,UAAkB,CAAC;IAEvB,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"name-class-and-file.js","sourceRoot":"","sources":["../../src/name-class-and-file.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC5C,IAAI,SAAiB,CAAC;IACtB,IAAI,UAAkB,CAAC;IAEvB,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,aAAa;QACb,SAAS,GAAG,IAAI,CAAC;QAEjB,cAAc;QACd,UAAU,GAAG,IAAI;YAChB,yBAAyB;aACxB,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;YACvD,+BAA+B;aAC9B,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YAClB,0BAA0B;aACzB,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACrD,CAAC;SACI,CAAC;QACL,MAAM,cAAc,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAExD,aAAa;QACb,SAAS,GAAG,IAAI;YACf,wBAAwB;aACvB,OAAO,CAAC,qBAAqB,EAAE,cAAc,CAAC;YAC/C,kCAAkC;aACjC,OAAO,CAAC,kBAAkB,EAAE,cAAc,CAAC;YAC5C,eAAe;aACd,iBAAiB,EAAE,CAAC;QAEtB,cAAc;QACd,UAAU,GAAG,IAAI;YAChB,0BAA0B;aACzB,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,OAAO;QACN,QAAQ,EAAE,GAAG,SAAS,KAAK;QAC3B,SAAS,EAAE,UAAU;KACrB,CAAC;AACH,CAAC;AAvCD,4CAuCC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const databaseOption:
|
|
1
|
+
import { CommandOption } from 'ts-commands';
|
|
2
|
+
export declare const databaseOption: CommandOption;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.databaseOption = void 0;
|
|
4
|
-
const ts_commands_1 = require("ts-commands");
|
|
5
|
-
exports.databaseOption = {
|
|
6
|
-
key: 'database',
|
|
7
|
-
type: ts_commands_1.OptionType.string,
|
|
8
|
-
default: 'main',
|
|
9
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.databaseOption = void 0;
|
|
4
|
+
const ts_commands_1 = require("ts-commands");
|
|
5
|
+
exports.databaseOption = {
|
|
6
|
+
key: 'database',
|
|
7
|
+
type: ts_commands_1.OptionType.string,
|
|
8
|
+
default: 'main',
|
|
9
|
+
};
|
|
10
10
|
//# sourceMappingURL=database-option.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database-option.js","sourceRoot":"","sources":["../../../src/options/database-option.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"database-option.js","sourceRoot":"","sources":["../../../src/options/database-option.ts"],"names":[],"mappings":";;;AAAA,6CAAwD;AAE3C,QAAA,cAAc,GAAkB;IAC5C,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,wBAAU,CAAC,MAAM;IACvB,OAAO,EAAE,MAAM;CACf,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface DbDriverPropertiesInterface {
|
|
3
|
-
package: string;
|
|
4
|
-
className: string;
|
|
5
|
-
port?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const dbDriverProperties: {
|
|
8
|
-
[key: string]: DbDriverPropertiesInterface;
|
|
9
|
-
};
|
|
10
|
-
export type DbDrivers = keyof typeof dbDriverProperties;
|
|
11
|
-
export declare const dbDriverKeys: string[];
|
|
12
|
-
export declare const dbDriverOption:
|
|
13
|
-
export {};
|
|
1
|
+
import { CommandOption } from 'ts-commands';
|
|
2
|
+
interface DbDriverPropertiesInterface {
|
|
3
|
+
package: string;
|
|
4
|
+
className: string;
|
|
5
|
+
port?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const dbDriverProperties: {
|
|
8
|
+
[key: string]: DbDriverPropertiesInterface;
|
|
9
|
+
};
|
|
10
|
+
export type DbDrivers = keyof typeof dbDriverProperties;
|
|
11
|
+
export declare const dbDriverKeys: string[];
|
|
12
|
+
export declare const dbDriverOption: CommandOption;
|
|
13
|
+
export {};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dbDriverOption = exports.dbDriverKeys = exports.dbDriverProperties = void 0;
|
|
4
|
-
const ts_commands_1 = require("ts-commands");
|
|
5
|
-
exports.dbDriverProperties = {
|
|
6
|
-
mssql2017: {
|
|
7
|
-
package: '@riao/mssql',
|
|
8
|
-
className: 'DatabaseMsSql2017',
|
|
9
|
-
port: 1433,
|
|
10
|
-
},
|
|
11
|
-
mssql2019: {
|
|
12
|
-
package: '@riao/mssql',
|
|
13
|
-
className: 'DatabaseMsSql2019',
|
|
14
|
-
port: 1433,
|
|
15
|
-
},
|
|
16
|
-
mysql5: {
|
|
17
|
-
package: '@riao/mysql',
|
|
18
|
-
className: 'DatabaseMySql5',
|
|
19
|
-
port: 3306,
|
|
20
|
-
},
|
|
21
|
-
mysql8: {
|
|
22
|
-
package: '@riao/mysql',
|
|
23
|
-
className: 'DatabaseMySql8',
|
|
24
|
-
port: 3306,
|
|
25
|
-
},
|
|
26
|
-
pg12: {
|
|
27
|
-
package: '@riao/postgres',
|
|
28
|
-
className: 'DatabasePostgres12',
|
|
29
|
-
port: 5432,
|
|
30
|
-
},
|
|
31
|
-
pg13: {
|
|
32
|
-
package: '@riao/postgres',
|
|
33
|
-
className: 'DatabasePostgres13',
|
|
34
|
-
port: 5432,
|
|
35
|
-
},
|
|
36
|
-
pg14: {
|
|
37
|
-
package: '@riao/postgres',
|
|
38
|
-
className: 'DatabasePostgres14',
|
|
39
|
-
port: 5432,
|
|
40
|
-
},
|
|
41
|
-
pg15: {
|
|
42
|
-
package: '@riao/postgres',
|
|
43
|
-
className: 'DatabasePostgres15',
|
|
44
|
-
port: 5432,
|
|
45
|
-
},
|
|
46
|
-
sqlite: {
|
|
47
|
-
package: '@riao/sqlite',
|
|
48
|
-
className: 'DatabaseSqlite',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
exports.dbDriverKeys = Object.keys(exports.dbDriverProperties);
|
|
52
|
-
exports.dbDriverOption = {
|
|
53
|
-
key: 'driver',
|
|
54
|
-
type: ts_commands_1.OptionType.string,
|
|
55
|
-
default: 'mysql8',
|
|
56
|
-
choices: exports.dbDriverKeys,
|
|
57
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dbDriverOption = exports.dbDriverKeys = exports.dbDriverProperties = void 0;
|
|
4
|
+
const ts_commands_1 = require("ts-commands");
|
|
5
|
+
exports.dbDriverProperties = {
|
|
6
|
+
mssql2017: {
|
|
7
|
+
package: '@riao/mssql',
|
|
8
|
+
className: 'DatabaseMsSql2017',
|
|
9
|
+
port: 1433,
|
|
10
|
+
},
|
|
11
|
+
mssql2019: {
|
|
12
|
+
package: '@riao/mssql',
|
|
13
|
+
className: 'DatabaseMsSql2019',
|
|
14
|
+
port: 1433,
|
|
15
|
+
},
|
|
16
|
+
mysql5: {
|
|
17
|
+
package: '@riao/mysql',
|
|
18
|
+
className: 'DatabaseMySql5',
|
|
19
|
+
port: 3306,
|
|
20
|
+
},
|
|
21
|
+
mysql8: {
|
|
22
|
+
package: '@riao/mysql',
|
|
23
|
+
className: 'DatabaseMySql8',
|
|
24
|
+
port: 3306,
|
|
25
|
+
},
|
|
26
|
+
pg12: {
|
|
27
|
+
package: '@riao/postgres',
|
|
28
|
+
className: 'DatabasePostgres12',
|
|
29
|
+
port: 5432,
|
|
30
|
+
},
|
|
31
|
+
pg13: {
|
|
32
|
+
package: '@riao/postgres',
|
|
33
|
+
className: 'DatabasePostgres13',
|
|
34
|
+
port: 5432,
|
|
35
|
+
},
|
|
36
|
+
pg14: {
|
|
37
|
+
package: '@riao/postgres',
|
|
38
|
+
className: 'DatabasePostgres14',
|
|
39
|
+
port: 5432,
|
|
40
|
+
},
|
|
41
|
+
pg15: {
|
|
42
|
+
package: '@riao/postgres',
|
|
43
|
+
className: 'DatabasePostgres15',
|
|
44
|
+
port: 5432,
|
|
45
|
+
},
|
|
46
|
+
sqlite: {
|
|
47
|
+
package: '@riao/sqlite',
|
|
48
|
+
className: 'DatabaseSqlite',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
exports.dbDriverKeys = Object.keys(exports.dbDriverProperties);
|
|
52
|
+
exports.dbDriverOption = {
|
|
53
|
+
key: 'driver',
|
|
54
|
+
type: ts_commands_1.OptionType.string,
|
|
55
|
+
default: 'mysql8',
|
|
56
|
+
choices: exports.dbDriverKeys,
|
|
57
|
+
};
|
|
58
58
|
//# sourceMappingURL=db-type-option.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-type-option.js","sourceRoot":"","sources":["../../../src/options/db-type-option.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"db-type-option.js","sourceRoot":"","sources":["../../../src/options/db-type-option.ts"],"names":[],"mappings":";;;AAAA,6CAAwD;AAQ3C,QAAA,kBAAkB,GAE3B;IACH,SAAS,EAAE;QACV,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,mBAAmB;QAC9B,IAAI,EAAE,IAAI;KACV;IACD,SAAS,EAAE;QACV,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,mBAAmB;QAC9B,IAAI,EAAE,IAAI;KACV;IACD,MAAM,EAAE;QACP,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,gBAAgB;QAC3B,IAAI,EAAE,IAAI;KACV;IACD,MAAM,EAAE;QACP,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,gBAAgB;QAC3B,IAAI,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACL,OAAO,EAAE,gBAAgB;QACzB,SAAS,EAAE,oBAAoB;QAC/B,IAAI,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACL,OAAO,EAAE,gBAAgB;QACzB,SAAS,EAAE,oBAAoB;QAC/B,IAAI,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACL,OAAO,EAAE,gBAAgB;QACzB,SAAS,EAAE,oBAAoB;QAC/B,IAAI,EAAE,IAAI;KACV;IACD,IAAI,EAAE;QACL,OAAO,EAAE,gBAAgB;QACzB,SAAS,EAAE,oBAAoB;QAC/B,IAAI,EAAE,IAAI;KACV;IACD,MAAM,EAAE;QACP,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,gBAAgB;KAC3B;CACD,CAAC;AAGW,QAAA,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,0BAAkB,CAAC,CAAC;AAE/C,QAAA,cAAc,GAAkB;IAC5C,GAAG,EAAE,QAAQ;IACb,IAAI,EAAE,wBAAU,CAAC,MAAM;IACvB,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,oBAAY;CACrB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const directionOption:
|
|
1
|
+
import { CommandOption } from 'ts-commands';
|
|
2
|
+
export declare const directionOption: CommandOption;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.directionOption = void 0;
|
|
4
|
-
const ts_commands_1 = require("ts-commands");
|
|
5
|
-
exports.directionOption = {
|
|
6
|
-
key: 'direction',
|
|
7
|
-
type: ts_commands_1.OptionType.string,
|
|
8
|
-
default: 'up',
|
|
9
|
-
choices: ['up', 'down'],
|
|
10
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.directionOption = void 0;
|
|
4
|
+
const ts_commands_1 = require("ts-commands");
|
|
5
|
+
exports.directionOption = {
|
|
6
|
+
key: 'direction',
|
|
7
|
+
type: ts_commands_1.OptionType.string,
|
|
8
|
+
default: 'up',
|
|
9
|
+
choices: ['up', 'down'],
|
|
10
|
+
};
|
|
11
11
|
//# sourceMappingURL=direction-option.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direction-option.js","sourceRoot":"","sources":["../../../src/options/direction-option.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"direction-option.js","sourceRoot":"","sources":["../../../src/options/direction-option.ts"],"names":[],"mappings":";;;AAAA,6CAAwD;AAE3C,QAAA,eAAe,GAAkB;IAC7C,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,wBAAU,CAAC,MAAM;IACvB,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC"}
|
package/options/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { databaseOption } from './database-option';
|
|
2
|
-
export { dbDriverOption, DbDrivers, dbDriverProperties, } from './db-type-option';
|
|
3
|
-
export { directionOption } from './direction-option';
|
|
4
|
-
export { nameOption } from './name-option';
|
|
5
|
-
export { seedOption } from './seed-option';
|
|
6
|
-
export { stepsOption } from './steps-option';
|
|
1
|
+
export { databaseOption } from './database-option';
|
|
2
|
+
export { dbDriverOption, DbDrivers, dbDriverProperties, } from './db-type-option';
|
|
3
|
+
export { directionOption } from './direction-option';
|
|
4
|
+
export { nameOption } from './name-option';
|
|
5
|
+
export { seedOption } from './seed-option';
|
|
6
|
+
export { stepsOption } from './steps-option';
|