@ruan-cat/vercel-deploy-tool 0.8.0 → 0.8.2

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/config.ts +12 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruan-cat/vercel-deploy-tool",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "阮喵喵自用的vercel部署工具,用于实现复杂项目的部署。",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -51,7 +51,7 @@
51
51
  "rimraf": "^6.0.1",
52
52
  "shx": "^0.3.4",
53
53
  "vercel": "^41.2.0",
54
- "@ruan-cat/utils": "^3.0.0"
54
+ "@ruan-cat/utils": "^3.0.1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/gulp": "^4.0.17",
package/src/config.ts CHANGED
@@ -2,7 +2,7 @@ import { resolve } from "pathe";
2
2
  import { loadConfig } from "c12";
3
3
  import { config as dotenvConfig } from "@dotenvx/dotenvx";
4
4
  import { consola } from "consola";
5
- import { merge } from "lodash-es";
5
+ import { merge, isEmpty } from "lodash-es";
6
6
  import { program } from "commander";
7
7
 
8
8
  /**
@@ -226,17 +226,21 @@ export async function initVercelConfig() {
226
226
  const vercelProjectId = currentDotenvConfig!.VERCEL_PROJECT_ID ?? process.env.VERCEL_PROJECT_ID;
227
227
  const vercelToken = currentDotenvConfig!.VERCEL_TOKEN ?? process.env.VERCEL_TOKEN;
228
228
 
229
- const res: Config = merge(userConfig, {
230
- vercelOrgId,
231
- vercelProjectId,
232
- vercelToken,
233
- } satisfies Partial<Config>);
229
+ if (!isEmpty(vercelOrgId)) {
230
+ userConfig.vercelOrgId = vercelOrgId;
231
+ }
232
+ if (!isEmpty(vercelProjectId)) {
233
+ userConfig.vercelProjectId = vercelProjectId;
234
+ }
235
+ if (!isEmpty(vercelToken)) {
236
+ userConfig.vercelToken = vercelToken;
237
+ }
234
238
 
235
239
  consola.success(" 完成初始化项目配置 ");
236
240
  // 显示效果没有那么好看
237
- consola.box(res);
241
+ consola.box(userConfig);
238
242
 
239
- return res;
243
+ return userConfig;
240
244
  }
241
245
 
242
246
  /** 项目内的vercel配置 */