Skip to content

Commit 55a2ec8

Browse files
committed
✨ refactor(app): 重构 script
1 parent 953422e commit 55a2ec8

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

scripts.config.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
22
"scripts": [
33
{
4-
"cmd": "prepare",
5-
"script": "npx codeg hooks",
6-
"desc": "预执行脚本, 用来初始化 hooks 等配置"
4+
"command": "npx codeg hooks",
5+
"display": "prepare",
6+
"description": "预执行脚本, 用来初始化 hooks 等配"
77
},
88
{
9-
"cmd": "build",
10-
"script": "unbuild",
11-
"desc": "使用 unbuild 构建项目, 输出到 dist 目录"
9+
"command": "unbuild",
10+
"display": "build",
11+
"description": "使用 unbuild 构建项目, 输出到 dist 目录"
1212
},
1313
{
14-
"cmd": "stub",
15-
"script": "unbuild --stub",
16-
"desc": "使用 unbuild 软构建项目, 方便调试"
14+
"command": "unbuild --stub",
15+
"display": "stub",
16+
"description": "使用 unbuild 软构建项目, 方便调试"
1717
},
1818
{
19-
"cmd": "release",
20-
"script": "dotenv release-it --ci",
21-
"desc": "发布项目到 npm 仓库, 并推送 Github"
19+
"command": "dotenv release-it --ci",
20+
"display": "release",
21+
"description": "发布项目到 npm 仓库, 并推送 Github"
2222
}
2323
]
2424
}

src/command/script/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import { CommandOptions } from "@/types";
1414
export function genScriptConfig(scripts: { [key: string]: string }) {
1515
return Object.keys(scripts).map((key) => {
1616
return {
17-
command: key,
18-
display: scripts[key],
17+
command: scripts[key],
18+
display: key,
1919
description: "description the function of this cmd command",
2020
};
2121
});

0 commit comments

Comments
 (0)