@heybox/hb-sdk 0.6.1 → 0.6.2

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/README.md CHANGED
@@ -421,7 +421,7 @@ try {
421
421
  2. 已运行过 `hb-sdk login` 登录 Heybox;多主体用户应确认 `hb-sdk remote entity current` 指向要发布的主体。
422
422
  3. 当前项目绑定的小程序必须属于服务端 current entity;如不一致,先运行 `hb-sdk remote entity switch <entity-id>` 切换主体。
423
423
  4. 如果需要以公司的名义发布小程序,需先找 @秦浩东 申请小程序开发权限。
424
- 5. 每次部署都要在 `package.json` 里配置 `heybox.miniProgramProfile.name`、`iconUrl` 和至少一张 `coverImageUrls`,这些资料会随版本提交审核。
424
+ 5. 小程序名称、icon 和介绍图在开放平台版本发布中维护;CLI 项目配置只保留 `heybox.miniProgramId`。首次部署且无历史审核通过资料时,服务端使用默认名与默认图。
425
425
  6. 每次部署都要准备发布日志:`hb-sdk remote deploy --release-note "..."`。发布日志 trim 后不能为空,最多 500 个字符,允许换行;CI / 非 TTY 环境缺失时会直接失败,TTY 环境会提示输入。
426
426
  7. 项目根有 `scripts.build`,会被 CLI 通过 lockfile 自动选用的 `pnpm`、`yarn` 或 `npm` 触发;无 lockfile 时回退 `npm`。
427
427
  8. 构建产物落在 `dist/`,包含 `index.html` 和 `manifest.json`。
@@ -444,20 +444,7 @@ try {
444
444
 
445
445
  `--from-version <version>` 用于复用已经上传过的远端历史版本产物提交新一轮审核。该模式不读取本地 `dist/`,也不会执行 build 或上传;目标审核版本由服务端根据版本表最高 SemVer 自动派生。
446
446
 
447
- `manifest.json` 不会上传到 CDN,只作为 submit audit 请求的 `manifest` 字段提交。`sdkVersion` 由 SDK 构建自动生成,业务配置不能覆盖;复用历史 Version Artifact 时继续使用源 Artifact 的 `sdkVersion`。名称、icon 和介绍图从 `package.json.heybox.miniProgramProfile` 读取,并随 precheck submit audit 一起提交:
448
-
449
- ```json
450
- {
451
- "heybox": {
452
- "miniProgramId": "mp_xxxxxxxx",
453
- "miniProgramProfile": {
454
- "name": "我的小程序",
455
- "iconUrl": "https://img.example.test/icon.png",
456
- "coverImageUrls": ["https://img.example.test/cover.png"]
457
- }
458
- }
459
- }
460
- ```
447
+ `manifest.json` 不会上传到 CDN,只作为 submit audit 请求的 `manifest` 字段提交。`sdkVersion` 由 SDK 构建自动生成,业务配置不能覆盖;复用历史 Version Artifact 时继续使用源 Artifact 的 `sdkVersion`。CLI precheck / submit audit **不传** name / icon / cover:服务端沿用最近一次审核通过的展示资料,没有则注入默认名「我的小程序」与平台默认图。正式名称与图片请在开放平台版本发布中修改;仍使用默认资料时可以 release,但无法 `square show` 对普通用户公开展示。
461
448
 
462
449
  内部测试或预发环境可通过 origin 级别的自定义地址切换后台环境:
463
450
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var session = require('./session-0XuUaVOO.cjs');
4
- var index = require('./index-BnCDW-BB.cjs');
3
+ var session = require('./session-D7mPwyx4.cjs');
4
+ var index = require('./index-CTyguEza.cjs');
5
5
  var fs$1 = require('node:fs');
6
6
  var fs = require('node:fs/promises');
7
7
  var path = require('node:path');
@@ -5,7 +5,7 @@ var fs = require('node:fs/promises');
5
5
  var path = require('node:path');
6
6
  var require$$0 = require('fs');
7
7
  var require$$1 = require('path');
8
- var index = require('./index-BnCDW-BB.cjs');
8
+ var index = require('./index-CTyguEza.cjs');
9
9
  require('node:module');
10
10
  require('os');
11
11
  require('readline');
@@ -9,9 +9,9 @@ var node_url = require('node:url');
9
9
  var net = require('node:net');
10
10
  var node_http = require('node:http');
11
11
  var browser = require('./browser-RAy8e8cV.cjs');
12
- var index = require('./index-BnCDW-BB.cjs');
13
- var context = require('./context-D0BowvGu.cjs');
14
- var session = require('./session-0XuUaVOO.cjs');
12
+ var index = require('./index-CTyguEza.cjs');
13
+ var context = require('./context-DmxbC_iV.cjs');
14
+ var session = require('./session-D7mPwyx4.cjs');
15
15
  require('node:process');
16
16
  require('node:buffer');
17
17
  require('node:util');
@@ -754,7 +754,7 @@ async function enforceRemoteSdkVersion(options) {
754
754
  /** 构建时替换为当前发布包的实际版本。 */
755
755
  const HB_SDK_VERSION = typeof undefined === 'string'
756
756
  ? undefined
757
- : '0.6.1';
757
+ : '0.6.2';
758
758
 
759
759
  const DEFAULT_APP_PORT = 5173;
760
760
  const DEFAULT_MOCK_PORT = 5174;
@@ -4,7 +4,7 @@ var fs$1 = require('node:fs');
4
4
  var fs = require('node:fs/promises');
5
5
  var os = require('node:os');
6
6
  var path = require('node:path');
7
- var index = require('./index-BnCDW-BB.cjs');
7
+ var index = require('./index-CTyguEza.cjs');
8
8
  require('node:module');
9
9
  require('path');
10
10
  require('os');
@@ -234,19 +234,19 @@ function requireArgument () {
234
234
 
235
235
  var command = {};
236
236
 
237
- const require$5 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-BnCDW-BB.cjs', document.baseURI).href)));
237
+ const require$5 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-CTyguEza.cjs', document.baseURI).href)));
238
238
  function __require$4() { return require$5("node:events"); }
239
239
 
240
- const require$4 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-BnCDW-BB.cjs', document.baseURI).href)));
240
+ const require$4 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-CTyguEza.cjs', document.baseURI).href)));
241
241
  function __require$3() { return require$4("node:child_process"); }
242
242
 
243
- const require$3 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-BnCDW-BB.cjs', document.baseURI).href)));
243
+ const require$3 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-CTyguEza.cjs', document.baseURI).href)));
244
244
  function __require$2() { return require$3("node:path"); }
245
245
 
246
- const require$2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-BnCDW-BB.cjs', document.baseURI).href)));
246
+ const require$2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-CTyguEza.cjs', document.baseURI).href)));
247
247
  function __require$1() { return require$2("node:fs"); }
248
248
 
249
- const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-BnCDW-BB.cjs', document.baseURI).href)));
249
+ const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-CTyguEza.cjs', document.baseURI).href)));
250
250
  function __require() { return require$1("node:process"); }
251
251
 
252
252
  var help = {};
@@ -13323,7 +13323,7 @@ function getPathname(pathWithQuery) {
13323
13323
  }
13324
13324
 
13325
13325
  const CLI_VERSION_PLACEHOLDER = ['__HB', 'SDK', 'CLI', 'VERSION__'].join('_');
13326
- const BUILT_CLI_VERSION = '0.6.1';
13326
+ const BUILT_CLI_VERSION = '0.6.2';
13327
13327
  const PACKAGE_JSON_CANDIDATES = [
13328
13328
  path.resolve(__dirname, '..', '..', 'package.json'),
13329
13329
  path.resolve(__dirname, '..', 'package.json'),
@@ -13644,31 +13644,31 @@ function createCommandLoggerResolver(options) {
13644
13644
  };
13645
13645
  }
13646
13646
  const defaultClearLoginStatus = async (...args) => {
13647
- const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-BsyENL1d.cjs'); });
13647
+ const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-BWN2-2Gk.cjs'); });
13648
13648
  return clearLoginStatus(...args);
13649
13649
  };
13650
13650
  const defaultLoginToHeybox = async (...args) => {
13651
- const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-BsyENL1d.cjs'); });
13651
+ const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-BWN2-2Gk.cjs'); });
13652
13652
  return loginToHeybox(...args);
13653
13653
  };
13654
13654
  const defaultPrintLoginStatus = async (...args) => {
13655
- const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-BsyENL1d.cjs'); });
13655
+ const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-BWN2-2Gk.cjs'); });
13656
13656
  return printLoginStatus(...args);
13657
13657
  };
13658
13658
  const defaultRunCreateCommand = async (...args) => {
13659
- const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-C0afRvs9.cjs'); });
13659
+ const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-CXBnqr5r.cjs'); });
13660
13660
  return runCreateCommand(...args);
13661
13661
  };
13662
13662
  const defaultRunDevCommand = async (...args) => {
13663
- const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-CN307p_G.cjs'); });
13663
+ const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-OCij_ecL.cjs'); });
13664
13664
  return runDevCommand(...args);
13665
13665
  };
13666
13666
  const defaultRunDoctorCommand = async (...args) => {
13667
- const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-VW0nKg5q.cjs'); });
13667
+ const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-DQIzL_3_.cjs'); });
13668
13668
  return runDoctorCommand(...args);
13669
13669
  };
13670
13670
  const defaultRunRemoteCommand = async (...args) => {
13671
- const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-BSvvxvVv.cjs'); });
13671
+ const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-DxKtJ21x.cjs'); });
13672
13672
  return runRemoteCommand(...args);
13673
13673
  };
13674
13674
  function resolveStandaloneLogger(options, verbose) {
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var index$2 = require('./index-BnCDW-BB.cjs');
3
+ var index$2 = require('./index-CTyguEza.cjs');
4
4
  var require$$0$2 = require('fs');
5
5
  var require$$2$1 = require('crypto');
6
6
  var require$$1$2 = require('path');
7
7
  var require$$0$3 = require('assert');
8
8
  var require$$4$2 = require('events');
9
9
  var require$$1$1 = require('util');
10
- var context$1 = require('./context-D0BowvGu.cjs');
10
+ var context$1 = require('./context-DmxbC_iV.cjs');
11
11
  var require$$0$5 = require('net');
12
12
  var require$$0$4 = require('url');
13
13
  var require$$2$2 = require('http');
@@ -3,9 +3,9 @@
3
3
  var promises = require('node:readline/promises');
4
4
  var node_crypto = require('node:crypto');
5
5
  var node_http = require('node:http');
6
- var session = require('./session-0XuUaVOO.cjs');
6
+ var session = require('./session-D7mPwyx4.cjs');
7
7
  var browser = require('./browser-RAy8e8cV.cjs');
8
- var index = require('./index-BnCDW-BB.cjs');
8
+ var index = require('./index-CTyguEza.cjs');
9
9
  require('node:path');
10
10
  require('fs');
11
11
  require('constants');
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  var promises = require('node:readline/promises');
4
- var index = require('./index-BnCDW-BB.cjs');
5
- var session = require('./session-0XuUaVOO.cjs');
4
+ var index = require('./index-CTyguEza.cjs');
5
+ var session = require('./session-D7mPwyx4.cjs');
6
6
  var childProcess = require('node:child_process');
7
7
  var fs = require('node:fs');
8
8
  var fs$1 = require('node:fs/promises');
9
9
  var path = require('node:path');
10
- var context = require('./context-D0BowvGu.cjs');
10
+ var context = require('./context-DmxbC_iV.cjs');
11
11
  require('node:module');
12
12
  require('path');
13
13
  require('os');
@@ -264,7 +264,7 @@ async function createDefaultCosClient(uploadToken) {
264
264
  };
265
265
  }
266
266
  async function loadCosConstructor() {
267
- const cosModule = await Promise.resolve().then(function () { return require('./index-DcZLSI_y.cjs'); }).then(function (n) { return n.index; });
267
+ const cosModule = await Promise.resolve().then(function () { return require('./index-Ulhxo0YK.cjs'); }).then(function (n) { return n.index; });
268
268
  return cosModule.default;
269
269
  }
270
270
  function formatSize(bytes) {
@@ -309,9 +309,7 @@ function isRecord(value) {
309
309
 
310
310
  async function precheckUserMiniprogramVersion(options, runtime = {}) {
311
311
  return postUserMiniprogramVersionForm(context.PRECHECK_USER_MINIPROGRAM_VERSION_API_PATH, options, {
312
- name: options.name,
313
- icon_url: options.iconUrl,
314
- cover_image_urls: options.coverImageUrls.join(','),
312
+ // 展示资料由服务端沿用 last approved 或注入默认名/默认图;CLI 不传 name/icon/cover。
315
313
  ...(options.version ? { version: options.version } : {}),
316
314
  ...(options.source_version ? { source_version: options.source_version } : {}),
317
315
  release_note: options.releaseNote,
@@ -320,9 +318,7 @@ async function precheckUserMiniprogramVersion(options, runtime = {}) {
320
318
  }
321
319
  async function submitUserMiniprogramAudit(options, runtime = {}) {
322
320
  return postUserMiniprogramVersionForm(context.SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH, options, {
323
- name: options.name,
324
- icon_url: options.iconUrl,
325
- cover_image_urls: options.coverImageUrls.join(','),
321
+ // 展示资料由服务端沿用 last approved 或注入默认名/默认图;CLI 不传 name/icon/cover。
326
322
  ...(options.manifest ? { manifest: JSON.stringify(options.manifest) } : {}),
327
323
  ...(options.source_version ? { source_version: options.source_version } : {}),
328
324
  release_note: options.releaseNote,
@@ -8670,7 +8666,6 @@ async function runDeployCommand(options, runtime = {}) {
8670
8666
  if (typeof miniProgramId !== 'string' || !miniProgramId.trim()) {
8671
8667
  throw new Error('未在 package.json 中找到 heybox.miniProgramId,请先配置 mini program id');
8672
8668
  }
8673
- const miniProgramProfile = readMiniProgramVersionProfile(packageJson);
8674
8669
  const fromVersion = options.fromVersion?.trim();
8675
8670
  const releaseNote = await resolveDeployReleaseNote(options, runtime);
8676
8671
  const session$1 = await logger.task('正在校验 Heybox 登录态', () => (runtime.requireAuthSession ?? session.requireHeyboxAuthSession)({ loginBaseUrl }), { successText: 'Heybox 登录态有效' });
@@ -8682,7 +8677,6 @@ async function runDeployCommand(options, runtime = {}) {
8682
8677
  const precheck = await runVersionPrecheck({
8683
8678
  session: session$1,
8684
8679
  miniProgramId,
8685
- ...miniProgramProfile,
8686
8680
  ...historyArtifact,
8687
8681
  releaseNote,
8688
8682
  autoPublish,
@@ -8701,7 +8695,6 @@ async function runDeployCommand(options, runtime = {}) {
8701
8695
  await runVersionPrecheck({
8702
8696
  session: session$1,
8703
8697
  miniProgramId,
8704
- ...miniProgramProfile,
8705
8698
  version: precheckVersion,
8706
8699
  releaseNote,
8707
8700
  autoPublish,
@@ -8754,8 +8747,8 @@ async function runDeployCommand(options, runtime = {}) {
8754
8747
  }
8755
8748
  try {
8756
8749
  const submitOptions = fromVersion
8757
- ? { session: session$1, miniProgramId, ...miniProgramProfile, ...historyArtifact, releaseNote, autoPublish }
8758
- : { session: session$1, miniProgramId, ...miniProgramProfile, manifest, releaseNote, autoPublish };
8750
+ ? { session: session$1, miniProgramId, ...historyArtifact, releaseNote, autoPublish }
8751
+ : { session: session$1, miniProgramId, manifest, releaseNote, autoPublish };
8759
8752
  submitAuditResult = await logger.task('正在提交审核', () => (runtime.submitUserMiniprogramAudit ?? submitUserMiniprogramAudit)(submitOptions, {
8760
8753
  baseUrl: apiBaseUrl,
8761
8754
  fetchImpl: runtime.fetchImpl,
@@ -8814,42 +8807,6 @@ function findProjectRoot(startDir) {
8814
8807
  async function readPackageJson(projectRoot) {
8815
8808
  return JSON.parse(await fs$1.readFile(path.join(projectRoot, 'package.json'), 'utf8'));
8816
8809
  }
8817
- function readMiniProgramVersionProfile(packageJson) {
8818
- const profile = packageJson.heybox?.miniProgramProfile;
8819
- return {
8820
- name: readRequiredProfileText(profile?.name, 'heybox.miniProgramProfile.name'),
8821
- iconUrl: readRequiredHttpsUrl(profile?.iconUrl, 'heybox.miniProgramProfile.iconUrl'),
8822
- coverImageUrls: readCoverImageUrls(profile?.coverImageUrls),
8823
- };
8824
- }
8825
- function readRequiredProfileText(value, pathLabel) {
8826
- const text = typeof value === 'string' ? value.trim() : '';
8827
- if (!text) {
8828
- throw new Error(`${pathLabel} 不能为空;请在 package.json 配置本次提交审核的小程序资料`);
8829
- }
8830
- return text;
8831
- }
8832
- function readRequiredHttpsUrl(value, pathLabel) {
8833
- const text = readRequiredProfileText(value, pathLabel);
8834
- if (!/^https:\/\//i.test(text)) {
8835
- throw new Error(`${pathLabel} 必须是 HTTPS 地址`);
8836
- }
8837
- return text;
8838
- }
8839
- function readCoverImageUrls(value) {
8840
- if (!Array.isArray(value)) {
8841
- throw new Error('heybox.miniProgramProfile.coverImageUrls 至少配置 1 张 HTTPS 图片');
8842
- }
8843
- const urls = value.map((item) => (typeof item === 'string' ? item.trim() : '')).filter(Boolean);
8844
- if (urls.length === 0) {
8845
- throw new Error('heybox.miniProgramProfile.coverImageUrls 至少配置 1 张 HTTPS 图片');
8846
- }
8847
- const invalidUrl = urls.find((url) => !/^https:\/\//i.test(url));
8848
- if (invalidUrl) {
8849
- throw new Error(`heybox.miniProgramProfile.coverImageUrls 必须都是 HTTPS 地址:${invalidUrl}`);
8850
- }
8851
- return urls;
8852
- }
8853
8810
  async function readDeployManifest(projectRoot, logger) {
8854
8811
  const distDir = path.join(projectRoot, 'dist');
8855
8812
  const manifestPath = path.join(distDir, 'manifest.json');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BnCDW-BB.cjs');
3
+ var index = require('./index-CTyguEza.cjs');
4
4
  var node_crypto = require('node:crypto');
5
5
  var path = require('node:path');
6
6
  var require$$0$2 = require('fs');
package/dist/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./cli-chunks/index-BnCDW-BB.cjs');
3
+ var index = require('./cli-chunks/index-CTyguEza.cjs');
4
4
  require('node:module');
5
5
  require('node:fs');
6
6
  require('node:fs/promises');
package/dist/index.cjs.js CHANGED
@@ -325,7 +325,7 @@ function createMessageId() {
325
325
  /** 构建时替换为当前发布包的实际版本。 */
326
326
  const HB_SDK_VERSION = typeof undefined === 'string'
327
327
  ? undefined
328
- : '0.6.1';
328
+ : '0.6.2';
329
329
 
330
330
  /**
331
331
  * 判断未知数据是否符合小程序 bridge 消息信封。
package/dist/index.esm.js CHANGED
@@ -321,7 +321,7 @@ function createMessageId() {
321
321
  /** 构建时替换为当前发布包的实际版本。 */
322
322
  const HB_SDK_VERSION = typeof undefined === 'string'
323
323
  ? undefined
324
- : '0.6.1';
324
+ : '0.6.2';
325
325
 
326
326
  /**
327
327
  * 判断未知数据是否符合小程序 bridge 消息信封。
@@ -21,7 +21,7 @@ npm run deploy
21
21
 
22
22
  - `npm run dev`:启动本地 Vite 服务和 `hb-sdk` 内置 mock runtime host,适合本地调试 SDK 能力;调试页内可点击按钮在 Mac 版 APP 中启动同一页面,也可以选择局域网网卡后用手机小黑盒 APP 扫码调试。手机需要与电脑处在同一局域网,并使用支持小程序调试壳的新版小黑盒 APP。Codex、VSCode 等内嵌浏览器可能无法唤起系统 APP,需要时请在系统浏览器中打开同一个调试页后重试。
23
23
  - `npm run build`:先执行 TypeScript 检查,再构建生产产物。
24
- - `npm run deploy -- --release-note "..."`:运行 `hb-sdk remote deploy`,构建、上传并提交当前小程序版本审核。部署前需要先执行过 `npx hb-sdk login`;多主体账号还应通过 `npx hb-sdk remote entity current` 确认服务端 current entity。远端小程序可通过 `npx hb-sdk remote create` 在 current entity 下创建并绑定,或用 `npx hb-sdk remote bind <mini-program-id>` 绑定 current entity 可管理的已有小程序。小程序名称、icon 和介绍图在 `package.json.heybox.miniProgramProfile` 中配置并随版本审核提交。`selectedEntity` 只是 CLI 登录缓存中的提示快照,实际 deploy/create/bind 以服务端 current entity 为准。默认审核通过后用 `hb-sdk remote versions` 查看状态,再用 `hb-sdk remote release <version>` 发布,如需审核通过后自动发布可追加 `--auto-publish`。顶层 `hb-sdk deploy` 已删除,不再作为兼容别名保留。
24
+ - `npm run deploy -- --release-note "..."`:运行 `hb-sdk remote deploy`,构建、上传并提交当前小程序版本审核。部署前需要先执行过 `npx hb-sdk login`;多主体账号还应通过 `npx hb-sdk remote entity current` 确认服务端 current entity。远端小程序可通过 `npx hb-sdk remote create` 在 current entity 下创建并绑定,或用 `npx hb-sdk remote bind <mini-program-id>` 绑定 current entity 可管理的已有小程序。小程序名称、icon 和介绍图在开放平台版本发布中维护;CLI 项目配置只保留 `heybox.miniProgramId`,首次部署服务端会使用默认名与默认图。`selectedEntity` 只是 CLI 登录缓存中的提示快照,实际 deploy/create/bind 以服务端 current entity 为准。默认审核通过后用 `hb-sdk remote versions` 查看状态,再用 `hb-sdk remote release <version>` 发布,如需审核通过后自动发布可追加 `--auto-publish`。顶层 `hb-sdk deploy` 已删除,不再作为兼容别名保留。
25
25
 
26
26
  ## 更多能力
27
27
 
@@ -4,12 +4,7 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "heybox": {
7
- "miniProgramId": "",
8
- "miniProgramProfile": {
9
- "name": "<%= packageName %>",
10
- "iconUrl": "",
11
- "coverImageUrls": []
12
- }
7
+ "miniProgramId": ""
13
8
  },
14
9
  "scripts": {
15
10
  "hb-sdk": "hb-sdk",
package/dist/vite.cjs.js CHANGED
@@ -10,7 +10,7 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
10
10
  /** 构建时替换为当前发布包的实际版本。 */
11
11
  const HB_SDK_VERSION = typeof undefined === 'string'
12
12
  ? undefined
13
- : '0.6.1';
13
+ : '0.6.2';
14
14
 
15
15
  function getDefaultExportFromCjs (x) {
16
16
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
package/dist/vite.esm.js CHANGED
@@ -7,7 +7,7 @@ import { readFile, mkdir, writeFile, rename } from 'node:fs/promises';
7
7
  /** 构建时替换为当前发布包的实际版本。 */
8
8
  const HB_SDK_VERSION = typeof undefined === 'string'
9
9
  ? undefined
10
- : '0.6.1';
10
+ : '0.6.2';
11
11
 
12
12
  function getDefaultExportFromCjs (x) {
13
13
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heybox/hb-sdk",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "sideEffects": [
5
5
  "./src/index.ts",
6
6
  "./src/core/singleton.ts",
package/skill/SKILL.md CHANGED
@@ -52,7 +52,7 @@ Apply these instructions when writing, reviewing, or debugging code that consume
52
52
  2. Use `hb-sdk dev` for local browser debugging through the built-in mock runtime host. The project must bind `package.json.heybox.miniProgramId` and the CLI must be logged in so dev can load the real Runtime permission snapshot before starting Vite.
53
53
  3. Use `hb-sdk remote ...` for developer-owned remote mini-program management. Top-level `hb-sdk deploy` has been hard-cut and must not be recommended as a compatibility alias.
54
54
  4. Use `hb-sdk remote entity list`, `hb-sdk remote entity current`, and `hb-sdk remote entity switch <entity-id>` to inspect or change the developer platform server-side current entity before remote management commands.
55
- 5. Use `hb-sdk remote create` to create a remote mini-program under the server-side current entity and bind the returned id into `package.json.heybox.miniProgramId`; use `hb-sdk remote bind <mini-program-id>` to bind an existing remote mini-program after current-entity manageability is verified. Mini-program name, icon, and cover images belong in `package.json.heybox.miniProgramProfile` and are submitted with version audit.
55
+ 5. Use `hb-sdk remote create` to create a remote mini-program under the server-side current entity and bind the returned id into `package.json.heybox.miniProgramId`; use `hb-sdk remote bind <mini-program-id>` to bind an existing remote mini-program after current-entity manageability is verified. CLI project configuration contains only `package.json.heybox.miniProgramId`; mini-program name, icon, and cover images are maintained on the Open platform version-publish flow. On first submit without prior approved profile, the server injects a default name and default images.
56
56
  6. Use `hb-sdk remote info`, `hb-sdk remote list`, `hb-sdk remote access`, `hb-sdk remote versions`, `hb-sdk remote preview <version>`, and `hb-sdk remote allowlist ...` for read/basic/preview management workflows. Mini-program name and image changes must go through version audit, so the CLI must not expose a basic-info update command.
57
57
  7. Use `hb-sdk remote deploy --release-note <text>` to build, upload, and submit the current project for audit. It reads `package.json.heybox.miniProgramId`, validates that the bound mini-program belongs to the server-side current entity before precheck/build/upload, prechecks `package.json.version` before build, runs the project's `build` script via the package manager auto-detected by lockfile, uploads `dist/` to CDN (skipping `manifest.json`, `.DS_Store`, `.map`), then calls the submit-audit API. Deploy and `--from-version` do not fetch or compare the client-side `minimumSdkVersion`; Manifest validation and server-side precheck / submit-audit policy still apply. When `--env <name>` or `HB_SDK_ENV=<name>` selects an environment preset, deploy also passes the same name to the project build as its Vite mode. The deploy upload pipeline rejects actual upload artifacts over 100MiB before any upload request, processes CDN upload metadata and callback confirmation at 50 files per batch, keeps 4-way upload concurrency within each batch, and validates CDN-returned keys exactly against the local expected upload keys.
58
58
  8. Use `hb-sdk remote deploy --from-version <version> --release-note <text>` to reuse a previously uploaded remote version artifact and submit a new audit version without reading local `dist`, building, or uploading.
@@ -19,7 +19,7 @@
19
19
  ## Package metadata
20
20
 
21
21
  - Package: `@heybox/hb-sdk`
22
- - Version at generation time: `0.6.1`
22
+ - Version at generation time: `0.6.2`
23
23
  - Public root export: `@heybox/hb-sdk`
24
24
  - Protocol export: `@heybox/hb-sdk/protocol`
25
25
  - Vite plugin export: `@heybox/hb-sdk/vite`
@@ -256,20 +256,7 @@ hb-sdk remote square show
256
256
 
257
257
  `hb-sdk remote create` 会创建远端工坊小程序并写入当前项目绑定;已有绑定时必须传 `--force-bind` 才能覆盖。`hb-sdk remote bind <mini-program-id>` 会先校验当前 CLI 用户可管理目标小程序,再写入本地配置;`--force` 只允许覆盖本地绑定,不跳过远端校验。
258
258
 
259
- 小程序名称、icon 和介绍图需要随版本提交审核,CLI 不再提供直接更新基础信息的命令。提交审核前在 `package.json.heybox.miniProgramProfile` 配置 `name`、HTTPS `iconUrl` 和至少一张 HTTPS `coverImageUrls`:
260
-
261
- ```json
262
- {
263
- "heybox": {
264
- "miniProgramId": "mp_xxxxxxxx",
265
- "miniProgramProfile": {
266
- "name": "我的小程序",
267
- "iconUrl": "https://img.example.test/icon.png",
268
- "coverImageUrls": ["https://img.example.test/cover.png"]
269
- }
270
- }
271
- }
272
- ```
259
+ 小程序名称、icon 和介绍图在开放平台「版本发布」中维护并随版本审核。CLI 项目配置只保留 `package.json.heybox.miniProgramId`;首次部署且没有历史审核资料时,服务端会使用默认名称「我的小程序」与平台默认图片。
273
260
 
274
261
  `hb-sdk remote square hide` 会隐藏当前绑定小程序在普通用户侧的小程序工坊广场展示;白名单用户仍可在小程序工坊广场看到,直接链接访问已发布版本也不受影响。`hb-sdk remote square show` 会恢复普通用户侧的小程序工坊广场展示。
275
262
 
@@ -281,7 +268,7 @@ Agent rules:
281
268
 
282
269
  - Use `hb-sdk remote entity list/current/switch` for developer entity inspection and switching.
283
270
  - Use `hb-sdk remote create` for create-and-bind and `hb-sdk remote bind <mini-program-id>` for binding an existing manageable remote mini-program.
284
- - Keep mini-program name, icon, and cover images in `package.json.heybox.miniProgramProfile`; these fields are submitted with version audit.
271
+ - Do not require or submit mini-program name/icon/cover from CLI; maintain them on Open version publish. CLI project configuration contains only `package.json.heybox.miniProgramId`.
285
272
  - Explain that `remote create` creates under the current entity and that multi-entity non-TTY usage must confirm with `--yes`; `--yes` confirms current-entity usage but does not switch entities.
286
273
  - Explain that `remote bind` verifies the mini-program is manageable by the current entity and does not write `package.json.heybox.miniProgramId` on entity mismatch.
287
274
  - Use `hb-sdk remote info`, `hb-sdk remote access`, `hb-sdk remote list`, `hb-sdk remote versions`, `hb-sdk remote preview <version>`, `hb-sdk remote square show/hide`, and `hb-sdk remote allowlist ...` instead of sending users to Open when a matching CLI command exists.
@@ -398,7 +385,7 @@ npm run deploy
398
385
 
399
386
  - `npm run dev`:启动本地 Vite 服务和 `hb-sdk` 内置 mock runtime host,适合本地调试 SDK 能力;调试页内可点击按钮在 Mac 版 APP 中启动同一页面,也可以选择局域网网卡后用手机小黑盒 APP 扫码调试。手机需要与电脑处在同一局域网,并使用支持小程序调试壳的新版小黑盒 APP。Codex、VSCode 等内嵌浏览器可能无法唤起系统 APP,需要时请在系统浏览器中打开同一个调试页后重试。
400
387
  - `npm run build`:先执行 TypeScript 检查,再构建生产产物。
401
- - `npm run deploy -- --release-note "..."`:运行 `hb-sdk remote deploy`,构建、上传并提交当前小程序版本审核。部署前需要先执行过 `npx hb-sdk login`;多主体账号还应通过 `npx hb-sdk remote entity current` 确认服务端 current entity。远端小程序可通过 `npx hb-sdk remote create` 在 current entity 下创建并绑定,或用 `npx hb-sdk remote bind <mini-program-id>` 绑定 current entity 可管理的已有小程序。小程序名称、icon 和介绍图在 `package.json.heybox.miniProgramProfile` 中配置并随版本审核提交。`selectedEntity` 只是 CLI 登录缓存中的提示快照,实际 deploy/create/bind 以服务端 current entity 为准。默认审核通过后用 `hb-sdk remote versions` 查看状态,再用 `hb-sdk remote release <version>` 发布,如需审核通过后自动发布可追加 `--auto-publish`。顶层 `hb-sdk deploy` 已删除,不再作为兼容别名保留。
388
+ - `npm run deploy -- --release-note "..."`:运行 `hb-sdk remote deploy`,构建、上传并提交当前小程序版本审核。部署前需要先执行过 `npx hb-sdk login`;多主体账号还应通过 `npx hb-sdk remote entity current` 确认服务端 current entity。远端小程序可通过 `npx hb-sdk remote create` 在 current entity 下创建并绑定,或用 `npx hb-sdk remote bind <mini-program-id>` 绑定 current entity 可管理的已有小程序。小程序名称、icon 和介绍图在开放平台版本发布中维护;CLI 项目配置只保留 `heybox.miniProgramId`,首次部署服务端会使用默认名与默认图。`selectedEntity` 只是 CLI 登录缓存中的提示快照,实际 deploy/create/bind 以服务端 current entity 为准。默认审核通过后用 `hb-sdk remote versions` 查看状态,再用 `hb-sdk remote release <version>` 发布,如需审核通过后自动发布可追加 `--auto-publish`。顶层 `hb-sdk deploy` 已删除,不再作为兼容别名保留。
402
389
 
403
390
  ## 更多能力
404
391
 
@@ -429,7 +429,7 @@ Agent rules:
429
429
 
430
430
  - Use \`hb-sdk remote entity list/current/switch\` for developer entity inspection and switching.
431
431
  - Use \`hb-sdk remote create\` for create-and-bind and \`hb-sdk remote bind <mini-program-id>\` for binding an existing manageable remote mini-program.
432
- - Keep mini-program name, icon, and cover images in \`package.json.heybox.miniProgramProfile\`; these fields are submitted with version audit.
432
+ - Do not require or submit mini-program name/icon/cover from CLI; maintain them on Open version publish. CLI project configuration contains only \`package.json.heybox.miniProgramId\`.
433
433
  - Explain that \`remote create\` creates under the current entity and that multi-entity non-TTY usage must confirm with \`--yes\`; \`--yes\` confirms current-entity usage but does not switch entities.
434
434
  - Explain that \`remote bind\` verifies the mini-program is manageable by the current entity and does not write \`package.json.heybox.miniProgramId\` on entity mismatch.
435
435
  - Use \`hb-sdk remote info\`, \`hb-sdk remote access\`, \`hb-sdk remote list\`, \`hb-sdk remote versions\`, \`hb-sdk remote preview <version>\`, \`hb-sdk remote square show/hide\`, and \`hb-sdk remote allowlist ...\` instead of sending users to Open when a matching CLI command exists.
package/skill/skill.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "hb-sdk",
3
- "skillVersion": "0.6.1+skill.31b72826f59b",
3
+ "skillVersion": "0.6.2+skill.f2a041bb2256",
4
4
  "sdk": {
5
5
  "package": "@heybox/hb-sdk",
6
- "version": "0.6.1",
7
- "compatibility": "0.6.1"
6
+ "version": "0.6.2",
7
+ "compatibility": "0.6.2"
8
8
  },
9
9
  "source": "https://open.xiaoheihe.cn/agent-skills/hb-sdk",
10
- "integrity": "sha256-31b72826f59beadd927f3f2cafcba36bbf9e035915a7734d0b990767fc34d926"
10
+ "integrity": "sha256-f2a041bb22563610e0fcaa991e2e5a2a94c331a029aafe4535083ecf89a4a6b0"
11
11
  }