@gmcb/cli 0.7.9 → 0.7.10

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.7.10](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.7.9...@gmcb/cli@0.7.10) (2026-07-12)
7
+
8
+ **Note:** Version bump only for package @gmcb/cli
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.7.9](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.7.7...@gmcb/cli@0.7.9) (2026-07-12)
7
15
 
8
16
  **Note:** Version bump only for package @gmcb/cli
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 aniu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -269,14 +269,14 @@ function downloadFile(url, dest) {
269
269
  });
270
270
  }
271
271
  async function fetchRemoteResources(opts) {
272
- const spinner = (0, ora_1.default)(`正在拉取远程资源...`).start();
272
+ const spinner = (0, ora_1.default)(`正在拉取远程仓库...`).start();
273
273
  const pkg = (0, fs_extra_1.readJsonSync)(utils_1.PACKAGE_PATH);
274
274
  // 校验 version 和 versionCode 必须存在
275
275
  if (!pkg.version) {
276
- throw new Error('package.json 缺少 version 字段');
276
+ utils_1.log.error('package.json 缺少 version 字段');
277
277
  }
278
278
  if (!pkg.versionCode) {
279
- throw new Error('package.json 缺少 versionCode 字段');
279
+ utils_1.log.error('package.json 缺少 versionCode 字段');
280
280
  }
281
281
  const appId = pkg.appId;
282
282
  // 1. 获取应用信息
@@ -295,7 +295,7 @@ async function fetchRemoteResources(opts) {
295
295
  await repoGit.fetch('origin');
296
296
  const remoteBranches = await repoGit.branch(['-r']);
297
297
  if (!remoteBranches.all.includes(`origin/${branch}`)) {
298
- throw new Error(`远程分支 origin/${branch} 不存在,请检查仓库 ${repoUrl}`);
298
+ utils_1.log.error(`远程分支 origin/${branch} 不存在,请检查仓库 ${repoUrl}`);
299
299
  }
300
300
  await repoGit.checkout(branch, ['-f']);
301
301
  await repoGit.pull('origin', branch);
@@ -308,7 +308,7 @@ async function fetchRemoteResources(opts) {
308
308
  await cloneGit.clone(repoUrl, repoDir, ['--branch', branch, '--single-branch']);
309
309
  }
310
310
  catch (err) {
311
- throw new Error(`远程仓库或分支 ${branch} 不存在:${repoUrl}`);
311
+ utils_1.log.error(err.message);
312
312
  }
313
313
  }
314
314
  spinner.stop();
package/lib/apis/index.js CHANGED
@@ -16,6 +16,7 @@ exports.getAppInfo = getAppInfo;
16
16
  const http_1 = require("./http");
17
17
  const const_1 = require("../utils/const");
18
18
  const config_1 = require("../utils/config");
19
+ const utils_1 = require("../utils");
19
20
  /**
20
21
  * 登录
21
22
  */
@@ -149,7 +150,7 @@ async function publishVersion(params) {
149
150
  latest = (Array.isArray(historyData) ? historyData : historyData?.list)?.[0];
150
151
  }
151
152
  if (!existingVersion && latest && Number(versionCode) <= Number(latest.versionNum)) {
152
- throw new Error(`版本号不能小于上次发布 ${latest.versionNum}`);
153
+ utils_1.log.error(`版本号不能小于上次发布 ${latest.versionNum}`);
153
154
  }
154
155
  let versionId;
155
156
  if (existingVersion) {
@@ -247,7 +248,7 @@ async function getAppInfo(appId) {
247
248
  const { data: pageData } = await getAppPage({ appId, pageNo: 1, pageSize: 10 });
248
249
  const appData = pageData?.list?.[0];
249
250
  if (!appData)
250
- throw new Error(`未查询到 ${appId} 应用数据`);
251
+ utils_1.log.error(`未查询到 ${appId} 应用数据`);
251
252
  let configJson = {};
252
253
  try {
253
254
  configJson = JSON.parse(appData?.configJson || '{}');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmcb/cli",
3
- "version": "0.7.9",
3
+ "version": "0.7.10",
4
4
  "description": "工茂草本前端命令行工具",
5
5
  "author": "yinjiazeng@163.com",
6
6
  "license": "MIT",
@@ -58,5 +58,6 @@
58
58
  "@types/inquirer": "^9.0.7",
59
59
  "@types/rimraf": "^4.0.5",
60
60
  "@types/user-home": "^2.0.2"
61
- }
61
+ },
62
+ "gitHead": "71ce7aeb811bd6fd27030b981d3545fdab4276f1"
62
63
  }