nsgm-cli 2.1.19 → 2.1.21
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/client/components/Button.tsx +3 -3
- package/client/components/ClientProviders.tsx +12 -12
- package/client/components/LanguageSwitcher.tsx +26 -26
- package/client/components/SSRSafeAntdProvider.tsx +7 -7
- package/client/components/SuppressHydrationWarnings.tsx +30 -30
- package/client/components/__tests__/Button.test.tsx +12 -12
- package/client/layout/index.tsx +124 -124
- package/client/redux/reducers.ts +2 -2
- package/client/redux/store.ts +24 -24
- package/client/redux/template/manage/actions.ts +40 -40
- package/client/redux/template/manage/reducers.ts +32 -32
- package/client/redux/template/manage/types.ts +19 -19
- package/client/service/template/manage.ts +29 -29
- package/client/styled/common.ts +6 -6
- package/client/styled/layout/index.ts +17 -17
- package/client/styled/template/manage.ts +19 -19
- package/client/utils/common.ts +54 -54
- package/client/utils/cookie.ts +30 -30
- package/client/utils/fetch.ts +111 -111
- package/client/utils/i18n.ts +41 -41
- package/client/utils/menu.tsx +12 -12
- package/client/utils/navigation.ts +22 -22
- package/client/utils/sso.ts +124 -124
- package/client/utils/suppressWarnings.ts +17 -17
- package/generation/prettierrc +6 -0
- package/lib/args.js +19 -19
- package/lib/cli/app.d.ts +1 -1
- package/lib/cli/app.js +2 -2
- package/lib/cli/commands/build.d.ts +1 -1
- package/lib/cli/commands/build.js +9 -9
- package/lib/cli/commands/create.d.ts +1 -1
- package/lib/cli/commands/create.js +36 -36
- package/lib/cli/commands/delete.d.ts +1 -1
- package/lib/cli/commands/delete.js +55 -55
- package/lib/cli/commands/export.d.ts +1 -1
- package/lib/cli/commands/export.js +12 -12
- package/lib/cli/commands/help.d.ts +1 -1
- package/lib/cli/commands/help.js +29 -29
- package/lib/cli/commands/init.d.ts +1 -1
- package/lib/cli/commands/init.js +31 -31
- package/lib/cli/commands/server.d.ts +1 -1
- package/lib/cli/commands/server.js +12 -12
- package/lib/cli/commands/upgrade.d.ts +1 -1
- package/lib/cli/commands/upgrade.js +13 -13
- package/lib/cli/commands/version.d.ts +1 -1
- package/lib/cli/commands/version.js +7 -7
- package/lib/cli/index.d.ts +13 -13
- package/lib/cli/parser.d.ts +1 -1
- package/lib/cli/parser.js +12 -12
- package/lib/cli/registry.d.ts +1 -1
- package/lib/cli/types.d.ts +2 -2
- package/lib/cli/utils/console.d.ts +2 -2
- package/lib/cli/utils/console.js +22 -22
- package/lib/cli/utils/index.d.ts +2 -2
- package/lib/cli/utils/prompt.d.ts +1 -1
- package/lib/cli/utils/prompt.js +98 -98
- package/lib/constants.js +28 -28
- package/lib/generate.d.ts +2 -2
- package/lib/generate.js +19 -19
- package/lib/generate_create.d.ts +1 -1
- package/lib/generate_create.js +38 -38
- package/lib/generate_delete.js +63 -63
- package/lib/generate_init.js +94 -94
- package/lib/generators/base-generator.d.ts +1 -1
- package/lib/generators/base-generator.js +23 -23
- package/lib/generators/file-generator.js +15 -15
- package/lib/generators/generator-factory.d.ts +5 -5
- package/lib/generators/i18n-generator.d.ts +1 -1
- package/lib/generators/i18n-generator.js +127 -127
- package/lib/generators/page-generator.d.ts +1 -1
- package/lib/generators/page-generator.js +25 -25
- package/lib/generators/resolver-generator.d.ts +1 -1
- package/lib/generators/resolver-generator.js +27 -27
- package/lib/generators/schema-generator.d.ts +1 -1
- package/lib/generators/schema-generator.js +4 -4
- package/lib/generators/service-generator.d.ts +1 -1
- package/lib/generators/service-generator.js +29 -29
- package/lib/generators/sql-generator.d.ts +1 -1
- package/lib/generators/sql-generator.js +10 -10
- package/lib/index.js +23 -23
- package/lib/server/csrf.d.ts +3 -3
- package/lib/server/csrf.js +20 -20
- package/lib/server/db.d.ts +1 -1
- package/lib/server/db.js +21 -21
- package/lib/server/graphql.js +26 -26
- package/lib/server/plugins/date.d.ts +1 -1
- package/lib/server/plugins/date.js +6 -6
- package/lib/server/utils/graphql-cache.js +5 -5
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/utils/project-config.d.ts +1 -1
- package/lib/utils/project-config.js +20 -20
- package/lib/utils.js +3 -3
- package/package.json +1 -1
- package/pages/_app.tsx +62 -62
- package/pages/_document.tsx +15 -15
- package/pages/_error.tsx +26 -26
- package/pages/index.tsx +48 -48
- package/pages/login.tsx +64 -64
- package/pages/template/manage.tsx +175 -175
|
@@ -3,24 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.startCommand = exports.devCommand = void 0;
|
|
4
4
|
const index_1 = require("../../index");
|
|
5
5
|
exports.devCommand = {
|
|
6
|
-
name:
|
|
6
|
+
name: "dev",
|
|
7
7
|
aliases: [],
|
|
8
|
-
description:
|
|
9
|
-
usage:
|
|
10
|
-
examples: [
|
|
8
|
+
description: "开发模式启动服务器",
|
|
9
|
+
usage: "nsgm dev",
|
|
10
|
+
examples: ["nsgm dev"],
|
|
11
11
|
execute: async (_options) => {
|
|
12
|
-
console.log(
|
|
13
|
-
(0, index_1.startExpress)({ dev: true }, undefined,
|
|
12
|
+
console.log("🚀 启动开发服务器...");
|
|
13
|
+
(0, index_1.startExpress)({ dev: true }, undefined, "dev");
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
exports.startCommand = {
|
|
17
|
-
name:
|
|
17
|
+
name: "start",
|
|
18
18
|
aliases: [],
|
|
19
|
-
description:
|
|
20
|
-
usage:
|
|
21
|
-
examples: [
|
|
19
|
+
description: "生产模式启动服务器",
|
|
20
|
+
usage: "nsgm start",
|
|
21
|
+
examples: ["nsgm start"],
|
|
22
22
|
execute: async (_options) => {
|
|
23
|
-
console.log(
|
|
24
|
-
(0, index_1.startExpress)({ dev: false }, undefined,
|
|
23
|
+
console.log("🌟 启动生产服务器...");
|
|
24
|
+
(0, index_1.startExpress)({ dev: false }, undefined, "start");
|
|
25
25
|
},
|
|
26
26
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Command } from
|
|
1
|
+
import { Command } from "../types";
|
|
2
2
|
export declare const upgradeCommand: Command;
|
|
@@ -4,34 +4,34 @@ exports.upgradeCommand = void 0;
|
|
|
4
4
|
const parser_1 = require("../parser");
|
|
5
5
|
const generate_1 = require("../../generate");
|
|
6
6
|
exports.upgradeCommand = {
|
|
7
|
-
name:
|
|
8
|
-
aliases: [
|
|
9
|
-
description:
|
|
10
|
-
usage:
|
|
11
|
-
examples: [
|
|
7
|
+
name: "upgrade",
|
|
8
|
+
aliases: ["-u", "--upgrade"],
|
|
9
|
+
description: "升级 NSGM 项目",
|
|
10
|
+
usage: "nsgm upgrade [dictionary]",
|
|
11
|
+
examples: ["nsgm upgrade", "nsgm upgrade myproject"],
|
|
12
12
|
options: [
|
|
13
13
|
{
|
|
14
|
-
name:
|
|
15
|
-
description:
|
|
16
|
-
default:
|
|
17
|
-
type:
|
|
14
|
+
name: "dictionary",
|
|
15
|
+
description: "项目目录名称",
|
|
16
|
+
default: "",
|
|
17
|
+
type: "string",
|
|
18
18
|
},
|
|
19
19
|
],
|
|
20
20
|
execute: async (options) => {
|
|
21
21
|
try {
|
|
22
22
|
const finalOptions = parser_1.ArgumentParser.applyDefaults(options, {
|
|
23
|
-
dictionary:
|
|
23
|
+
dictionary: "",
|
|
24
24
|
});
|
|
25
|
-
console.log(
|
|
25
|
+
console.log("⬆️ 升级 NSGM 项目...");
|
|
26
26
|
if (finalOptions.dictionary) {
|
|
27
27
|
console.log(`📁 目录: ${finalOptions.dictionary}`);
|
|
28
28
|
}
|
|
29
29
|
(0, generate_1.initFiles)(finalOptions.dictionary, true);
|
|
30
|
-
console.log(
|
|
30
|
+
console.log("✅ 升级完成!");
|
|
31
31
|
process.exit(0);
|
|
32
32
|
}
|
|
33
33
|
catch (error) {
|
|
34
|
-
console.error(
|
|
34
|
+
console.error("❌ 升级失败:", error);
|
|
35
35
|
process.exit(1);
|
|
36
36
|
}
|
|
37
37
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Command } from
|
|
1
|
+
import { Command } from "../types";
|
|
2
2
|
export declare const versionCommand: Command;
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.versionCommand = void 0;
|
|
4
4
|
exports.versionCommand = {
|
|
5
|
-
name:
|
|
6
|
-
aliases: [
|
|
7
|
-
description:
|
|
8
|
-
usage:
|
|
9
|
-
examples: [
|
|
5
|
+
name: "version",
|
|
6
|
+
aliases: ["-v", "--version"],
|
|
7
|
+
description: "显示版本信息",
|
|
8
|
+
usage: "nsgm version",
|
|
9
|
+
examples: ["nsgm version", "nsgm -v"],
|
|
10
10
|
execute: async () => {
|
|
11
11
|
try {
|
|
12
|
-
const { version } = require(
|
|
12
|
+
const { version } = require("../../../package.json");
|
|
13
13
|
console.log(`📦 NSGM CLI 版本: ${version}`);
|
|
14
14
|
// 显示额外的环境信息
|
|
15
15
|
console.log(`🔧 Node.js 版本: ${process.version}`);
|
|
@@ -17,7 +17,7 @@ exports.versionCommand = {
|
|
|
17
17
|
process.exit(0);
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
|
-
console.error(
|
|
20
|
+
console.error("❌ 无法获取版本信息:", error);
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
23
23
|
},
|
package/lib/cli/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI 模块入口
|
|
3
3
|
*/
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
4
|
+
export * from "./types";
|
|
5
|
+
export * from "./parser";
|
|
6
|
+
export * from "./registry";
|
|
7
|
+
export * from "./app";
|
|
8
|
+
export * from "./commands/build";
|
|
9
|
+
export * from "./commands/create";
|
|
10
|
+
export * from "./commands/delete";
|
|
11
|
+
export * from "./commands/export";
|
|
12
|
+
export * from "./commands/help";
|
|
13
|
+
export * from "./commands/init";
|
|
14
|
+
export * from "./commands/server";
|
|
15
|
+
export * from "./commands/upgrade";
|
|
16
|
+
export * from "./commands/version";
|
package/lib/cli/parser.d.ts
CHANGED
package/lib/cli/parser.js
CHANGED
|
@@ -10,23 +10,23 @@ class ArgumentParser {
|
|
|
10
10
|
*/
|
|
11
11
|
static parse(args = process.argv.slice(2)) {
|
|
12
12
|
if (args.length === 0) {
|
|
13
|
-
return { command:
|
|
13
|
+
return { command: "help", options: {} };
|
|
14
14
|
}
|
|
15
15
|
const command = args[0];
|
|
16
16
|
const options = {};
|
|
17
17
|
// 解析参数
|
|
18
18
|
for (let i = 1; i < args.length; i++) {
|
|
19
19
|
const arg = args[i];
|
|
20
|
-
if (arg.includes(
|
|
20
|
+
if (arg.includes("=")) {
|
|
21
21
|
// 处理 key=value 格式
|
|
22
|
-
const [key, value] = arg.split(
|
|
22
|
+
const [key, value] = arg.split("=", 2);
|
|
23
23
|
options[key.toLowerCase()] = value;
|
|
24
24
|
}
|
|
25
|
-
else if (arg.startsWith(
|
|
25
|
+
else if (arg.startsWith("--")) {
|
|
26
26
|
// 处理 --key value 格式
|
|
27
27
|
const key = arg.slice(2).toLowerCase();
|
|
28
28
|
const nextArg = args[i + 1];
|
|
29
|
-
if (nextArg && !nextArg.startsWith(
|
|
29
|
+
if (nextArg && !nextArg.startsWith("-")) {
|
|
30
30
|
options[key] = nextArg;
|
|
31
31
|
i++; // 跳过下一个参数
|
|
32
32
|
}
|
|
@@ -34,11 +34,11 @@ class ArgumentParser {
|
|
|
34
34
|
options[key] = true;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
else if (arg.startsWith(
|
|
37
|
+
else if (arg.startsWith("-")) {
|
|
38
38
|
// 处理 -k value 格式
|
|
39
39
|
const key = arg.slice(1).toLowerCase();
|
|
40
40
|
const nextArg = args[i + 1];
|
|
41
|
-
if (nextArg && !nextArg.startsWith(
|
|
41
|
+
if (nextArg && !nextArg.startsWith("-")) {
|
|
42
42
|
options[key] = nextArg;
|
|
43
43
|
i++; // 跳过下一个参数
|
|
44
44
|
}
|
|
@@ -58,10 +58,10 @@ class ArgumentParser {
|
|
|
58
58
|
* 解析位置参数(保持向后兼容)
|
|
59
59
|
*/
|
|
60
60
|
static parsePositionalArgs(command, args, options) {
|
|
61
|
-
const createCommands = [
|
|
62
|
-
const initCommands = [
|
|
61
|
+
const createCommands = ["create", "-c", "delete", "-d", "deletedb", "-db"];
|
|
62
|
+
const initCommands = ["init", "-i", "export"];
|
|
63
63
|
args.forEach((arg, index) => {
|
|
64
|
-
if (arg.includes(
|
|
64
|
+
if (arg.includes("=") || arg.startsWith("-")) {
|
|
65
65
|
return; // 跳过已处理的参数
|
|
66
66
|
}
|
|
67
67
|
if (createCommands.includes(command)) {
|
|
@@ -93,7 +93,7 @@ class ArgumentParser {
|
|
|
93
93
|
static validateRequired(options, required) {
|
|
94
94
|
const missing = [];
|
|
95
95
|
for (const key of required) {
|
|
96
|
-
if (!options[key] || options[key] ===
|
|
96
|
+
if (!options[key] || options[key] === "") {
|
|
97
97
|
missing.push(key);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -105,7 +105,7 @@ class ArgumentParser {
|
|
|
105
105
|
static applyDefaults(options, defaults) {
|
|
106
106
|
const result = { ...options };
|
|
107
107
|
for (const [key, value] of Object.entries(defaults)) {
|
|
108
|
-
if (result[key] === undefined || result[key] ===
|
|
108
|
+
if (result[key] === undefined || result[key] === "") {
|
|
109
109
|
result[key] = value;
|
|
110
110
|
}
|
|
111
111
|
}
|
package/lib/cli/registry.d.ts
CHANGED
package/lib/cli/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI 类型定义
|
|
3
3
|
*/
|
|
4
|
-
export * from
|
|
4
|
+
export * from "./types/project";
|
|
5
5
|
export interface CommandOptions {
|
|
6
6
|
dictionary?: string;
|
|
7
7
|
controller?: string;
|
|
@@ -23,7 +23,7 @@ export interface CommandOption {
|
|
|
23
23
|
description: string;
|
|
24
24
|
required?: boolean;
|
|
25
25
|
default?: any;
|
|
26
|
-
type?:
|
|
26
|
+
type?: "string" | "number" | "boolean";
|
|
27
27
|
}
|
|
28
28
|
export interface ParsedArgs {
|
|
29
29
|
command: string;
|
|
@@ -45,7 +45,7 @@ export declare class Console {
|
|
|
45
45
|
/**
|
|
46
46
|
* 简单的加载动画
|
|
47
47
|
*/
|
|
48
|
-
static spinner(text: string, color?:
|
|
48
|
+
static spinner(text: string, color?: "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white"): {
|
|
49
49
|
start(): void;
|
|
50
50
|
stop(): void;
|
|
51
51
|
succeed(message?: string): void;
|
|
@@ -54,7 +54,7 @@ export declare class Console {
|
|
|
54
54
|
/**
|
|
55
55
|
* 带边框的消息
|
|
56
56
|
*/
|
|
57
|
-
static box(message: string, type?:
|
|
57
|
+
static box(message: string, type?: "success" | "error" | "warning" | "info"): void;
|
|
58
58
|
/**
|
|
59
59
|
* 进度条(简单版本)
|
|
60
60
|
*/
|
package/lib/cli/utils/console.js
CHANGED
|
@@ -13,31 +13,31 @@ class Console {
|
|
|
13
13
|
* 成功消息
|
|
14
14
|
*/
|
|
15
15
|
static success(message) {
|
|
16
|
-
console.log(chalk_1.default.green(
|
|
16
|
+
console.log(chalk_1.default.green("✅ ") + chalk_1.default.white(message));
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* 错误消息
|
|
20
20
|
*/
|
|
21
21
|
static error(message) {
|
|
22
|
-
console.log(chalk_1.default.red(
|
|
22
|
+
console.log(chalk_1.default.red("❌ ") + chalk_1.default.white(message));
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* 警告消息
|
|
26
26
|
*/
|
|
27
27
|
static warning(message) {
|
|
28
|
-
console.log(chalk_1.default.yellow(
|
|
28
|
+
console.log(chalk_1.default.yellow("⚠️ ") + chalk_1.default.white(message));
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* 信息消息
|
|
32
32
|
*/
|
|
33
33
|
static info(message) {
|
|
34
|
-
console.log(chalk_1.default.blue(
|
|
34
|
+
console.log(chalk_1.default.blue("ℹ️ ") + chalk_1.default.white(message));
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* 调试消息
|
|
38
38
|
*/
|
|
39
39
|
static debug(message) {
|
|
40
|
-
console.log(chalk_1.default.gray(
|
|
40
|
+
console.log(chalk_1.default.gray("🐛 ") + chalk_1.default.gray(message));
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* 标题
|
|
@@ -61,20 +61,20 @@ class Console {
|
|
|
61
61
|
* 分隔线
|
|
62
62
|
*/
|
|
63
63
|
static separator() {
|
|
64
|
-
console.log(chalk_1.default.gray(
|
|
64
|
+
console.log(chalk_1.default.gray("─".repeat(50)));
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* 空行
|
|
68
68
|
*/
|
|
69
69
|
static newLine(count = 1) {
|
|
70
|
-
console.log(
|
|
70
|
+
console.log("\n".repeat(count - 1));
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* 简单的加载动画
|
|
74
74
|
*/
|
|
75
|
-
static spinner(text, color =
|
|
75
|
+
static spinner(text, color = "cyan") {
|
|
76
76
|
let spinnerInterval = null;
|
|
77
|
-
const frames = [
|
|
77
|
+
const frames = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
78
78
|
let currentFrame = 0;
|
|
79
79
|
return {
|
|
80
80
|
start() {
|
|
@@ -88,7 +88,7 @@ class Console {
|
|
|
88
88
|
if (spinnerInterval) {
|
|
89
89
|
clearInterval(spinnerInterval);
|
|
90
90
|
spinnerInterval = null;
|
|
91
|
-
process.stdout.write(`\r${
|
|
91
|
+
process.stdout.write(`\r${" ".repeat(text.length + 2)}\r`);
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
succeed(message) {
|
|
@@ -104,7 +104,7 @@ class Console {
|
|
|
104
104
|
/**
|
|
105
105
|
* 带边框的消息
|
|
106
106
|
*/
|
|
107
|
-
static box(message, type =
|
|
107
|
+
static box(message, type = "info") {
|
|
108
108
|
const colors = {
|
|
109
109
|
success: chalk_1.default.green,
|
|
110
110
|
error: chalk_1.default.red,
|
|
@@ -112,20 +112,20 @@ class Console {
|
|
|
112
112
|
info: chalk_1.default.blue,
|
|
113
113
|
};
|
|
114
114
|
const icons = {
|
|
115
|
-
success:
|
|
116
|
-
error:
|
|
117
|
-
warning:
|
|
118
|
-
info:
|
|
115
|
+
success: "✅",
|
|
116
|
+
error: "❌",
|
|
117
|
+
warning: "⚠️",
|
|
118
|
+
info: "ℹ️",
|
|
119
119
|
};
|
|
120
120
|
const color = colors[type];
|
|
121
121
|
const icon = icons[type];
|
|
122
|
-
const lines = message.split(
|
|
122
|
+
const lines = message.split("\n");
|
|
123
123
|
const maxLength = Math.max(...lines.map((line) => line.length));
|
|
124
|
-
const border =
|
|
124
|
+
const border = "─".repeat(maxLength + 4);
|
|
125
125
|
console.log(color(`┌${border}┐`));
|
|
126
|
-
console.log(color(`│ ${icon} ${
|
|
126
|
+
console.log(color(`│ ${icon} ${" ".repeat(maxLength - 1)} │`));
|
|
127
127
|
lines.forEach((line) => {
|
|
128
|
-
const padding =
|
|
128
|
+
const padding = " ".repeat(maxLength - line.length);
|
|
129
129
|
console.log(color(`│ ${line}${padding} │`));
|
|
130
130
|
});
|
|
131
131
|
console.log(color(`└${border}┘`));
|
|
@@ -133,12 +133,12 @@ class Console {
|
|
|
133
133
|
/**
|
|
134
134
|
* 进度条(简单版本)
|
|
135
135
|
*/
|
|
136
|
-
static progress(current, total, description =
|
|
136
|
+
static progress(current, total, description = "") {
|
|
137
137
|
const percentage = Math.round((current / total) * 100);
|
|
138
138
|
const completed = Math.round((current / total) * 20);
|
|
139
139
|
const remaining = 20 - completed;
|
|
140
|
-
const progressBar = chalk_1.default.green(
|
|
141
|
-
const text = description ? ` ${description}` :
|
|
140
|
+
const progressBar = chalk_1.default.green("█".repeat(completed)) + chalk_1.default.gray("░".repeat(remaining));
|
|
141
|
+
const text = description ? ` ${description}` : "";
|
|
142
142
|
process.stdout.write(`\r[${progressBar}] ${percentage}%${text}`);
|
|
143
143
|
if (current === total) {
|
|
144
144
|
console.log(); // 换行
|
package/lib/cli/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Console } from
|
|
2
|
-
export { Prompt } from
|
|
1
|
+
export { Console } from "./console";
|
|
2
|
+
export { Prompt } from "./prompt";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface FieldDefinition {
|
|
2
2
|
name: string;
|
|
3
|
-
type:
|
|
3
|
+
type: "varchar" | "text" | "integer" | "decimal" | "boolean" | "date" | "datetime" | "timestamp";
|
|
4
4
|
length?: string | number;
|
|
5
5
|
required?: boolean;
|
|
6
6
|
comment?: string;
|