@gmcb/cli 0.9.13 → 0.9.15

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.9.15 [2026-11-18]
6
+ <!-- generated-by: specs -->
7
+ ### 优化
8
+ - 非 App 平台(H5 / 小程序)默认走本地 uni 工程化构建,不再因为工程没有 `src/` 目录强制使用 HBuilderX;根布局会自动注入 `UNI_INPUT_DIR=<工程根绝对路径>`,App 平台与显式 `--pack` 仍使用 HBuilderX。
9
+ ### 破坏性变更
10
+ - 非 App 的根布局工程构建产物目录从 `unpackage/dist/build/*` 改为 `dist/build/*`;依赖旧目录的脚本需改为 `dist/build/*`,必须继续使用 HBuilderX 的项目请显式加 `--pack`。
11
+
12
+ ## 0.9.14 [2026-11-16]
13
+ <!-- generated-by: specs -->
14
+ ### 修复
15
+ - 子应用发布 wgt 或 zip 其中一种时,不再用历史版本回填另一种包链接,避免更新检查始终命中历史版本。
16
+
5
17
  ## 0.9.13 [2026-11-16]
6
18
  <!-- generated-by: specs -->
7
19
  ### 优化
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @gmcb/cli
2
2
 
3
- 工茂草本前端命令行工具:创建、开发、构建、发布、资源复制、图标/启动图与技能同步。
3
+ 工茂草本前端命令行工具:创建、开发、构建、发布、资源复制、图标/启动图与技能同步,覆盖经典 uni-app 与 uni-app x。
4
4
 
5
5
  ## 安装
6
6
 
@@ -31,21 +31,11 @@ gmcb build -p h5
31
31
  # App 热更新资源(uni-app x 蒸汽模式)
32
32
  gmcb build -p app --wgt
33
33
 
34
- # 自动发布(跳过确认)
35
- gmcb publish -p app --wgt -a
36
-
37
34
  # 生成圆角应用图标
38
35
  gmcb icon --source logo.png
