@heybox/hb-sdk 0.8.1-alpha.13 → 0.8.1-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +38 -0
- package/dist/cli-chunks/{build-CBPmqCVZ.cjs → build-6nkCiXV0.cjs} +21 -7
- package/dist/cli-chunks/{context-CvuPJq1G.cjs → context-DyeSJSqE.cjs} +2 -2
- package/dist/cli-chunks/{create-CyMWFYrc.cjs → create-wXBzkgmP.cjs} +1 -1
- package/dist/cli-chunks/{dev-BcAPHk9L.cjs → dev-Caq_oO7n.cjs} +28 -10
- package/dist/cli-chunks/{doctor-CIwaVrM1.cjs → doctor-n4vISsD-.cjs} +1 -1
- package/dist/cli-chunks/{index-E0qh3FUb.cjs → index-BTUkiKjC.cjs} +15 -15
- package/dist/cli-chunks/{index-B0KCGR9H.cjs → index-hyB5_A_G.cjs} +2 -2
- package/dist/cli-chunks/{index.esm-DTEOIvDp.cjs → index.esm-DU-rsJ3-.cjs} +7 -7
- package/dist/cli-chunks/{login-DGvHzH9j.cjs → login-CsXZXtCS.cjs} +2 -2
- package/dist/cli-chunks/{project-vite-CRnpRhSb.cjs → project-vite-87sg4Mnk.cjs} +1 -1
- package/dist/cli-chunks/{remote-C1_Hs11w.cjs → remote-Cfr3wcGq.cjs} +74 -10
- package/dist/cli-chunks/{runtime-permission-env-Bn1ONUDU.cjs → runtime-permission-env-B3wQZF2c.cjs} +128 -1
- package/dist/cli-chunks/{session-BvZgS7VI.cjs → session-YWsulrKF.cjs} +1 -1
- package/dist/cli-chunks/{skill-BVT6fBpQ.cjs → skill-CS2JoOL8.cjs} +2 -2
- package/dist/cli-chunks/{version-CJTEIaOQ.cjs → version-DXjXtCXW.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/browser-dev-host/assets/{browser-dev-host-DOzYp6JS.js → browser-dev-host-GNgPrL3B.js} +21 -21
- package/dist/devtools/browser-dev-host/assets/{desktop-app-launch-DZ_umnQp.js → desktop-app-launch-BUVHeuGC.js} +3 -3
- package/dist/devtools/browser-dev-host/assets/{index-DoPg_zh_.js → index-C3EtSrqt.js} +4 -4
- 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 +30 -0
- package/dist/miniapp-publish.esm.js +30 -1
- package/dist/vite.cjs.js +179 -17
- package/dist/vite.esm.js +179 -18
- package/package.json +5 -5
- package/skill/SKILL.md +17 -14
- package/skill/references/api-protocol.md +3 -3
- package/skill/references/api-root.md +3 -1
- package/skill/references/cli.md +2 -0
- package/skill/references/safety-boundaries.md +2 -0
- package/skill/skill.json +5 -5
- package/types/miniapp-manifest/bindings.d.ts +5 -0
- package/types/miniapp-manifest/index.d.ts +1 -0
- package/types/miniapp-manifest/node.d.ts +9 -1
- package/types/miniapp-manifest/schema.d.ts +39 -0
- package/types/miniapp-publish/index.d.ts +1 -0
- package/types/vite/index.d.ts +1 -0
|
@@ -3,6 +3,27 @@ import type { MiniappCompanionManifestDeclarations } from './companion-types';
|
|
|
3
3
|
export declare const MINIAPP_TEMPLATE_VERSION = "0.0.0";
|
|
4
4
|
export declare const MINIAPP_PLATFORM_VALUES: readonly ["android", "ios", "ohos", "windows", "macos", "linux"];
|
|
5
5
|
export type MiniappPlatform = (typeof MINIAPP_PLATFORM_VALUES)[number];
|
|
6
|
+
/** 窗口尺寸字段的脏值兜底上限;真正的上限是宿主侧显示器 workArea。 */
|
|
7
|
+
export declare const MINIAPP_WINDOW_SIZE_MAX = 16384;
|
|
8
|
+
/**
|
|
9
|
+
* `package.json#heybox.window` 的开发者声明字段。
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* 只描述**开窗初值**与可缩放性,不是窗口当前尺寸;运行期尺寸请用 `viewport.getWindowInfo()`。
|
|
13
|
+
* 位置(`x` / `y`)不开放声明,由用户拖拽产生并由宿主记忆。
|
|
14
|
+
*/
|
|
15
|
+
export interface MiniappWindowDeclaration {
|
|
16
|
+
/** 默认窗口内容宽度(逻辑像素),正整数,不超过 16384。 */
|
|
17
|
+
defaultWidth?: number;
|
|
18
|
+
/** 默认窗口内容高度(逻辑像素),正整数,不超过 16384。 */
|
|
19
|
+
defaultHeight?: number;
|
|
20
|
+
/** 尺寸下限宽度;必须与 defaultWidth 同时声明,且不大于 defaultWidth。 */
|
|
21
|
+
minWidth?: number;
|
|
22
|
+
/** 尺寸下限高度;必须与 defaultHeight 同时声明,且不大于 defaultHeight。 */
|
|
23
|
+
minHeight?: number;
|
|
24
|
+
/** 是否允许用户手动拖拽改变尺寸。 */
|
|
25
|
+
resizable?: boolean;
|
|
26
|
+
}
|
|
6
27
|
/**
|
|
7
28
|
* 桌面平台子集:从唯一平台词表 `MINIAPP_PLATFORM_VALUES` 派生,`satisfies` 阻止它漂移出词表。
|
|
8
29
|
* 小程序声明其中任一平台,即视为该项目承诺适配 PC / 桌面端;调试台据此取舍桌面调试入口。
|
|
@@ -19,6 +40,8 @@ export interface MiniappManifest {
|
|
|
19
40
|
platforms: readonly MiniappPlatform[];
|
|
20
41
|
permissions?: MiniappPermissionDeclarations;
|
|
21
42
|
companions?: MiniappCompanionManifestDeclarations;
|
|
43
|
+
window?: MiniappWindowDeclaration;
|
|
44
|
+
bindAppIds?: readonly string[];
|
|
22
45
|
}
|
|
23
46
|
export interface ParseMiniappManifestResult {
|
|
24
47
|
manifest: MiniappManifest;
|
|
@@ -30,6 +53,8 @@ export declare function validateMiniappManifestVersion(version: unknown, sourceL
|
|
|
30
53
|
export declare function renderMiniappManifest(manifest: MiniappManifest): string;
|
|
31
54
|
export declare function parseMiniappManifestJson(raw: string, sourceLabel?: string): ParseMiniappManifestResult;
|
|
32
55
|
export declare function validateMiniappManifestForDeploy(manifest: MiniappManifest): {
|
|
56
|
+
bindAppIds?: readonly string[] | undefined;
|
|
57
|
+
window?: MiniappWindowDeclaration | undefined;
|
|
33
58
|
companions?: MiniappCompanionManifestDeclarations | undefined;
|
|
34
59
|
permissions?: Partial<Record<"userInfo" | "steamLibrary" | "share" | "storage" | "filesystem" | "clipboard" | "leaderboard" | "companion", import("./permissions").SimpleMiniappPermissionDeclaration> & {
|
|
35
60
|
network: import("./permissions").NetworkMiniappPermissionDeclaration;
|
|
@@ -40,4 +65,18 @@ export declare function validateMiniappManifestForDeploy(manifest: MiniappManife
|
|
|
40
65
|
};
|
|
41
66
|
export declare function validateMiniappPlatforms(platforms: unknown, sourceLabel?: string): readonly MiniappPlatform[];
|
|
42
67
|
export declare function areMiniappPlatformsEqual(left: readonly MiniappPlatform[], right: readonly MiniappPlatform[]): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* 校验并归一化 `package.json#heybox.window` / `manifest.window` 声明。
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* 与 `heybox.permissions` 同样的严格风格:未知字段报错,不做静默忽略。
|
|
73
|
+
* `width` / `height` 显式给出改名提示;`x` / `y` 按未知字段显式报错(`INV-NO-DEV-POSITION`)。
|
|
74
|
+
* 未声明时返回 `undefined`,由调用方决定不写入产物。
|
|
75
|
+
* @param value - 待校验的原始声明(不可信输入)。
|
|
76
|
+
* @param sourceLabel - 报错前缀,默认指向开发者声明路径。
|
|
77
|
+
* @throws 当声明不是非空对象、含未知字段、数值/布尔类型不合法或 min/default 不配对时抛出。
|
|
78
|
+
*/
|
|
79
|
+
export declare function validateMiniappWindow(value: unknown, sourceLabel?: string): MiniappWindowDeclaration | undefined;
|
|
80
|
+
/** 比较两份窗口声明是否逐字段一致;未声明视同 `undefined`。 */
|
|
81
|
+
export declare function areMiniappWindowsEqual(left: MiniappWindowDeclaration | undefined, right: MiniappWindowDeclaration | undefined): boolean;
|
|
43
82
|
export declare function validateSdkVersion(version: unknown, sourceLabel?: string): string;
|
|
@@ -27,6 +27,7 @@ export declare const REOPEN_USER_MINIPROGRAM_API_PATH = "/mall/developer/user_mi
|
|
|
27
27
|
export declare const UPDATE_SQUARE_DISPLAY_API_PATH = "/mall/developer/user_miniprogram/square_display/update";
|
|
28
28
|
export declare const LIST_USER_MINIPROGRAM_VERSION_API_PATH = "/mall/developer/user_miniprogram/version/list";
|
|
29
29
|
export { isValidMiniappManifestVersion as isValidVersion } from '../miniapp-manifest/schema';
|
|
30
|
+
export { parseMiniappBindAppIds, type ParseMiniappBindAppIdsOptions } from '../miniapp-manifest/bindings';
|
|
30
31
|
export declare function normalizeRelativePath(relativePath: string): string;
|
|
31
32
|
export declare function relativePathContainsNodeModulesSegment(relativePath: string): boolean;
|
|
32
33
|
export declare function getMiniProgramUploadAlias(miniProgramId: string): string;
|
package/types/vite/index.d.ts
CHANGED
|
@@ -50,4 +50,5 @@ export interface MiniappManifestResolvedConfig {
|
|
|
50
50
|
export { MINIAPP_PLATFORM_VALUES };
|
|
51
51
|
export type { MiniappPlatform };
|
|
52
52
|
export declare const HB_SDK_COMPANION_ARTIFACT_ACCESS_TOKEN_ENV = "HB_SDK_COMPANION_ARTIFACT_ACCESS_TOKEN";
|
|
53
|
+
export declare const HB_SDK_MINI_PROGRAM_MANIFEST_ACCESS_TOKEN_ENV = "HB_SDK_MINI_PROGRAM_MANIFEST_ACCESS_TOKEN";
|
|
53
54
|
export declare function miniappManifest(): MiniappManifestPlugin;
|