@gmcb/cli 0.9.12 → 0.9.13
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 +5 -0
- package/README.md +1 -0
- package/lib/actions/build.js +8 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- release:insert -->
|
|
4
4
|
|
|
5
|
+
## 0.9.13 [2026-11-16]
|
|
6
|
+
<!-- generated-by: specs -->
|
|
7
|
+
### 优化
|
|
8
|
+
- H5 zip 默认不再包含 appId 目录;仅在 `package.json.appId` 存在时保留该目录,并在压缩包 `manifest.json` 中写入 `appid`,兼容存量环境。
|
|
9
|
+
|
|
5
10
|
## 0.9.12 [2026-11-16]
|
|
6
11
|
<!-- generated-by: specs -->
|
|
7
12
|
### 优化
|
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ gmcb icon --source logo.png
|
|
|
42
42
|
- HBuilderX CLI 路径用 `gmcb config --cli.hbuilderx <path>` 配置。
|
|
43
43
|
- `uni.build.json` 可配置 wgt 文件名/输出路径与发布参数;App/H5 包名、bundle、appid(`app.android.packagename`、`app.ios.bundle`、`app.harmony.packagename`、`h5.windows.appid`、`h5.macos.appid`)需显式配置,CLI 不再从 `package.json` 的 `appId` 自动补齐。
|
|
44
44
|
- appId 优先取 `package.json` 的 `appId`,缺失时回退 `manifest.json` 的 `appid`;存量项目无需调整,新项目可删除 `package.json.appId`。
|
|
45
|
+
- H5 zip 默认不包含 appId 目录;仅 `package.json.appId` 存在时保留该目录,zip 内 `manifest.json` 会写入 `appid`。
|
|
45
46
|
- 项目模板仓库与技能仓库需显式配置(无内置默认值):`gmcb config --template.repo <repo-url>`、`gmcb config --skill.repo <repo-url>`;未配置时 `gmcb create` / `gmcb skill sync` 会提示先添加。
|
|
46
47
|
|
|
47
48
|
## 文档
|
package/lib/actions/build.js
CHANGED
|
@@ -288,6 +288,7 @@ async function getCommands(...args) {
|
|
|
288
288
|
}
|
|
289
289
|
function generateH5Manifest() {
|
|
290
290
|
const manifest = (0, utils_1.readManifest)();
|
|
291
|
+
const pkg = (0, fs_extra_1.readJsonSync)(utils_1.PACKAGE_PATH, { throws: false }) || {};
|
|
291
292
|
const source = (0, path_1.join)(utils_1.COMMAND_PATH, utils_1.HAS_SRC ? 'dist/build/h5' : 'unpackage/dist/build/web');
|
|
292
293
|
if (!(0, fs_1.existsSync)(source)) {
|
|
293
294
|
utils_1.log.warning('H5 构建输出目录不存在,跳过生成 manifest.json');
|
|
@@ -296,6 +297,7 @@ function generateH5Manifest() {
|
|
|
296
297
|
(0, fs_extra_1.writeJsonSync)((0, path_1.join)(source, 'manifest.json'), {
|
|
297
298
|
versionName: manifest['versionName'] || '',
|
|
298
299
|
versionCode: manifest['versionCode'] || '',
|
|
300
|
+
appid: (0, utils_1.resolveAppId)(manifest, pkg),
|
|
299
301
|
});
|
|
300
302
|
}
|
|
301
303
|
async function generatePackage(opts) {
|
|
@@ -332,14 +334,18 @@ async function generatePackage(opts) {
|
|
|
332
334
|
defaultSource = 'dist/win-unpacked/resources';
|
|
333
335
|
}
|
|
334
336
|
const ext = platform?.startsWith('app') ? '.wgt' : '.zip';
|
|
335
|
-
const appId = (0, utils_1.resolveAppId)(manifest, pkg);
|
|
336
337
|
const name = zipConfig.name || `${manifest.appid || pkg.name}${ext}`;
|
|
337
338
|
const source = (0, path_1.join)(utils_1.COMMAND_PATH, zipConfig.source || defaultSource);
|
|
338
339
|
dest = (0, path_1.join)(utils_1.COMMAND_PATH, `${zipConfig.path || 'unpackage/release'}/${name}`);
|
|
339
340
|
if ((0, fs_1.existsSync)(dest)) {
|
|
340
341
|
(0, fs_1.unlinkSync)(dest);
|
|
341
342
|
}
|
|
342
|
-
const zipRoot = compiler === 'uni' && platform === 'h5' ? appId : '';
|
|
343
|
+
const zipRoot = compiler === 'uni' && platform === 'h5' && pkg.appId ? String(pkg.appId) : '';
|
|
344
|
+
if (compiler === 'uni' && platform === 'h5') {
|
|
345
|
+
const h5ManifestPath = (0, path_1.join)(source, 'manifest.json');
|
|
346
|
+
const h5Manifest = (0, fs_extra_1.readJsonSync)(h5ManifestPath, { throws: false }) || {};
|
|
347
|
+
(0, fs_extra_1.writeJsonSync)(h5ManifestPath, { ...h5Manifest, appid: (0, utils_1.resolveAppId)(manifest, pkg) });
|
|
348
|
+
}
|
|
343
349
|
zip.addLocalFolder(source, zipRoot);
|
|
344
350
|
zip.writeZip(dest);
|
|
345
351
|
}
|