weapp-ide-cli 5.4.5 → 5.4.7
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/dist/{cli-DJr4cadu.js → cli-cDh7iXGz.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/commands-DI8UiCwX.js +2 -0
- package/dist/{commands-BmMXhKYb.js → commands-iZ4aJ0BZ.js} +40 -5
- package/dist/index.d.ts +11 -1
- package/dist/index.js +3 -3
- package/package.json +3 -3
- package/dist/commands-CL5B82hV.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as overwriteCustomConfig, C as configureLocaleFromArgv, H as resolveDevtoolsAutomationDefaults, J as logger_default, Q as createLocaleConfig, T as validateLocaleOption, V as getConfiguredLocale, X as createAutoTrustProjectConfig, Y as createAutoBootstrapDevtoolsConfig, Z as createCustomConfig, et as readCustomConfig, q as colors, r as connectMiniProgram, rt as defaultCustomConfigFilePath, tt as removeCustomConfigKey, w as i18nText, z as resolveCliPath } from "./automator-session-JEM5q8tK.js";
|
|
2
|
-
import {
|
|
2
|
+
import { A as isWechatIdeLoggedIn, B as runWechatCliCommand, C as clearWechatIdeCache, F as quitWechatIde, G as transformArgv, H as execute, K as promptForCliPath, L as resetWechatIdeFileUtils, M as openWechatIde, N as openWechatIdeOtherProject, P as previewWechatIde, Q as startWechatIdeEngineBuildByHttp, S as buildWechatIdeNpm, T as closeWechatIdeProject, U as createAlias, W as createPathCompat, Y as pollWechatIdeEngineBuildResultByHttp, _ as autoPreviewWechatIde, a as navigateBack, b as buildWechatIdeApk, c as pageStack, d as remote, f as scrollTo, g as tap, i as input, it as removeOption, j as loginWechatIde, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, nt as readBooleanOption, o as navigateTo, p as switchTab, r as currentPage, rt as readOptionValue, s as pageData, t as audit, tt as parseAutomatorArgs, u as redirectTo, v as autoReplayWechatIde, x as buildWechatIdeIpa, y as autoWechatIde, z as uploadWechatIde } from "./commands-iZ4aJ0BZ.js";
|
|
3
3
|
import "./run-mcp-L4shbBPP.js";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
@@ -313,7 +313,7 @@ async function runScreenshot(argv) {
|
|
|
313
313
|
}
|
|
314
314
|
const options = parseScreenshotArgs(argv);
|
|
315
315
|
const isJsonOutput = argv.includes("--json");
|
|
316
|
-
const { takeScreenshot } = await import("./commands-
|
|
316
|
+
const { takeScreenshot } = await import("./commands-DI8UiCwX.js");
|
|
317
317
|
const result = await takeScreenshot(options);
|
|
318
318
|
if (isJsonOutput) {
|
|
319
319
|
console.log(JSON.stringify(result, null, 2));
|
package/dist/cli.js
CHANGED
|
@@ -210,7 +210,7 @@ async function captureFullPageScreenshotBuffer(options) {
|
|
|
210
210
|
const initialScrollTop = typeof page.scrollTop === "function" ? await page.scrollTop() : 0;
|
|
211
211
|
const pageHeight = toPositiveNumber(pageSize.height);
|
|
212
212
|
const viewportHeight = toPositiveNumber(systemInfo.windowHeight);
|
|
213
|
-
if (!pageHeight || !viewportHeight) return decodeScreenshotBuffer(await runWithTimeout(miniProgram.screenshot(), timeoutMs, screenshotTimeoutMessage, "DEVTOOLS_SCREENSHOT_TIMEOUT"));
|
|
213
|
+
if (!pageHeight || !viewportHeight) return decodeScreenshotBuffer(await runWithTimeout(miniProgram.screenshot({ timeout: timeoutMs }), timeoutMs, screenshotTimeoutMessage, "DEVTOOLS_SCREENSHOT_TIMEOUT"));
|
|
214
214
|
const segments = [];
|
|
215
215
|
const positions = createScrollPositions(pageHeight, viewportHeight);
|
|
216
216
|
let coveredUntil = 0;
|
|
@@ -219,7 +219,7 @@ async function captureFullPageScreenshotBuffer(options) {
|
|
|
219
219
|
for (const scrollTop of positions) {
|
|
220
220
|
await miniProgram.pageScrollTo(scrollTop);
|
|
221
221
|
await page.waitFor(150);
|
|
222
|
-
const rawScreenshot = await runWithTimeout(miniProgram.screenshot(), timeoutMs, screenshotTimeoutMessage, "DEVTOOLS_SCREENSHOT_TIMEOUT");
|
|
222
|
+
const rawScreenshot = await runWithTimeout(miniProgram.screenshot({ timeout: timeoutMs }), timeoutMs, screenshotTimeoutMessage, "DEVTOOLS_SCREENSHOT_TIMEOUT");
|
|
223
223
|
const png = PNG.sync.read(decodeScreenshotBuffer(rawScreenshot));
|
|
224
224
|
if (viewportHeight > 0) scale = png.height / viewportHeight;
|
|
225
225
|
const visibleEnd = Math.min(scrollTop + viewportHeight, pageHeight);
|
|
@@ -254,6 +254,25 @@ async function captureFullPageScreenshotBuffer(options) {
|
|
|
254
254
|
return PNG.sync.write(merged);
|
|
255
255
|
}
|
|
256
256
|
//#endregion
|
|
257
|
+
//#region src/cli/wechatDevtoolsRuntimePort.ts
|
|
258
|
+
let runtimeWechatDevtoolsServicePort;
|
|
259
|
+
/**
|
|
260
|
+
* @description 标记当前进程最近一次检测到的微信开发者工具服务端口。
|
|
261
|
+
*/
|
|
262
|
+
function setRuntimeWechatDevtoolsServicePort(port) {
|
|
263
|
+
if (typeof port !== "number" || !Number.isInteger(port) || port <= 0 || port > 65535) {
|
|
264
|
+
runtimeWechatDevtoolsServicePort = void 0;
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
runtimeWechatDevtoolsServicePort = port;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* @description 读取当前进程最近一次检测到的微信开发者工具服务端口。
|
|
271
|
+
*/
|
|
272
|
+
function getRuntimeWechatDevtoolsServicePort() {
|
|
273
|
+
return runtimeWechatDevtoolsServicePort;
|
|
274
|
+
}
|
|
275
|
+
//#endregion
|
|
257
276
|
//#region src/cli/http.ts
|
|
258
277
|
const DEFAULT_WECHAT_DEVTOOLS_HTTP_PORT = 9420;
|
|
259
278
|
const ENGINE_BUILD_NOT_START = "NOT_START";
|
|
@@ -268,6 +287,8 @@ function createWechatDevtoolsHttpError(message, code) {
|
|
|
268
287
|
}
|
|
269
288
|
async function resolveWechatDevtoolsHttpPort(port) {
|
|
270
289
|
if (typeof port === "number" && Number.isInteger(port) && port > 0) return port;
|
|
290
|
+
const runtimePort = getRuntimeWechatDevtoolsServicePort();
|
|
291
|
+
if (runtimePort) return runtimePort;
|
|
271
292
|
const detected = await detectWechatDevtoolsServicePort();
|
|
272
293
|
if (detected.servicePortEnabled === false) throw createWechatDevtoolsHttpError("WECHAT_DEVTOOLS_SERVICE_PORT_DISABLED", "WECHAT_DEVTOOLS_SERVICE_PORT_DISABLED");
|
|
273
294
|
return detected.servicePort ?? DEFAULT_WECHAT_DEVTOOLS_HTTP_PORT;
|
|
@@ -474,6 +495,7 @@ function resolveLoginRetryConfig(argv) {
|
|
|
474
495
|
}
|
|
475
496
|
//#endregion
|
|
476
497
|
//#region src/cli/run-login.ts
|
|
498
|
+
const IDE_SERVER_STARTED_RE = /IDE server has started,\s*listening on\s+https?:\/\/127\.0\.0\.1:(\d+)/i;
|
|
477
499
|
function unwrapWechatCliExecutionError(result) {
|
|
478
500
|
return result.kind === "retryable" ? result.error : result.value;
|
|
479
501
|
}
|
|
@@ -507,6 +529,13 @@ function flushExecutionOutput(result) {
|
|
|
507
529
|
if (typeof candidate.stdout === "string" && candidate.stdout) process.stdout.write(candidate.stdout);
|
|
508
530
|
if (typeof candidate.stderr === "string" && candidate.stderr) process.stderr.write(candidate.stderr);
|
|
509
531
|
}
|
|
532
|
+
function captureWechatDevtoolsServicePort(result) {
|
|
533
|
+
if (!result || typeof result !== "object") return;
|
|
534
|
+
const candidate = result;
|
|
535
|
+
const match = [typeof candidate.stdout === "string" ? candidate.stdout : "", typeof candidate.stderr === "string" ? candidate.stderr : ""].join("\n").match(IDE_SERVER_STARTED_RE);
|
|
536
|
+
if (!match?.[1]) return;
|
|
537
|
+
setRuntimeWechatDevtoolsServicePort(Number.parseInt(match[1], 10));
|
|
538
|
+
}
|
|
510
539
|
/**
|
|
511
540
|
* @description 运行微信开发者工具 CLI,并在登录失效时允许按键重试。
|
|
512
541
|
*/
|
|
@@ -544,6 +573,7 @@ async function runWechatCliWithRetry(cliPath, argv) {
|
|
|
544
573
|
});
|
|
545
574
|
if (result.kind === "retryable") throw createWechatIdeLoginRequiredExitError(result.error);
|
|
546
575
|
if (isWechatIdeLoginRequiredError(result.value)) throw createWechatIdeLoginRequiredExitError(result.value);
|
|
576
|
+
captureWechatDevtoolsServicePort(result.value);
|
|
547
577
|
flushExecutionOutput(result.value);
|
|
548
578
|
}
|
|
549
579
|
//#endregion
|
|
@@ -907,6 +937,10 @@ function isDevtoolsProtocolTimeoutError(error) {
|
|
|
907
937
|
function isScreenshotNavigationTimeoutError(error) {
|
|
908
938
|
return error instanceof Error && Reflect.get(error, "code") === "DEVTOOLS_SCREENSHOT_NAVIGATION_TIMEOUT";
|
|
909
939
|
}
|
|
940
|
+
function isScreenshotRequestTimeoutError(error) {
|
|
941
|
+
if (!(error instanceof Error)) return false;
|
|
942
|
+
return error.message === "DEVTOOLS_SCREENSHOT_TIMEOUT" || Reflect.get(error, "code") === "DEVTOOLS_SCREENSHOT_TIMEOUT";
|
|
943
|
+
}
|
|
910
944
|
async function reLaunchForScreenshot(miniProgram, page) {
|
|
911
945
|
const routeOptions = { url: page };
|
|
912
946
|
if (typeof miniProgram.callWxMethod === "function") await miniProgram.callWxMethod("reLaunch", routeOptions);
|
|
@@ -1089,7 +1123,7 @@ async function captureScreenshotBuffer(options) {
|
|
|
1089
1123
|
});
|
|
1090
1124
|
}
|
|
1091
1125
|
logger_default.info(i18nText("正在截图...", "Taking screenshot..."));
|
|
1092
|
-
const screenshot = await withCommandTimeout(miniProgram.screenshot(), commandTimeout, screenshotTimeoutMessage, "DEVTOOLS_SCREENSHOT_TIMEOUT");
|
|
1126
|
+
const screenshot = await withCommandTimeout(miniProgram.screenshot({ timeout: commandTimeout }), commandTimeout, screenshotTimeoutMessage, "DEVTOOLS_SCREENSHOT_TIMEOUT");
|
|
1093
1127
|
const buffer = typeof screenshot === "string" ? Buffer.from(screenshot, "base64") : Buffer.from(screenshot);
|
|
1094
1128
|
if (buffer.length === 0) throw new Error(i18nText("截图失败", "Failed to capture screenshot"));
|
|
1095
1129
|
return buffer;
|
|
@@ -1108,7 +1142,8 @@ async function takeScreenshot(options) {
|
|
|
1108
1142
|
} catch (error) {
|
|
1109
1143
|
const isProtocolTimeout = error instanceof Error && error.message === "DEVTOOLS_PROTOCOL_TIMEOUT";
|
|
1110
1144
|
const isNavigationTimeout = isScreenshotNavigationTimeoutError(error);
|
|
1111
|
-
|
|
1145
|
+
const isScreenshotTimeout = isScreenshotRequestTimeoutError(error);
|
|
1146
|
+
if (!Boolean(!nextOptions.miniProgram && (isProtocolTimeout || isNavigationTimeout || isScreenshotTimeout) && !hasRetriedWithFreshSession)) throw error;
|
|
1112
1147
|
hasRetriedWithFreshSession = true;
|
|
1113
1148
|
await closeWechatIdeProject().catch((closeError) => {
|
|
1114
1149
|
logger_default.warn(i18nText(`关闭当前微信开发者工具项目窗口失败:${closeError instanceof Error ? closeError.message : String(closeError)},仍将继续尝试重建自动化会话。`, `Failed to close the current Wechat DevTools project window: ${closeError instanceof Error ? closeError.message : String(closeError)}. Continuing to rebuild the automation session.`));
|
|
@@ -1146,4 +1181,4 @@ async function remote(options) {
|
|
|
1146
1181
|
});
|
|
1147
1182
|
}
|
|
1148
1183
|
//#endregion
|
|
1149
|
-
export {
|
|
1184
|
+
export { getRuntimeWechatDevtoolsServicePort as $, isWechatIdeLoggedIn as A, runWechatCliCommand as B, clearWechatIdeCache as C, getWechatIdeTestAccounts as D, compileWechatIdeByAutomator as E, quitWechatIde as F, transformArgv as G, execute as H, refreshWechatIdeTicket as I, openWechatIdeProjectByHttp as J, promptForCliPath as K, resetWechatIdeFileUtils as L, openWechatIde as M, openWechatIdeOtherProject as N, getWechatIdeTicket as O, previewWechatIde as P, startWechatIdeEngineBuildByHttp as Q, setWechatIdeTicket as R, buildWechatIdeNpm as S, closeWechatIdeProject as T, createAlias as U, runWechatCliWithRetry as V, createPathCompat as W, requestWechatDevtoolsHttp as X, pollWechatIdeEngineBuildResultByHttp as Y, resetWechatIdeFileUtilsByHttp as Z, autoPreviewWechatIde as _, navigateBack as a, buildWechatIdeApk as b, pageStack as c, remote as d, setRuntimeWechatDevtoolsServicePort as et, scrollTo as f, tap as g, takeScreenshot as h, input as i, removeOption as it, loginWechatIde as j, getWechatIdeToolInfo as k, reLaunch as l, systemInfo as m, captureScreenshotBuffer as n, readBooleanOption as nt, navigateTo as o, switchTab as p, WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES as q, currentPage as r, readOptionValue as rt, pageData as s, audit as t, parseAutomatorArgs as tt, redirectTo as u, autoReplayWechatIde as v, clearWechatIdeCacheByAutomator as w, buildWechatIdeIpa as x, autoWechatIde as y, uploadWechatIde as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -727,6 +727,16 @@ declare function buildWechatIdeIpa(options: BuildWechatIdeIpaOptions): Promise<v
|
|
|
727
727
|
*/
|
|
728
728
|
declare function dispatchWechatCliCommand(argv: string[]): Promise<boolean>;
|
|
729
729
|
//#endregion
|
|
730
|
+
//#region src/cli/wechatDevtoolsRuntimePort.d.ts
|
|
731
|
+
/**
|
|
732
|
+
* @description 标记当前进程最近一次检测到的微信开发者工具服务端口。
|
|
733
|
+
*/
|
|
734
|
+
declare function setRuntimeWechatDevtoolsServicePort(port: number | undefined): void;
|
|
735
|
+
/**
|
|
736
|
+
* @description 读取当前进程最近一次检测到的微信开发者工具服务端口。
|
|
737
|
+
*/
|
|
738
|
+
declare function getRuntimeWechatDevtoolsServicePort(): number | undefined;
|
|
739
|
+
//#endregion
|
|
730
740
|
//#region src/cli/wechatDevtoolsSettings.d.ts
|
|
731
741
|
interface WechatDevtoolsSecuritySettings {
|
|
732
742
|
enableServicePort: boolean;
|
|
@@ -953,4 +963,4 @@ declare function execute(cliPath: string, argv: string[], options?: ExecuteOptio
|
|
|
953
963
|
*/
|
|
954
964
|
declare function resolvePath(filePath: string): string;
|
|
955
965
|
//#endregion
|
|
956
|
-
export { AUTOMATOR_COMMAND_NAMES, ArgvTransform, AuditOptions, AutoPreviewWechatIdeOptions, AutoReplayWechatIdeOptions, AutoWechatIdeOptions, AutomatorCommandOptions, AutomatorOptions, AutomatorSessionOptions, type BaseConfig, BootstrapWechatDevtoolsSettingsOptions, BootstrapWechatDevtoolsSettingsResult, BuildWechatIdeApkOptions, BuildWechatIdeIpaOptions, BuildWechatIdeNpmOptions, CONFIG_COMMAND_NAME, ClearWechatIdeCacheByAutomatorOptions, ClearWechatIdeCacheOptions, CompileWechatIdeByAutomatorOptions, type ConfigSource, DetectWechatDevtoolsServicePortOptions, DetectWechatDevtoolsServicePortResult, DetectedWechatDevtoolsServicePortSettings, type DevtoolsConnectionInput, type DevtoolsContext, type DevtoolsElementSnapshot, type DevtoolsPageSnapshot, type DevtoolsToolResult, ExclusiveKeypressOptions, ForwardConsoleEvent, ForwardConsoleLogLevel, ForwardConsoleOptions, ForwardConsoleSession, InputOptions, LoginWechatIdeOptions, MCP_COMMAND_NAME, MINIDEV_NAMESPACE_COMMAND_NAMES, McpCommandOptions, MiniProgramElement, type MiniProgramEventMap, MiniProgramLike, MiniProgramPage, NavigateOptions, OpenWechatIdeOptions, OpenWechatIdeOtherProjectOptions, PageDataOptions, PageInfoOptions, ParsedAutomatorArgs, PollWechatIdeEngineBuildResult, PreviewWechatIdeOptions, RETRY_CANCEL_KEYS, RETRY_CONFIRM_KEYS, RETRY_PROMPT_INITIAL_IGNORE_MS, RemoteOptions, ResetWechatIdeFileUtilsOptions, type ResolvedConfig, RetryKeypressOptions, RetryLogger, RetryPromptOptions, RetryPromptResult, RetryableCommandExecutorOptions, RunWechatIdeEngineBuildByHttpOptions, RunWechatIdeEngineBuildOptions, ScreenshotOptions, ScreenshotResult, ScrollOptions, SelectorOptions, SetWechatIdeTicketOptions, SharedInputSession, SharedInputSessionOptions, StartWeappIdeMcpServerOptions, StartWechatIdeEngineBuildResult, SupportedPlatform, SupportedPlatformsMap, TapOptions, UploadWechatIdeOptions, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, WECHAT_CLI_COMMAND_NAMES, WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, WeappIdeMcpRuntimeHooks, WeappIdeMcpServerHandle, WeappIdeMcpServerOptions, WechatDevtoolsEngineBuildResult, WechatDevtoolsHttpCommandOptions, WechatDevtoolsSecuritySettings, WechatIdeAutomatorSessionOptions, WechatIdeLoginRetryOptions, acquireSharedMiniProgram, audit, autoPreviewWechatIde, autoReplayWechatIde, autoWechatIde, bootstrapWechatDevtoolsSettings, buildWechatIdeApk, buildWechatIdeIpa, buildWechatIdeNpm, captureScreenshotBuffer, clearWechatIdeCache, clearWechatIdeCacheByAutomator, closeSharedMiniProgram, closeWechatIdeProject, compileWechatIdeByAutomator, connectMiniProgram, connectOpenedAutomator, createAlias, createAutoBootstrapDevtoolsConfig, createAutoTrustProjectConfig, createCli, createCustomConfig, createLocaleConfig, createPathCompat, createSharedInputSession, createWeappIdeMcpServer, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, detectWechatDevtoolsServicePort, dispatchWechatCliCommand, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getAutomatorCommandHelp, getAutomatorProtocolTimeoutMethod, getConfig, getConfiguredLocale, getDefaultCliPath, getSharedMiniProgramSessionCount, getWechatIdeTestAccounts, getWechatIdeTicket, getWechatIdeToolInfo, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isAutomatorProtocolTimeoutError, isAutomatorWsConnectError, isDevtoolsExtensionContextInvalidatedError, isDevtoolsHttpPortError, isOperatingSystemSupported, isRetryableAutomatorLaunchError, isWeappIdeTopLevelCommand, isWechatIdeEngineBuildEndpointMissingError, isWechatIdeLoggedIn, isWechatIdeLoginRequiredError, isWechatIdeLoginRequiredExitError, launchAutomator, loginWechatIde, navigateBack, navigateTo, openWechatIde, openWechatIdeOtherProject, openWechatIdeProjectByHttp, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseCompareArgs, parseScreenshotArgs, pollWechatIdeEngineBuildResultByHttp, previewWechatIde, printCompareHelp, printScreenshotHelp, promptForCliPath, promptRetryKeypress, promptWechatIdeLoginRetry, quitWechatIde, reLaunch, readBooleanOption, readCustomConfig, readElementSnapshot, readOptionValue, redirectTo, refreshWechatIdeTicket, registerWeappIdeMcpTools, releaseSharedMiniProgram, remote, removeCustomConfigKey, removeOption, requestWechatDevtoolsHttp, resetWechatIdeFileUtils, resetWechatIdeFileUtilsByHttp, resolveCliPath, resolveDevtoolsAutomationDefaults, resolvePath, resolveProjectAutomatorPort, resolveProjectPath, runAutomatorCommand, runMcpCommand, runMinidev, runRetryableCommand, runWechatCliWithRetry, runWechatIdeEngineBuild, runWechatIdeEngineBuildByHttp, runWithSuspendedSharedInput, scrollTo, setWechatIdeTicket, startForwardConsole, startWeappIdeMcpServer, startWechatIdeEngineBuildByHttp, switchTab, systemInfo, takeScreenshot, tap, toSerializableValue, transformArgv, uploadWechatIde, validateWechatCliCommandArgs, waitForExclusiveKeypress, waitForRetryKeypress, withMiniProgram };
|
|
966
|
+
export { AUTOMATOR_COMMAND_NAMES, ArgvTransform, AuditOptions, AutoPreviewWechatIdeOptions, AutoReplayWechatIdeOptions, AutoWechatIdeOptions, AutomatorCommandOptions, AutomatorOptions, AutomatorSessionOptions, type BaseConfig, BootstrapWechatDevtoolsSettingsOptions, BootstrapWechatDevtoolsSettingsResult, BuildWechatIdeApkOptions, BuildWechatIdeIpaOptions, BuildWechatIdeNpmOptions, CONFIG_COMMAND_NAME, ClearWechatIdeCacheByAutomatorOptions, ClearWechatIdeCacheOptions, CompileWechatIdeByAutomatorOptions, type ConfigSource, DetectWechatDevtoolsServicePortOptions, DetectWechatDevtoolsServicePortResult, DetectedWechatDevtoolsServicePortSettings, type DevtoolsConnectionInput, type DevtoolsContext, type DevtoolsElementSnapshot, type DevtoolsPageSnapshot, type DevtoolsToolResult, ExclusiveKeypressOptions, ForwardConsoleEvent, ForwardConsoleLogLevel, ForwardConsoleOptions, ForwardConsoleSession, InputOptions, LoginWechatIdeOptions, MCP_COMMAND_NAME, MINIDEV_NAMESPACE_COMMAND_NAMES, McpCommandOptions, MiniProgramElement, type MiniProgramEventMap, MiniProgramLike, MiniProgramPage, NavigateOptions, OpenWechatIdeOptions, OpenWechatIdeOtherProjectOptions, PageDataOptions, PageInfoOptions, ParsedAutomatorArgs, PollWechatIdeEngineBuildResult, PreviewWechatIdeOptions, RETRY_CANCEL_KEYS, RETRY_CONFIRM_KEYS, RETRY_PROMPT_INITIAL_IGNORE_MS, RemoteOptions, ResetWechatIdeFileUtilsOptions, type ResolvedConfig, RetryKeypressOptions, RetryLogger, RetryPromptOptions, RetryPromptResult, RetryableCommandExecutorOptions, RunWechatIdeEngineBuildByHttpOptions, RunWechatIdeEngineBuildOptions, ScreenshotOptions, ScreenshotResult, ScrollOptions, SelectorOptions, SetWechatIdeTicketOptions, SharedInputSession, SharedInputSessionOptions, StartWeappIdeMcpServerOptions, StartWechatIdeEngineBuildResult, SupportedPlatform, SupportedPlatformsMap, TapOptions, UploadWechatIdeOptions, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, WECHAT_CLI_COMMAND_NAMES, WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, WeappIdeMcpRuntimeHooks, WeappIdeMcpServerHandle, WeappIdeMcpServerOptions, WechatDevtoolsEngineBuildResult, WechatDevtoolsHttpCommandOptions, WechatDevtoolsSecuritySettings, WechatIdeAutomatorSessionOptions, WechatIdeLoginRetryOptions, acquireSharedMiniProgram, audit, autoPreviewWechatIde, autoReplayWechatIde, autoWechatIde, bootstrapWechatDevtoolsSettings, buildWechatIdeApk, buildWechatIdeIpa, buildWechatIdeNpm, captureScreenshotBuffer, clearWechatIdeCache, clearWechatIdeCacheByAutomator, closeSharedMiniProgram, closeWechatIdeProject, compileWechatIdeByAutomator, connectMiniProgram, connectOpenedAutomator, createAlias, createAutoBootstrapDevtoolsConfig, createAutoTrustProjectConfig, createCli, createCustomConfig, createLocaleConfig, createPathCompat, createSharedInputSession, createWeappIdeMcpServer, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, detectWechatDevtoolsServicePort, dispatchWechatCliCommand, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getAutomatorCommandHelp, getAutomatorProtocolTimeoutMethod, getConfig, getConfiguredLocale, getDefaultCliPath, getRuntimeWechatDevtoolsServicePort, getSharedMiniProgramSessionCount, getWechatIdeTestAccounts, getWechatIdeTicket, getWechatIdeToolInfo, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isAutomatorProtocolTimeoutError, isAutomatorWsConnectError, isDevtoolsExtensionContextInvalidatedError, isDevtoolsHttpPortError, isOperatingSystemSupported, isRetryableAutomatorLaunchError, isWeappIdeTopLevelCommand, isWechatIdeEngineBuildEndpointMissingError, isWechatIdeLoggedIn, isWechatIdeLoginRequiredError, isWechatIdeLoginRequiredExitError, launchAutomator, loginWechatIde, navigateBack, navigateTo, openWechatIde, openWechatIdeOtherProject, openWechatIdeProjectByHttp, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseCompareArgs, parseScreenshotArgs, pollWechatIdeEngineBuildResultByHttp, previewWechatIde, printCompareHelp, printScreenshotHelp, promptForCliPath, promptRetryKeypress, promptWechatIdeLoginRetry, quitWechatIde, reLaunch, readBooleanOption, readCustomConfig, readElementSnapshot, readOptionValue, redirectTo, refreshWechatIdeTicket, registerWeappIdeMcpTools, releaseSharedMiniProgram, remote, removeCustomConfigKey, removeOption, requestWechatDevtoolsHttp, resetWechatIdeFileUtils, resetWechatIdeFileUtilsByHttp, resolveCliPath, resolveDevtoolsAutomationDefaults, resolvePath, resolveProjectAutomatorPort, resolveProjectPath, runAutomatorCommand, runMcpCommand, runMinidev, runRetryableCommand, runWechatCliWithRetry, runWechatIdeEngineBuild, runWechatIdeEngineBuildByHttp, runWithSuspendedSharedInput, scrollTo, setRuntimeWechatDevtoolsServicePort, setWechatIdeTicket, startForwardConsole, startWeappIdeMcpServer, startWechatIdeEngineBuildByHttp, switchTab, systemInfo, takeScreenshot, tap, toSerializableValue, transformArgv, uploadWechatIde, validateWechatCliCommandArgs, waitForExclusiveKeypress, waitForRetryKeypress, withMiniProgram };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as overwriteCustomConfig, A as isAutomatorProtocolTimeoutError, B as getConfig, D as formatAutomatorLoginError, E as connectOpenedAutomator, F as launchAutomator, G as isOperatingSystemSupported, H as resolveDevtoolsAutomationDefaults, I as resolveProjectAutomatorPort, K as operatingSystemName, L as bootstrapWechatDevtoolsSettings, M as isDevtoolsExtensionContextInvalidatedError, N as isDevtoolsHttpPortError, O as getAutomatorProtocolTimeoutMethod, P as isRetryableAutomatorLaunchError, Q as createLocaleConfig, R as detectWechatDevtoolsServicePort, S as waitForExclusiveKeypress, U as SupportedPlatformsMap, V as getConfiguredLocale, W as getDefaultCliPath, X as createAutoTrustProjectConfig, Y as createAutoBootstrapDevtoolsConfig, Z as createCustomConfig, _ as promptRetryKeypress, a as releaseSharedMiniProgram, b as createSharedInputSession, c as RETRY_CANCEL_KEYS, d as createWechatIdeLoginRequiredExitError, et as readCustomConfig, f as extractExecutionErrorText, g as isWechatIdeLoginRequiredExitError, h as isWechatIdeLoginRequiredError, i as getSharedMiniProgramSessionCount, it as resolvePath, j as isAutomatorWsConnectError, k as isAutomatorLoginError, l as RETRY_CONFIRM_KEYS, m as formatWechatIdeLoginRequiredError, n as closeSharedMiniProgram, nt as defaultCustomConfigDirPath, o as withMiniProgram, p as formatRetryHotkeyPrompt, r as connectMiniProgram, rt as defaultCustomConfigFilePath, s as runRetryableCommand, t as acquireSharedMiniProgram, tt as removeCustomConfigKey, u as RETRY_PROMPT_INITIAL_IGNORE_MS, v as promptWechatIdeLoginRetry, x as runWithSuspendedSharedInput, y as waitForRetryKeypress, z as resolveCliPath } from "./automator-session-JEM5q8tK.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { C as parseCompareArgs, S as printScreenshotHelp, _ as AUTOMATOR_COMMAND_NAMES, a as runMinidev, b as runAutomatorCommand, c as runWechatIdeEngineBuild, d as CONFIG_COMMAND_NAME, f as MCP_COMMAND_NAME, g as isWeappIdeTopLevelCommand, h as WECHAT_CLI_COMMAND_NAMES, i as validateWechatCliCommandArgs, l as runWechatIdeEngineBuildByHttp, m as WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, n as parse, o as startForwardConsole, p as MINIDEV_NAMESPACE_COMMAND_NAMES, r as dispatchWechatCliCommand, s as isWechatIdeEngineBuildEndpointMissingError, t as createCli, u as handleConfigCommand, v as getAutomatorCommandHelp, w as printCompareHelp, x as parseScreenshotArgs, y as isAutomatorCommand } from "./cli-
|
|
2
|
+
import { $ as getRuntimeWechatDevtoolsServicePort, A as isWechatIdeLoggedIn, C as clearWechatIdeCache, D as getWechatIdeTestAccounts, E as compileWechatIdeByAutomator, F as quitWechatIde, G as transformArgv, H as execute, I as refreshWechatIdeTicket, J as openWechatIdeProjectByHttp, K as promptForCliPath, L as resetWechatIdeFileUtils, M as openWechatIde, N as openWechatIdeOtherProject, O as getWechatIdeTicket, P as previewWechatIde, Q as startWechatIdeEngineBuildByHttp, R as setWechatIdeTicket, S as buildWechatIdeNpm, T as closeWechatIdeProject, U as createAlias, V as runWechatCliWithRetry, W as createPathCompat, X as requestWechatDevtoolsHttp, Y as pollWechatIdeEngineBuildResultByHttp, Z as resetWechatIdeFileUtilsByHttp, _ as autoPreviewWechatIde, a as navigateBack, b as buildWechatIdeApk, c as pageStack, d as remote, et as setRuntimeWechatDevtoolsServicePort, f as scrollTo, g as tap, h as takeScreenshot, i as input, it as removeOption, j as loginWechatIde, k as getWechatIdeToolInfo, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, nt as readBooleanOption, o as navigateTo, p as switchTab, q as WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, r as currentPage, rt as readOptionValue, s as pageData, t as audit, tt as parseAutomatorArgs, u as redirectTo, v as autoReplayWechatIde, w as clearWechatIdeCacheByAutomator, x as buildWechatIdeIpa, y as autoWechatIde, z as uploadWechatIde } from "./commands-iZ4aJ0BZ.js";
|
|
3
|
+
import { C as parseCompareArgs, S as printScreenshotHelp, _ as AUTOMATOR_COMMAND_NAMES, a as runMinidev, b as runAutomatorCommand, c as runWechatIdeEngineBuild, d as CONFIG_COMMAND_NAME, f as MCP_COMMAND_NAME, g as isWeappIdeTopLevelCommand, h as WECHAT_CLI_COMMAND_NAMES, i as validateWechatCliCommandArgs, l as runWechatIdeEngineBuildByHttp, m as WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, n as parse, o as startForwardConsole, p as MINIDEV_NAMESPACE_COMMAND_NAMES, r as dispatchWechatCliCommand, s as isWechatIdeEngineBuildEndpointMissingError, t as createCli, u as handleConfigCommand, v as getAutomatorCommandHelp, w as printCompareHelp, x as parseScreenshotArgs, y as isAutomatorCommand } from "./cli-cDh7iXGz.js";
|
|
4
4
|
import { a as readElementSnapshot, i as registerWeappIdeMcpTools, n as startWeappIdeMcpServer, o as resolveProjectPath, r as createWeappIdeMcpServer, s as toSerializableValue, t as runMcpCommand } from "./run-mcp-L4shbBPP.js";
|
|
5
|
-
export { AUTOMATOR_COMMAND_NAMES, CONFIG_COMMAND_NAME, MCP_COMMAND_NAME, MINIDEV_NAMESPACE_COMMAND_NAMES, RETRY_CANCEL_KEYS, RETRY_CONFIRM_KEYS, RETRY_PROMPT_INITIAL_IGNORE_MS, SupportedPlatformsMap, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, WECHAT_CLI_COMMAND_NAMES, WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, acquireSharedMiniProgram, audit, autoPreviewWechatIde, autoReplayWechatIde, autoWechatIde, bootstrapWechatDevtoolsSettings, buildWechatIdeApk, buildWechatIdeIpa, buildWechatIdeNpm, captureScreenshotBuffer, clearWechatIdeCache, clearWechatIdeCacheByAutomator, closeSharedMiniProgram, closeWechatIdeProject, compileWechatIdeByAutomator, connectMiniProgram, connectOpenedAutomator, createAlias, createAutoBootstrapDevtoolsConfig, createAutoTrustProjectConfig, createCli, createCustomConfig, createLocaleConfig, createPathCompat, createSharedInputSession, createWeappIdeMcpServer, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, detectWechatDevtoolsServicePort, dispatchWechatCliCommand, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getAutomatorCommandHelp, getAutomatorProtocolTimeoutMethod, getConfig, getConfiguredLocale, getDefaultCliPath, getSharedMiniProgramSessionCount, getWechatIdeTestAccounts, getWechatIdeTicket, getWechatIdeToolInfo, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isAutomatorProtocolTimeoutError, isAutomatorWsConnectError, isDevtoolsExtensionContextInvalidatedError, isDevtoolsHttpPortError, isOperatingSystemSupported, isRetryableAutomatorLaunchError, isWeappIdeTopLevelCommand, isWechatIdeEngineBuildEndpointMissingError, isWechatIdeLoggedIn, isWechatIdeLoginRequiredError, isWechatIdeLoginRequiredExitError, launchAutomator, loginWechatIde, navigateBack, navigateTo, openWechatIde, openWechatIdeOtherProject, openWechatIdeProjectByHttp, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseCompareArgs, parseScreenshotArgs, pollWechatIdeEngineBuildResultByHttp, previewWechatIde, printCompareHelp, printScreenshotHelp, promptForCliPath, promptRetryKeypress, promptWechatIdeLoginRetry, quitWechatIde, reLaunch, readBooleanOption, readCustomConfig, readElementSnapshot, readOptionValue, redirectTo, refreshWechatIdeTicket, registerWeappIdeMcpTools, releaseSharedMiniProgram, remote, removeCustomConfigKey, removeOption, requestWechatDevtoolsHttp, resetWechatIdeFileUtils, resetWechatIdeFileUtilsByHttp, resolveCliPath, resolveDevtoolsAutomationDefaults, resolvePath, resolveProjectAutomatorPort, resolveProjectPath, runAutomatorCommand, runMcpCommand, runMinidev, runRetryableCommand, runWechatCliWithRetry, runWechatIdeEngineBuild, runWechatIdeEngineBuildByHttp, runWithSuspendedSharedInput, scrollTo, setWechatIdeTicket, startForwardConsole, startWeappIdeMcpServer, startWechatIdeEngineBuildByHttp, switchTab, systemInfo, takeScreenshot, tap, toSerializableValue, transformArgv, uploadWechatIde, validateWechatCliCommandArgs, waitForExclusiveKeypress, waitForRetryKeypress, withMiniProgram };
|
|
5
|
+
export { AUTOMATOR_COMMAND_NAMES, CONFIG_COMMAND_NAME, MCP_COMMAND_NAME, MINIDEV_NAMESPACE_COMMAND_NAMES, RETRY_CANCEL_KEYS, RETRY_CONFIRM_KEYS, RETRY_PROMPT_INITIAL_IGNORE_MS, SupportedPlatformsMap, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, WECHAT_CLI_COMMAND_NAMES, WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, acquireSharedMiniProgram, audit, autoPreviewWechatIde, autoReplayWechatIde, autoWechatIde, bootstrapWechatDevtoolsSettings, buildWechatIdeApk, buildWechatIdeIpa, buildWechatIdeNpm, captureScreenshotBuffer, clearWechatIdeCache, clearWechatIdeCacheByAutomator, closeSharedMiniProgram, closeWechatIdeProject, compileWechatIdeByAutomator, connectMiniProgram, connectOpenedAutomator, createAlias, createAutoBootstrapDevtoolsConfig, createAutoTrustProjectConfig, createCli, createCustomConfig, createLocaleConfig, createPathCompat, createSharedInputSession, createWeappIdeMcpServer, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, detectWechatDevtoolsServicePort, dispatchWechatCliCommand, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getAutomatorCommandHelp, getAutomatorProtocolTimeoutMethod, getConfig, getConfiguredLocale, getDefaultCliPath, getRuntimeWechatDevtoolsServicePort, getSharedMiniProgramSessionCount, getWechatIdeTestAccounts, getWechatIdeTicket, getWechatIdeToolInfo, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isAutomatorProtocolTimeoutError, isAutomatorWsConnectError, isDevtoolsExtensionContextInvalidatedError, isDevtoolsHttpPortError, isOperatingSystemSupported, isRetryableAutomatorLaunchError, isWeappIdeTopLevelCommand, isWechatIdeEngineBuildEndpointMissingError, isWechatIdeLoggedIn, isWechatIdeLoginRequiredError, isWechatIdeLoginRequiredExitError, launchAutomator, loginWechatIde, navigateBack, navigateTo, openWechatIde, openWechatIdeOtherProject, openWechatIdeProjectByHttp, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseCompareArgs, parseScreenshotArgs, pollWechatIdeEngineBuildResultByHttp, previewWechatIde, printCompareHelp, printScreenshotHelp, promptForCliPath, promptRetryKeypress, promptWechatIdeLoginRetry, quitWechatIde, reLaunch, readBooleanOption, readCustomConfig, readElementSnapshot, readOptionValue, redirectTo, refreshWechatIdeTicket, registerWeappIdeMcpTools, releaseSharedMiniProgram, remote, removeCustomConfigKey, removeOption, requestWechatDevtoolsHttp, resetWechatIdeFileUtils, resetWechatIdeFileUtilsByHttp, resolveCliPath, resolveDevtoolsAutomationDefaults, resolvePath, resolveProjectAutomatorPort, resolveProjectPath, runAutomatorCommand, runMcpCommand, runMinidev, runRetryableCommand, runWechatCliWithRetry, runWechatIdeEngineBuild, runWechatIdeEngineBuildByHttp, runWithSuspendedSharedInput, scrollTo, setRuntimeWechatDevtoolsServicePort, setWechatIdeTicket, startForwardConsole, startWeappIdeMcpServer, startWechatIdeEngineBuildByHttp, switchTab, systemInfo, takeScreenshot, tap, toSerializableValue, transformArgv, uploadWechatIde, validateWechatCliCommandArgs, waitForExclusiveKeypress, waitForRetryKeypress, withMiniProgram };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-ide-cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.4.
|
|
4
|
+
"version": "5.4.7",
|
|
5
5
|
"description": "让微信开发者工具,用起来更加方便!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"zod": "^4.4.3",
|
|
72
72
|
"@weapp-core/logger": "3.1.1",
|
|
73
73
|
"@weapp-core/shared": "3.0.4",
|
|
74
|
-
"@weapp-vite/devtools-runtime": "0.4.
|
|
75
|
-
"@weapp-vite/miniprogram-automator": "1.2.
|
|
74
|
+
"@weapp-vite/devtools-runtime": "0.4.5",
|
|
75
|
+
"@weapp-vite/miniprogram-automator": "1.2.4"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"dev": "tsdown -w --sourcemap",
|