@gmcb/cli 0.7.0 → 0.7.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
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.2](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.7.1...@gmcb/cli@0.7.2) (2026-07-07)
7
+
8
+ **Note:** Version bump only for package @gmcb/cli
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.7.1](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.7.0...@gmcb/cli@0.7.1) (2026-07-06)
15
+
16
+ **Note:** Version bump only for package @gmcb/cli
17
+
18
+
19
+
20
+
21
+
6
22
  # [0.7.0](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.5.5...@gmcb/cli@0.7.0) (2026-07-06)
7
23
 
8
24
 
@@ -272,7 +272,13 @@ async function fetchRemoteResources(opts) {
272
272
  const pkg = (0, fs_extra_1.readJsonSync)(utils_1.PACKAGE_PATH);
273
273
  const appId = pkg.appId;
274
274
  const result = await (0, apis_1.fetchRemoteVersionInfo)(appId);
275
- const { appName, iconUrl, versionName, versionNum } = result;
275
+ const { appName, iconUrl, versionName, versionNum, versionDesc } = result;
276
+ if (!config_1.CONFIG_DATA.publish) {
277
+ config_1.CONFIG_DATA.publish = {};
278
+ }
279
+ if (versionDesc && !config_1.CONFIG_DATA.publish.versionDesc) {
280
+ config_1.CONFIG_DATA.publish.versionDesc = versionDesc;
281
+ }
276
282
  if (opts.win) {
277
283
  // Windows
278
284
  const zipUrl = result.resourcePackageUrl;
@@ -302,10 +308,8 @@ async function fetchRemoteResources(opts) {
302
308
  await downloadFile(iconUrl, iconPath);
303
309
  await (0, utils_1.png2ico)(iconPath, (0, path_1.join)(utils_1.COMMAND_PATH, 'res', 'icon.ico'));
304
310
  }
305
- spinner.succeed(`Windows本地资源已更新`);
306
- if (!config_1.CONFIG_DATA.publish)
307
- config_1.CONFIG_DATA.publish = {};
308
311
  config_1.CONFIG_DATA.publish['_remoteResourceUrl'] = zipUrl;
312
+ spinner.succeed(`Windows本地资源已更新`);
309
313
  }
310
314
  else if (opts.compiler === 'gradlew') {
311
315
  // Android
@@ -350,10 +354,8 @@ async function fetchRemoteResources(opts) {
350
354
  await downloadFile(iconUrl, iconPath);
351
355
  (0, fs_1.copyFileSync)(iconPath, (0, path_1.join)(drawableDir, 'push.png'));
352
356
  }
353
- spinner.succeed(`Android本地资源已更新`);
354
- if (!config_1.CONFIG_DATA.publish)
355
- config_1.CONFIG_DATA.publish = {};
356
357
  config_1.CONFIG_DATA.publish['_remoteResourceUrl'] = wgtUrl;
358
+ spinner.succeed(`Android本地资源已更新`);
357
359
  }
358
360
  }
359
361
  async function default_1(...args) {
package/lib/apis/index.js CHANGED
@@ -205,26 +205,30 @@ async function publishVersion(params) {
205
205
  versionId = newId;
206
206
  }
207
207
  const urls = Array.isArray(remoteUrl) ? remoteUrl : [remoteUrl || ''];
208
- const fullUrl = urls.find((u) => !/\.zip$/i.test(u)) || '';
209
- const resUrl = urls.find((u) => /\.zip$/i.test(u)) || '';
208
+ let fullUrl = '';
209
+ let resUrl = '';
210
+ if (publishType == 1) {
211
+ fullUrl = urls.find((u) => !/\.(zip|wgt)$/i.test(u)) || '';
212
+ resUrl = urls.find((u) => /\.(zip|wgt)$/i.test(u)) || '';
213
+ }
214
+ else {
215
+ fullUrl = urls.find((u) => !/\.zip$/i.test(u)) || '';
216
+ resUrl = urls.find((u) => /\.zip$/i.test(u)) || '';
217
+ }
218
+ let fallbackFullUrl = existingVersion?.fullPackageUrl || latest?.fullPackageUrl || '';
219
+ let fallbackResUrl = existingVersion?.resourcePackageUrl || latest?.resourcePackageUrl || '';
210
220
  if (config_1.CONFIG_DATA.publish?.updateMode != null) {
211
221
  const isHotUpdate = config_1.CONFIG_DATA.publish.updateMode == 2;
212
222
  const hotResUrl = isHotUpdate ? (config_1.CONFIG_DATA.publish['_remoteResourceUrl'] || '') : '';
213
- await postVersion({
214
- id: versionId,
215
- fullPackageUrl: fullUrl,
216
- resourcePackageUrl: hotResUrl,
217
- });
218
- }
219
- else {
220
- const fallbackFullUrl = existingVersion?.fullPackageUrl || latest?.fullPackageUrl || '';
221
- const fallbackResUrl = existingVersion?.resourcePackageUrl || latest?.resourcePackageUrl || '';
222
- await postVersion({
223
- id: versionId,
224
- fullPackageUrl: fullUrl || fallbackFullUrl,
225
- resourcePackageUrl: resUrl || fallbackResUrl,
226
- });
223
+ resUrl = hotResUrl;
224
+ fallbackFullUrl = '';
225
+ fallbackResUrl = '';
227
226
  }
227
+ await postVersion({
228
+ id: versionId,
229
+ fullPackageUrl: fullUrl || fallbackFullUrl,
230
+ resourcePackageUrl: resUrl || fallbackResUrl,
231
+ });
228
232
  }
229
233
  catch (err) {
230
234
  console.error(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmcb/cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "工茂草本前端命令行工具",
5
5
  "author": "yinjiazeng@163.com",
6
6
  "license": "MIT",
@@ -59,5 +59,5 @@
59
59
  "@types/rimraf": "^4.0.5",
60
60
  "@types/user-home": "^2.0.2"
61
61
  },
62
- "gitHead": "7aa3012c0c76701618d1e54ea9efcdcb3c3ed438"
62
+ "gitHead": "cae047773a0db2ebffdfdb45f86070c19ba07631"
63
63
  }