@heybox/hb-sdk 0.6.1 → 0.6.3

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.
Files changed (31) hide show
  1. package/README.md +4 -17
  2. package/dist/cli-chunks/{context-D0BowvGu.cjs → context-Bu0Zusj_.cjs} +1 -37
  3. package/dist/cli-chunks/{create-C0afRvs9.cjs → create-CgAGcRtZ.cjs} +1 -1
  4. package/dist/cli-chunks/{dev-CN307p_G.cjs → dev-g35-QcIa.cjs} +4 -96
  5. package/dist/cli-chunks/{doctor-VW0nKg5q.cjs → doctor-klsQg82G.cjs} +1 -1
  6. package/dist/cli-chunks/{index-BnCDW-BB.cjs → index--P321c8v.cjs} +13 -13
  7. package/dist/cli-chunks/{index-DcZLSI_y.cjs → index-CbsbCgtf.cjs} +2 -2
  8. package/dist/cli-chunks/{login-BsyENL1d.cjs → login-DEoReXOe.cjs} +2 -2
  9. package/dist/cli-chunks/{remote-BSvvxvVv.cjs → remote-CZ-G3RSH.cjs} +9 -52
  10. package/dist/cli-chunks/{session-0XuUaVOO.cjs → session-vlPGi1Z8.cjs} +1 -2
  11. package/dist/cli.cjs +1 -1
  12. package/dist/index.cjs.js +1 -1
  13. package/dist/index.esm.js +1 -1
  14. package/dist/miniapp-publish.cjs.js +0 -4
  15. package/dist/miniapp-publish.esm.js +1 -4
  16. package/dist/templates/vue3-vite-ts/README.md.ejs +1 -1
  17. package/dist/templates/vue3-vite-ts/package.json.ejs +1 -6
  18. package/dist/vite.cjs.js +2 -344
  19. package/dist/vite.esm.js +2 -344
  20. package/package.json +1 -1
  21. package/skill/SKILL.md +2 -2
  22. package/skill/references/api-root.md +3 -25
  23. package/skill/references/cli.md +5 -18
  24. package/skill/scripts/sync-references.mjs +1 -1
  25. package/skill/skill.json +4 -4
  26. package/types/miniapp-publish/index.d.ts +0 -1
  27. package/types/vite/index.d.ts +1 -7
  28. package/types/cli/auth/base-url.d.ts +0 -20
  29. package/types/cli/config.d.ts +0 -11
  30. package/types/miniapp-manifest/sdk-version-policy.d.ts +0 -9
  31. package/types/vite/sdk-version-gate.d.ts +0 -8
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
 
@@ -490,7 +477,7 @@ hb-sdk remote deploy --env test --service-tag other-tag --release-note "灰度"
490
477
 
491
478
  `--env <name>` 会读取项目根下的 `.env.<name>`,`--env-file <path>` 显式指定路径且优先级高于 `--env`;两者也可通过 `HB_SDK_ENV=<name>` 触发。加载遵循 dotenv 惯例:不覆盖进程已有的同名变量,因此 CI 或命令行显式设置的值优先。使用 `--env <name>` 或 `HB_SDK_ENV=<name>` 执行 `remote deploy` 时,CLI 还会把同一个 `name` 作为 `--mode <name>` 传给项目 build,使 CLI 后端环境与 Vite mode 保持一致。文件仅支持 `KEY=VALUE`、空行和 `#` 注释,不做变量插值;文件不存在时静默跳过。`--verbose` 会打印生效的文件路径和被跳过的 key。
492
479
 
