@gmcb/cli 0.4.6 → 0.4.7

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.4.7](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.4.6...@gmcb/cli@0.4.7) (2026-06-15)
7
+
8
+ **Note:** Version bump only for package @gmcb/cli
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.4.6](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.4.5...@gmcb/cli@0.4.6) (2026-06-15)
7
15
 
8
16
  **Note:** Version bump only for package @gmcb/cli
@@ -179,6 +179,18 @@ async function getCommands(...args) {
179
179
  }
180
180
  return commands;
181
181
  }
182
+ function generateH5Manifest() {
183
+ const manifest = (0, utils_1.readManifest)();
184
+ const source = (0, path_1.join)(utils_1.COMMAND_PATH, utils_1.HAS_SRC ? 'dist/build/h5' : 'unpackage/dist/build/web');
185
+ if (!(0, fs_1.existsSync)(source)) {
186
+ utils_1.log.warning('H5 构建输出目录不存在,跳过生成 manifest.json');
187
+ return;
188
+ }
189
+ (0, fs_extra_1.writeJsonSync)((0, path_1.join)(source, 'manifest.json'), {
190
+ versionName: manifest['versionName'] || '',
191
+ versionCode: manifest['versionCode'] || '',
192
+ });
193
+ }
182
194
  async function createZip(compiler, platform) {
183
195
  const spinner = (0, ora_1.default)(`正在生成资源文件...`).start();
184
196
  await (0, delay_1.default)(1000);
@@ -201,12 +213,6 @@ async function createZip(compiler, platform) {
201
213
  if ((0, fs_1.existsSync)(dest)) {
202
214
  (0, fs_1.unlinkSync)(dest);
203
215
  }
204
- if (compiler === 'uni' && platform === 'h5') {
205
- (0, fs_extra_1.writeJsonSync)((0, path_1.join)(source, 'manifest.json'), {
206
- versionName: manifest['versionName'] || '',
207
- versionCode: manifest['versionCode'] || '',
208
- });
209
- }
210
216
  const zipRoot = compiler === 'uni' && platform === 'h5' ? (config.app?.windows?.packagename || '') : '';
211
217
  zip.addLocalFolder(source, zipRoot);
212
218
  zip.writeZip(dest);
@@ -227,6 +233,10 @@ async function default_1(...args) {
227
233
  utils_1.log.error('检测到您的HbuilderX未启动或项目管理器中未发现构建项目,请检查后重试!');
228
234
  }
229
235
  }
236
+ // H5 构建完成后立即生成 manifest.json
237
+ if (opts.compiler === 'uni' && opts.platform === 'h5') {
238
+ generateH5Manifest();
239
+ }
230
240
  if ((opts.compiler === 'electron-vite' && opts.zip) ||
231
241
  (opts.compiler === 'uni' && opts.platform === 'h5' && opts.zip)) {
232
242
  await createZip(opts.compiler, opts.platform);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmcb/cli",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "工茂草本前端命令行工具",
5
5
  "author": "yinjiazeng@163.com",
6
6
  "license": "MIT",