39
36
  ```
40
37
 
41
- - 构建环境用 `-e <env>` 选择,默认 `prod`。
42
- - HBuilderX CLI 路径用 `gmcb config --cli.hbuilderx <path>` 配置。
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
- - appId 优先取 `package.json` 的 `appId`,缺失时回退 `manifest.json` 的 `appid`;存量项目无需调整,新项目可删除 `package.json.appId`。
45
- - H5 zip 默认不包含 appId 目录;仅 `package.json.appId` 存在时保留该目录,zip 内 `manifest.json` 会写入 `appid`。
46
- - 项目模板仓库与技能仓库需显式配置(无内置默认值):`gmcb config --template.repo <repo-url>`、`gmcb config --skill.repo <repo-url>`;未配置时 `gmcb create` / `gmcb skill sync` 会提示先添加。
47
-
48
38
  ## 文档
49
39
 
50
- - 操作约束与命令:[AGENTS.md](AGENTS.md)
51
- - 完整命令选项、uni-app x 兼容、平台映射与 icon/image/copy 规则:[.specs/implementation.md](.specs/implementation.md)
40
+ - 每个命令的完整选项:`gmcb <command> --help`(如 `gmcb build --help`)
41
+ - 变更记录:[CHANGELOG.md](CHANGELOG.md)
@@ -164,11 +164,20 @@ async function getCommands(...args) {
164
164
  }
165
165
  }
166
166
  const isUniappX = (0, utils_1.isUniappXManifest)(projectPath);
167
- const isUniappXApp = isUniappX && opts.platform.startsWith('app');
168
- if (!utils_1.HAS_SRC || isUniappXApp || projectName !== currentName) {
167
+ const isAppPlatform = !!opts.platform && opts.platform.startsWith('app');
168
+ const isUniappXApp = isUniappX && isAppPlatform;
169
+ // 非 App 且未显式 --pack 时走本地工程化构建;无 src 布局需显式输入目录
170
+ if (opts.pack || projectName !== currentName || isUniappXApp || (isAppPlatform && !utils_1.HAS_SRC)) {
169
171
  opts.pack = true;
170
172
  }
171
173
  if (!opts.pack) {
174
+ if (!/^(h5|mp-|app)/.test(opts.platform)) {
175
+ utils_1.log.error(`不支持的平台:${opts.platform}`);
176
+ }
177
+ if (!utils_1.HAS_SRC) {
178
+ // 用绝对路径:部分根布局工程(含 nvue 页面)用 "." 时 Vite import-glob 会生成相对 glob 并报错
179
+ commands.push(`UNI_INPUT_DIR="${utils_1.COMMAND_PATH}"`);
180
+ }
172
181
  commands = [...commands, bin, 'build -p', opts.platform];
173
182
  }
174
183
  else {
@@ -286,10 +295,10 @@ async function getCommands(...args) {
286
295
  }
287
296
  return commands;
288
297
  }
289
- function generateH5Manifest() {
298
+ function generateH5Manifest(opts) {
290
299
  const manifest = (0, utils_1.readManifest)();
291
300
  const pkg = (0, fs_extra_1.readJsonSync)(utils_1.PACKAGE_PATH, { throws: false }) || {};
292
- const source = (0, path_1.join)(utils_1.COMMAND_PATH, utils_1.HAS_SRC ? 'dist/build/h5' : 'unpackage/dist/build/web');
301
+ const source = (0, path_1.join)(utils_1.COMMAND_PATH, opts.pack ? 'unpackage/dist/build/web' : 'dist/build/h5');
293
302
  if (!(0, fs_1.existsSync)(source)) {
294
303
  utils_1.log.warning('H5 构建输出目录不存在,跳过生成 manifest.json');
295
304
  return;
@@ -322,11 +331,11 @@ async function generatePackage(opts) {
322
331
  if (compiler === 'uni') {
323
332
  if (platform === 'h5') {
324
333
  zipConfig = config_1.CONFIG_DATA.h5?.zip || {};
325
- defaultSource = utils_1.HAS_SRC ? 'dist/build/h5' : 'unpackage/dist/build/web';
334
+ defaultSource = opts.pack ? 'unpackage/dist/build/web' : 'dist/build/h5';
326
335
  }
327
336
  else if (platform?.startsWith('app')) {
328
337
  zipConfig = config_1.CONFIG_DATA.app?.wgt || {};
329
- defaultSource = utils_1.HAS_SRC ? 'dist/build/app' : 'unpackage/dist/build/app-plus';
338
+ defaultSource = opts.pack ? 'unpackage/dist/build/app-plus' : 'dist/build/app';
330
339
  }
331
340
  }
332
341
  else if (compiler === 'electron-vite') {
@@ -523,7 +532,7 @@ async function default_1(...args) {
523
532
  (0, fs_1.unlinkSync)(envPath);
524
533
  }
525
534
  if (opts.compiler === 'uni' && opts.platform === 'h5') {
526
- generateH5Manifest();
535
+ generateH5Manifest(opts);
527
536
  }
528
537
  if ((opts.compiler === 'electron-vite' && (opts.zip || opts.win)) ||
529
538
  (opts.compiler === 'uni' && opts.platform === 'h5' && opts.zip) ||
@@ -7,6 +7,9 @@ async function default_1(...args) {
7
7
  let commands = ['cross-env NODE_ENV=development'];
8
8
  const bin = (0, utils_1.getBinPath)(opts.compiler);
9
9
  if (opts.compiler === 'uni') {
10
+ if (!utils_1.HAS_SRC) {
11
+ commands = [...commands, `UNI_INPUT_DIR="${process.cwd()}"`];
12
+ }
10
13
  commands = [...commands, bin, 'dev', '-p', opts.platform];
11
14
  }
12
15
  else {
@@ -247,7 +247,7 @@ async function default_1(...args) {
247
247
  }
248
248
  else if (opts.compiler === 'uni') {
249
249
  if (opts.platform?.startsWith('mp')) {
250
- await require('../scripts/mp-weixin').default();
250
+ await require('../scripts/mp-weixin').default(opts);
251
251
  }
252
252
  else if (opts.platform === 'h5') {
253
253
  if (opts.wgt && opts.zip) {
@@ -40,11 +40,11 @@ const os_1 = __importDefault(require("os"));
40
40
  const config_1 = require("../utils/config");
41
41
  const utils_1 = require("../utils");
42
42
  const ENV_MAP = {
43
- default: ".agents",
44
- opencode: ".opencode",
45
- claude: ".claude",
46
- codex: ".codex",
47
- qoder: ".qoder",
43
+ default: '.agents',
44
+ opencode: '.opencode',
45
+ claude: '.claude',
46
+ codex: '.codex',
47
+ qoder: '.qoder',
48
48
  };
49
49
  function parseFrontmatter(content) {
50
50
  const match = content.match(/^---\s*\n([\s\S]*?)\n---/);
@@ -52,8 +52,8 @@ function parseFrontmatter(content) {
52
52
  return {};
53
53
  const frontmatter = match[1];
54
54
  const result = {};
55
- frontmatter.split("\n").forEach((line) => {
56
- const colonIndex = line.indexOf(":");
55
+ frontmatter.split('\n').forEach((line) => {
56
+ const colonIndex = line.indexOf(':');
57
57
  if (colonIndex !== -1) {
58
58
  const key = line.substring(0, colonIndex).trim();
59
59
  const value = line.substring(colonIndex + 1).trim();
@@ -72,27 +72,27 @@ function getExistingEnvs() {
72
72
  return result;
73
73
  }
74
74
  function scanLocalSkills(envDir) {
75
- const skillsPath = (0, path_1.join)(envDir, "skills");
75
+ const skillsPath = (0, path_1.join)(envDir, 'skills');
76
76
  if (!(0, fs_1.existsSync)(skillsPath))
77
77
  return [];
78
78
  return (0, fs_1.readdirSync)(skillsPath).filter((name) => {
79
- const skillMd = (0, path_1.join)(skillsPath, name, "SKILL.md");
79
+ const skillMd = (0, path_1.join)(skillsPath, name, 'SKILL.md');
80
80
  return (0, fs_1.existsSync)(skillMd);
81
81
  });
82
82
  }
83
83
  function scanRemoteSkills(repoDir) {
84
84
  const skills = [];
85
- const skillsDir = (0, fs_1.existsSync)((0, path_1.join)(repoDir, "skills")) ? (0, path_1.join)(repoDir, "skills") : repoDir;
85
+ const skillsDir = (0, fs_1.existsSync)((0, path_1.join)(repoDir, 'skills')) ? (0, path_1.join)(repoDir, 'skills') : repoDir;
86
86
  const items = (0, fs_1.readdirSync)(skillsDir);
87
87
  items.forEach((item) => {
88
88
  const itemPath = (0, path_1.join)(skillsDir, item);
89
- const skillMd = (0, path_1.join)(itemPath, "SKILL.md");
89
+ const skillMd = (0, path_1.join)(itemPath, 'SKILL.md');
90
90
  if ((0, fs_1.existsSync)(skillMd)) {
91
- const content = (0, fs_2.readFileSync)(skillMd, "utf-8");
91
+ const content = (0, fs_2.readFileSync)(skillMd, 'utf-8');
92
92
  const { name, description } = parseFrontmatter(content);
93
93
  skills.push({
94
94
  name: name || item,
95
- description: description || "",
95
+ description: description || '',
96
96
  path: itemPath,
97
97
  });
98
98
  }
@@ -101,25 +101,25 @@ function scanRemoteSkills(repoDir) {
101
101
  }
102
102
  async function syncSkill(...args) {
103
103
  const opts = args[0];
104
- const repoUrl = opts["skill.repo"] || config_1.CONFIG_DATA.skill?.repo;
104
+ const repoUrl = opts['skill.repo'] || config_1.CONFIG_DATA.skill?.repo;
105
105
  if (!repoUrl) {
106
- utils_1.log.error("未配置技能仓库地址。请先添加:gmcb config --skill.repo <repo-url>");
106
+ utils_1.log.error('未配置技能仓库地址。请先添加:gmcb config --skill.repo <repo-url>');
107
107
  return;
108
108
  }
109
109
  const tempDir = (0, path_1.join)(os_1.default.tmpdir(), `gmcb-skill-${Date.now()}`);
110
- const spinner = (0, ora_1.default)("正在克隆技能仓库...");
110
+ const spinner = (0, ora_1.default)('正在克隆技能仓库...');
111
111
  try {
112
112
  spinner.start();
113
113
  await (0, simple_git_1.default)().clone(repoUrl, tempDir);
114
- spinner.succeed("技能仓库克隆完成");
114
+ spinner.succeed('技能仓库克隆完成');
115
115
  }
116
116
  catch (e) {
117
- spinner.fail("克隆技能仓库失败:" + e.message);
117
+ spinner.fail('克隆技能仓库失败:' + e.message);
118
118
  return;
119
119
  }
120
120
  const remoteSkills = scanRemoteSkills(tempDir);
121
121
  if (remoteSkills.length === 0) {
122
- utils_1.log.warning("远程仓库中未发现任何技能");
122
+ utils_1.log.warning('远程仓库中未发现任何技能');
123
123
  await fsExtra.remove(tempDir);
124
124
  return;
125
125
  }
@@ -136,11 +136,11 @@ async function syncSkill(...args) {
136
136
  }));
137
137
  const ans = await inquirer_1.default.prompt([
138
138
  {
139
- type: "list",
140
- name: "env",
141
- message: "请选择目标环境",
139
+ type: 'list',
140
+ name: 'env',
141
+ message: '请选择目标环境',
142
142
  choices: envChoices,
143
- default: "default",
143
+ default: 'default',
144
144
  },
145
145
  ]);
146
146
  selectedEnv = ans.env;
@@ -152,9 +152,9 @@ async function syncSkill(...args) {
152
152
  }));
153
153
  const ans = await inquirer_1.default.prompt([
154
154
  {
155
- type: "list",
156
- name: "env",
157
- message: "检测到多个环境,请选择",
155
+ type: 'list',
156
+ name: 'env',
157
+ message: '检测到多个环境,请选择',
158
158
  choices: envChoices,
159
159
  default: existingEnvs[0],
160
160
  },
@@ -164,24 +164,24 @@ async function syncSkill(...args) {
164
164
  const targetEnvDir = (0, path_1.join)(utils_1.COMMAND_PATH, ENV_MAP[selectedEnv]);
165
165
  const localSkills = scanLocalSkills(targetEnvDir);
166
166
  const skillChoices = remoteSkills.map((skill) => ({
167
- name: `${skill.name} ${skill.description ? `- ${skill.description}` : ""}`,
167
+ name: `${skill.name} ${skill.description ? `- ${skill.description}` : ''}`,
168
168
  value: skill.name,
169
169
  checked: localSkills.includes(skill.name),
170
170
  }));
171
171
  const { selectedSkills } = await inquirer_1.default.prompt([
172
172
  {
173
- type: "checkbox",
174
- name: "selectedSkills",
175
- message: "请选择要同步的技能",
173
+ type: 'checkbox',
174
+ name: 'selectedSkills',
175
+ message: '请选择要同步的技能',
176
176
  choices: skillChoices,
177
177
  },
178
178
  ]);
179
179
  if (selectedSkills.length === 0) {
180
- utils_1.log.warning("未选择任何技能");
180
+ utils_1.log.warning('未选择任何技能');
181
181
  await fsExtra.remove(tempDir);
182
182
  return;
183
183
  }
184
- const skillsDir = (0, path_1.join)(targetEnvDir, "skills");
184
+ const skillsDir = (0, path_1.join)(targetEnvDir, 'skills');
185
185
  await fsExtra.ensureDir(skillsDir);
186
186
  let count = 0;
187
187
  for (const skillName of selectedSkills) {
@@ -199,25 +199,25 @@ async function listSkill() {
199
199
  let hasSkills = false;
200
200
  Object.keys(ENV_MAP).forEach((env) => {
201
201
  const envDir = (0, path_1.join)(utils_1.COMMAND_PATH, ENV_MAP[env]);
202
- const skillsPath = (0, path_1.join)(envDir, "skills");
202
+ const skillsPath = (0, path_1.join)(envDir, 'skills');
203
203
  if (!(0, fs_1.existsSync)(skillsPath))
204
204
  return;
205
205
  const skills = (0, fs_1.readdirSync)(skillsPath).filter((name) => {
206
- return (0, fs_1.existsSync)((0, path_1.join)(skillsPath, name, "SKILL.md"));
206
+ return (0, fs_1.existsSync)((0, path_1.join)(skillsPath, name, 'SKILL.md'));
207
207
  });
208
208
  if (skills.length === 0)
209
209
  return;
210
210
  hasSkills = true;
211
211
  console.log(chalk_1.default.cyan(`\n${env} (${ENV_MAP[env]}/skills):`));
212
212
  skills.forEach((skillName) => {
213
- const skillMd = (0, path_1.join)(skillsPath, skillName, "SKILL.md");
214
- const content = (0, fs_2.readFileSync)(skillMd, "utf-8");
213
+ const skillMd = (0, path_1.join)(skillsPath, skillName, 'SKILL.md');
214
+ const content = (0, fs_2.readFileSync)(skillMd, 'utf-8');
215
215
  const { description } = parseFrontmatter(content);
216
- const desc = description ? ` - ${description}` : "";
217
- console.log(` ${chalk_1.default.green("●")} ${skillName}${desc}`);
216
+ const desc = description ? ` - ${description}` : '';
217
+ console.log(` ${chalk_1.default.green('●')} ${skillName}${desc}`);
218
218
  });
219
219
  });
220
220
  if (!hasSkills) {
221
- utils_1.log.warning("当前项目未安装任何技能");
221
+ utils_1.log.warning('当前项目未安装任何技能');
222
222
  }
223
223
  }
package/lib/apis/index.js CHANGED
@@ -190,6 +190,15 @@ async function publishVersion(params) {
190
190
  fallbackFullUrl = '';
191
191
  fallbackResUrl = '';
192
192
  }
193
+ // 子应用允许 wgt/zip 只发一个,禁止用历史版本补齐另一包,
194
+ // 否则新版本链接会指向历史版本文件,客户端更新检查会一直命中历史版本。
195
+ if (publishType == 3) {
196
+ fallbackFullUrl = '';
197
+ fallbackResUrl = '';
198
+ }
199
+ if (publishType == 3 && !fullUrl && !resUrl) {
200
+ throw new Error('子应用发布未上传 wgt 或 zip 文件');
201
+ }
193
202
  await postVersion({
194
203
  id: versionId,
195
204
  fullPackageUrl: fullUrl || fallbackFullUrl,
@@ -1 +1,4 @@
1
- export default function (): Promise<void>;
1
+ import type { Options } from '../commands';
2
+ /** 小程序构建产物目录:HBuilderX(pack)在 unpackage,本地构建在 dist */
3
+ export declare function getMpProjectPath(pack?: boolean, root?: string): string;
4
+ export default function (opts?: Options): Promise<void>;
@@ -1,12 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMpProjectPath = getMpProjectPath;
3
4
  exports.default = default_1;
4
5
  const path_1 = require("path");
5
6
  const miniprogram_ci_1 = require("miniprogram-ci");
6
7
  const utils_1 = require("../utils");
7
- const const_1 = require("../utils/const");
8
8
  const config_1 = require("../utils/config");
9
- async function default_1() {
9
+ /** 小程序构建产物目录:HBuilderX(pack)在 unpackage,本地构建在 dist */
10
+ function getMpProjectPath(pack, root = process.cwd()) {
11
+ return (0, path_1.join)(root, pack ? 'unpackage' : '', 'dist/build/mp-weixin');
12
+ }
13
+ async function default_1(opts) {
10
14
  const buildEnv = process.env.BUILD_ENV || '';
11
15
  const manifest = (0, utils_1.readManifest)();
12
16
  const appid = manifest['mp-weixin']?.appid;
@@ -16,7 +20,7 @@ async function default_1() {
16
20
  const project = new miniprogram_ci_1.Project({
17
21
  appid,
18
22
  type: config_1.CONFIG_DATA?.mp?.weixin?.type || 'miniProgram',
19
- projectPath: (0, path_1.join)(process.cwd(), const_1.HAS_SRC ? '' : 'unpackage', 'dist/build/mp-weixin'),
23
+ projectPath: getMpProjectPath(opts?.pack),
20
24
  privateKeyPath: (0, path_1.resolve)(config_1.CONFIG_DATA?.mp?.weixin?.privatekey || ''),
21
25
  ignores: ['node_modules/**/*'],
22
26
  });
@@ -10,7 +10,6 @@ export declare const LOCAL_CONFIG_PATH: string;
10
10
  export declare const BUILD_ENV_PATH: string;
11
11
  export declare const HAS_SRC: boolean;
12
12
  export declare const SRC_PATH: string;
13
- export declare const DIST_PATH: string;
14
13
  export declare const MAINFEST_PATH: string;
15
14
  export { HOME_PATH };
16
15
  export declare const PLATFORM_OPTIONS: readonly ["h5", "mp-alipay", "mp-baidu", "mp-jd", "mp-kuaishou", "mp-qq", "mp-toutiao", "mp-weixin", "app", "app-ios", "app-android", "app-harmony", "windows", "macos", "linux"];
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PLATFORM_TYPE = exports.CHANNEL_TYPE = exports.APP_TYPE = exports.BASE_URL = exports.COMPILER_OPTIONS = exports.PLATFORM_OPTIONS = exports.HOME_PATH = exports.MAINFEST_PATH = exports.DIST_PATH = exports.SRC_PATH = exports.HAS_SRC = exports.BUILD_ENV_PATH = exports.LOCAL_CONFIG_PATH = exports.PACKAGE_PATH = exports.COMMAND_PATH = exports.CONFIG_PATH = exports.IS_WIN = exports.IS_MAC = exports.PLATFORM = exports.BIN_NAME = void 0;
6
+ exports.PLATFORM_TYPE = exports.CHANNEL_TYPE = exports.APP_TYPE = exports.BASE_URL = exports.COMPILER_OPTIONS = exports.PLATFORM_OPTIONS = exports.HOME_PATH = exports.MAINFEST_PATH = exports.SRC_PATH = exports.HAS_SRC = exports.BUILD_ENV_PATH = exports.LOCAL_CONFIG_PATH = exports.PACKAGE_PATH = exports.COMMAND_PATH = exports.CONFIG_PATH = exports.IS_WIN = exports.IS_MAC = exports.PLATFORM = exports.BIN_NAME = void 0;
7
7
  const path_1 = require("path");
8
8
  const os_1 = __importDefault(require("os"));
9
9
  const fs_1 = require("fs");
@@ -21,7 +21,6 @@ exports.LOCAL_CONFIG_PATH = (0, path_1.join)(exports.COMMAND_PATH, 'uni.build.js
21
21
  exports.BUILD_ENV_PATH = (0, path_1.join)(exports.COMMAND_PATH, 'buildenv');
22
22
  exports.HAS_SRC = (0, fs_1.existsSync)((0, path_1.join)(exports.COMMAND_PATH, 'src'));
23
23
  exports.SRC_PATH = (0, path_1.join)(exports.COMMAND_PATH, exports.HAS_SRC ? 'src' : '');
24
- exports.DIST_PATH = (0, path_1.join)(exports.COMMAND_PATH, exports.HAS_SRC ? 'unpackage' : '', 'dist');
25
24
  exports.MAINFEST_PATH = (0, path_1.join)(exports.SRC_PATH, 'manifest.json');
26
25
  exports.PLATFORM_OPTIONS = [
27
26
  'h5',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gmcb/cli",
3
- "version": "0.9.13",
3
+ "version": "0.9.15",
4
4
  "description": "工茂草本前端命令行工具",
5
5
  "author": "yinjiazeng@163.com",
6
6
  "license": "UNLICENSED",
package/schema.json CHANGED
@@ -1,421 +1,421 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "type": "object",
4
- "properties": {
5
- "skip": {
6
- "type": ["boolean", "number"],
7
- "description": "是否跳过所有确认提示自动发布。true/1 跳过,false/0 不跳过。CLI 传入 --skip 时会覆盖此配置"
8
- },
9
- "branch": {
10
- "type": ["boolean", "string"],
11
- "description": "是否在分支下打包,true表示在当前分支下打包,字符串表示仅在该分支下打包"
12
- },
13
- "install": {
14
- "type": "string",
15
- "description": "安装依赖的命令,默认为 npm install,可配置为 pnpm install、yarn 等"
16
- },
17
- "cli": {
18
- "type": "object",
19
- "description": "cli配置",
20
- "properties": {
21
- "hbuilderx": {
22
- "type": "string",
23
- "description": "hbuilderx cli路径"
24
- }
25
- }
26
- },
27
- "web": {
28
- "type": "object",
29
- "description": "管理平台配置",
30
- "properties": {
31
- "username": {
32
- "type": "string",
33
- "description": "登录用户名"
34
- },
35
- "password": {
36
- "type": "string",
37
- "description": "登录密码"
38
- }
39
- },
40
- "required": ["username", "password"]
41
- },
42
- "pull": {
43
- "type": "object",
44
- "description": "拉取资源配置",
45
- "properties": {
46
- "repo": {
47
- "type": "string",
48
- "description": "远程仓库地址,--pull 拉取代码时使用"
49
- }
50
- }
51
- },
52
- "pub": {
53
- "type": "object",
54
- "description": "发布配置",
55
- "properties": {
56
- "brand": {
57
- "type": "string",
58
- "description": "品牌名称"
59
- },
60
- "type": {
61
- "type": "number",
62
- "description": "应用类型,1:医生端、2:门店端、3:患者端"
63
- },
64
- "status": {
65
- "type": "number",
66
- "description": "更新状态,4:强制更新、3:提示更新、2:不提示更新"
67
- },
68
- "platform": {
69
- "type": "number",
70
- "description": "平台类型,1:android、2:ios、3:harmonyos、4:windows、5:macos"
71
- },
72
- "path": {
73
- "type": "string",
74
- "description": "远程路径"
75
- }
76
- },
77
- "required": ["brand", "type"]
78
- },
79
- "publish": {
80
- "type": "object",
81
- "description": "魔方发布配置",
82
- "properties": {
83
- "updateMode": {
84
- "type": "number",
85
- "description": "更新方式"
86
- },
87
- "updateType": {
88
- "type": "number",
89
- "description": "更新类型"
90
- },
91
- "versionDesc": {
92
- "type": "string",
93
- "description": "版本描述"
94
- },
95
- "publishType": {
96
- "type": "number",
97
- "description": "发布类型"
98
- },
99
- "platform": {
100
- "type": "number",
101
- "description": "平台类型,1:android、2:ios、3:harmonyos、4:windows、5:macos"
102
- },
103
- "path": {
104
- "type": "string",
105
- "description": "远程路径"
106
- }
107
- },
108
- "required": ["publishType"]
109
- },
110
- "cos": {
111
- "type": "object",
112
- "description": "腾讯云对象存储配置",
113
- "properties": {
114
- "secretid": {
115
- "type": "string",
116
- "description": "秘钥id"
117
- },
118
- "secretkey": {
119
- "type": "string",
120
- "description": "秘钥key"
121
- },
122
- "bucket": {
123
- "type": "string",
124
- "description": "存储桶名称"
125
- },
126
- "region": {
127
- "type": "string",
128
- "description": "所属地域,例如ap-nanjing"
129
- },
130
- "path": {
131
- "type": "string",
132
- "description": "上传远程目录,默认/"
133
- }
134
- },
135
- "required": ["bucket", "region"]
136
- },
137
- "app": {
138
- "type": "object",
139
- "description": "app配置",
140
- "properties": {
141
- "iscustom": {
142
- "type": "boolean",
143
- "description": "是否使用自定义基座"
144
- },
145
- "safemode": {
146
- "type": "boolean",
147
- "description": "是否为安心打包"
148
- },
149
- "isconfusion": {
150
- "type": "boolean",
151
- "description": "是否对配置的js/nvue文件进行原生混淆"
152
- },
153
- "splashads": {
154
- "type": "boolean",
155
- "description": "是否开启开屏广告"
156
- },
157
- "rpads": {
158
- "type": "boolean",
159
- "description": "是否开启悬浮红包广告"
160
- },
161
- "pushads": {
162
- "type": "boolean",
163
- "description": "是否开启推送广告"
164
- },
165
- "exchange": {
166
- "type": "boolean",
167
- "description": "是否加入换量联盟"
168
- },
169
- "harmony": {
170
- "type": "object",
171
- "description": "harmony配置",
172
- "properties": {
173
- "packagename": {
174
- "type": "string",
175
- "description": "包名"
176
- }
177
- }
178
- },
179
- "android": {
180
- "type": "object",
181
- "description": "android配置",
182
- "properties": {
183
- "packagename": {
184
- "type": "string",
185
- "description": "包名"
186
- },
187
- "androidpacktype": {
188
- "type": "integer",
189
- "description": "打包类型,0 使用自有证书 1 使用公共证书 2 使用DCloud老版证书"
190
- },
191
- "certalias": {
192
- "type": "string",
193
- "description": "打包证书别名"
194
- },
195
- "certfile": {
196
- "type": "string",
197
- "description": "打包证书文件路径"
198
- },
199
- "certpassword": {
200
- "type": "string",
201
- "description": "打包证书密码"
202
- },
203
- "name": {
204
- "type": "string",
205
- "description": "导出文件名称,默认为app-release.apk"
206
- },
207
- "path": {
208
- "type": "string",
209
- "description": "导出路径,默认app/build/outputs/apk/release"
210
- }
211
- },
212
- "required": ["androidpacktype", "certalias", "certfile", "certpassword"]
213
- },
214
- "ios": {
215
- "type": "object",
216
- "description": "ios配置",
217
- "properties": {
218
- "bundle": {
219
- "type": "string",
220
- "description": "包名"
221
- },
222
- "supporteddevice": {
223
- "type": "string",
224
- "description": "打包支持的设备类型,值有\"iPhone\",\"iPad\" 如果要打多个逗号隔开打包平台"
225
- },
226
- "profile": {
227
- "type": "string",
228
- "description": "使用自定义证书打包的profile文件路径"
229
- },
230
- "certfile": {
231
- "type": "string",
232
- "description": "使用自定义证书打包的p12文件路径"
233
- },
234
- "certpassword": {
235
- "type": "string",
236
- "description": "使用自定义证书打包的证书密码"
237
- },
238
- "name": {
239
- "type": "string",
240
- "description": "导出文件名称,默认为app-release.ipa"
241
- },
242
- "path": {
243
- "type": "string",
244
- "description": "导出路径,默认app/release"
245
- }
246
- },
247
- "required": ["supporteddevice", "profile", "certfile", "certpassword"]
248
- },
249
- "wgt": {
250
- "type": "object",
251
- "description": "移动应用热更新资源配置",
252
- "properties": {
253
- "name": {
254
- "type": "string",
255
- "description": "导出文件名称,例如app.wgt,默认为[appid].wgt"
256
- },
257
- "path": {
258
- "type": "string",
259
- "description": "导出路径,默认unpackage/release"
260
- }
261
- }
262
- },
263
- "custom": {
264
- "type": "object",
265
- "description": "自定义基座配置",
266
- "properties": {
267
- "android": {
268
- "type": "object",
269
- "description": "android配置",
270
- "properties": {
271
- "packagename": {
272
- "type": "string",
273
- "description": "包名"
274
- },
275
- "androidpacktype": {
276
- "type": "integer",
277
- "description": "打包类型,0 使用自有证书 1 使用公共证书 2 使用DCloud老版证书"
278
- },
279
- "certalias": {
280
- "type": "string",
281
- "description": "打包证书别名"
282
- },
283
- "certfile": {
284
- "type": "string",
285
- "description": "打包证书文件路径"
286
- },
287
- "certpassword": {
288
- "type": "string",
289
- "description": "打包证书密码"
290
- }
291
- }
292
- },
293
- "ios": {
294
- "type": "object",
295
- "description": "ios配置",
296
- "properties": {
297
- "bundle": {
298
- "type": "string",
299
- "description": "包名"
300
- },
301
- "supporteddevice": {
302
- "type": "string",
303
- "description": "打包支持的设备类型,值有\"iPhone\",\"iPad\" 如果要打多个逗号隔开打包平台"
304
- },
305
- "profile": {
306
- "type": "string",
307
- "description": "使用自定义证书打包的profile文件路径"
308
- },
309
- "certfile": {
310
- "type": "string",
311
- "description": "使用自定义证书打包的p12文件路径"
312
- },
313
- "certpassword": {
314
- "type": "string",
315
- "description": "使用自定义证书打包的证书密码"
316
- }
317
- },
318
- "required": ["profile", "certfile"]
319
- }
320
- }
321
- }
322
- }
323
- },
324
- "h5": {
325
- "type": "object",
326
- "description": "h5配置",
327
- "properties": {
328
- "windows": {
329
- "type": "object",
330
- "description": "windows配置",
331
- "properties": {
332
- "appid": {
333
- "type": "string",
334
- "description": "应用ID"
335
- },
336
- "name": {
337
- "type": "string",
338
- "description": "导出文件名称,默认为app-release.exe"
339
- },
340
- "path": {
341
- "type": "string",
342
- "description": "导出路径,默认dist"
343
- }
344
- }
345
- },
346
- "macos": {
347
- "type": "object",
348
- "description": "macos配置",
349
- "properties": {
350
- "appid": {
351
- "type": "string",
352
- "description": "应用ID"
353
- },
354
- "name": {
355
- "type": "string",
356
- "description": "导出文件名称,默认为app-release.dmg"
357
- },
358
- "path": {
359
- "type": "string",
360
- "description": "导出路径,默认dist"
361
- }
362
- }
363
- },
364
- "zip": {
365
- "type": "object",
366
- "description": "打包资源配置,开启--zip时生效",
367
- "properties": {
368
- "name": {
369
- "type": "string",
370
- "description": "导出文件名称,例如app.zip,默认为[appid].zip或[name].zip"
371
- },
372
- "path": {
373
- "type": "string",
374
- "description": "导出路径,默认unpackage/release"
375
- },
376
- "source": {
377
- "type": "string",
378
- "description": "资源路径,h5默认dist/build/h5或unpackage/dist/build/web,electron-vite默认dist/win-unpacked/resources"
379
- }
380
- }
381
- }
382
- }
383
- },
384
- "mp": {
385
- "type": "object",
386
- "description": "小程序配置",
387
- "properties": {
388
- "weixin": {
389
- "type": "object",
390
- "description": "微信小程序配置",
391
- "properties": {
392
- "type": {
393
- "type": "string",
394
- "description": "上传类型"
395
- },
396
- "privatekey": {
397
- "type": "string",
398
- "description": "代码上传密钥文件"
399
- }
400
- },
401
- "required": ["privatekey"]
402
- },
403
- "alipay": {
404
- "type": "object",
405
- "description": "支付宝小程序配置",
406
- "properties": {
407
- "type": {
408
- "type": "string",
409
- "description": "上传类型"
410
- },
411
- "privatekey": {
412
- "type": "string",
413
- "description": "代码上传密钥文件"
414
- }
415
- },
416
- "required": ["privatekey"]
417
- }
418
- }
419
- }
420
- }
421
- }
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "skip": {
6
+ "type": ["boolean", "number"],
7
+ "description": "是否跳过所有确认提示自动发布。true/1 跳过,false/0 不跳过。CLI 传入 --skip 时会覆盖此配置"
8
+ },
9
+ "branch": {
10
+ "type": ["boolean", "string"],
11
+ "description": "是否在分支下打包,true表示在当前分支下打包,字符串表示仅在该分支下打包"
12
+ },
13
+ "install": {
14
+ "type": "string",
15
+ "description": "安装依赖的命令,默认为 npm install,可配置为 pnpm install、yarn 等"
16
+ },
17
+ "cli": {
18
+ "type": "object",
19
+ "description": "cli配置",
20
+ "properties": {
21
+ "hbuilderx": {
22
+ "type": "string",
23
+ "description": "hbuilderx cli路径"
24
+ }
25
+ }
26
+ },
27
+ "web": {
28
+ "type": "object",
29
+ "description": "管理平台配置",
30
+ "properties": {
31
+ "username": {
32
+ "type": "string",
33
+ "description": "登录用户名"
34
+ },
35
+ "password": {
36
+ "type": "string",
37
+ "description": "登录密码"
38
+ }
39
+ },
40
+ "required": ["username", "password"]
41
+ },
42
+ "pull": {
43
+ "type": "object",
44
+ "description": "拉取资源配置",
45
+ "properties": {
46
+ "repo": {
47
+ "type": "string",
48
+ "description": "远程仓库地址,--pull 拉取代码时使用"
49
+ }
50
+ }
51
+ },
52
+ "pub": {
53
+ "type": "object",
54
+ "description": "发布配置",
55
+ "properties": {
56
+ "brand": {
57
+ "type": "string",
58
+ "description": "品牌名称"
59
+ },
60
+ "type": {
61
+ "type": "number",
62
+ "description": "应用类型,1:医生端、2:门店端、3:患者端"
63
+ },
64
+ "status": {
65
+ "type": "number",
66
+ "description": "更新状态,4:强制更新、3:提示更新、2:不提示更新"
67
+ },
68
+ "platform": {
69
+ "type": "number",
70
+ "description": "平台类型,1:android、2:ios、3:harmonyos、4:windows、5:macos"
71
+ },
72
+ "path": {
73
+ "type": "string",
74
+ "description": "远程路径"
75
+ }
76
+ },
77
+ "required": ["brand", "type"]
78
+ },
79
+ "publish": {
80
+ "type": "object",
81
+ "description": "魔方发布配置",
82
+ "properties": {
83
+ "updateMode": {
84
+ "type": "number",
85
+ "description": "更新方式"
86
+ },
87
+ "updateType": {
88
+ "type": "number",
89
+ "description": "更新类型"
90
+ },
91
+ "versionDesc": {
92
+ "type": "string",
93
+ "description": "版本描述"
94
+ },
95
+ "publishType": {
96
+ "type": "number",
97
+ "description": "发布类型"
98
+ },
99
+ "platform": {
100
+ "type": "number",
101
+ "description": "平台类型,1:android、2:ios、3:harmonyos、4:windows、5:macos"
102
+ },
103
+ "path": {
104
+ "type": "string",
105
+ "description": "远程路径"
106
+ }
107
+ },
108
+ "required": ["publishType"]
109
+ },
110
+ "cos": {
111
+ "type": "object",
112
+ "description": "腾讯云对象存储配置",
113
+ "properties": {
114
+ "secretid": {
115
+ "type": "string",
116
+ "description": "秘钥id"
117
+ },
118
+ "secretkey": {
119
+ "type": "string",
120
+ "description": "秘钥key"
121
+ },
122
+ "bucket": {
123
+ "type": "string",
124
+ "description": "存储桶名称"
125
+ },
126
+ "region": {
127
+ "type": "string",
128
+ "description": "所属地域,例如ap-nanjing"
129
+ },
130
+ "path": {
131
+ "type": "string",
132
+ "description": "上传远程目录,默认/"
133
+ }
134
+ },
135
+ "required": ["bucket", "region"]
136
+ },
137
+ "app": {
138
+ "type": "object",
139
+ "description": "app配置",
140
+ "properties": {
141
+ "iscustom": {
142
+ "type": "boolean",
143
+ "description": "是否使用自定义基座"
144
+ },
145
+ "safemode": {
146
+ "type": "boolean",
147
+ "description": "是否为安心打包"
148
+ },
149
+ "isconfusion": {
150
+ "type": "boolean",
151
+ "description": "是否对配置的js/nvue文件进行原生混淆"
152
+ },
153
+ "splashads": {
154
+ "type": "boolean",
155
+ "description": "是否开启开屏广告"
156
+ },
157
+ "rpads": {
158
+ "type": "boolean",
159
+ "description": "是否开启悬浮红包广告"
160
+ },
161
+ "pushads": {
162
+ "type": "boolean",
163
+ "description": "是否开启推送广告"
164
+ },
165
+ "exchange": {
166
+ "type": "boolean",
167
+ "description": "是否加入换量联盟"
168
+ },
169
+ "harmony": {
170
+ "type": "object",
171
+ "description": "harmony配置",
172
+ "properties": {
173
+ "packagename": {
174
+ "type": "string",
175
+ "description": "包名"
176
+ }
177
+ }
178
+ },
179
+ "android": {
180
+ "type": "object",
181
+ "description": "android配置",
182
+ "properties": {
183
+ "packagename": {
184
+ "type": "string",
185
+ "description": "包名"
186
+ },
187
+ "androidpacktype": {
188
+ "type": "integer",
189
+ "description": "打包类型,0 使用自有证书 1 使用公共证书 2 使用DCloud老版证书"
190
+ },
191
+ "certalias": {
192
+ "type": "string",
193
+ "description": "打包证书别名"
194
+ },
195
+ "certfile": {
196
+ "type": "string",
197
+ "description": "打包证书文件路径"
198
+ },
199
+ "certpassword": {
200
+ "type": "string",
201
+ "description": "打包证书密码"
202
+ },
203
+ "name": {
204
+ "type": "string",
205
+ "description": "导出文件名称,默认为app-release.apk"
206
+ },
207
+ "path": {
208
+ "type": "string",
209
+ "description": "导出路径,默认app/build/outputs/apk/release"
210
+ }
211
+ },
212
+ "required": ["androidpacktype", "certalias", "certfile", "certpassword"]
213
+ },
214
+ "ios": {
215
+ "type": "object",
216
+ "description": "ios配置",
217
+ "properties": {
218
+ "bundle": {
219
+ "type": "string",
220
+ "description": "包名"
221
+ },
222
+ "supporteddevice": {
223
+ "type": "string",
224
+ "description": "打包支持的设备类型,值有\"iPhone\",\"iPad\" 如果要打多个逗号隔开打包平台"
225
+ },
226
+ "profile": {
227
+ "type": "string",
228
+ "description": "使用自定义证书打包的profile文件路径"
229
+ },
230
+ "certfile": {
231
+ "type": "string",
232
+ "description": "使用自定义证书打包的p12文件路径"
233
+ },
234
+ "certpassword": {
235
+ "type": "string",
236
+ "description": "使用自定义证书打包的证书密码"
237
+ },
238
+ "name": {
239
+ "type": "string",
240
+ "description": "导出文件名称,默认为app-release.ipa"
241
+ },
242
+ "path": {
243
+ "type": "string",
244
+ "description": "导出路径,默认app/release"
245
+ }
246
+ },
247
+ "required": ["supporteddevice", "profile", "certfile", "certpassword"]
248
+ },
249
+ "wgt": {
250
+ "type": "object",
251
+ "description": "移动应用热更新资源配置",
252
+ "properties": {
253
+ "name": {
254
+ "type": "string",
255
+ "description": "导出文件名称,例如app.wgt,默认为[appid].wgt"
256
+ },
257
+ "path": {
258
+ "type": "string",
259
+ "description": "导出路径,默认unpackage/release"
260
+ }
261
+ }
262
+ },
263
+ "custom": {
264
+ "type": "object",
265
+ "description": "自定义基座配置",
266
+ "properties": {
267
+ "android": {
268
+ "type": "object",
269
+ "description": "android配置",
270
+ "properties": {
271
+ "packagename": {
272
+ "type": "string",
273
+ "description": "包名"
274
+ },
275
+ "androidpacktype": {
276
+ "type": "integer",
277
+ "description": "打包类型,0 使用自有证书 1 使用公共证书 2 使用DCloud老版证书"
278
+ },
279
+ "certalias": {
280
+ "type": "string",
281
+ "description": "打包证书别名"
282
+ },
283
+ "certfile": {
284
+ "type": "string",
285
+ "description": "打包证书文件路径"
286
+ },
287
+ "certpassword": {
288
+ "type": "string",
289
+ "description": "打包证书密码"
290
+ }
291
+ }
292
+ },
293
+ "ios": {
294
+ "type": "object",
295
+ "description": "ios配置",
296
+ "properties": {
297
+ "bundle": {
298
+ "type": "string",
299
+ "description": "包名"
300
+ },
301
+ "supporteddevice": {
302
+ "type": "string",
303
+ "description": "打包支持的设备类型,值有\"iPhone\",\"iPad\" 如果要打多个逗号隔开打包平台"
304
+ },
305
+ "profile": {
306
+ "type": "string",
307
+ "description": "使用自定义证书打包的profile文件路径"
308
+ },
309
+ "certfile": {
310
+ "type": "string",
311
+ "description": "使用自定义证书打包的p12文件路径"
312
+ },
313
+ "certpassword": {
314
+ "type": "string",
315
+ "description": "使用自定义证书打包的证书密码"
316
+ }
317
+ },
318
+ "required": ["profile", "certfile"]
319
+ }
320
+ }
321
+ }
322
+ }
323
+ },
324
+ "h5": {
325
+ "type": "object",
326
+ "description": "h5配置",
327
+ "properties": {
328
+ "windows": {
329
+ "type": "object",
330
+ "description": "windows配置",
331
+ "properties": {
332
+ "appid": {
333
+ "type": "string",
334
+ "description": "应用ID"
335
+ },
336
+ "name": {
337
+ "type": "string",
338
+ "description": "导出文件名称,默认为app-release.exe"
339
+ },
340
+ "path": {
341
+ "type": "string",
342
+ "description": "导出路径,默认dist"
343
+ }
344
+ }
345
+ },
346
+ "macos": {
347
+ "type": "object",
348
+ "description": "macos配置",
349
+ "properties": {
350
+ "appid": {
351
+ "type": "string",
352
+ "description": "应用ID"
353
+ },
354
+ "name": {
355
+ "type": "string",
356
+ "description": "导出文件名称,默认为app-release.dmg"
357
+ },
358
+ "path": {
359
+ "type": "string",
360
+ "description": "导出路径,默认dist"
361
+ }
362
+ }
363
+ },
364
+ "zip": {
365
+ "type": "object",
366
+ "description": "打包资源配置,开启--zip时生效",
367
+ "properties": {
368
+ "name": {
369
+ "type": "string",
370
+ "description": "导出文件名称,例如app.zip,默认为[appid].zip或[name].zip"
371
+ },
372
+ "path": {
373
+ "type": "string",
374
+ "description": "导出路径,默认unpackage/release"
375
+ },
376
+ "source": {
377
+ "type": "string",
378
+ "description": "资源路径,h5默认dist/build/h5或unpackage/dist/build/web,electron-vite默认dist/win-unpacked/resources"
379
+ }
380
+ }
381
+ }
382
+ }
383
+ },
384
+ "mp": {
385
+ "type": "object",
386
+ "description": "小程序配置",
387
+ "properties": {
388
+ "weixin": {
389
+ "type": "object",
390
+ "description": "微信小程序配置",
391
+ "properties": {
392
+ "type": {
393
+ "type": "string",
394
+ "description": "上传类型"
395
+ },
396
+ "privatekey": {
397
+ "type": "string",
398
+ "description": "代码上传密钥文件"
399
+ }
400
+ },
401
+ "required": ["privatekey"]
402
+ },
403
+ "alipay": {
404
+ "type": "object",
405
+ "description": "支付宝小程序配置",
406
+ "properties": {
407
+ "type": {
408
+ "type": "string",
409
+ "description": "上传类型"
410
+ },
411
+ "privatekey": {
412
+ "type": "string",
413
+ "description": "代码上传密钥文件"
414
+ }
415
+ },
416
+ "required": ["privatekey"]
417
+ }
418
+ }
419
+ }
420
+ }
421
+ }