@heybox/hb-sdk 0.5.18 → 0.6.0
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 +29 -25
- package/dist/cli-chunks/{create-OZOIdeBz.cjs → create-DYb53EQ-.cjs} +1 -1
- package/dist/cli-chunks/{dev-DXz8izSJ.cjs → dev-CPKTuA6q.cjs} +35 -6
- package/dist/cli-chunks/{doctor-DjMSJoQ5.cjs → doctor-TshFvqHC.cjs} +1 -1
- package/dist/cli-chunks/{index-CsOcGUzF.cjs → index-CCeHouBU.cjs} +21 -16
- package/dist/cli-chunks/{index-Cl5HFTBW.cjs → index-NOO3q8_C.cjs} +3 -3
- package/dist/cli-chunks/{login-Ct-46gLx.cjs → login-DtXHSm8R.cjs} +2 -2
- package/dist/cli-chunks/remote-BWfn7qIN.cjs +9915 -0
- package/dist/cli-chunks/{context-CKJlNcSN.cjs → sdk-version-policy-B1CFC1Dk.cjs} +122 -1
- package/dist/cli-chunks/{session-dRGPpyS1.cjs → session-DIcRjyDY.cjs} +2 -1
- package/dist/cli.cjs +1 -1
- package/dist/devtools/mock-host/index.html +40 -0
- package/dist/devtools/mock-host/main.js +85 -0
- package/dist/index.cjs.js +232 -4
- package/dist/index.esm.js +233 -3
- package/dist/miniapp-publish.cjs.js +4 -0
- package/dist/miniapp-publish.esm.js +4 -1
- package/dist/protocol.cjs.js +9 -0
- package/dist/protocol.esm.js +7 -1
- package/dist/vite.cjs.js +9159 -22
- package/dist/vite.esm.js +9159 -23
- package/package.json +19 -7
- package/skill/SKILL.md +23 -23
- package/skill/references/api-protocol.md +11 -2
- package/skill/references/api-root.md +145 -19
- package/skill/references/cli.md +13 -15
- package/skill/references/recipes.md +12 -44
- package/skill/references/safety-boundaries.md +1 -2
- package/skill/scripts/sync-references.mjs +2 -2
- package/skill/skill.json +4 -4
- package/types/cli/auth/base-url.d.ts +20 -0
- package/types/cli/config.d.ts +11 -0
- package/types/core/client.d.ts +7 -0
- package/types/core/csp-violation.d.ts +5 -0
- package/types/core/history-observer.d.ts +4 -0
- package/types/core/version.d.ts +2 -0
- package/types/index.d.ts +0 -2
- package/types/miniapp-manifest/schema.d.ts +6 -1
- package/types/miniapp-manifest/sdk-version-policy.d.ts +9 -0
- package/types/miniapp-publish/index.d.ts +1 -0
- package/types/protocol/constants.d.ts +6 -0
- package/types/protocol/types.d.ts +45 -0
- package/types/protocol.d.ts +2 -2
- package/types/vite/html-policy.d.ts +4 -0
- package/types/vite/index.d.ts +23 -3
- package/types/vite/runtime-gate.d.ts +5 -0
- package/types/vite/sdk-version-gate.d.ts +8 -0
- package/dist/cli-chunks/remote-C77axNSw.cjs +0 -1604
|
@@ -237,7 +237,7 @@ hb-sdk remote allowlist list
|
|
|
237
237
|
hb-sdk remote allowlist add <heybox-id...>
|
|
238
238
|
hb-sdk remote allowlist remove <heybox-id...>
|
|
239
239
|
hb-sdk remote allowlist set <heybox-id...>
|
|
240
|
-
hb-sdk remote deploy --release-note <text> [--
|
|
240
|
+
hb-sdk remote deploy --release-note <text> [--from-version <version>] [--auto-publish]
|
|
241
241
|
hb-sdk remote versions
|
|
242
242
|
hb-sdk remote preview <version>
|
|
243
243
|
hb-sdk remote release <version> [--yes]
|
|
@@ -397,7 +397,7 @@ ${cliRemoteEntityDeploySection}
|
|
|
397
397
|
Agent rules:
|
|
398
398
|
|
|
399
399
|
- Use \`hb-sdk remote deploy --release-note <text>\` for normal build, upload, and submit-audit flows.
|
|
400
|
-
- Use \`hb-sdk remote deploy --from-version <version> --release-note <text>\` to reuse a remote history artifact.
|
|
400
|
+
- Use \`hb-sdk remote deploy --from-version <version> --release-note <text>\` to reuse a remote history artifact.
|
|
401
401
|
- Verify remote deploy guidance says current-entity mismatch fails before precheck/build/upload/submit and never auto-switches the developer entity.
|
|
402
402
|
- Never recommend top-level \`hb-sdk deploy\`; it has been removed rather than retained as a compatibility alias.
|
|
403
403
|
- After non-auto deploy succeeds, suggest \`hb-sdk remote versions\` and then \`hb-sdk remote release <version>\` after approval. Do not send the user to Open for manual publish when the CLI command exists.
|
package/skill/skill.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hb-sdk",
|
|
3
|
-
"skillVersion": "0.
|
|
3
|
+
"skillVersion": "0.6.0+skill.451f74e19672",
|
|
4
4
|
"sdk": {
|
|
5
5
|
"package": "@heybox/hb-sdk",
|
|
6
|
-
"version": "0.
|
|
7
|
-
"compatibility": "0.
|
|
6
|
+
"version": "0.6.0",
|
|
7
|
+
"compatibility": "0.6.0"
|
|
8
8
|
},
|
|
9
9
|
"source": "https://open.xiaoheihe.cn/agent-skills/hb-sdk",
|
|
10
|
-
"integrity": "sha256-
|
|
10
|
+
"integrity": "sha256-451f74e19672cca0953ebb9d47d6f2632c9341ba2c4f9bcf4a861d5344285673"
|
|
11
11
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface HeyboxBaseUrlEnv extends NodeJS.ProcessEnv {
|
|
2
|
+
HB_SDK_API_BASE_URL?: string;
|
|
3
|
+
HB_SDK_ALLOW_UNSAFE_API_BASE_URL?: string;
|
|
4
|
+
HB_SDK_LOGIN_BASE_URL?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface HeyboxBaseUrlResolveOptions {
|
|
7
|
+
env?: HeyboxBaseUrlEnv;
|
|
8
|
+
}
|
|
9
|
+
export interface HeyboxApiBaseUrlResolveOptions extends HeyboxBaseUrlResolveOptions {
|
|
10
|
+
allowUnsafeApiBaseUrl?: boolean;
|
|
11
|
+
apiBaseUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface HeyboxLoginBaseUrlResolveOptions extends HeyboxBaseUrlResolveOptions {
|
|
14
|
+
loginBaseUrl?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const HEYBOX_API_BASE_URL = "https://api.xiaoheihe.cn";
|
|
17
|
+
export declare const HEYBOX_LOGIN_BASE_URL = "https://login.xiaoheihe.cn";
|
|
18
|
+
export declare function resolveHeyboxApiBaseUrl(options?: HeyboxApiBaseUrlResolveOptions): string;
|
|
19
|
+
export declare function resolveHeyboxLoginBaseUrl(options?: HeyboxLoginBaseUrlResolveOptions): string;
|
|
20
|
+
export declare function normalizeHeyboxOriginUrl(value: string, label: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RylaiServiceTagConfig } from '@heybox/hb-types';
|
|
2
|
+
export type HeyboxCliRequestConfig = RylaiServiceTagConfig;
|
|
3
|
+
export declare function configureHeyboxCliRequestConfig(config: HeyboxCliRequestConfig): void;
|
|
4
|
+
export declare function readHeyboxCliRequestConfig(): HeyboxCliRequestConfig;
|
|
5
|
+
/**
|
|
6
|
+
* 当 tag 为非空字符串时,把它设为 CLI 全局 default_tag;为空时不改动现有配置,
|
|
7
|
+
* 避免清掉 env 预设阶段已注入的值。
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyServiceTagIfNeeded(tag: unknown): void;
|
|
10
|
+
export declare function resolveHeyboxRylaiServiceTag(pathWithQuery?: string, config?: RylaiServiceTagConfig): string | undefined;
|
|
11
|
+
export declare function normalizeHeyboxRylaiServiceTagConfig(config: HeyboxCliRequestConfig): RylaiServiceTagConfig;
|
package/types/core/client.d.ts
CHANGED
|
@@ -34,6 +34,11 @@ export declare class MiniProgramBridgeClient implements MiniProgramRequester {
|
|
|
34
34
|
private readonly pendingRequests;
|
|
35
35
|
private readonly eventBus;
|
|
36
36
|
private readonly handleMessage;
|
|
37
|
+
private readonly handlePopState;
|
|
38
|
+
private readonly handleHashChange;
|
|
39
|
+
private readonly handlePageShow;
|
|
40
|
+
private readonly handleSecurityPolicyViolation;
|
|
41
|
+
private unsubscribeHistoryChanges?;
|
|
37
42
|
private started;
|
|
38
43
|
private readySettled;
|
|
39
44
|
private readyPromise;
|
|
@@ -58,6 +63,8 @@ export declare class MiniProgramBridgeClient implements MiniProgramRequester {
|
|
|
58
63
|
private ensureStarted;
|
|
59
64
|
private postHandshake;
|
|
60
65
|
private onMessage;
|
|
66
|
+
private postLocationReport;
|
|
67
|
+
private postCSPViolation;
|
|
61
68
|
private handleEvent;
|
|
62
69
|
private handleResponse;
|
|
63
70
|
private postMessage;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SDKCSPViolationPayload } from '../protocol/types';
|
|
2
|
+
type CSPViolationLike = Pick<SecurityPolicyViolationEvent, 'blockedURI' | 'disposition' | 'effectiveDirective' | 'violatedDirective'>;
|
|
3
|
+
/** 将浏览器 CSP 事件转换为不包含原始 URL 敏感部分的 bridge 载荷。 */
|
|
4
|
+
export declare function createCSPViolationPayload(event: CSPViolationLike, baseHref: string, sdkVersion: string, cryptoImplementation: Crypto): Promise<SDKCSPViolationPayload>;
|
|
5
|
+
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export { createMiniProgramSDK, MiniProgramSDK } from './core/sdk';
|
|
2
1
|
export { HbMiniProgramSDKError, HbMiniProgramNetworkError } from './core/errors';
|
|
3
|
-
export type { MiniProgramSDKOptions } from './core/client';
|
|
4
2
|
export { ready, on, off, auth, user, share, viewport, storage, network, ui, device, navigation, cloud } from './core/singleton';
|
|
5
3
|
export type { MiniProgramEventHandler, MiniProgramEventName, MiniProgramEventPayloadMap, } from './protocol/types';
|
|
6
4
|
export type { LoginPayload, LoginResult, MiniProgramAuthModule } from './modules/auth';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const MINIAPP_TEMPLATE_VERSION = "0.0.0";
|
|
2
2
|
export interface MiniappManifest {
|
|
3
3
|
[key: string]: unknown;
|
|
4
|
+
sdkVersion: string;
|
|
4
5
|
version: string;
|
|
5
6
|
}
|
|
6
7
|
export interface ParseMiniappManifestResult {
|
|
@@ -12,4 +13,8 @@ export declare function validateMiniappPackageVersionForBuild(version: string):
|
|
|
12
13
|
export declare function validateMiniappManifestVersion(version: unknown, sourceLabel?: string): string;
|
|
13
14
|
export declare function renderMiniappManifest(manifest: MiniappManifest): string;
|
|
14
15
|
export declare function parseMiniappManifestJson(raw: string, sourceLabel?: string): ParseMiniappManifestResult;
|
|
15
|
-
export declare function validateMiniappManifestForDeploy(manifest: MiniappManifest):
|
|
16
|
+
export declare function validateMiniappManifestForDeploy(manifest: MiniappManifest): {
|
|
17
|
+
version: string;
|
|
18
|
+
sdkVersion: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function validateSdkVersion(version: unknown, sourceLabel?: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function resolveMinimumSdkVersion(options: {
|
|
2
|
+
cacheDir: string;
|
|
3
|
+
environment: string;
|
|
4
|
+
fetchMinimumSdkVersion: () => Promise<string>;
|
|
5
|
+
now?: number;
|
|
6
|
+
}): Promise<string>;
|
|
7
|
+
export declare function validateCurrentSdkVersion(currentSdkVersion: string, minimumSdkVersion: string, options: {
|
|
8
|
+
allowPrerelease: boolean;
|
|
9
|
+
}): string;
|
|
@@ -2,6 +2,7 @@ export declare const MINIAPP_UPLOAD_SCOPE = "activity";
|
|
|
2
2
|
export declare const ACTIVITY_UPLOAD_KEY_MAX_LENGTH = 64;
|
|
3
3
|
export declare const MINIAPP_UPLOAD_BATCH_SIZE = 50;
|
|
4
4
|
export declare const MINIAPP_UPLOAD_TOTAL_SIZE_LIMIT_BYTES: number;
|
|
5
|
+
export declare const PUBLIC_USER_MINIPROGRAM_SDK_CONFIG_API_PATH = "/user_miniprogram/public/sdk_config";
|
|
5
6
|
export declare const USER_MINIPROGRAM_ACCESS_STATUS_API_PATH = "/mall/developer/user_miniprogram/access_status";
|
|
6
7
|
export declare const DEVELOPER_ENTITY_LIST_API_PATH = "/mall/developer/entity/list";
|
|
7
8
|
export declare const DEVELOPER_ENTITY_SWITCH_API_PATH = "/mall/developer/entity/switch";
|
|
@@ -6,3 +6,9 @@ export declare const MINI_PROGRAM_MESSAGE_VERSION: 1;
|
|
|
6
6
|
export declare const MINI_PROGRAM_BRIDGE_NONCE_PARAM: "hb_mini_bridge_nonce";
|
|
7
7
|
/** SDK 初始化时发给父容器的握手方法名。 */
|
|
8
8
|
export declare const SDK_HANDSHAKE_METHOD: "sdk.handshake";
|
|
9
|
+
/** Runtime 主动探测 SDK 当前文档地址的内部方法名。 */
|
|
10
|
+
export declare const RUNTIME_LOCATION_PROBE_METHOD: "runtime.location.probe";
|
|
11
|
+
/** SDK 向 Runtime 报告当前文档地址的内部方法名。 */
|
|
12
|
+
export declare const SDK_LOCATION_REPORT_METHOD: "sdk.location.report";
|
|
13
|
+
/** SDK 向 Runtime 报告 CSP 违规的内部方法名。 */
|
|
14
|
+
export declare const SDK_CSP_VIOLATION_METHOD: "sdk.csp.violation";
|
|
@@ -27,6 +27,51 @@ export interface MiniProgramBridgeError {
|
|
|
27
27
|
/** 可选调试数据,不保证结构稳定。 */
|
|
28
28
|
data?: unknown;
|
|
29
29
|
}
|
|
30
|
+
/** SDK 初始化握手载荷。 */
|
|
31
|
+
export interface SDKHandshakePayload {
|
|
32
|
+
/** 当前文档地址。 */
|
|
33
|
+
href: string;
|
|
34
|
+
/** 当前浏览器 User-Agent。 */
|
|
35
|
+
userAgent: string;
|
|
36
|
+
/** SDK 构建时注入的实际版本。 */
|
|
37
|
+
sdkVersion: string;
|
|
38
|
+
}
|
|
39
|
+
/** Runtime 发起 URL 探测时的载荷。 */
|
|
40
|
+
export interface RuntimeLocationProbePayload {
|
|
41
|
+
/** 当前探测的唯一标识。 */
|
|
42
|
+
probeId: string;
|
|
43
|
+
/** Runtime 发起探测的时间戳。 */
|
|
44
|
+
timestamp: number;
|
|
45
|
+
}
|
|
46
|
+
/** SDK 主动或被动报告 URL 的触发来源。 */
|
|
47
|
+
export type SDKLocationReportTrigger = 'probe' | 'history' | 'popstate' | 'hashchange' | 'pageshow' | 'resume';
|
|
48
|
+
/** SDK 向 Runtime 报告当前 URL 的载荷。 */
|
|
49
|
+
export interface SDKLocationReportPayload {
|
|
50
|
+
/** 响应探测时回传;主动报告时省略。 */
|
|
51
|
+
probeId?: string;
|
|
52
|
+
/** 当前文档完整地址,由 Runtime 执行范围校验。 */
|
|
53
|
+
href: string;
|
|
54
|
+
/** SDK 构建时注入的实际版本。 */
|
|
55
|
+
sdkVersion: string;
|
|
56
|
+
/** 本次报告的触发来源。 */
|
|
57
|
+
trigger: SDKLocationReportTrigger;
|
|
58
|
+
/** SDK 生成报告的时间戳。 */
|
|
59
|
+
timestamp: number;
|
|
60
|
+
}
|
|
61
|
+
/** CSP 阻断资源的归一化类型。 */
|
|
62
|
+
export type SDKCSPBlockedResourceType = 'url' | 'inline' | 'eval' | 'unknown';
|
|
63
|
+
/** SDK 向 Runtime 报告 CSP 违规的脱敏载荷。 */
|
|
64
|
+
export interface SDKCSPViolationPayload {
|
|
65
|
+
effectiveDirective: string;
|
|
66
|
+
violatedDirective: string;
|
|
67
|
+
disposition: string;
|
|
68
|
+
blockedResourceType: SDKCSPBlockedResourceType;
|
|
69
|
+
blockedOrigin?: string;
|
|
70
|
+
redactedPathname?: string;
|
|
71
|
+
sanitizedPathnameHash?: string;
|
|
72
|
+
sdkVersion: string;
|
|
73
|
+
timestamp: number;
|
|
74
|
+
}
|
|
30
75
|
/**
|
|
31
76
|
* SDK 与沙盒之间统一的 postMessage 信封。
|
|
32
77
|
*
|
package/types/protocol.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { MINI_PROGRAM_BRIDGE_NONCE_PARAM, MINI_PROGRAM_MESSAGE_NAMESPACE, MINI_PROGRAM_MESSAGE_VERSION, SDK_HANDSHAKE_METHOD, } from './protocol/constants';
|
|
1
|
+
export { MINI_PROGRAM_BRIDGE_NONCE_PARAM, MINI_PROGRAM_MESSAGE_NAMESPACE, MINI_PROGRAM_MESSAGE_VERSION, RUNTIME_LOCATION_PROBE_METHOD, SDK_CSP_VIOLATION_METHOD, SDK_HANDSHAKE_METHOD, SDK_LOCATION_REPORT_METHOD, } from './protocol/constants';
|
|
2
2
|
export { isMiniProgramBridgeMessage } from './protocol/guards';
|
|
3
|
-
export type { MiniProgramBridgeError, MiniProgramBridgeMessage, MiniProgramBridgeMessageType, MiniProgramEventHandler, MiniProgramEventName, MiniProgramEventPayloadMap, } from './protocol/types';
|
|
3
|
+
export type { MiniProgramBridgeError, MiniProgramBridgeMessage, MiniProgramBridgeMessageType, MiniProgramEventHandler, MiniProgramEventName, MiniProgramEventPayloadMap, RuntimeLocationProbePayload, SDKCSPBlockedResourceType, SDKCSPViolationPayload, SDKHandshakePayload, SDKLocationReportPayload, SDKLocationReportTrigger, } from './protocol/types';
|
|
4
4
|
export { AUTH_LOGIN_METHOD, CLOUD_LEADERBOARD_DELETE_CURRENT_USER_ENTRY_METHOD, CLOUD_LEADERBOARD_GET_CURRENT_USER_ENTRY_METHOD, CLOUD_LEADERBOARD_GET_INFO_METHOD, CLOUD_LEADERBOARD_GET_LIST_METHOD, CLOUD_LEADERBOARD_SUBMIT_METHOD, DEVICE_SET_CLIPBOARD_METHOD, DEVICE_VIBRATE_METHOD, MINI_PROGRAM_PROTOCOL_CAPABILITIES, NAVIGATION_CLOSE_METHOD, NAVIGATION_OPEN_APP_PAGE_METHOD, NAVIGATION_RELOAD_METHOD, NETWORK_REQUEST_METHOD, SHARE_SCREENSHOT_METHOD, SHARE_SHOW_SHARE_MENU_METHOD, STORAGE_GET_STORAGE_METHOD, STORAGE_SET_STORAGE_METHOD, UI_HIDE_LOADING_METHOD, UI_SHOW_LOADING_METHOD, UI_SHOW_TOAST_METHOD, USER_GET_CURRENT_USER_DETAIL_METHOD, USER_GET_CURRENT_USER_PROFILE_METHOD, USER_GET_INFO_METHOD, USER_GET_PLATFORM_ACCOUNT_INFO_METHOD, USER_GET_PLATFORM_ACCOUNT_OVERVIEW_METHOD, USER_GET_STEAM_GAME_LIST_METHOD, VIEWPORT_GET_WINDOW_INFO_METHOD, VIEWPORT_SET_NAVIGATION_BAR_STYLE_METHOD, } from './protocol/capabilities';
|
|
5
5
|
export type { MiniProgramDeviceMethod, MiniProgramAuthMethod, MiniProgramBridgeMethod, MiniProgramCapabilityDefinition, MiniProgramCapabilityModule, MiniProgramCapabilityPayload, MiniProgramCapabilityPayloadMap, MiniProgramCapabilityResult, MiniProgramCapabilityResultMap, MiniProgramCapabilityRisk, MiniProgramCloudMethod, MiniProgramNavigationMethod, MiniProgramNetworkMethod, MiniProgramShareMethod, MiniProgramStorageMethod, MiniProgramUiMethod, MiniProgramUserMethod, MiniProgramViewportMethod, } from './protocol/capabilities';
|
|
6
6
|
export type { LoginPayload, LoginResult } from './modules/auth';
|
package/types/vite/index.d.ts
CHANGED
|
@@ -1,21 +1,41 @@
|
|
|
1
|
+
import { enforceViteSdkVersion as defaultEnforceRemoteSdkVersion } from './sdk-version-gate';
|
|
1
2
|
type MiniappManifestPlugin = {
|
|
2
3
|
name: string;
|
|
3
|
-
apply: 'build';
|
|
4
4
|
config: (config: MiniappManifestUserConfig) => MiniappManifestUserConfig | void;
|
|
5
5
|
configResolved: (resolved: MiniappManifestResolvedConfig) => void;
|
|
6
|
-
|
|
6
|
+
buildStart: () => Promise<void>;
|
|
7
|
+
/** Rollup 在构建失败后仍会跑 closeBundle;用 buildEnd 记录真实错误,避免二次校验掩盖原因。 */
|
|
8
|
+
buildEnd: (error?: Error) => void;
|
|
9
|
+
transformIndexHtml: (html: string) => string;
|
|
10
|
+
closeBundle: (this: MiniappManifestPluginContext) => Promise<void>;
|
|
7
11
|
};
|
|
12
|
+
export interface MiniappManifestOptions {
|
|
13
|
+
/** 仅供平台测试和自托管 Remote Environment adapter 使用。 */
|
|
14
|
+
enforceSdkVersion?: typeof defaultEnforceRemoteSdkVersion;
|
|
15
|
+
}
|
|
8
16
|
interface MiniappManifestUserConfig {
|
|
9
17
|
base?: string;
|
|
18
|
+
define?: Record<string, string>;
|
|
10
19
|
}
|
|
11
20
|
interface MiniappManifestPluginContext {
|
|
12
21
|
warn: (message: string) => void;
|
|
13
22
|
}
|
|
14
23
|
interface MiniappManifestResolvedConfig {
|
|
15
24
|
root: string;
|
|
25
|
+
command: 'build' | 'serve';
|
|
16
26
|
build: {
|
|
17
27
|
outDir: string;
|
|
18
28
|
};
|
|
29
|
+
server: {
|
|
30
|
+
host?: string | boolean;
|
|
31
|
+
port?: number;
|
|
32
|
+
hmr?: boolean | {
|
|
33
|
+
clientPort?: number;
|
|
34
|
+
host?: string;
|
|
35
|
+
port?: number;
|
|
36
|
+
protocol?: 'ws' | 'wss';
|
|
37
|
+
};
|
|
38
|
+
};
|
|
19
39
|
}
|
|
20
|
-
export declare function miniappManifest(): MiniappManifestPlugin;
|
|
40
|
+
export declare function miniappManifest(options?: MiniappManifestOptions): MiniappManifestPlugin;
|
|
21
41
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type DefaultTreeAdapterMap } from 'parse5';
|
|
2
|
+
type HtmlDocument = DefaultTreeAdapterMap['document'];
|
|
3
|
+
export declare function injectMiniappRuntimeGate(document: HtmlDocument): void;
|
|
4
|
+
export declare function hasMiniappRuntimeGate(html: string): boolean;
|
|
5
|
+
export {};
|