@heybox/hb-sdk 0.9.1-alpha.10 → 0.9.1-alpha.11
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 +10 -0
- package/README.md +1 -0
- package/dist/cli-chunks/{build-BK0MOduC.cjs → build-CSTdWNu1.cjs} +5 -5
- package/dist/cli-chunks/{context-D7AFyc_9.cjs → context-Bej2XR0w.cjs} +2 -2
- package/dist/cli-chunks/{create-C-pAXZR_.cjs → create-Cz5tqvMR.cjs} +1 -1
- package/dist/cli-chunks/{dev-CONKtd6c.cjs → dev-6nGC0_bZ.cjs} +8 -8
- package/dist/cli-chunks/{doctor-D18leeH7.cjs → doctor-BSSJ7n8i.cjs} +1 -1
- package/dist/cli-chunks/{index-BWRDIX1T.cjs → index-CQtu_5c7.cjs} +16 -16
- package/dist/cli-chunks/{index-DJoBhXcG.cjs → index-gqsUj-Am.cjs} +1 -1
- package/dist/cli-chunks/{index.esm-CtAKePcf.cjs → index.esm-BuwSVK1U.cjs} +6 -6
- package/dist/cli-chunks/{login-BHq8vDRt.cjs → login-BB07gOy9.cjs} +1 -1
- package/dist/cli-chunks/{project-vite-DD3bmbqm.cjs → project-vite-DqbyiCMm.cjs} +1 -1
- package/dist/cli-chunks/{remote-DeLLzkXt.cjs → remote-BvvAbGIG.cjs} +6 -6
- package/dist/cli-chunks/{runtime-gate-wKj1l5xM.cjs → runtime-gate-Bh1vm1an.cjs} +2 -2
- package/dist/cli-chunks/{runtime-permission-env-DBra_0-U.cjs → runtime-permission-env-DuRchECp.cjs} +29 -2
- package/dist/cli-chunks/{skill-Cq3wjRBj.cjs → skill-D1pYV7g_.cjs} +2 -2
- package/dist/cli-chunks/{version-BF4JQQCU.cjs → version-BaMa3UQg.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-wMCyX_zc.js +102 -0
- package/dist/devtools/browser-dev-host/assets/{desktop-app-launch-DXmUwcoE.js → desktop-app-launch-D1z3MxUY.js} +1 -1
- package/dist/devtools/browser-dev-host/assets/{index-CVZ3CdPt.js → index-CuH8wWTJ.js} +3 -3
- package/dist/devtools/browser-dev-host/index.html +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/miniapp-publish.cjs.js +27 -0
- package/dist/miniapp-publish.esm.js +27 -0
- package/dist/vite.cjs.js +36 -1
- package/dist/vite.esm.js +36 -1
- package/package.json +6 -6
- package/skill/skill.json +4 -4
- package/types/index.d.ts +1 -1
- package/types/miniapp-publish/index.d.ts +3 -0
- package/types/vite/index.d.ts +1 -0
- package/dist/devtools/browser-dev-host/assets/browser-dev-host-C4b9nlYA.js +0 -102
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="theme-color" content="#f4f5f7" />
|
|
7
7
|
<title>小程序工坊调试台</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="modulepreload" crossorigin href="/assets/desktop-app-launch-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CuH8wWTJ.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="/assets/desktop-app-launch-D1z3MxUY.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-BRxbUJVN.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
package/dist/index.cjs.js
CHANGED
|
@@ -7278,7 +7278,7 @@ function createMessageId() {
|
|
|
7278
7278
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
7279
7279
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
7280
7280
|
? undefined
|
|
7281
|
-
: '0.9.1-alpha.
|
|
7281
|
+
: '0.9.1-alpha.11';
|
|
7282
7282
|
|
|
7283
7283
|
const RUNTIME_MODES = new Set(['production', 'preview', 'development', 'unknown']);
|
|
7284
7284
|
const OPERATING_SYSTEM_NAMES = new Set(['android', 'ios', 'ohos', 'windows', 'macos', 'linux', 'unknown']);
|
package/dist/index.esm.js
CHANGED
|
@@ -7274,7 +7274,7 @@ function createMessageId() {
|
|
|
7274
7274
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
7275
7275
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
7276
7276
|
? undefined
|
|
7277
|
-
: '0.9.1-alpha.
|
|
7277
|
+
: '0.9.1-alpha.11';
|
|
7278
7278
|
|
|
7279
7279
|
const RUNTIME_MODES = new Set(['production', 'preview', 'development', 'unknown']);
|
|
7280
7280
|
const OPERATING_SYSTEM_NAMES = new Set(['android', 'ios', 'ohos', 'windows', 'macos', 'linux', 'unknown']);
|
|
@@ -9531,6 +9531,31 @@ function parseMiniappBindAppIds(value, options = {}) {
|
|
|
9531
9531
|
return Object.freeze(appIds);
|
|
9532
9532
|
}
|
|
9533
9533
|
|
|
9534
|
+
/** 小程序简介最大长度(Unicode code point),与服务端截断口径一致。 */
|
|
9535
|
+
const MINIAPP_DESC_MAX_LENGTH = 200;
|
|
9536
|
+
/**
|
|
9537
|
+
* 校验并规范化 `package.json#heybox.desc` / `manifest.desc`。
|
|
9538
|
+
*
|
|
9539
|
+
* @param value - 原始声明;未声明时为 `undefined`。
|
|
9540
|
+
* @param sourceLabel - 错误消息中的字段来源,默认 `package.json#heybox.desc`。
|
|
9541
|
+
* @returns 去除首尾空白后的简介;未声明或为空串时返回 `undefined`。
|
|
9542
|
+
* @throws `Error` 非字符串、超过 200 个字符,或包含除换行外的控制字符时抛出。
|
|
9543
|
+
*/
|
|
9544
|
+
function parseMiniappDesc(value, sourceLabel = 'package.json#heybox.desc') {
|
|
9545
|
+
if (value === undefined)
|
|
9546
|
+
return undefined;
|
|
9547
|
+
if (typeof value !== 'string')
|
|
9548
|
+
throw new Error(`${sourceLabel} 必须是字符串`);
|
|
9549
|
+
const desc = value.replace(/^\p{White_Space}+|\p{White_Space}+$/gu, '');
|
|
9550
|
+
if (!desc)
|
|
9551
|
+
return undefined;
|
|
9552
|
+
if (Array.from(desc).length > MINIAPP_DESC_MAX_LENGTH)
|
|
9553
|
+
throw new Error(`${sourceLabel} 不能超过 ${MINIAPP_DESC_MAX_LENGTH} 个字符`);
|
|
9554
|
+
if (/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(desc.replace(/\n/g, '')))
|
|
9555
|
+
throw new Error(`${sourceLabel} 不能包含控制字符`);
|
|
9556
|
+
return desc;
|
|
9557
|
+
}
|
|
9558
|
+
|
|
9534
9559
|
const MINIAPP_PERMISSION_KEYS = MINI_PROGRAM_PERMISSION_KEYS;
|
|
9535
9560
|
function parseMiniappPermissions(value, options) {
|
|
9536
9561
|
const sourceLabel = options.sourceLabel ?? 'package.json#heybox.permissions';
|
|
@@ -9703,6 +9728,7 @@ function validateMiniappManifestForDeploy(manifest) {
|
|
|
9703
9728
|
throw new Error('manifest.category 缺失,请在 package.json#heybox.category 声明 tool、game 或 other 后重新构建');
|
|
9704
9729
|
}
|
|
9705
9730
|
const bindAppIds = parseMiniappBindAppIds(manifest.bindAppIds, { sourceLabel: 'manifest.bindAppIds' });
|
|
9731
|
+
const desc = parseMiniappDesc(manifest.desc, 'manifest.desc');
|
|
9706
9732
|
return {
|
|
9707
9733
|
version,
|
|
9708
9734
|
sdkVersion,
|
|
@@ -9714,6 +9740,7 @@ function validateMiniappManifestForDeploy(manifest) {
|
|
|
9714
9740
|
...(window === undefined ? {} : { window }),
|
|
9715
9741
|
...(bindAppIds.length === 0 ? {} : { bindAppIds }),
|
|
9716
9742
|
...(category === undefined ? {} : { category }),
|
|
9743
|
+
...(desc === undefined ? {} : { desc }),
|
|
9717
9744
|
};
|
|
9718
9745
|
}
|
|
9719
9746
|
function validateGeneratedCompanions(value) {
|
|
@@ -9529,6 +9529,31 @@ function parseMiniappBindAppIds(value, options = {}) {
|
|
|
9529
9529
|
return Object.freeze(appIds);
|
|
9530
9530
|
}
|
|
9531
9531
|
|
|
9532
|
+
/** 小程序简介最大长度(Unicode code point),与服务端截断口径一致。 */
|
|
9533
|
+
const MINIAPP_DESC_MAX_LENGTH = 200;
|
|
9534
|
+
/**
|
|
9535
|
+
* 校验并规范化 `package.json#heybox.desc` / `manifest.desc`。
|
|
9536
|
+
*
|
|
9537
|
+
* @param value - 原始声明;未声明时为 `undefined`。
|
|
9538
|
+
* @param sourceLabel - 错误消息中的字段来源,默认 `package.json#heybox.desc`。
|
|
9539
|
+
* @returns 去除首尾空白后的简介;未声明或为空串时返回 `undefined`。
|
|
9540
|
+
* @throws `Error` 非字符串、超过 200 个字符,或包含除换行外的控制字符时抛出。
|
|
9541
|
+
*/
|
|
9542
|
+
function parseMiniappDesc(value, sourceLabel = 'package.json#heybox.desc') {
|
|
9543
|
+
if (value === undefined)
|
|
9544
|
+
return undefined;
|
|
9545
|
+
if (typeof value !== 'string')
|
|
9546
|
+
throw new Error(`${sourceLabel} 必须是字符串`);
|
|
9547
|
+
const desc = value.replace(/^\p{White_Space}+|\p{White_Space}+$/gu, '');
|
|
9548
|
+
if (!desc)
|
|
9549
|
+
return undefined;
|
|
9550
|
+
if (Array.from(desc).length > MINIAPP_DESC_MAX_LENGTH)
|
|
9551
|
+
throw new Error(`${sourceLabel} 不能超过 ${MINIAPP_DESC_MAX_LENGTH} 个字符`);
|
|
9552
|
+
if (/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(desc.replace(/\n/g, '')))
|
|
9553
|
+
throw new Error(`${sourceLabel} 不能包含控制字符`);
|
|
9554
|
+
return desc;
|
|
9555
|
+
}
|
|
9556
|
+
|
|
9532
9557
|
const MINIAPP_PERMISSION_KEYS = MINI_PROGRAM_PERMISSION_KEYS;
|
|
9533
9558
|
function parseMiniappPermissions(value, options) {
|
|
9534
9559
|
const sourceLabel = options.sourceLabel ?? 'package.json#heybox.permissions';
|
|
@@ -9701,6 +9726,7 @@ function validateMiniappManifestForDeploy(manifest) {
|
|
|
9701
9726
|
throw new Error('manifest.category 缺失,请在 package.json#heybox.category 声明 tool、game 或 other 后重新构建');
|
|
9702
9727
|
}
|
|
9703
9728
|
const bindAppIds = parseMiniappBindAppIds(manifest.bindAppIds, { sourceLabel: 'manifest.bindAppIds' });
|
|
9729
|
+
const desc = parseMiniappDesc(manifest.desc, 'manifest.desc');
|
|
9704
9730
|
return {
|
|
9705
9731
|
version,
|
|
9706
9732
|
sdkVersion,
|
|
@@ -9712,6 +9738,7 @@ function validateMiniappManifestForDeploy(manifest) {
|
|
|
9712
9738
|
...(window === undefined ? {} : { window }),
|
|
9713
9739
|
...(bindAppIds.length === 0 ? {} : { bindAppIds }),
|
|
9714
9740
|
...(category === undefined ? {} : { category }),
|
|
9741
|
+
...(desc === undefined ? {} : { desc }),
|
|
9715
9742
|
};
|
|
9716
9743
|
}
|
|
9717
9744
|
function validateGeneratedCompanions(value) {
|
package/dist/vite.cjs.js
CHANGED
|
@@ -10282,7 +10282,7 @@ async function ensureBasicInfoDirectory(rootPath, relative) {
|
|
|
10282
10282
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
10283
10283
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
10284
10284
|
? undefined
|
|
10285
|
-
: '0.9.1-alpha.
|
|
10285
|
+
: '0.9.1-alpha.11';
|
|
10286
10286
|
|
|
10287
10287
|
/**
|
|
10288
10288
|
* iframe 与调试台页面的开发期 console 捕获转发。
|
|
@@ -10700,6 +10700,31 @@ function parseMiniappCategory(value, sourceLabel = 'package.json#heybox.category
|
|
|
10700
10700
|
throw new Error(`${sourceLabel} 必须是 tool、game 或 other`);
|
|
10701
10701
|
}
|
|
10702
10702
|
|
|
10703
|
+
/** 小程序简介最大长度(Unicode code point),与服务端截断口径一致。 */
|
|
10704
|
+
const MINIAPP_DESC_MAX_LENGTH = 200;
|
|
10705
|
+
/**
|
|
10706
|
+
* 校验并规范化 `package.json#heybox.desc` / `manifest.desc`。
|
|
10707
|
+
*
|
|
10708
|
+
* @param value - 原始声明;未声明时为 `undefined`。
|
|
10709
|
+
* @param sourceLabel - 错误消息中的字段来源,默认 `package.json#heybox.desc`。
|
|
10710
|
+
* @returns 去除首尾空白后的简介;未声明或为空串时返回 `undefined`。
|
|
10711
|
+
* @throws `Error` 非字符串、超过 200 个字符,或包含除换行外的控制字符时抛出。
|
|
10712
|
+
*/
|
|
10713
|
+
function parseMiniappDesc(value, sourceLabel = 'package.json#heybox.desc') {
|
|
10714
|
+
if (value === undefined)
|
|
10715
|
+
return undefined;
|
|
10716
|
+
if (typeof value !== 'string')
|
|
10717
|
+
throw new Error(`${sourceLabel} 必须是字符串`);
|
|
10718
|
+
const desc = value.replace(/^\p{White_Space}+|\p{White_Space}+$/gu, '');
|
|
10719
|
+
if (!desc)
|
|
10720
|
+
return undefined;
|
|
10721
|
+
if (Array.from(desc).length > MINIAPP_DESC_MAX_LENGTH)
|
|
10722
|
+
throw new Error(`${sourceLabel} 不能超过 ${MINIAPP_DESC_MAX_LENGTH} 个字符`);
|
|
10723
|
+
if (/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(desc.replace(/\n/g, '')))
|
|
10724
|
+
throw new Error(`${sourceLabel} 不能包含控制字符`);
|
|
10725
|
+
return desc;
|
|
10726
|
+
}
|
|
10727
|
+
|
|
10703
10728
|
const MINIAPP_PERMISSION_KEYS = MINI_PROGRAM_PERMISSION_KEYS;
|
|
10704
10729
|
function parseMiniappPermissions(value, options) {
|
|
10705
10730
|
const sourceLabel = options.sourceLabel ?? 'package.json#heybox.permissions';
|
|
@@ -10811,6 +10836,7 @@ function renderMiniappManifest(manifest) {
|
|
|
10811
10836
|
const window = validateMiniappWindow(manifest.window, 'manifest.window');
|
|
10812
10837
|
const category = parseMiniappCategory(manifest.category, 'manifest.category');
|
|
10813
10838
|
const bindAppIds = parseMiniappBindAppIds(manifest.bindAppIds, { sourceLabel: 'manifest.bindAppIds' });
|
|
10839
|
+
const desc = parseMiniappDesc(manifest.desc, 'manifest.desc');
|
|
10814
10840
|
const output = {
|
|
10815
10841
|
version: manifest.version,
|
|
10816
10842
|
sdkVersion: manifest.sdkVersion,
|
|
@@ -10822,6 +10848,7 @@ function renderMiniappManifest(manifest) {
|
|
|
10822
10848
|
...(window === undefined ? {} : { window }),
|
|
10823
10849
|
...(bindAppIds.length === 0 ? {} : { bindAppIds }),
|
|
10824
10850
|
...(category === undefined ? {} : { category }),
|
|
10851
|
+
...(desc === undefined ? {} : { desc }),
|
|
10825
10852
|
};
|
|
10826
10853
|
return `${JSON.stringify(output, null, 2)}\n`;
|
|
10827
10854
|
}
|
|
@@ -10992,6 +11019,11 @@ function readMiniappCategoryFromPackageJson(root) {
|
|
|
10992
11019
|
const { packageJson } = readMiniappPackageJson(root, false);
|
|
10993
11020
|
return parseMiniappCategory(readMiniappHeyboxConfig(packageJson)?.category);
|
|
10994
11021
|
}
|
|
11022
|
+
/** 读取并校验 `package.json#heybox.desc`;未声明或为空时返回 `undefined`。 */
|
|
11023
|
+
function readMiniappDescFromPackageJson(root) {
|
|
11024
|
+
const { packageJson } = readMiniappPackageJson(root, false);
|
|
11025
|
+
return parseMiniappDesc(readMiniappHeyboxConfig(packageJson)?.desc);
|
|
11026
|
+
}
|
|
10995
11027
|
function readMiniappPackageJson(root, requireVersion) {
|
|
10996
11028
|
const packageJsonPath = findNearestPackageJsonPath(root);
|
|
10997
11029
|
let content;
|
|
@@ -20529,6 +20561,7 @@ const devSnapshotStores = devSnapshotRegistry[devSnapshotStoreKey];
|
|
|
20529
20561
|
* 图片源路径相对项目目录;icon 为 200×200,封面 1–5 张,每张不超过 10 MiB / 4000 万像素。
|
|
20530
20562
|
* build 会复制图片到输出目录 `_hb/basic-info/`,并将 Manifest 路径改为生成路径,不改写源图片;
|
|
20531
20563
|
* - `heybox.category`:`tool`、`game` 或 `other`;构建时允许缺省,发布预检要求提供;
|
|
20564
|
+
* - `heybox.desc`:可选简介,最多 200 个字符,写入 manifest 后在小程序简介页展示;
|
|
20532
20565
|
* - `heybox.platforms`:项目实际承诺适配的非空、无重复平台 allowlist;输出按平台词表规范排序。
|
|
20533
20566
|
* 声明仍停留在旧模板移动端默认(`android`、`ios`、`ohos`)时,`serve` 与 `build` 都只输出
|
|
20534
20567
|
* 一条非阻断提示,不影响构建结果;
|
|
@@ -20983,6 +21016,7 @@ function miniappManifest() {
|
|
|
20983
21016
|
const companionDeclarations = includeCompanions ? companionConfig.declarations : undefined;
|
|
20984
21017
|
const bindAppIds = readMiniappBindAppIdsFromPackageJson(root);
|
|
20985
21018
|
const category = readMiniappCategoryFromPackageJson(root);
|
|
21019
|
+
const desc = readMiniappDescFromPackageJson(root);
|
|
20986
21020
|
if (companionDeclarations && !parsedPermissions.permissions?.companion) {
|
|
20987
21021
|
throw new Error('配置 companions 时必须声明 package.json#heybox.permissions.companion.enabled=true');
|
|
20988
21022
|
}
|
|
@@ -21020,6 +21054,7 @@ function miniappManifest() {
|
|
|
21020
21054
|
const companions = prepareMiniappCompanions(companionDeclarations, { root: companionConfig.projectRoot, outputRoot, platforms });
|
|
21021
21055
|
node_fs.mkdirSync(path.dirname(manifestPath), { recursive: true });
|
|
21022
21056
|
const manifestText = renderMiniappManifest({
|
|
21057
|
+
...(desc === undefined ? {} : { desc }),
|
|
21023
21058
|
version,
|
|
21024
21059
|
sdkVersion,
|
|
21025
21060
|
platforms,
|
package/dist/vite.esm.js
CHANGED
|
@@ -10279,7 +10279,7 @@ async function ensureBasicInfoDirectory(rootPath, relative) {
|
|
|
10279
10279
|
/** 构建时替换为当前发布包的实际版本。 */
|
|
10280
10280
|
const HB_SDK_VERSION = typeof undefined === 'string'
|
|
10281
10281
|
? undefined
|
|
10282
|
-
: '0.9.1-alpha.
|
|
10282
|
+
: '0.9.1-alpha.11';
|
|
10283
10283
|
|
|
10284
10284
|
/**
|
|
10285
10285
|
* iframe 与调试台页面的开发期 console 捕获转发。
|
|
@@ -10697,6 +10697,31 @@ function parseMiniappCategory(value, sourceLabel = 'package.json#heybox.category
|
|
|
10697
10697
|
throw new Error(`${sourceLabel} 必须是 tool、game 或 other`);
|
|
10698
10698
|
}
|
|
10699
10699
|
|
|
10700
|
+
/** 小程序简介最大长度(Unicode code point),与服务端截断口径一致。 */
|
|
10701
|
+
const MINIAPP_DESC_MAX_LENGTH = 200;
|
|
10702
|
+
/**
|
|
10703
|
+
* 校验并规范化 `package.json#heybox.desc` / `manifest.desc`。
|
|
10704
|
+
*
|
|
10705
|
+
* @param value - 原始声明;未声明时为 `undefined`。
|
|
10706
|
+
* @param sourceLabel - 错误消息中的字段来源,默认 `package.json#heybox.desc`。
|
|
10707
|
+
* @returns 去除首尾空白后的简介;未声明或为空串时返回 `undefined`。
|
|
10708
|
+
* @throws `Error` 非字符串、超过 200 个字符,或包含除换行外的控制字符时抛出。
|
|
10709
|
+
*/
|
|
10710
|
+
function parseMiniappDesc(value, sourceLabel = 'package.json#heybox.desc') {
|
|
10711
|
+
if (value === undefined)
|
|
10712
|
+
return undefined;
|
|
10713
|
+
if (typeof value !== 'string')
|
|
10714
|
+
throw new Error(`${sourceLabel} 必须是字符串`);
|
|
10715
|
+
const desc = value.replace(/^\p{White_Space}+|\p{White_Space}+$/gu, '');
|
|
10716
|
+
if (!desc)
|
|
10717
|
+
return undefined;
|
|
10718
|
+
if (Array.from(desc).length > MINIAPP_DESC_MAX_LENGTH)
|
|
10719
|
+
throw new Error(`${sourceLabel} 不能超过 ${MINIAPP_DESC_MAX_LENGTH} 个字符`);
|
|
10720
|
+
if (/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(desc.replace(/\n/g, '')))
|
|
10721
|
+
throw new Error(`${sourceLabel} 不能包含控制字符`);
|
|
10722
|
+
return desc;
|
|
10723
|
+
}
|
|
10724
|
+
|
|
10700
10725
|
const MINIAPP_PERMISSION_KEYS = MINI_PROGRAM_PERMISSION_KEYS;
|
|
10701
10726
|
function parseMiniappPermissions(value, options) {
|
|
10702
10727
|
const sourceLabel = options.sourceLabel ?? 'package.json#heybox.permissions';
|
|
@@ -10808,6 +10833,7 @@ function renderMiniappManifest(manifest) {
|
|
|
10808
10833
|
const window = validateMiniappWindow(manifest.window, 'manifest.window');
|
|
10809
10834
|
const category = parseMiniappCategory(manifest.category, 'manifest.category');
|
|
10810
10835
|
const bindAppIds = parseMiniappBindAppIds(manifest.bindAppIds, { sourceLabel: 'manifest.bindAppIds' });
|
|
10836
|
+
const desc = parseMiniappDesc(manifest.desc, 'manifest.desc');
|
|
10811
10837
|
const output = {
|
|
10812
10838
|
version: manifest.version,
|
|
10813
10839
|
sdkVersion: manifest.sdkVersion,
|
|
@@ -10819,6 +10845,7 @@ function renderMiniappManifest(manifest) {
|
|
|
10819
10845
|
...(window === undefined ? {} : { window }),
|
|
10820
10846
|
...(bindAppIds.length === 0 ? {} : { bindAppIds }),
|
|
10821
10847
|
...(category === undefined ? {} : { category }),
|
|
10848
|
+
...(desc === undefined ? {} : { desc }),
|
|
10822
10849
|
};
|
|
10823
10850
|
return `${JSON.stringify(output, null, 2)}\n`;
|
|
10824
10851
|
}
|
|
@@ -10989,6 +11016,11 @@ function readMiniappCategoryFromPackageJson(root) {
|
|
|
10989
11016
|
const { packageJson } = readMiniappPackageJson(root, false);
|
|
10990
11017
|
return parseMiniappCategory(readMiniappHeyboxConfig(packageJson)?.category);
|
|
10991
11018
|
}
|
|
11019
|
+
/** 读取并校验 `package.json#heybox.desc`;未声明或为空时返回 `undefined`。 */
|
|
11020
|
+
function readMiniappDescFromPackageJson(root) {
|
|
11021
|
+
const { packageJson } = readMiniappPackageJson(root, false);
|
|
11022
|
+
return parseMiniappDesc(readMiniappHeyboxConfig(packageJson)?.desc);
|
|
11023
|
+
}
|
|
10992
11024
|
function readMiniappPackageJson(root, requireVersion) {
|
|
10993
11025
|
const packageJsonPath = findNearestPackageJsonPath(root);
|
|
10994
11026
|
let content;
|
|
@@ -20526,6 +20558,7 @@ const devSnapshotStores = devSnapshotRegistry[devSnapshotStoreKey];
|
|
|
20526
20558
|
* 图片源路径相对项目目录;icon 为 200×200,封面 1–5 张,每张不超过 10 MiB / 4000 万像素。
|
|
20527
20559
|
* build 会复制图片到输出目录 `_hb/basic-info/`,并将 Manifest 路径改为生成路径,不改写源图片;
|
|
20528
20560
|
* - `heybox.category`:`tool`、`game` 或 `other`;构建时允许缺省,发布预检要求提供;
|
|
20561
|
+
* - `heybox.desc`:可选简介,最多 200 个字符,写入 manifest 后在小程序简介页展示;
|
|
20529
20562
|
* - `heybox.platforms`:项目实际承诺适配的非空、无重复平台 allowlist;输出按平台词表规范排序。
|
|
20530
20563
|
* 声明仍停留在旧模板移动端默认(`android`、`ios`、`ohos`)时,`serve` 与 `build` 都只输出
|
|
20531
20564
|
* 一条非阻断提示,不影响构建结果;
|
|
@@ -20980,6 +21013,7 @@ function miniappManifest() {
|
|
|
20980
21013
|
const companionDeclarations = includeCompanions ? companionConfig.declarations : undefined;
|
|
20981
21014
|
const bindAppIds = readMiniappBindAppIdsFromPackageJson(root);
|
|
20982
21015
|
const category = readMiniappCategoryFromPackageJson(root);
|
|
21016
|
+
const desc = readMiniappDescFromPackageJson(root);
|
|
20983
21017
|
if (companionDeclarations && !parsedPermissions.permissions?.companion) {
|
|
20984
21018
|
throw new Error('配置 companions 时必须声明 package.json#heybox.permissions.companion.enabled=true');
|
|
20985
21019
|
}
|
|
@@ -21017,6 +21051,7 @@ function miniappManifest() {
|
|
|
21017
21051
|
const companions = prepareMiniappCompanions(companionDeclarations, { root: companionConfig.projectRoot, outputRoot, platforms });
|
|
21018
21052
|
mkdirSync(path.dirname(manifestPath), { recursive: true });
|
|
21019
21053
|
const manifestText = renderMiniappManifest({
|
|
21054
|
+
...(desc === undefined ? {} : { desc }),
|
|
21020
21055
|
version,
|
|
21021
21056
|
sdkVersion,
|
|
21022
21057
|
platforms,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heybox/hb-sdk",
|
|
3
|
-
"version": "0.9.1-alpha.
|
|
3
|
+
"version": "0.9.1-alpha.11",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"./src/index.ts",
|
|
6
6
|
"./src/core/singleton.ts",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"undici": "^7.28.0",
|
|
77
77
|
"ws": "^8.18.0",
|
|
78
78
|
"sharp": "^0.34.5",
|
|
79
|
-
"@heybox/hb-sdk-protocol": "0.9.1-alpha.
|
|
79
|
+
"@heybox/hb-sdk-protocol": "0.9.1-alpha.11"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"vite": ">=5"
|
|
@@ -129,12 +129,12 @@
|
|
|
129
129
|
"@ai-desktop/view-contract": "file:../hb-sdk-protocol/vendor/view-contract-2.2.2-6ac49bbf6410.tgz",
|
|
130
130
|
"rollup-plugin-dts": "6.4.0",
|
|
131
131
|
"@heybox-domain/heybox-theme": "~0.1.0",
|
|
132
|
-
"@heybox
|
|
132
|
+
"@heybox/hb-sdk-runtime": "~0.9.1-alpha.11",
|
|
133
133
|
"@heybox/hb-api": "~1.28.14",
|
|
134
|
+
"@heybox-domain/heybox-vue3-ui": "~0.1.0",
|
|
134
135
|
"@heybox/runtime": "~0.2.1",
|
|
135
|
-
"@heybox/
|
|
136
|
-
"@heybox/runtime-transport-fetch": "~0.2.1"
|
|
137
|
-
"@heybox/runtime-policy": "~0.2.1"
|
|
136
|
+
"@heybox/runtime-policy": "~0.2.1",
|
|
137
|
+
"@heybox/runtime-transport-fetch": "~0.2.1"
|
|
138
138
|
},
|
|
139
139
|
"publishConfig": {
|
|
140
140
|
"registry": "https://registry.npmjs.org/",
|
package/skill/skill.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hb-sdk",
|
|
3
|
-
"skillVersion": "0.9.1-alpha.
|
|
3
|
+
"skillVersion": "0.9.1-alpha.11+skill.3260e7d71ada",
|
|
4
4
|
"sdk": {
|
|
5
5
|
"package": "@heybox/hb-sdk",
|
|
6
|
-
"version": "0.9.1-alpha.
|
|
7
|
-
"compatibility": "0.9.1-alpha.
|
|
6
|
+
"version": "0.9.1-alpha.11",
|
|
7
|
+
"compatibility": "0.9.1-alpha.11"
|
|
8
8
|
},
|
|
9
9
|
"distribution": {
|
|
10
10
|
"type": "npm",
|
|
11
11
|
"package": "@heybox/hb-sdk",
|
|
12
|
-
"version": "0.9.1-alpha.
|
|
12
|
+
"version": "0.9.1-alpha.11",
|
|
13
13
|
"path": "skill"
|
|
14
14
|
},
|
|
15
15
|
"integrity": "sha256-3260e7d71ada646d5d8b269490e3de4b5ecd3fe824b18cdb73fe64247738ffea"
|
package/types/index.d.ts
CHANGED
|
@@ -6261,7 +6261,7 @@ interface MiniProgramStorageModule {
|
|
|
6261
6261
|
* @throws {@link HbMiniProgramSDKError} `INVALID_PARAMS`:`options`、key 或 JSON 数据非法,
|
|
6262
6262
|
* 包括顶层 `undefined`、`BigInt`、循环引用或序列化过程抛错。
|
|
6263
6263
|
* @throws {@link HbMiniProgramSDKError} `STORAGE_QUOTA_EXCEEDED`:完整 JSON 字符串的 UTF-8
|
|
6264
|
-
* 字节数超过当前 Host
|
|
6264
|
+
* 字节数超过当前 Host 配额,或写入新 key 后当前小程序的不同 key 数量将超过 1000 个。
|
|
6265
6265
|
* @throws {@link HbMiniProgramSDKError} `PERMISSION_NOT_DECLARED` / `PERMISSION_DENIED`:当前
|
|
6266
6266
|
* 版本未声明或未启用 `storage`;`INVALID_STATE`:canonical 小程序身份尚未就绪。
|
|
6267
6267
|
* @throws {@link HbMiniProgramSDKError} `METHOD_NOT_FOUND` / `METHOD_FORBIDDEN`:当前 Host
|
|
@@ -155,6 +155,8 @@ interface MiniappManifest {
|
|
|
155
155
|
bindAppIds?: readonly string[];
|
|
156
156
|
/** 发布类别;历史读取可缺省,发布校验必须提供。 */
|
|
157
157
|
category?: MiniappCategory;
|
|
158
|
+
/** 简介,最多 200 个字符;未声明时简介页不展示。 */
|
|
159
|
+
desc?: string;
|
|
158
160
|
}
|
|
159
161
|
/**
|
|
160
162
|
* 判断小程序版本是否符合公开 Manifest 版本规则。
|
|
@@ -211,6 +213,7 @@ declare function isValidMiniappManifestVersion(version: string): boolean;
|
|
|
211
213
|
* 成功仅表示 Manifest 字段通过校验,不能替代文件检查与服务端发布预检。
|
|
212
214
|
*/
|
|
213
215
|
declare function validateMiniappManifestForDeploy(manifest: MiniappManifest): {
|
|
216
|
+
desc?: string | undefined;
|
|
214
217
|
category?: MiniappCategory | undefined;
|
|
215
218
|
bindAppIds?: readonly string[] | undefined;
|
|
216
219
|
window?: MiniappWindowDeclaration | undefined;
|
package/types/vite/index.d.ts
CHANGED
|
@@ -149,6 +149,7 @@ declare const HB_SDK_MINI_PROGRAM_MANIFEST_ACCESS_TOKEN_ENV = "HB_SDK_MINI_PROGR
|
|
|
149
149
|
* 图片源路径相对项目目录;icon 为 200×200,封面 1–5 张,每张不超过 10 MiB / 4000 万像素。
|
|
150
150
|
* build 会复制图片到输出目录 `_hb/basic-info/`,并将 Manifest 路径改为生成路径,不改写源图片;
|
|
151
151
|
* - `heybox.category`:`tool`、`game` 或 `other`;构建时允许缺省,发布预检要求提供;
|
|
152
|
+
* - `heybox.desc`:可选简介,最多 200 个字符,写入 manifest 后在小程序简介页展示;
|
|
152
153
|
* - `heybox.platforms`:项目实际承诺适配的非空、无重复平台 allowlist;输出按平台词表规范排序。
|
|
153
154
|
* 声明仍停留在旧模板移动端默认(`android`、`ios`、`ohos`)时,`serve` 与 `build` 都只输出
|
|
154
155
|
* 一条非阻断提示,不影响构建结果;
|