@gmcb/cli 0.9.18 → 0.10.1

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
@@ -2,6 +2,18 @@
2
2
 
3
3
  <!-- release:insert -->
4
4
 
5
+ ## 0.10.1 [2026-11-22]
6
+ <!-- generated-by: specs -->
7
+ ### 优化
8
+ - 发布上传的远端路径顺序调整为 `<appId>/<versionName>.<versionCode>/<平台>/<原文件名>`:平台目录移到版本目录之后;无平台目录的 apk/exe/zip 路径仍为 `<appId>/<versionName>.<versionCode>/<原文件名>`。
9
+
10
+ ## 0.10.0 [2026-11-22]
11
+ <!-- generated-by: specs -->
12
+ ### 优化
13
+ - 发布上传的远端文件改为按版本目录归档:`<versionName>.<versionCode>/<原文件名>`,上传文件名直接使用现有 `name` 配置;同一版本的 wgt/zip/apk/exe 共享目录并保留各自文件名。
14
+ ### 破坏性变更
15
+ - 远端文件 URL 由 `<versionName>.<versionCode>.<ext>` 改为 `<versionName>.<versionCode>/<原文件名>`;依赖旧 URL 规则的外部脚本需同步调整,历史版本 URL 不受影响。
16
+
5
17
  ## 0.9.18 [2026-11-20]
6
18
  <!-- generated-by: specs -->
7
19
  ### 修复
@@ -32,12 +32,19 @@ async function publish(options) {
32
32
  const secretId = config_1.CONFIG_DATA.cos?.secretid || '';
33
33
  const secretKey = config_1.CONFIG_DATA.cos?.secretkey || '';
34
34
  const dir = options.dir || '';
35
- const remotePath = config_1.CONFIG_DATA.publish?.path || config_1.CONFIG_DATA.pub?.path || `/app/${appId}${dir ? `/${dir}` : ''}`;
35
+ const configPath = config_1.CONFIG_DATA.publish?.path || config_1.CONFIG_DATA.pub?.path || '';
36
+ const appPath = configPath || `/app/${appId}`;
37
+ // 接口 path 语义保持不变:默认带平台目录,配置路径时不追加
38
+ const platformPath = !configPath && dir ? `/${dir}` : '';
39
+ const remotePath = `${appPath}${platformPath}`;
36
40
  const cos = new cos_nodejs_sdk_v5_1.default({
37
41
  SecretId: secretId,
38
42
  SecretKey: secretKey,
39
43
  });
40
44
  const remoteUrls = [];
45
+ // 对象路径:版本目录在前,平台目录在后
46
+ const versionDir = `${versionName}.${versionCode}`;
47
+ const versionPath = `${appPath}/${versionDir}${platformPath}`;
41
48
  for (const file of options.files) {
42
49
  const appCfg = PUBLISH_APP_CFG[file.ext];
43
50
  const fileName = appCfg?.name || `${file.name}.${file.ext}`;
@@ -46,8 +53,7 @@ async function publish(options) {
46
53
  if (!(0, fs_1.existsSync)(source)) {
47
54
  utils_1.log.error(`未找到待上传文件:${source}`);
48
55
  }
49
- const destName = `${versionName}.${versionCode}.${file.ext}`;
50
- const path = `${remotePath}/${destName}`;
56
+ const path = `${versionPath}/${fileName}`;
51
57
  const remoteUrl = `https://${bucket}.cos.${region}.myqcloud.com${`/${path}`.replace(/\/+/g, '/')}`;
52
58
  await new Promise((res) => {
53
59
  const spinner = (0, ora_1.default)(`资源正在上传...`).start();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmcb/cli",
3
- "version": "0.9.18",
3
+ "version": "0.10.1",
4
4
  "description": "工茂草本前端命令行工具",
5
5
  "author": "yinjiazeng@163.com",
6
6
  "license": "UNLICENSED",
package/schema.json CHANGED
@@ -202,7 +202,7 @@
202
202
  },
203
203
  "name": {
204
204
  "type": "string",
205
- "description": "导出文件名称,默认为app-release.apk"
205
+ "description": "导出文件名称,同时作为上传后的远端文件名,默认为app-release.apk"
206
206
  },
207
207
  "path": {
208
208
  "type": "string",
@@ -252,7 +252,7 @@
252
252
  "properties": {
253
253
  "name": {
254
254
  "type": "string",
255
- "description": "导出文件名称,例如app.wgt,默认为[appid].wgt"
255
+ "description": "导出文件名称,同时作为上传后的远端文件名,例如app.wgt,默认为[appid].wgt"
256
256
  },
257
257
  "path": {
258
258
  "type": "string",
@@ -335,7 +335,7 @@
335
335
  },
336
336
  "name": {
337
337
  "type": "string",
338
- "description": "导出文件名称,默认为app-release.exe"
338
+ "description": "导出文件名称,同时作为上传后的远端文件名,默认为app-release.exe"
339
339
  },
340
340
  "path": {
341
341
  "type": "string",
@@ -367,7 +367,7 @@
367
367
  "properties": {
368
368
  "name": {
369
369
  "type": "string",
370
- "description": "导出文件名称,例如app.zip,默认为[appid].zip或[name].zip"
370
+ "description": "导出文件名称,同时作为上传后的远端文件名,例如app.zip,默认为[appid].zip或[name].zip"
371
371
  },
372
372
  "path": {
373
373
  "type": "string",