493
- `--api-base-url` 优先于 `HB_SDK_API_BASE_URL`,影响 `hb-sdk remote` 里的远端平台后台 API,包括预检、CDN 上传凭证/回调、提交审核、版本、发布、撤回、下架、重新上架、详情和白名单等调用;`--login-base-url` 优先于 `HB_SDK_LOGIN_BASE_URL`,用于 `hb-sdk login` 的登录入口,以及 remote 命令前校验当前 CLI 登录态是否属于同一个登录环境。`--service-tag <tag>` 优先于 `HB_SDK_SERVICE_TAG`,给 Heybox 后台请求附加 `x-rylai-service-tag` header,并复用命中的 tag 追加 `special_tag` 请求参数,用于开发环境路由或灰度验证。手动 Vite build 的最低 SDK 版本门禁请求会同时携带该 header 和 query;`remote deploy` 的子构建不执行客户端最低版本门禁。仓库内开发也可继续在 `packages/hb-sdk/src/cli/config.ts` 里按 `@heybox/hb-types` 的 `RylaiServiceTagConfig` 配置 path-prefix 级 `special_tag`。自定义地址只接受 origin,不允许包含 path、query 或 hash;API origin 默认还必须是 Heybox 受信 HTTPS 域名,只有本地联调等场景可显式使用 `--allow-unsafe-api-base-url` 或 `HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1` 放开。日志只输出 origin,不输出带身份和签名参数的完整请求 URL。`hb-sdk doctor`、npm latest 检查、mock host 的 `network.request()` 不受这些配置影响。
480
+ `--api-base-url` 优先于 `HB_SDK_API_BASE_URL`,影响 `hb-sdk remote` 里的远端平台后台 API,包括预检、CDN 上传凭证/回调、提交审核、版本、发布、撤回、下架、重新上架、详情和白名单等调用;`--login-base-url` 优先于 `HB_SDK_LOGIN_BASE_URL`,用于 `hb-sdk login` 的登录入口,以及 remote 命令前校验当前 CLI 登录态是否属于同一个登录环境。`--service-tag <tag>` 优先于 `HB_SDK_SERVICE_TAG`,给 Heybox 后台请求附加 `x-rylai-service-tag` header,并复用命中的 tag 追加 `special_tag` 请求参数,用于开发环境路由或灰度验证。仓库内开发也可继续在 `packages/hb-sdk/src/cli/config.ts` 里按 `@heybox/hb-types` 的 `RylaiServiceTagConfig` 配置 path-prefix 级 `special_tag`。自定义地址只接受 origin,不允许包含 path、query 或 hash;API origin 默认还必须是 Heybox 受信 HTTPS 域名,只有本地联调等场景可显式使用 `--allow-unsafe-api-base-url` 或 `HB_SDK_ALLOW_UNSAFE_API_BASE_URL=1` 放开。日志只输出 origin,不输出带身份和签名参数的完整请求 URL。`hb-sdk doctor`、npm latest 检查、mock host 的 `network.request()` 不受这些配置影响。
494
481
 
495
482
  ## hb-sdk remote 命令参考
496
483
 
