@gmcb/cli 0.9.3 → 0.9.4

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.9.4](http://10.10.10.16/caoben/front-end-tools/compare/@gmcb/cli@0.9.3...@gmcb/cli@0.9.4) (2026-11-04)
7
+
8
+ **Note:** Version bump only for package @gmcb/cli
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.9.3](http://10.10.10.16/caoben/front-end-tools/compare/@gmcb/cli@0.9.2...@gmcb/cli@0.9.3) (2026-11-04)
7
15
 
8
16
 
package/README.md CHANGED
@@ -29,7 +29,7 @@ npm i @gmcb/cli -g
29
29
 
30
30
  | 选项 | 描述 |
31
31
  |---|---|
32
- | `-p, --platform` | 编译平台,默认 h5(uni-app x 可用 web,等价 h5) |
32
+ | `-p, --platform` | 编译平台,默认 h5(`web` 为 h5 的别名,HBuilderX 5.x 平台名) |
33
33
  | `-c, --compiler` | 构建工具,默认 uni |
34
34
  | `-b, --branch` | Git 分支名称 |
35
35
  | `-e, --env` | 构建环境,默认 prod |
@@ -41,6 +41,8 @@ npm i @gmcb/cli -g
41
41
 
42
42
  使用 `--wgt` 构建移动应用热更新资源时,经典 uni-app 会先通过 vite/uni 正常构建 app,再将构建产物(`dist/build/app` 或 `unpackage/dist/build/app-plus`)打包为 `.wgt` 文件,输出路径默认为 `unpackage/release`;uni-app x 的 wgt 由 HBuilderX 直接导出(见「uni-app x 兼容」)。
43
43
 
44
+ `gmcb build` 与 `gmcb publish` 的 `-p web` 等价 `-p h5`:`web` 是 HBuilderX 5.x 的平台名,CLI 会在构建/发布前统一归一化为 `h5`,经典 uni-app 与 uni-app x 行为一致。
45
+
44
46
  `uni.build.json` 中可通过 `app.wgt` 配置导出文件名和路径:
45
47
 
46
48
  ```json
@@ -67,7 +69,7 @@ gmcb build -p app --wgt
67
69
 
68
70
  | 选项 | 描述 |
69
71
  |---|---|
70
- | `-p, --platform` | 编译平台,默认 h5 |
72
+ | `-p, --platform` | 编译平台,默认 h5(`web` 为 h5 的别名) |
71
73
  | `-c, --compiler` | 构建工具,默认 uni |
72
74
  | `-b, --branch` | Git 分支名称 |
73
75
  | `-e, --env` | 构建环境,默认 prod |
@@ -104,29 +106,31 @@ gmcb publish -p app --wgt -a
104
106
  ### 识别与前提
105
107
 
106
108
  - `src/manifest.json` 或项目根 `manifest.json` 含 `uni-app-x` 字段(如 `"uni-app-x": {}`)即识别为 uni-app x 工程
107
- - **App 平台(`app` / `app-android` / `app-ios` / `app-harmony`)始终使用 `cli.hbuilderx` 编译**:无论工程有没有 `src` 目录,都走 `publish ... --type appResource|wgt` / `pack ...`,不需要 `--pack`
109
+ - **App 平台(`app` / `app-android` / `app-ios` / `app-harmony`)始终使用 `cli.hbuilderx` 编译**:无论工程有没有 `src` 目录,都走 HBuilderX 命令:`app` 用 `publish --platform APP --type appResource|wgt`,`app-android` / `app-ios` 用 `publish --platform app-android|app-ios --type ...`,`app-harmony` 用 `publish app-harmony --type ...`;无参数打包分别走 `pack --platform ...` / `pack --platform harmony`,不需要 `--pack`
108
110
  - H5 / 微信小程序按布局分流:含 `src` 走本地 npm CLI(`uni build`);无 `src` 走 `cli.hbuilderx publish ...`(传 `--pack` 或 `-P` 时也走 HBuilderX)
109
111
  - HBuilderX 4.67+(蒸汽模式 wgt 需要 5.33+),需启动 HBuilderX 且项目已导入,CLI 路径用 `gmcb config --cli.hbuilderx <cli-path>` 配置;`src` 布局工程需在 HBuilderX 中被识别为 uni-app x(如 App 导出提示“不支持”,可在 HBuilderX 中调整项目类型)
110
- - `-p web` 是 `-p h5` 的别名(仅 uni-app x)
111
112
 
112
113
  ### 平台与命令行映射(HBuilderX 编译分支)
113
114
 
114
- 下表为 App 平台(有无 `src` 均如此)以及无 `src`(或传 `--pack` / `-P`)时 H5 / 微信小程序实际执行的 HBuilderX 命令:
115
+ 下表为 App 平台(有无 `src` 均如此)以及无 `src`(或传 `--pack` / `-P`)时 H5 / 微信小程序实际执行的 HBuilderX 命令(App 平台按 `-p` 平台区分命令):
115
116
 
116
117
  | `-p` 平台 | 附加参数 | 执行的 HBuilderX 命令 | 输出目录 |
117
118
  |---|---|---|---|
118
- | `h5` / `web` | - | `publish web` | `unpackage/dist/build/web` |
119
- | `mp-weixin` | - | `publish mp-weixin [--appid ...]` | `unpackage/dist/build/mp-weixin` |
120
- | `app` / `app-android` / `app-ios` | `--res` | `publish <app\|app-android\|app-ios> --type appResource` | `unpackage/resources/app-*`(`-p app` 同时导出 app-android、app-ios) |
121
- | `app` / `app-android` / `app-ios` | `--wgt` | `publish <target> --type wgt` | `unpackage/release/<平台>/<AppID>.wgt`(平台为 app-android / app-ios,`-p app` 导出两个平台) |
119
+ | `h5` / `web` | - | `publish --platform h5` | `unpackage/dist/build/web` |
120
+ | `mp-weixin` | - | `publish --platform MP-WEIXIN [--appid ...]` | `unpackage/dist/build/mp-weixin` |
121
+ | `app` | `--res` | `publish --platform APP --type appResource` | `unpackage/resources/app-*`(`-p app` 同时导出 app-android、app-ios) |
122
+ | `app-android` / `app-ios` | `--res` | `publish --platform app-android\|app-ios --type appResource` | `unpackage/resources/app-*` |
123
+ | `app` | `--wgt` | `publish --platform APP --type wgt` | `unpackage/release`(名称/路径由 `app.wgt` 配置决定) |
124
+ | `app-android` / `app-ios` | `--wgt` | `publish --platform app-android\|app-ios --type wgt` | `unpackage/release`(名称/路径由 `app.wgt` 配置决定) |
122
125
  | `app` / `app-android` / `app-ios` | 无 | `pack --platform android,ios\|android\|ios` | 云端打包 |
123
- | `app-harmony` | `--res` / `--wgt` / 无 | `publish app-harmony --type appResource\|wgt` / `pack app-harmony` | `unpackage/resources/app-harmony` 等 |
126
+ | `app-harmony` | `--res` / `--wgt` / 无 | `publish app-harmony --type appResource\|wgt` / `pack --platform harmony` | 以 HBuilderX 实际输出为准 |
124
127
 
125
128
  - uni-app x 的 `--wgt` 仅蒸汽模式(`manifest.json` 的 `"uni-app-x": { "vapor": true }`)支持,由 HBuilderX 校验
126
129
  - `--res` 产物结构随编译模式不同:VDOM 模式包含 `uniappx/app-android/src/**/*.kt` 等页面 Kotlin 源码;蒸汽模式(vapor)为 `__UNI__xxx/www/bytes/**/*.bytes` + `app-service.js`,不含 Kotlin 源码
127
- - `--wgt` 产物按平台分子目录(`unpackage/release/app-android/<AppID>.wgt`、`app-ios/<AppID>.wgt`);`gmcb publish --wgt` 上传时可在 `uni.build.json` 的 `app.wgt.path` / `app.wgt.name` 指向对应平台目录与文件名(一次一个平台),或直接手动上传
130
+ - `--wgt` 产物由 HBuilderX 导出,导出路径/文件名由 `uni.build.json` 的 `app.wgt.path` / `app.wgt.name` 控制;`gmcb publish --wgt` 上传时同样读取该配置,或直接手动上传
128
131
  - `mp-weixin` 的 `appid` 取 `manifest.json` 的 `mp-weixin.appid`,有值时才传 `--appid`;appid 为空时仍可编译出产物,但 HBuilderX 会尝试打开微信开发者工具并提示 appid 不存在,配置 appid 后即可正常使用;发布上传时为空会给出明确错误
129
132
  - 云打包的证书/包名等配置与经典 uni-app 相同(`uni.build.json` 的 `app.android` / `app.ios`)
133
+ - uni-app x 的 HBuilderX 子命令按平台区分:`app` 使用 `--platform APP`,`app-android` / `app-ios` 使用 `--platform app-android|app-ios`,`app-harmony` 使用 `publish app-harmony` / `pack --platform harmony`,后续再按 HBuilderX 版本继续优化
130
134
  - 含 `src` 的工程执行上表 App 命令时会自动走 HBuilderX(`src` 布局的 H5 / `mp-weixin` 仍为本地 `uni build`,不会走 HBuilderX)
131
135
  - 完整示例见 `examples/uniapp-x`(`src` 布局的蒸汽模式工程),可直接验证下列命令
132
136
 
@@ -117,39 +117,12 @@ async function syncLatestVersion() {
117
117
  }
118
118
  spinner.stop();
119
119
  }
120
- /**
121
- * 归一化 wgt 导出参数(uni-app x 新分支使用):正确识别 --path,保证只出现一次
122
- */
123
- function prepareWgtFlags(wgtFlags) {
124
- const flags = [...wgtFlags];
125
- const index = flags.findIndex((item) => item === '--path' || item.startsWith('--path '));
126
- let dist;
127
- if (index === -1) {
128
- dist = (0, path_1.resolve)('unpackage/release');
129
- flags.push('--path', dist);
130
- }
131
- else if (flags[index] === '--path') {
132
- dist = flags[index + 1] || (0, path_1.resolve)('unpackage/release');
133
- }
134
- else {
135
- dist = flags[index].slice('--path '.length);
136
- }
137
- (0, fs_extra_1.ensureDirSync)(dist);
138
- const manifest = (0, utils_1.readManifest)();
139
- if (manifest.appid) {
140
- (0, fs_extra_1.removeSync)((0, path_1.join)(dist, `${manifest.appid}.wgt`));
141
- }
142
- return { flags, dist };
143
- }
144
120
  async function getCommands(...args) {
145
121
  const opts = args[0];
146
- const isUniappX = (0, utils_1.isUniappXManifest)();
147
- if (isUniappX) {
148
- // uni-app x 使用 HBuilderX 5.x 平台名:-p web 等价 -p h5(经典 uni-app 保持原有行为)
149
- opts.platform = (0, utils_1.normalizePlatform)(opts.platform);
122
+ if (opts.platform === 'web') {
123
+ opts.platform = 'h5';
150
124
  }
151
- // uni-app x 的 App 平台(app/app-android/app-ios/app-harmony)必须由 HBuilderX 编译,与是否有 src 无关
152
- const isUniappXApp = isUniappX && !!opts.platform?.startsWith('app');
125
+ const isUniappX = (0, utils_1.isUniappXManifest)();
153
126
  if (config_1.CONFIG_DATA.branch && config_1.CONFIG_DATA.branch !== 'false') {
154
127
  opts.branch = config_1.CONFIG_DATA.branch;
155
128
  }
@@ -178,20 +151,22 @@ async function getCommands(...args) {
178
151
  }
179
152
  const currentName = (0, path_1.basename)(utils_1.COMMAND_PATH);
180
153
  const projectName = opts.project || currentName;
181
- let useHBuilderX = false;
182
154
  if (opts.compiler === 'uni') {
183
- if (!utils_1.HAS_SRC) {
155
+ const isUniappXApp = isUniappX && opts.platform.startsWith('app');
156
+ // 无 src、uni-app x 的 App 平台、-P 指定了不同的 HBuilderX 项目名时都必须由 HBuilderX 构建,统一归一到 opts.pack
157
+ if (!utils_1.HAS_SRC || isUniappXApp || projectName !== currentName) {
184
158
  opts.pack = true;
185
159
  }
186
- // uni-app x 的 App 平台必须由 HBuilderX 编译,与是否有 src 无关(不写 opts.pack,避免 publish 连续构建时影响 h5)
187
- useHBuilderX = projectName !== currentName || !!opts.pack || isUniappXApp;
188
- if (!useHBuilderX) {
160
+ if (!opts.pack) {
189
161
  commands = [...commands, bin, 'build -p', opts.platform];
190
162
  }
191
163
  else {
192
164
  if (!(0, fs_1.existsSync)(config_1.CONFIG_DATA?.cli?.hbuilderx)) {
193
165
  utils_1.log.error('HbuilderX Cli路径不正确,请执行“gmcb config --cli.hbuilderx <cli-path>”设置正确的路径!');
194
166
  }
167
+ if (!(0, fs_1.existsSync)(utils_1.PACKAGE_PATH)) {
168
+ commands = [];
169
+ }
195
170
  if (projectName !== currentName) {
196
171
  const sourcePath = opts.source ? (0, path_1.join)(utils_1.COMMAND_PATH, opts.source) : utils_1.COMMAND_PATH;
197
172
  envPath = (0, path_1.join)(sourcePath, 'buildenv');
@@ -212,54 +187,10 @@ async function getCommands(...args) {
212
187
  }
213
188
  (0, fs_1.writeFileSync)(envPath, buildEnv);
214
189
  }
215
- if (isUniappX) {
216
- // uni-app x 使用 HBuilderX 5.x 子命令形式(经典 uni-app 分支保持不变)
217
- const cleanFlags = (flags) => flags.filter((item) => !/^--[\w.]+ (\{\}|\[\]|)$/.test(item));
218
- if (opts.platform === 'app-harmony') {
219
- if (opts.wgt) {
220
- cmds = ['publish', 'app-harmony', '--type', 'wgt', ...prepareWgtFlags(platform.app(opts).wgt).flags];
221
- }
222
- else if (opts.res) {
223
- cmds = ['publish', 'app-harmony', '--type', 'appResource'];
224
- }
225
- else {
226
- cmds = ['pack', 'app-harmony'];
227
- }
228
- }
229
- else if (opts.platform.startsWith('app')) {
230
- const app = platform.app(opts);
231
- if (opts.wgt) {
232
- cmds = ['publish', opts.platform, '--type', 'wgt', ...prepareWgtFlags(app.wgt).flags];
233
- }
234
- else if (opts.res) {
235
- cmds = ['publish', opts.platform, '--type', 'appResource'];
236
- }
237
- else {
238
- const packPlatform = opts.platform === 'app' ? 'android,ios' : opts.platform.replace('app-', '');
239
- cmds = [
240
- 'pack',
241
- '--platform',
242
- packPlatform,
243
- ...cleanFlags(app.common),
244
- ...cleanFlags(app.android),
245
- ...cleanFlags(app.ios),
246
- ];
247
- }
248
- }
249
- else if (opts.platform === 'mp-weixin') {
250
- const manifest = (0, utils_1.readManifest)();
251
- const appid = manifest['mp-weixin']?.appid;
252
- cmds = ['publish', 'mp-weixin', ...(appid ? ['--appid', appid] : []), ...platform.mp().common];
253
- }
254
- else if (opts.platform === 'h5') {
255
- cmds = ['publish', 'web', ...platform.h5()];
256
- }
257
- else {
258
- utils_1.log.error(`uni-app x 仅支持 h5/web、mp-weixin、app、app-android、app-ios、app-harmony 平台,当前平台:${opts.platform}`);
259
- }
260
- }
261
- else if (opts.platform.startsWith('app')) {
190
+ const cleanFlags = (flags) => flags.filter((item) => !/^--[\w.]+ (\{\}|\[\]|)$/.test(item));
191
+ if (opts.platform.startsWith('app')) {
262
192
  const app = platform.app(opts);
193
+ const isHarmony = opts.platform === 'app-harmony';
263
194
  if (opts.wgt) {
264
195
  if (opts.pack) {
265
196
  // HBuilderX CLI publish 流程
@@ -274,7 +205,12 @@ async function getCommands(...args) {
274
205
  if (manifest.appid) {
275
206
  (0, fs_extra_1.removeSync)((0, path_1.join)(wgtDist, `${manifest.appid}.wgt`));
276
207
  }
277
- cmds = ['publish', '--platform APP', '--type wgt', ...app.wgt];
208
+ cmds = [
209
+ 'publish',
210
+ isHarmony ? opts.platform : `--platform ${opts.platform === 'app' ? 'APP' : opts.platform}`,
211
+ '--type wgt',
212
+ ...app.wgt,
213
+ ];
278
214
  }
279
215
  else {
280
216
  // 普通构建,后续由 generatePackage 打包 wgt
@@ -283,29 +219,32 @@ async function getCommands(...args) {
283
219
  }
284
220
  }
285
221
  else if (opts.res) {
286
- cmds = ['publish', '--platform APP', '--type appResource'];
222
+ cmds = [
223
+ 'publish',
224
+ isHarmony ? opts.platform : `--platform ${opts.platform === 'app' ? 'APP' : opts.platform}`,
225
+ '--type appResource',
226
+ ];
287
227
  }
288
228
  else {
289
229
  cmds = ['pack', '--platform'];
290
230
  if (opts.platform === 'app') {
291
- const _platform = 'android,ios';
292
- cmds = [...cmds, _platform, ...app.common, ...app.android, ...app.ios];
231
+ cmds = [...cmds, 'android,ios', ...cleanFlags([...app.common, ...app.android, ...app.ios])];
293
232
  }
294
233
  else {
295
234
  const _platform = opts.platform.replace('app-', '');
296
- cmds = [...cmds, _platform, ...app.common, ...app[_platform]];
235
+ cmds = [...cmds, _platform, ...cleanFlags([...app.common, ...(app[_platform] ?? [])])];
297
236
  }
298
237
  }
299
238
  }
300
239
  else if (opts.platform.startsWith('mp')) {
301
240
  const mp = platform.mp();
302
241
  const manifest = JSON.parse((0, strip_json_comments_1.default)((0, fs_1.readFileSync)(utils_1.MAINFEST_PATH).toString()));
242
+ const appid = manifest[opts.platform]?.appid;
303
243
  cmds = [
304
244
  'publish',
305
245
  '--platform',
306
246
  opts.platform.toUpperCase(),
307
- '--appid',
308
- manifest[opts.platform].appid,
247
+ ...(appid ? ['--appid', appid] : []),
309
248
  ...mp.common,
310
249
  ];
311
250
  }
@@ -313,6 +252,9 @@ async function getCommands(...args) {
313
252
  const h5 = platform.h5();
314
253
  cmds = ['publish', '--platform h5', ...h5];
315
254
  }
255
+ else {
256
+ utils_1.log.error(`不支持的平台:${opts.platform}`);
257
+ }
316
258
  if (cmds) {
317
259
  commands = [...commands, config_1.CONFIG_DATA?.cli?.hbuilderx, ...cmds, '--project', projectName];
318
260
  }
@@ -344,15 +286,6 @@ async function getCommands(...args) {
344
286
  else {
345
287
  commands = [...commands, bin, 'build'];
346
288
  }
347
- // 走 HBuilderX 且无 package.json 的 uni-app x 工程无法保证 cross-env 可执行,直接通过进程环境变量传递
348
- if (isUniappX &&
349
- opts.compiler === 'uni' &&
350
- useHBuilderX &&
351
- !(0, fs_1.existsSync)(utils_1.PACKAGE_PATH) &&
352
- commands[0] === 'cross-env') {
353
- process.env.NODE_ENV = 'production';
354
- commands = commands.slice(2).filter((item) => !/^(NODE_ENV|BUILD_ENV)=/.test(item));
355
- }
356
289
  return commands;
357
290
  }
358
291
  function generateH5Manifest() {
@@ -606,8 +539,6 @@ async function default_1(...args) {
606
539
  const deferRestore = args[args.length - 1] === true;
607
540
  const commands = await getCommands(...args);
608
541
  const command = commands.join(' ');
609
- // uni-app x 的 App 产物(含 wgt)由 HBuilderX 产出,不再走本地二次打包
610
- const isUniappXApp = (0, utils_1.isUniappXManifest)() && !!opts.platform?.startsWith('app');
611
542
  remoteBackups.clear();
612
543
  if (opts.latest) {
613
544
  await syncLatestVersion();
@@ -634,7 +565,7 @@ async function default_1(...args) {
634
565
  }
635
566
  if ((opts.compiler === 'electron-vite' && (opts.zip || opts.win)) ||
636
567
  (opts.compiler === 'uni' && opts.platform === 'h5' && opts.zip) ||
637
- (opts.compiler === 'uni' && opts.platform?.startsWith('app') && opts.wgt && !opts.pack && !isUniappXApp) ||
568
+ (opts.compiler === 'uni' && opts.platform?.startsWith('app') && opts.wgt && !opts.pack) ||
638
569
  (opts.compiler === 'gradlew' && opts.apk)) {
639
570
  await generatePackage(opts);
640
571
  }
@@ -34,9 +34,8 @@ const build_1 = __importStar(require("./build"));
34
34
  const config_1 = require("../utils/config");
35
35
  async function default_1(...args) {
36
36
  const opts = args[0];
37
- if ((0, utils_1.isUniappXManifest)()) {
38
- // uni-app x 使用 HBuilderX 5.x 平台名:-p web 等价 -p h5(经典 uni-app 保持原有行为)
39
- opts.platform = (0, utils_1.normalizePlatform)(opts.platform);
37
+ if (opts.platform === 'web') {
38
+ opts.platform = 'h5';
40
39
  }
41
40
  const isPublishFlow = !!config_1.CONFIG_DATA.publish;
42
41
  const isAuto = opts.skip || !!config_1.CONFIG_DATA.skip;
@@ -226,15 +225,8 @@ async function default_1(...args) {
226
225
  try {
227
226
  let cmds;
228
227
  if (opts.compiler === 'uni' && opts.wgt && opts.zip) {
229
- const originalPlatform = opts.platform;
230
- // 先构建 app(生成 wgt)
231
- opts.platform = 'app';
232
- cmds = await (0, build_1.default)(opts, true);
233
- // 再构建 h5(生成 zip)
234
- opts.platform = 'h5';
235
- await (0, build_1.default)(opts, true);
236
- // 恢复
237
- opts.platform = originalPlatform;
228
+ cmds = await (0, build_1.default)({ ...opts, platform: 'app' }, true);
229
+ await (0, build_1.default)({ ...opts, platform: 'h5' }, true);
238
230
  }
239
231
  else {
240
232
  cmds = await (0, build_1.default)(opts, true);
@@ -1,7 +1,7 @@
1
1
  import { PLATFORM_OPTIONS, COMPILER_OPTIONS } from '../utils';
2
2
  export declare const version: readonly ["-v, --version", "输出版本号"];
3
3
  export declare const template: readonly ["-t, --template <template-name>", "模版仓库名称"];
4
- export declare const platform: readonly ["-p, --platform <platform-name>", "编译平台,默认h5", "h5"];
4
+ export declare const platform: readonly ["-p, --platform <platform-name>", "编译平台,默认h5(web 等价 h5)", "h5"];
5
5
  export declare const project: readonly ["-P, --project <project-name>", "HbuilderX工作台中的项目名称"];
6
6
  export declare const compiler: readonly ["-c, --compiler <compiler-name>", "构建工具,默认uni", "uni"];
7
7
  export declare const env: readonly ["-e, --env <env-name>", "构建环境,可选如dev/sit/uat/prod等"];
@@ -46,7 +46,7 @@ export declare const templateRepo: readonly ["--template.repo <repo-url>", "项
46
46
  export interface Options {
47
47
  template?: string;
48
48
  branch?: string | boolean;
49
- platform?: (typeof PLATFORM_OPTIONS)[number];
49
+ platform?: (typeof PLATFORM_OPTIONS)[number] | 'web';
50
50
  compiler?: (typeof COMPILER_OPTIONS)[number];
51
51
  project?: string;
52
52
  env?: string;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.templateRepo = exports.skillRepo = exports.cosSecretkey = exports.cosSecretid = exports.alipayCli = exports.weixinCli = exports.hbuilderxCli = exports.bg = exports.top = exports.left = exports.height = exports.width = exports.ico = exports.sizes = exports.size = exports.radius = exports.nobuild = exports.restore = exports.latest = exports.pull = exports.skip = exports.apk = exports.res = exports.wgt = exports.pack = exports.custom = exports.zip = exports.linux = exports.mac = exports.win = exports.link = exports.path = exports.name = exports.clean = exports.ignore = exports.dest = exports.source = exports.branch = exports.env = exports.compiler = exports.project = exports.platform = exports.template = exports.version = void 0;
4
4
  exports.version = ['-v, --version', '输出版本号'];
5
5
  exports.template = ['-t, --template <template-name>', '模版仓库名称'];
6
- exports.platform = ['-p, --platform <platform-name>', '编译平台,默认h5', 'h5'];
6
+ exports.platform = ['-p, --platform <platform-name>', '编译平台,默认h5(web 等价 h5)', 'h5'];
7
7
  exports.project = ['-P, --project <project-name>', 'HbuilderX工作台中的项目名称'];
8
8
  exports.compiler = ['-c, --compiler <compiler-name>', '构建工具,默认uni', 'uni'];
9
9
  exports.env = ['-e, --env <env-name>', '构建环境,可选如dev/sit/uat/prod等'];
@@ -3,6 +3,7 @@ export declare const app: (opts: Options) => {
3
3
  common: any[];
4
4
  android: any[];
5
5
  ios: any[];
6
+ harmony: any[];
6
7
  wgt: any[];
7
8
  };
8
9
  export declare const mp: () => {
@@ -34,10 +34,12 @@ const app = (opts) => {
34
34
  const android = (0, utils_1.filterToArray)(androidCommand);
35
35
  const ios = (0, utils_1.filterToArray)(iosCommand);
36
36
  const wgt = (0, utils_1.filterToArray)(wgtCommand);
37
+ const harmony = [];
37
38
  return {
38
39
  common,
39
40
  android,
40
41
  ios,
42
+ harmony,
41
43
  wgt,
42
44
  };
43
45
  };
@@ -3,10 +3,6 @@ export declare function readManifest(): Record<string, unknown>;
3
3
  * 是否 uni-app x 工程(manifest.json 含 uni-app-x 字段,空对象也算)
4
4
  */
5
5
  export declare function isUniappXManifest(manifest?: Record<string, unknown>): boolean;
6
- /**
7
- * 平台名归一化:web 是 HBuilderX 5.x 的平台名,等价 h5
8
- */
9
- export declare function normalizePlatform(platform?: string): string;
10
6
  export declare function objectToCommand(obj?: Record<string, any>): {};
11
7
  export declare function filterToArray(obj?: Record<string, any>): any[];
12
8
  export declare function spawnSync(command?: string): import("child_process").SpawnSyncReturns<Buffer>;
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.readManifest = readManifest;
7
7
  exports.isUniappXManifest = isUniappXManifest;
8
- exports.normalizePlatform = normalizePlatform;
9
8
  exports.objectToCommand = objectToCommand;
10
9
  exports.filterToArray = filterToArray;
11
10
  exports.spawnSync = spawnSync;
@@ -34,15 +33,6 @@ function readManifest() {
34
33
  function isUniappXManifest(manifest = readManifest()) {
35
34
  return Object.prototype.hasOwnProperty.call(manifest, 'uni-app-x');
36
35
  }
37
- /**
38
- * 平台名归一化:web 是 HBuilderX 5.x 的平台名,等价 h5
39
- */
40
- function normalizePlatform(platform) {
41
- if (!platform) {
42
- return 'h5';
43
- }
44
- return platform === 'web' ? 'h5' : platform;
45
- }
46
36
  function objectToCommand(obj = {}) {
47
37
  const object = (0, flat_1.flatten)(obj);
48
38
  const res = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmcb/cli",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "工茂草本前端命令行工具",
5
5
  "author": "yinjiazeng@163.com",
6
6
  "license": "MIT",
@@ -58,5 +58,5 @@
58
58
  "@types/rimraf": "^4.0.5",
59
59
  "@types/user-home": "^2.0.2"
60
60
  },
61
- "gitHead": "859bef47f814cd811f1f24ade77c9e8a2fb86e23"
61
+ "gitHead": "f08146b438f7da9d13513596ebab9e8c491e809b"
62
62
  }