@ruan-cat/vercel-deploy-tool 0.8.17 → 0.9.0
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/package.json +2 -2
- package/src/config.ts +10 -0
- package/src/index.ts +12 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruan-cat/vercel-deploy-tool",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "阮喵喵自用的vercel部署工具,用于实现复杂项目的部署。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"pathe": "^2.0.3",
|
|
51
51
|
"rimraf": "^6.0.1",
|
|
52
52
|
"vercel": "^41.3.0",
|
|
53
|
-
"@ruan-cat/utils": "^4.
|
|
53
|
+
"@ruan-cat/utils": "^4.6.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/gulp": "^4.0.17",
|
package/src/config.ts
CHANGED
|
@@ -25,6 +25,16 @@ export type Base = {
|
|
|
25
25
|
|
|
26
26
|
/** 生产环境的访问url */
|
|
27
27
|
url: string[];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 是否需要vercel的build命令?
|
|
31
|
+
* @description
|
|
32
|
+
* 某些情况下 用户已经能够准备好vercel的目录结构 不需要依赖于 `vercel build` 命令完成目录构建
|
|
33
|
+
*
|
|
34
|
+
* 故设计此配置 允许用户直接跳过 `vercel build` 命令
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
isNeedVercelBuild?: boolean;
|
|
28
38
|
};
|
|
29
39
|
|
|
30
40
|
/**
|
package/src/index.ts
CHANGED
|
@@ -96,6 +96,11 @@ function getIsCopyDist(target: WithUserCommands) {
|
|
|
96
96
|
return target?.isCopyDist ?? true;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/** isNeedVercelBuild 配置 */
|
|
100
|
+
function isNeedVercelBuild(target: Base) {
|
|
101
|
+
return target?.isNeedVercelBuild ?? true;
|
|
102
|
+
}
|
|
103
|
+
|
|
99
104
|
/** 是否需要移动文件? */
|
|
100
105
|
function isNeedCopyDist(target: DeployTarget) {
|
|
101
106
|
if (isDeployTargetsWithUserCommands(target)) {
|
|
@@ -463,12 +468,17 @@ async function main() {
|
|
|
463
468
|
type: "parallel",
|
|
464
469
|
tasks: deployTargets.map((deployTarget) => {
|
|
465
470
|
return generateSimpleAsyncTask(async () => {
|
|
471
|
+
/** 当前部署目标 是否需要 vercel 的 build 任务? */
|
|
472
|
+
const isNeedBuildTask = isNeedVercelBuild(deployTarget);
|
|
473
|
+
if (!isNeedBuildTask) {
|
|
474
|
+
consola.warn(` 当前部署目标不需要执行build任务 `);
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
|
|
466
478
|
const build = generateBuildTask(deployTarget);
|
|
467
479
|
consola.start(` 开始build任务 `);
|
|
468
480
|
const { stdout } = await build();
|
|
469
481
|
consola.success(` 完成build任务 `);
|
|
470
|
-
// consola.info(` 完成命令 ${code} `);
|
|
471
|
-
// consola.box(stdout);
|
|
472
482
|
});
|
|
473
483
|
}),
|
|
474
484
|
},
|