@@ -570,7 +557,7 @@ export default defineConfig({
570
557
 
571
558
  插件只接受单页应用:输出目录只能存在入口 `index.html`。build 会用结构化 HTML parser 校验入口,并把平台 CSP 插入 `<head>` 首位;已有 CSP 会原样保留,两份策略按浏览器交集生效。正式策略禁止 `fetch`、XHR、WebSocket、EventSource、Beacon、Worker、iframe、表单和对象加载等浏览器原生出口;业务网络请求应使用 `network.request()`。dev 使用相同策略,只额外放行当前 Vite 的精确 HMR WebSocket 地址。
572
559
 
573
- meta refresh、外部 anchor、`dns-prefetch`、`preconnect`、`prerender`、外部资源 URL 和额外 HTML 会使 build 失败。内联 script/style 允许,但 `unsafe-eval` 不允许。`dev` 和手动 Vite build 会读取 `/user_miniprogram/public/sdk_config` `minimumSdkVersion`;最新请求失败时只回退当前 Remote Environment 下 24 小时内的有效缓存,无缓存则默认阻断并提示升级 `@heybox/hb-sdk@latest`。`hb-sdk remote deploy`(包括 `--from-version`)不执行客户端最低版本查询或比较,但仍校验 Manifest 结构并经过服务端 precheck / submit-audit 策略。
560
+ meta refresh、外部 anchor、`dns-prefetch`、`preconnect`、`prerender`、外部资源 URL 和额外 HTML 会使 build 失败。内联 script/style 允许,但 `unsafe-eval` 不允许。`dev` 和手动 Vite build 不再请求远端最低 SDK 版本;构建仍会把当前 `sdkVersion` 写入 Manifest,`hb-sdk remote deploy` 仍校验 Manifest 结构并经过服务端 precheck / submit-audit 策略。
574
561
 
575
562
  失败与警告语义:
576
563
 
@@ -1,30 +1,10 @@
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-vlPGi1Z8.cjs');
5
4
  var fs$1 = require('node:fs');
6
5
  var fs = require('node:fs/promises');
7
6
  var path = require('node:path');
8
7
 
9
- const APIUserMiniprogramPublicSdkConfigPath = '/user_miniprogram/public/sdk_config';
10
- function createUserMiniprogramPublicSdkConfigRequest(serviceTag) {
11
- return {
12
- path: APIUserMiniprogramPublicSdkConfigPath,
13
- searchParams: serviceTag ? { special_tag: serviceTag } : {},
14
- headers: serviceTag ? { 'x-rylai-service-tag': serviceTag } : {},
15
- };
16
- }
17
- function parseUserMiniprogramPublicSdkConfigResult(value) {
18
- if (!isRecord(value) ||
19
- typeof value.minimum_sdk_version !== 'string') {
20
- throw new Error('公共 SDK 配置响应无效');
21
- }
22
- return value;
23
- }
24
- function isRecord(value) {
25
- return typeof value === 'object' && value !== null;
26
- }
27
-
28
8
  var re = {exports: {}};
29
9
 
30
10
  var constants;
@@ -2814,7 +2794,6 @@ const MINIAPP_UPLOAD_SCOPE = 'activity';
2814
2794
  const ACTIVITY_UPLOAD_KEY_MAX_LENGTH = 64;
2815
2795
  const MINIAPP_UPLOAD_BATCH_SIZE = 50;
2816
2796
  const MINIAPP_UPLOAD_TOTAL_SIZE_LIMIT_BYTES = 100 * 1024 * 1024;
2817
- const PUBLIC_USER_MINIPROGRAM_SDK_CONFIG_API_PATH = APIUserMiniprogramPublicSdkConfigPath;
2818
2797
  const USER_MINIPROGRAM_ACCESS_STATUS_API_PATH = '/mall/developer/user_miniprogram/access_status';
2819
2798
  const DEVELOPER_ENTITY_LIST_API_PATH = '/mall/developer/entity/list';
2820
2799
  const DEVELOPER_ENTITY_SWITCH_API_PATH = '/mall/developer/entity/switch';
@@ -2930,20 +2909,6 @@ function createRemoteApiClient(options) {
2930
2909
  listUserMiniprogramVersions: (requestOptions) => listUserMiniprogramVersions(requestOptions, options),
2931
2910
  };
2932
2911
  }
2933
- async function getPublicSdkConfig(runtime) {
2934
- const fetchImpl = runtime.fetchImpl ?? fetch;
2935
- const serviceTag = index.resolveHeyboxRylaiServiceTag(PUBLIC_USER_MINIPROGRAM_SDK_CONFIG_API_PATH);
2936
- const request = createUserMiniprogramPublicSdkConfigRequest(serviceTag);
2937
- const response = await fetchImpl(session.createHeyboxApiUrl(runtime.baseUrl ?? 'https://api.xiaoheihe.cn', request.path, request.searchParams), {
2938
- method: 'GET',
2939
- headers: {
2940
- Referer: session.HEYBOX_WEB_REFERER,
2941
- ...request.headers,
2942
- },
2943
- });
2944
- const result = await readRequiredResult(response, request.path);
2945
- return parseUserMiniprogramPublicSdkConfigResult(result);
2946
- }
2947
2912
  async function listDeveloperEntities(runtime) {
2948
2913
  return remoteGet(DEVELOPER_ENTITY_LIST_API_PATH, {}, runtime);
2949
2914
  }
@@ -3223,7 +3188,6 @@ exports.SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH = SUBMIT_USER_MINIPROGRAM_AUDIT_A
3223
3188
  exports.createRemoteApiClientForEnvironment = createRemoteApiClientForEnvironment;
3224
3189
  exports.getBoundMiniProgram = getBoundMiniProgram;
3225
3190
  exports.getMiniappUploadKey = getMiniappUploadKey;
3226
- exports.getPublicSdkConfig = getPublicSdkConfig;
3227
3191
  exports.normalizeRelativePath = normalizeRelativePath;
3228
3192
  exports.readBoundMiniProgramId = readBoundMiniProgramId;
3229
3193
  exports.readBoundMiniProgramIdFromPackageJson = readBoundMiniProgramIdFromPackageJson;
@@ -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--P321c8v.cjs');
9
9
  require('node:module');
10
10
  require('os');
11
11
  require('readline');
@@ -9,9 +9,8 @@ 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--P321c8v.cjs');
13
+ var context = require('./context-Bu0Zusj_.cjs');
15
14
  require('node:process');
16
15
  require('node:buffer');
17
16
  require('node:util');
@@ -25,6 +24,7 @@ require('events');
25
24
  require('stream');
26
25
  require('buffer');
27
26
  require('util');
27
+ require('./session-vlPGi1Z8.cjs');
28
28
  require('node:crypto');
29
29
  require('fs');
30
30
  require('constants');
@@ -666,95 +666,10 @@ function createHeyboxProtocol(payload) {
666
666
  return `heybox://${encodeURIComponent(JSON.stringify(payload))}`;
667
667
  }
668
668
 
669
- const CACHE_MAX_AGE_MS = 24 * 60 * 60 * 1_000;
670
- const CACHE_FILE_NAME = 'minimum-sdk-versions.json';
671
- async function resolveMinimumSdkVersion(options) {
672
- const now = options.now ?? Date.now();
673
- const cachePath = path.join(options.cacheDir, CACHE_FILE_NAME);
674
- const cache = await readCache(cachePath);
675
- let minimumSdkVersion;
676
- try {
677
- minimumSdkVersion = validateStableSdkVersion(await options.fetchMinimumSdkVersion(), 'minimumSdkVersion');
678
- }
679
- catch {
680
- const cached = cache.environments[options.environment];
681
- const cacheAge = cached ? now - cached.fetchedAt : Number.NaN;
682
- if (cached && Number.isFinite(cached.fetchedAt) && cacheAge >= 0 && cacheAge <= CACHE_MAX_AGE_MS) {
683
- try {
684
- return validateStableSdkVersion(cached.minimumSdkVersion, 'cached minimumSdkVersion');
685
- }
686
- catch {
687
- // 非法缓存按不存在处理。
688
- }
689
- }
690
- throw new Error('MINIMUM_SDK_VERSION_UNAVAILABLE:无法获取最低 SDK 版本,且没有 24 小时内的有效缓存');
691
- }
692
- cache.environments[options.environment] = { fetchedAt: now, minimumSdkVersion };
693
- try {
694
- await writeCache(cachePath, cache);
695
- }
696
- catch {
697
- // 已校验的远端策略仍然可信;缓存只是离线回退优化。
698
- }
699
- return minimumSdkVersion;
700
- }
701
- function validateCurrentSdkVersion(currentSdkVersion, minimumSdkVersion, options) {
702
- const current = validateSdkVersion(currentSdkVersion, '当前 SDK 版本');
703
- const minimum = validateStableSdkVersion(minimumSdkVersion, 'minimumSdkVersion');
704
- if (!options.allowPrerelease && context.semverExports.prerelease(current) !== null) {
705
- throw new Error('正式发布不允许使用预发布 SDK,请运行 pnpm add @heybox/hb-sdk@latest 后重新构建');
706
- }
707
- if (!context.semverExports.satisfies(current, `>=${minimum}`, { includePrerelease: options.allowPrerelease })) {
708
- throw new Error(`SDK_VERSION_TOO_LOW:当前 @heybox/hb-sdk@${current} 低于最低版本 ${minimum},请运行 pnpm add @heybox/hb-sdk@latest`);
709
- }
710
- return current;
711
- }
712
- function validateSdkVersion(value, label) {
713
- const normalized = String(value).trim();
714
- const parsed = context.semverExports.parse(normalized);
715
- if (!parsed || parsed.version !== normalized || parsed.build.length > 0) {
716
- throw new Error(`${label} 必须是合法 SemVer:${normalized}`);
717
- }
718
- return normalized;
719
- }
720
- function validateStableSdkVersion(value, label) {
721
- const normalized = validateSdkVersion(value, label);
722
- if (context.semverExports.prerelease(normalized) !== null)
723
- throw new Error(`${label} 必须是稳定 SemVer:${normalized}`);
724
- return normalized;
725
- }
726
- async function readCache(cachePath) {
727
- try {
728
- const parsed = JSON.parse(await fs$1.readFile(cachePath, 'utf8'));
729
- if (parsed && typeof parsed === 'object' && parsed.environments && typeof parsed.environments === 'object')
730
- return parsed;
731
- }
732
- catch {
733
- // 缓存缺失或损坏时继续请求最新配置。
734
- }
735
- return { environments: {} };
736
- }
737
- async function writeCache(cachePath, cache) {
738
- await fs$1.mkdir(path.dirname(cachePath), { recursive: true });
739
- const temporaryPath = `${cachePath}.${process.pid}.tmp`;
740
- await fs$1.writeFile(temporaryPath, `${JSON.stringify(cache, null, 2)}\n`, { mode: 0o600 });
741
- await fs$1.rename(temporaryPath, cachePath);
742
- }
743
-
744
- const paths = index.envPaths('hb-sdk');
745
- async function enforceRemoteSdkVersion(options) {
746
- const minimumSdkVersion = await resolveMinimumSdkVersion({
747
- cacheDir: options.cacheDir ?? paths.cache,
748
- environment: options.environment,
749
- fetchMinimumSdkVersion: async () => (await context.getPublicSdkConfig({ baseUrl: options.environment, fetchImpl: options.fetchImpl })).minimum_sdk_version,
750
- });
751
- return validateCurrentSdkVersion(options.sdkVersion, minimumSdkVersion, { allowPrerelease: options.allowPrerelease });
752
- }
753
-
754
669
  /** 构建时替换为当前发布包的实际版本。 */
755
670
  const HB_SDK_VERSION = typeof undefined === 'string'
756
671
  ? undefined
757
- : '0.6.1';
672
+ : '0.6.3';
758
673
 
759
674
  const DEFAULT_APP_PORT = 5173;
760
675
  const DEFAULT_MOCK_PORT = 5174;
@@ -766,13 +681,6 @@ const VITE_LOG_LEVEL = 'warn';
766
681
  async function runDevCommand(options, runtime = {}) {
767
682
  const logger = runtime.logger ?? index.createCliLogger();
768
683
  const fetchImpl = runtime.fetchImpl ?? fetch;
769
- const environment = session.resolveHeyboxApiBaseUrl({ env: runtime.env });
770
- await (runtime.enforceRemoteSdkVersion ?? enforceRemoteSdkVersion)({
771
- sdkVersion: HB_SDK_VERSION,
772
- environment,
773
- fetchImpl,
774
- allowPrerelease: true,
775
- });
776
684
  const openUrl = runtime.openExternalUrl ?? browser.openExternalUrl;
777
685
  const networkInterfaceSnapshot = (runtime.networkInterfaces ?? os.networkInterfaces)();
778
686
  const getPortImpl = runtime.getPort ?? getPorts;
@@ -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--P321c8v.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--P321c8v.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--P321c8v.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--P321c8v.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--P321c8v.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--P321c8v.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.3';
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-DEoReXOe.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-DEoReXOe.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-DEoReXOe.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-CgAGcRtZ.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-g35-QcIa.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-klsQg82G.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-CZ-G3RSH.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--P321c8v.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-Bu0Zusj_.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-vlPGi1Z8.cjs');
7
7
  var browser = require('./browser-RAy8e8cV.cjs');
8
- var index = require('./index-BnCDW-BB.cjs');
8
+ var index = require('./index--P321c8v.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--P321c8v.cjs');
5
+ var session = require('./session-vlPGi1Z8.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-Bu0Zusj_.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-CbsbCgtf.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');
@@ -8939,7 +8896,7 @@ async function runBuildScript(pm, cwd, spawnImpl, options) {
8939
8896
  const buildArgs = createBuildArgs(pm, options.mode);
8940
8897
  const child = spawnImpl(pm, buildArgs, {
8941
8898
  cwd,
8942
- env: { ...process.env, ...options.env, HB_SDK_DEPLOY_BUILD: '1' },
8899
+ env: { ...process.env, ...options.env },
8943
8900
  stdio: pipeStdoutToStderr ? ['inherit', 'pipe', 'inherit'] : 'inherit',
8944
8901
  });
8945
8902
  if (pipeStdoutToStderr) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BnCDW-BB.cjs');
3
+ var index = require('./index--P321c8v.cjs');
4
4
  var node_crypto = require('node:crypto');
5
5
  var path = require('node:path');
6
6
  var require$$0$2 = require('fs');
@@ -3321,7 +3321,6 @@ function isRecord(value) {
3321
3321
  return Object.prototype.toString.call(value) === '[object Object]';
3322
3322
  }
3323
3323
 
3324
- exports.HEYBOX_WEB_REFERER = HEYBOX_WEB_REFERER;
3325
3324
  exports.clearHeyboxAuthSession = clearHeyboxAuthSession;
3326
3325
  exports.createHeyboxApiUrl = createHeyboxApiUrl;
3327
3326
  exports.createHeyboxAuthSession = createHeyboxAuthSession;
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--P321c8v.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.3';
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.3';
325
325
 
326
326
  /**
327
327
  * 判断未知数据是否符合小程序 bridge 消息信封。
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const APIUserMiniprogramPublicSdkConfigPath = '/user_miniprogram/public/sdk_config';
4
-
5
3
  var re = {exports: {}};
6
4
 
7
5
  var constants;
@@ -2815,7 +2813,6 @@ const MINIAPP_UPLOAD_SCOPE = 'activity';
2815
2813
  const ACTIVITY_UPLOAD_KEY_MAX_LENGTH = 64;
2816
2814
  const MINIAPP_UPLOAD_BATCH_SIZE = 50;
2817
2815
  const MINIAPP_UPLOAD_TOTAL_SIZE_LIMIT_BYTES = 100 * 1024 * 1024;
2818
- const PUBLIC_USER_MINIPROGRAM_SDK_CONFIG_API_PATH = APIUserMiniprogramPublicSdkConfigPath;
2819
2816
  const USER_MINIPROGRAM_ACCESS_STATUS_API_PATH = '/mall/developer/user_miniprogram/access_status';
2820
2817
  const DEVELOPER_ENTITY_LIST_API_PATH = '/mall/developer/entity/list';
2821
2818
  const DEVELOPER_ENTITY_SWITCH_API_PATH = '/mall/developer/entity/switch';
@@ -2921,7 +2918,6 @@ exports.MINIAPP_UPLOAD_BATCH_SIZE = MINIAPP_UPLOAD_BATCH_SIZE;
2921
2918
  exports.MINIAPP_UPLOAD_SCOPE = MINIAPP_UPLOAD_SCOPE;
2922
2919
  exports.MINIAPP_UPLOAD_TOTAL_SIZE_LIMIT_BYTES = MINIAPP_UPLOAD_TOTAL_SIZE_LIMIT_BYTES;
2923
2920
  exports.PRECHECK_USER_MINIPROGRAM_VERSION_API_PATH = PRECHECK_USER_MINIPROGRAM_VERSION_API_PATH;
2924
- exports.PUBLIC_USER_MINIPROGRAM_SDK_CONFIG_API_PATH = PUBLIC_USER_MINIPROGRAM_SDK_CONFIG_API_PATH;
2925
2921
  exports.RELEASE_USER_MINIPROGRAM_VERSION_API_PATH = RELEASE_USER_MINIPROGRAM_VERSION_API_PATH;
2926
2922
  exports.REOPEN_USER_MINIPROGRAM_API_PATH = REOPEN_USER_MINIPROGRAM_API_PATH;
2927
2923
  exports.SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH = SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH;
@@ -1,5 +1,3 @@
1
- const APIUserMiniprogramPublicSdkConfigPath = '/user_miniprogram/public/sdk_config';
2
-
3
1
  var re = {exports: {}};
4
2
 
5
3
  var constants;
@@ -2813,7 +2811,6 @@ const MINIAPP_UPLOAD_SCOPE = 'activity';
2813
2811
  const ACTIVITY_UPLOAD_KEY_MAX_LENGTH = 64;
2814
2812
  const MINIAPP_UPLOAD_BATCH_SIZE = 50;
2815
2813
  const MINIAPP_UPLOAD_TOTAL_SIZE_LIMIT_BYTES = 100 * 1024 * 1024;
2816
- const PUBLIC_USER_MINIPROGRAM_SDK_CONFIG_API_PATH = APIUserMiniprogramPublicSdkConfigPath;
2817
2814
  const USER_MINIPROGRAM_ACCESS_STATUS_API_PATH = '/mall/developer/user_miniprogram/access_status';
2818
2815
  const DEVELOPER_ENTITY_LIST_API_PATH = '/mall/developer/entity/list';
2819
2816
  const DEVELOPER_ENTITY_SWITCH_API_PATH = '/mall/developer/entity/switch';
@@ -2904,4 +2901,4 @@ function shouldUploadDistFile(relativePath) {
2904
2901
  return true;
2905
2902
  }
2906
2903
 
2907
- export { ACTIVITY_UPLOAD_KEY_MAX_LENGTH, CREATE_USER_MINIPROGRAM_API_PATH, CREATE_USER_MINIPROGRAM_LEADERBOARD_API_PATH, DELETE_USER_MINIPROGRAM_LEADERBOARD_API_PATH, DETAIL_USER_MINIPROGRAM_API_PATH, DETAIL_USER_MINIPROGRAM_LEADERBOARD_API_PATH, DEVELOPER_ENTITY_LIST_API_PATH, DEVELOPER_ENTITY_SWITCH_API_PATH, LIST_USER_MINIPROGRAM_API_PATH, LIST_USER_MINIPROGRAM_LEADERBOARD_API_PATH, LIST_USER_MINIPROGRAM_VERSION_API_PATH, MINIAPP_UPLOAD_BATCH_SIZE, MINIAPP_UPLOAD_SCOPE, MINIAPP_UPLOAD_TOTAL_SIZE_LIMIT_BYTES, PRECHECK_USER_MINIPROGRAM_VERSION_API_PATH, PUBLIC_USER_MINIPROGRAM_SDK_CONFIG_API_PATH, RELEASE_USER_MINIPROGRAM_VERSION_API_PATH, REOPEN_USER_MINIPROGRAM_API_PATH, SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH, TAKE_DOWN_USER_MINIPROGRAM_API_PATH, UPDATE_SQUARE_DISPLAY_API_PATH, UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH, USER_MINIPROGRAM_ACCESS_STATUS_API_PATH, USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH, USER_MINIPROGRAM_VERSION_PREVIEW_INFO_API_PATH, WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH, getMiniProgramUploadAlias, getMiniappUploadKey, isValidMiniappManifestVersion as isValidVersion, normalizeRelativePath, relativePathContainsNodeModulesSegment, shouldUploadDistFile, validateUploadPaths, validateUploadTotalSize };
2904
+ export { ACTIVITY_UPLOAD_KEY_MAX_LENGTH, CREATE_USER_MINIPROGRAM_API_PATH, CREATE_USER_MINIPROGRAM_LEADERBOARD_API_PATH, DELETE_USER_MINIPROGRAM_LEADERBOARD_API_PATH, DETAIL_USER_MINIPROGRAM_API_PATH, DETAIL_USER_MINIPROGRAM_LEADERBOARD_API_PATH, DEVELOPER_ENTITY_LIST_API_PATH, DEVELOPER_ENTITY_SWITCH_API_PATH, LIST_USER_MINIPROGRAM_API_PATH, LIST_USER_MINIPROGRAM_LEADERBOARD_API_PATH, LIST_USER_MINIPROGRAM_VERSION_API_PATH, MINIAPP_UPLOAD_BATCH_SIZE, MINIAPP_UPLOAD_SCOPE, MINIAPP_UPLOAD_TOTAL_SIZE_LIMIT_BYTES, PRECHECK_USER_MINIPROGRAM_VERSION_API_PATH, RELEASE_USER_MINIPROGRAM_VERSION_API_PATH, REOPEN_USER_MINIPROGRAM_API_PATH, SUBMIT_USER_MINIPROGRAM_AUDIT_API_PATH, TAKE_DOWN_USER_MINIPROGRAM_API_PATH, UPDATE_SQUARE_DISPLAY_API_PATH, UPDATE_USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH, USER_MINIPROGRAM_ACCESS_STATUS_API_PATH, USER_MINIPROGRAM_PREVIEW_ALLOWLIST_API_PATH, USER_MINIPROGRAM_VERSION_PREVIEW_INFO_API_PATH, WITHDRAW_USER_MINIPROGRAM_VERSION_API_PATH, getMiniProgramUploadAlias, getMiniappUploadKey, isValidMiniappManifestVersion as isValidVersion, normalizeRelativePath, relativePathContainsNodeModulesSegment, shouldUploadDistFile, validateUploadPaths, validateUploadTotalSize };
@@ -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",