weapp-ide-cli 5.4.12 → 6.0.1
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-BBXXj7vb.js → cli-DmeQRhOO.js} +9 -8
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands-C8UlE6XD.js +2 -0
- package/dist/{commands-CK4N5Nel.js → commands-CUPNG3V_.js} +1 -1
- package/dist/index.js +2 -2
- package/package.json +7 -7
- package/dist/commands-DKiKnVKp.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, a as releaseSharedMiniProgram, et as readCustomConfig, q as colors, r as connectMiniProgram, rt as defaultCustomConfigFilePath, t as acquireSharedMiniProgram, tt as removeCustomConfigKey, w as i18nText, z as resolveCliPath } from "./automator-session-ec0i76Cx.js";
|
|
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-
|
|
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-CUPNG3V_.js";
|
|
3
3
|
import "./run-mcp-DPz-bwrD.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-C8UlE6XD.js");
|
|
317
317
|
const result = await takeScreenshot(options);
|
|
318
318
|
if (isJsonOutput) {
|
|
319
319
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -1255,11 +1255,11 @@ async function refreshOpenedMiniProgramConsoleLog(options) {
|
|
|
1255
1255
|
miniProgram.disconnect();
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
1258
|
-
function startEnableLogRefresh(miniProgram, options) {
|
|
1258
|
+
function startEnableLogRefresh(miniProgram, options, refreshOpenedSession) {
|
|
1259
1259
|
if (typeof miniProgram.enableLog !== "function") return;
|
|
1260
1260
|
const timer = setInterval(() => {
|
|
1261
1261
|
miniProgram.enableLog().catch(() => {});
|
|
1262
|
-
refreshOpenedMiniProgramConsoleLog(options).catch(() => {});
|
|
1262
|
+
if (refreshOpenedSession) refreshOpenedMiniProgramConsoleLog(options).catch(() => {});
|
|
1263
1263
|
}, ENABLE_LOG_REFRESH_INTERVAL_MS);
|
|
1264
1264
|
return () => {
|
|
1265
1265
|
clearInterval(timer);
|
|
@@ -1269,7 +1269,8 @@ function startEnableLogRefresh(miniProgram, options) {
|
|
|
1269
1269
|
* @description 启动小程序控制台日志转发,并保持 automator 会话常驻。
|
|
1270
1270
|
*/
|
|
1271
1271
|
async function startForwardConsole(options) {
|
|
1272
|
-
const
|
|
1272
|
+
const usesSharedSession = !options.miniProgram;
|
|
1273
|
+
const miniProgram = options.miniProgram ?? await acquireSharedMiniProgram(options);
|
|
1273
1274
|
const logLevels = new Set(options.logLevels?.length ? options.logLevels : DEFAULT_FORWARD_CONSOLE_LEVELS);
|
|
1274
1275
|
const logHandler = options.onLog ?? printForwardConsoleEvent;
|
|
1275
1276
|
const recentLogTimes = /* @__PURE__ */ new Map();
|
|
@@ -1310,7 +1311,7 @@ async function startForwardConsole(options) {
|
|
|
1310
1311
|
auxiliaryMiniProgram.disconnect();
|
|
1311
1312
|
auxiliaryMiniProgram = void 0;
|
|
1312
1313
|
}
|
|
1313
|
-
releaseSharedMiniProgram(options.projectPath, options.sessionId || options.port);
|
|
1314
|
+
if (usesSharedSession) releaseSharedMiniProgram(options.projectPath, options.sessionId || options.port);
|
|
1314
1315
|
};
|
|
1315
1316
|
try {
|
|
1316
1317
|
await enableMiniProgramConsoleLog(miniProgram);
|
|
@@ -1320,8 +1321,8 @@ async function startForwardConsole(options) {
|
|
|
1320
1321
|
}
|
|
1321
1322
|
miniProgram.on("console", onConsole);
|
|
1322
1323
|
miniProgram.on("exception", onException);
|
|
1323
|
-
stopEnableLogRefresh = startEnableLogRefresh(miniProgram, options);
|
|
1324
|
-
auxiliaryTimer = setTimeout(() => {
|
|
1324
|
+
stopEnableLogRefresh = startEnableLogRefresh(miniProgram, options, usesSharedSession);
|
|
1325
|
+
if (usesSharedSession) auxiliaryTimer = setTimeout(() => {
|
|
1325
1326
|
(async () => {
|
|
1326
1327
|
const openedMiniProgram = await connectMiniProgram({
|
|
1327
1328
|
...options,
|
package/dist/cli.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/cli.js
CHANGED
|
@@ -1109,7 +1109,7 @@ async function requireElement(page, selector, timeoutMs = 5e3) {
|
|
|
1109
1109
|
let lastError;
|
|
1110
1110
|
while (Date.now() - startedAt <= timeoutMs) {
|
|
1111
1111
|
try {
|
|
1112
|
-
const element = await page.$(selector);
|
|
1112
|
+
const element = await page.$(selector, { fallback: false });
|
|
1113
1113
|
if (element) return element;
|
|
1114
1114
|
} catch (error) {
|
|
1115
1115
|
lastError = error;
|
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-ec0i76Cx.js";
|
|
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-
|
|
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-CUPNG3V_.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-DmeQRhOO.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-DPz-bwrD.js";
|
|
5
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": "
|
|
4
|
+
"version": "6.0.1",
|
|
5
5
|
"description": "让微信开发者工具,用起来更加方便!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -55,24 +55,24 @@
|
|
|
55
55
|
"dist"
|
|
56
56
|
],
|
|
57
57
|
"engines": {
|
|
58
|
-
"node": "
|
|
58
|
+
"node": ">=22"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public",
|
|
62
62
|
"registry": "https://registry.npmjs.org/"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
65
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
66
66
|
"cac": "^7.0.0",
|
|
67
|
-
"execa": "
|
|
67
|
+
"execa": "10.0.0",
|
|
68
68
|
"pathe": "^2.0.3",
|
|
69
69
|
"pixelmatch": "^7.2.0",
|
|
70
70
|
"pngjs": "^7.0.0",
|
|
71
71
|
"zod": "^4.4.3",
|
|
72
72
|
"@weapp-core/logger": "3.1.1",
|
|
73
|
-
"@weapp-core/shared": "3.0
|
|
74
|
-
"@weapp-vite/devtools-runtime": "0.4.
|
|
75
|
-
"@weapp-vite/miniprogram-automator": "1.2.
|
|
73
|
+
"@weapp-core/shared": "3.1.0",
|
|
74
|
+
"@weapp-vite/devtools-runtime": "0.4.10",
|
|
75
|
+
"@weapp-vite/miniprogram-automator": "1.2.9"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"dev": "tsdown -w --sourcemap",
|