weapp-ide-cli 6.3.0 → 6.4.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 +2 -0
- package/dist/automator-BqhUtMJp.js +1 -0
- package/dist/{automator-BOe32upt.js → automator-Esp3BjoT.js} +11 -18
- package/dist/{automator-session-VOB03glx.js → automator-session-Ba27VW0_.js} +4 -6
- package/dist/{automatorProject-DjYLqMj6.js → automatorProject-DPU-pEF0.js} +19 -38
- package/dist/{cli-CFlqFpIw.js → cli-Dd1RJ5PH.js} +41 -71
- package/dist/cli.js +3 -4
- package/dist/{commands-mslf7-sP.js → commands-5entj0Rh.js} +5 -7
- package/dist/commands-DR-8MVFm.js +1 -0
- package/dist/{devtoolsProjectOwnership-BMfSAg4n.js → devtoolsProjectOwnership-C4jj8msU.js} +116 -89
- package/dist/index.d.ts +0 -110
- package/dist/index.js +7 -7
- package/dist/{managed-B04Xo9U_.js → managed-hSCZXTon.js} +4 -6
- package/dist/{run-mcp-Ni139Z5C.js → run-mcp-CbmskSgr.js} +4 -7
- package/dist/run-mcp-D1w7-oPp.js +1 -0
- package/package.json +9 -9
- package/dist/automator-VSjgHujY.js +0 -1
- package/dist/commands-DmirGBy4.js +0 -1
- package/dist/run-mcp-83-VKZVA.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as operatingSystemName, B as removeCustomConfigKey, C as registerWechatDevtoolsInstallation, F as createAutoTrustProjectConfig, H as defaultCustomConfigFilePath, I as createCustomConfig, L as createLocaleConfig, M as logger, N as wechatDevtoolsSelectionContext, P as createAutoBootstrapDevtoolsConfig, R as overwriteCustomConfig, S as selectInstalledWechatDevtools, U as resolvePath, d as validateWechatDevtoolsSelection, f as withWechatDevtoolsSelection, j as colors, k as isOperatingSystemSupported, m as assertWechatDevtoolsPort, p as assertWechatDevtoolsHost, u as resolveWechatDevtoolsTarget, w as unregisterWechatDevtoolsInstallation, x as listWechatDevtoolsInstallations, z as readCustomConfig } from "./automatorProject-
|
|
2
|
-
import { a as isManagedWechatProjectFullyReleased, c as resolveManagedJournal, d as assertManagedInstallation, f as inspectManagedProjectHost, l as withManagedJournalLock, o as readManagedRecord, p as sameManagedProcess, s as readManagedWechatProjectRecords, u as writeManagedRecord } from "./devtoolsProjectOwnership-
|
|
3
|
-
import { C as isWechatIdeLoginRequiredError, E as promptWechatIdeLoginRetry, F as parseAutomatorPort, M as i18nText, N as validateLocaleOption, P as resolveAutomatorSessionOptions, a as bootstrapWechatDevtoolsSettings, j as configureLocaleFromArgv, k as runWithSuspendedSharedInput, o as detectWechatDevtoolsServicePort, y as createWechatIdeLoginRequiredExitError } from "./automator-
|
|
4
|
-
import { a as connectConsoleMiniProgram, c as releaseSharedMiniProgram, i as closeSharedMiniProgram, l as withMiniProgram$1, r as closeOwnedSharedMiniProgram, t as acquireConsoleMiniProgram, u as runRetryableCommand } from "./automator-session-
|
|
5
|
-
import { a as navigateBack, c as pageStack, d as remote, f as scrollTo, g as tap, i as input, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, o as navigateTo, p as switchTab, r as currentPage, s as pageData, t as audit, u as redirectTo } from "./commands-
|
|
6
|
-
import "./run-mcp-
|
|
1
|
+
import { A as operatingSystemName, B as removeCustomConfigKey, C as registerWechatDevtoolsInstallation, F as createAutoTrustProjectConfig, H as defaultCustomConfigFilePath, I as createCustomConfig, L as createLocaleConfig, M as logger, N as wechatDevtoolsSelectionContext, P as createAutoBootstrapDevtoolsConfig, R as overwriteCustomConfig, S as selectInstalledWechatDevtools, U as resolvePath, d as validateWechatDevtoolsSelection, f as withWechatDevtoolsSelection, j as colors, k as isOperatingSystemSupported, m as assertWechatDevtoolsPort, p as assertWechatDevtoolsHost, u as resolveWechatDevtoolsTarget, w as unregisterWechatDevtoolsInstallation, x as listWechatDevtoolsInstallations, z as readCustomConfig } from "./automatorProject-DPU-pEF0.js";
|
|
2
|
+
import { a as isManagedWechatProjectFullyReleased, c as resolveManagedJournal, d as assertManagedInstallation, f as inspectManagedProjectHost, l as withManagedJournalLock, o as readManagedRecord, p as sameManagedProcess, s as readManagedWechatProjectRecords, u as writeManagedRecord } from "./devtoolsProjectOwnership-C4jj8msU.js";
|
|
3
|
+
import { C as isWechatIdeLoginRequiredError, E as promptWechatIdeLoginRetry, F as parseAutomatorPort, M as i18nText, N as validateLocaleOption, P as resolveAutomatorSessionOptions, a as bootstrapWechatDevtoolsSettings, j as configureLocaleFromArgv, k as runWithSuspendedSharedInput, o as detectWechatDevtoolsServicePort, y as createWechatIdeLoginRequiredExitError } from "./automator-Esp3BjoT.js";
|
|
4
|
+
import { a as connectConsoleMiniProgram, c as releaseSharedMiniProgram, i as closeSharedMiniProgram, l as withMiniProgram$1, r as closeOwnedSharedMiniProgram, t as acquireConsoleMiniProgram, u as runRetryableCommand } from "./automator-session-Ba27VW0_.js";
|
|
5
|
+
import { a as navigateBack, c as pageStack, d as remote, f as scrollTo, g as tap, i as input, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, o as navigateTo, p as switchTab, r as currentPage, s as pageData, t as audit, u as redirectTo } from "./commands-5entj0Rh.js";
|
|
6
|
+
import "./run-mcp-CbmskSgr.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { inspect } from "node:util";
|
|
9
9
|
import { withMachineE2ELease } from "@weapp-vite/devtools-runtime";
|
|
@@ -16,7 +16,7 @@ import { PNG } from "pngjs";
|
|
|
16
16
|
import pixelmatch from "pixelmatch";
|
|
17
17
|
import { createInterface } from "node:readline/promises";
|
|
18
18
|
import { cac } from "cac";
|
|
19
|
-
|
|
19
|
+
// src/cli/automator-argv.ts
|
|
20
20
|
function parsePositiveInt(raw) {
|
|
21
21
|
const value = Number.parseInt(raw, 10);
|
|
22
22
|
if (!Number.isFinite(value) || value <= 0) return;
|
|
@@ -185,8 +185,7 @@ function removeOption(argv, optionName) {
|
|
|
185
185
|
}
|
|
186
186
|
return nextArgv;
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
//#region src/cli/imageDiff.ts
|
|
188
|
+
// src/cli/imageDiff.ts
|
|
190
189
|
function readPng(buffer, label) {
|
|
191
190
|
try {
|
|
192
191
|
return PNG.sync.read(buffer);
|
|
@@ -224,8 +223,7 @@ async function comparePngWithBaseline(options) {
|
|
|
224
223
|
diffRatio: diffPixels / (currentPng.width * currentPng.height)
|
|
225
224
|
};
|
|
226
225
|
}
|
|
227
|
-
|
|
228
|
-
//#region src/cli/compare.ts
|
|
226
|
+
// src/cli/compare.ts
|
|
229
227
|
function createCliError(message, exitCode, cause) {
|
|
230
228
|
const error = new Error(message, cause ? { cause } : void 0);
|
|
231
229
|
error.exitCode = exitCode;
|
|
@@ -257,7 +255,7 @@ ${colors.bold("参数:")}
|
|
|
257
255
|
--diff-output <path> diff 图片输出路径
|
|
258
256
|
--page <path> 对比前先跳转页面
|
|
259
257
|
--full-page 对比时使用整页长截图
|
|
260
|
-
--threshold <number>
|
|
258
|
+
--threshold <number> OKLab/HyAB 感知色差阈值(默认:0.1)
|
|
261
259
|
--max-diff-pixels <count> 最大允许差异像素数
|
|
262
260
|
--max-diff-ratio <number> 最大允许差异占比(0-1)
|
|
263
261
|
-t, --timeout <ms> 连接超时时间(默认:30000)
|
|
@@ -286,7 +284,7 @@ ${colors.bold("Options:")}
|
|
|
286
284
|
--diff-output <path> Output file path for diff image
|
|
287
285
|
--page <path> Navigate to page before comparison
|
|
288
286
|
--full-page Use stitched full-page screenshots for comparison
|
|
289
|
-
--threshold <number>
|
|
287
|
+
--threshold <number> OKLab/HyAB perceptual threshold (default: 0.1)
|
|
290
288
|
--max-diff-pixels <count> Maximum allowed diff pixels
|
|
291
289
|
--max-diff-ratio <number> Maximum allowed diff ratio (0-1)
|
|
292
290
|
-t, --timeout <ms> Connection timeout in milliseconds (default: 30000)
|
|
@@ -392,8 +390,7 @@ async function runCompare(argv) {
|
|
|
392
390
|
else printCompareSummary(result);
|
|
393
391
|
if (!result.passed) process.exitCode = 1;
|
|
394
392
|
}
|
|
395
|
-
|
|
396
|
-
//#region src/cli/screenshot.ts
|
|
393
|
+
// src/cli/screenshot.ts
|
|
397
394
|
/**
|
|
398
395
|
* @description Print help for screenshot command
|
|
399
396
|
*/
|
|
@@ -494,7 +491,7 @@ async function runScreenshot(argv) {
|
|
|
494
491
|
}
|
|
495
492
|
const options = parseScreenshotArgs(argv);
|
|
496
493
|
const isJsonOutput = argv.includes("--json");
|
|
497
|
-
const { takeScreenshot } = await import("./commands-
|
|
494
|
+
const { takeScreenshot } = await import("./commands-DR-8MVFm.js");
|
|
498
495
|
const result = await takeScreenshot(options);
|
|
499
496
|
if (isJsonOutput) {
|
|
500
497
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -502,8 +499,7 @@ async function runScreenshot(argv) {
|
|
|
502
499
|
}
|
|
503
500
|
if (result.base64) console.log(result.base64);
|
|
504
501
|
}
|
|
505
|
-
|
|
506
|
-
//#region src/cli/runtime-service.ts
|
|
502
|
+
// src/cli/runtime-service.ts
|
|
507
503
|
const DEFAULT_RUNTIME_SERVICE_URL = "http://127.0.0.1:3088/api/weapp/devtools";
|
|
508
504
|
const SERVICE_UNAVAILABLE_CODES = /* @__PURE__ */ new Set([
|
|
509
505
|
"ECONNREFUSED",
|
|
@@ -631,8 +627,7 @@ async function tryRunRuntimeServiceCommand(command, argv) {
|
|
|
631
627
|
const args = parseAutomatorArgs(argv);
|
|
632
628
|
return await runRouteCommand(command, args, baseUrl) || await runInfoCommand(command, args, baseUrl);
|
|
633
629
|
}
|
|
634
|
-
|
|
635
|
-
//#region src/cli/run-automator.ts
|
|
630
|
+
// src/cli/run-automator.ts
|
|
636
631
|
const COMMON_OPTION_DEFINITIONS = [
|
|
637
632
|
{
|
|
638
633
|
flag: "--cli-path <path>",
|
|
@@ -1022,8 +1017,7 @@ async function runAutomatorCommand(command, argv) {
|
|
|
1022
1017
|
args
|
|
1023
1018
|
}));
|
|
1024
1019
|
}
|
|
1025
|
-
|
|
1026
|
-
//#region src/cli/command-catalog.ts
|
|
1020
|
+
// src/cli/command-catalog.ts
|
|
1027
1021
|
const WECHAT_CLI_COMMAND_NAMES = [
|
|
1028
1022
|
"open",
|
|
1029
1023
|
"login",
|
|
@@ -1066,8 +1060,7 @@ const WEAPP_IDE_TOP_LEVEL_COMMAND_SET = new Set(WEAPP_IDE_TOP_LEVEL_COMMAND_NAME
|
|
|
1066
1060
|
function isWeappIdeTopLevelCommand(command) {
|
|
1067
1061
|
return Boolean(command && WEAPP_IDE_TOP_LEVEL_COMMAND_SET.has(command));
|
|
1068
1062
|
}
|
|
1069
|
-
|
|
1070
|
-
//#region src/config/resolver.ts
|
|
1063
|
+
// src/config/resolver.ts
|
|
1071
1064
|
function isCustomConfigJson(value) {
|
|
1072
1065
|
return typeof value === "object" && value !== null;
|
|
1073
1066
|
}
|
|
@@ -1151,8 +1144,7 @@ async function getConfig() {
|
|
|
1151
1144
|
async function getConfiguredLocale() {
|
|
1152
1145
|
return (await readCustomConfig()).locale;
|
|
1153
1146
|
}
|
|
1154
|
-
|
|
1155
|
-
//#region src/cli/prompt.ts
|
|
1147
|
+
// src/cli/prompt.ts
|
|
1156
1148
|
/**
|
|
1157
1149
|
* @description 交互式提示并保存 CLI 路径
|
|
1158
1150
|
*/
|
|
@@ -1188,8 +1180,7 @@ async function promptForCliPath() {
|
|
|
1188
1180
|
}
|
|
1189
1181
|
});
|
|
1190
1182
|
}
|
|
1191
|
-
|
|
1192
|
-
//#region src/cli/resolver.ts
|
|
1183
|
+
// src/cli/resolver.ts
|
|
1193
1184
|
/**
|
|
1194
1185
|
* @description 解析 CLI 路径并校验可用性
|
|
1195
1186
|
*/
|
|
@@ -1204,8 +1195,7 @@ async function resolveCliPath() {
|
|
|
1204
1195
|
source: config.source
|
|
1205
1196
|
};
|
|
1206
1197
|
}
|
|
1207
|
-
|
|
1208
|
-
//#region src/cli/config-command.ts
|
|
1198
|
+
// src/cli/config-command.ts
|
|
1209
1199
|
function parseBooleanConfigValue(rawValue) {
|
|
1210
1200
|
const normalized = rawValue.trim().toLowerCase();
|
|
1211
1201
|
if (normalized === "true" || normalized === "1" || normalized === "on") return true;
|
|
@@ -1359,8 +1349,7 @@ async function handleConfigCommand(argv) {
|
|
|
1359
1349
|
}
|
|
1360
1350
|
throw new Error(i18nText("支持的 config 子命令:lang | set-lang | show | get | set | unset | doctor | import | export", "Supported config subcommands: lang | set-lang | show | get | set | unset | doctor | import | export"));
|
|
1361
1351
|
}
|
|
1362
|
-
|
|
1363
|
-
//#region src/cli/devtoolsSelection.ts
|
|
1352
|
+
// src/cli/devtoolsSelection.ts
|
|
1364
1353
|
const selectionOptions$1 = /* @__PURE__ */ new Map([
|
|
1365
1354
|
["--cli-path", "cliPath"],
|
|
1366
1355
|
["--devtools-channel", "devtoolsChannel"],
|
|
@@ -1479,8 +1468,7 @@ async function withWechatDevtoolsSelectionArgs(argv, runner) {
|
|
|
1479
1468
|
const { args, selection } = splitWechatDevtoolsSelectionArgs(argv);
|
|
1480
1469
|
return Object.keys(selection).length ? await withWechatDevtoolsSelection(selection, () => runner(args)) : await runner(args);
|
|
1481
1470
|
}
|
|
1482
|
-
|
|
1483
|
-
//#region src/cli/managedProjectGate.ts
|
|
1471
|
+
// src/cli/managedProjectGate.ts
|
|
1484
1472
|
function sameTarget(first, second) {
|
|
1485
1473
|
return first.installationId === second.installationId && first.cliPath === second.cliPath && first.appPath === second.appPath && first.profileDir === second.profileDir && first.version === second.version && first.channel === second.channel;
|
|
1486
1474
|
}
|
|
@@ -1525,7 +1513,7 @@ async function ensureManagedWechatProject(target, projectPath, options = {}) {
|
|
|
1525
1513
|
await assertManagedInstallation(target);
|
|
1526
1514
|
options.signal?.throwIfAborted();
|
|
1527
1515
|
if (existing) return existing;
|
|
1528
|
-
const { launchAutomator } = await import("./automator-
|
|
1516
|
+
const { launchAutomator } = await import("./automator-BqhUtMJp.js");
|
|
1529
1517
|
await (await launchAutomator({
|
|
1530
1518
|
target,
|
|
1531
1519
|
cliPath: target.cliPath,
|
|
@@ -1543,8 +1531,7 @@ async function ensureManagedWechatProject(target, projectPath, options = {}) {
|
|
|
1543
1531
|
return confirmed;
|
|
1544
1532
|
});
|
|
1545
1533
|
}
|
|
1546
|
-
|
|
1547
|
-
//#region src/cli/wechatDevtoolsRuntimePort.ts
|
|
1534
|
+
// src/cli/wechatDevtoolsRuntimePort.ts
|
|
1548
1535
|
const runtimePorts = /* @__PURE__ */ new Map();
|
|
1549
1536
|
/**
|
|
1550
1537
|
* @description 标记所选安装检测到的服务端口;无身份的旧调用仅保留在独立兼容槽中。
|
|
@@ -1563,8 +1550,7 @@ function setRuntimeWechatDevtoolsServicePort(port, target) {
|
|
|
1563
1550
|
function getRuntimeWechatDevtoolsServicePort(target) {
|
|
1564
1551
|
return runtimePorts.get(target?.installationId ?? "");
|
|
1565
1552
|
}
|
|
1566
|
-
|
|
1567
|
-
//#region src/cli/http.ts
|
|
1553
|
+
// src/cli/http.ts
|
|
1568
1554
|
const ENGINE_BUILD_NOT_START = "NOT_START";
|
|
1569
1555
|
const ENGINE_BUILD_OPEN_PROJECT = "OPEN_PROJECT";
|
|
1570
1556
|
const ENGINE_BUILD_BUILDING = "BUILDING";
|
|
@@ -1688,8 +1674,7 @@ const WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES = {
|
|
|
1688
1674
|
NOT_START: ENGINE_BUILD_NOT_START,
|
|
1689
1675
|
OPEN_PROJECT: ENGINE_BUILD_OPEN_PROJECT
|
|
1690
1676
|
};
|
|
1691
|
-
|
|
1692
|
-
//#region src/cli/engine.ts
|
|
1677
|
+
// src/cli/engine.ts
|
|
1693
1678
|
function createEngineBuildError(message, code) {
|
|
1694
1679
|
const error = new Error(message);
|
|
1695
1680
|
error.code = code;
|
|
@@ -1904,8 +1889,7 @@ async function prepareAcceptanceProject(projectPath, signal, options = {}) {
|
|
|
1904
1889
|
});
|
|
1905
1890
|
});
|
|
1906
1891
|
}
|
|
1907
|
-
|
|
1908
|
-
//#region src/cli/forwardConsole/refresh.ts
|
|
1892
|
+
// src/cli/forwardConsole/refresh.ts
|
|
1909
1893
|
/** 刷新已有项目的日志开关,并保留日志启用与连接释放的独立错误。 */
|
|
1910
1894
|
async function refreshOpenedMiniProgramConsoleLog(options, enableLog) {
|
|
1911
1895
|
const miniProgram = await connectConsoleMiniProgram({
|
|
@@ -1928,8 +1912,7 @@ async function refreshOpenedMiniProgramConsoleLog(options, enableLog) {
|
|
|
1928
1912
|
}
|
|
1929
1913
|
if (failed) throw failure;
|
|
1930
1914
|
}
|
|
1931
|
-
|
|
1932
|
-
//#region src/cli/forwardConsole.ts
|
|
1915
|
+
// src/cli/forwardConsole.ts
|
|
1933
1916
|
const DEFAULT_FORWARD_CONSOLE_LEVELS = [
|
|
1934
1917
|
"log",
|
|
1935
1918
|
"info",
|
|
@@ -2192,8 +2175,7 @@ async function startForwardConsole(options) {
|
|
|
2192
2175
|
options.onReady?.();
|
|
2193
2176
|
return { close: closeSession };
|
|
2194
2177
|
}
|
|
2195
|
-
|
|
2196
|
-
//#region src/utils/argv.ts
|
|
2178
|
+
// src/utils/argv.ts
|
|
2197
2179
|
function ensurePathArgument(argv, optionIndex) {
|
|
2198
2180
|
const paramIdx = optionIndex + 1;
|
|
2199
2181
|
const param = argv[paramIdx];
|
|
@@ -2231,8 +2213,7 @@ function createPathCompat(option) {
|
|
|
2231
2213
|
return ensurePathArgument(argv, optionIndex);
|
|
2232
2214
|
};
|
|
2233
2215
|
}
|
|
2234
|
-
|
|
2235
|
-
//#region src/utils/exec.ts
|
|
2216
|
+
// src/utils/exec.ts
|
|
2236
2217
|
/**
|
|
2237
2218
|
* @description 执行 CLI 命令并透传输出
|
|
2238
2219
|
*/
|
|
@@ -2248,8 +2229,7 @@ async function execute(cliPath, argv, options = {}) {
|
|
|
2248
2229
|
if (pipeStderr) task?.stderr?.pipe(process.stderr);
|
|
2249
2230
|
return await task;
|
|
2250
2231
|
}
|
|
2251
|
-
|
|
2252
|
-
//#region src/cli/loginQuery.ts
|
|
2232
|
+
// src/cli/loginQuery.ts
|
|
2253
2233
|
/** 读取原生 CLI 的明确登录结果;日志、空输出与相互矛盾的响应均不能证明登录状态。 */
|
|
2254
2234
|
function parseLoginOutput(stdout) {
|
|
2255
2235
|
const login = readWechatLoginState(stdout);
|
|
@@ -2303,8 +2283,7 @@ async function queryWechatIdeLogin(cliPath, options = {}) {
|
|
|
2303
2283
|
};
|
|
2304
2284
|
}
|
|
2305
2285
|
}
|
|
2306
|
-
|
|
2307
|
-
//#region src/cli/minidev.ts
|
|
2286
|
+
// src/cli/minidev.ts
|
|
2308
2287
|
const MINIDEV_COMMAND = "minidev";
|
|
2309
2288
|
function isCommandNotFound(error) {
|
|
2310
2289
|
return Boolean(error && typeof error === "object" && "code" in error && error.code === "ENOENT");
|
|
@@ -2327,8 +2306,7 @@ async function runMinidev(argv) {
|
|
|
2327
2306
|
throw error;
|
|
2328
2307
|
}
|
|
2329
2308
|
}
|
|
2330
|
-
|
|
2331
|
-
//#region src/cli/devtools.ts
|
|
2309
|
+
// src/cli/devtools.ts
|
|
2332
2310
|
/** 本地安装管理不启动 IDE,不更改账号或默认 CLI 配置。 */
|
|
2333
2311
|
async function handleDevtoolsCommand(argv) {
|
|
2334
2312
|
const [action = "list", cliPath] = argv;
|
|
@@ -2343,8 +2321,7 @@ async function handleDevtoolsCommand(argv) {
|
|
|
2343
2321
|
if (action === "add") console.log(JSON.stringify(await registerWechatDevtoolsInstallation(cliPath), null, 2));
|
|
2344
2322
|
else await unregisterWechatDevtoolsInstallation(cliPath);
|
|
2345
2323
|
}
|
|
2346
|
-
|
|
2347
|
-
//#region src/cli/run-login-config.ts
|
|
2324
|
+
// src/cli/run-login-config.ts
|
|
2348
2325
|
function normalizeLoginRetryMode(value, nonInteractive) {
|
|
2349
2326
|
if (value && value !== "never" && value !== "once" && value !== "always") throw new Error(i18nText(`不支持的 --login-retry 值: ${value}(仅支持 never/once/always)`, `Invalid --login-retry value: ${value} (supported: never/once/always)`));
|
|
2350
2327
|
if (value === "never" || value === "once" || value === "always") return value;
|
|
@@ -2381,8 +2358,7 @@ function resolveLoginRetryConfig(argv) {
|
|
|
2381
2358
|
runtimeArgv: stripLoginRetryControlFlags(argv)
|
|
2382
2359
|
};
|
|
2383
2360
|
}
|
|
2384
|
-
|
|
2385
|
-
//#region src/cli/run-login.ts
|
|
2361
|
+
// src/cli/run-login.ts
|
|
2386
2362
|
const IDE_SERVER_STARTED_RE = /IDE server has started,\s*listening on\s+https?:\/\/127\.0\.0\.1:(\d+)/i;
|
|
2387
2363
|
function unwrapWechatCliExecutionError(result) {
|
|
2388
2364
|
return result.kind === "retryable" ? result.error : result.value;
|
|
@@ -2484,8 +2460,7 @@ async function executeWechatCliWithRetry(cliPath, argv, options) {
|
|
|
2484
2460
|
async function runWechatCliWithRetry(cliPath, argv, options = {}) {
|
|
2485
2461
|
return await withMachineE2ELease(() => executeWechatCliWithRetry(cliPath, argv, options));
|
|
2486
2462
|
}
|
|
2487
|
-
|
|
2488
|
-
//#region src/cli/run-wechat-cli.ts
|
|
2463
|
+
// src/cli/run-wechat-cli.ts
|
|
2489
2464
|
function shouldBootstrapWechatDevtools(command) {
|
|
2490
2465
|
return command === "open" || command === "auto" || command === "auto-preview";
|
|
2491
2466
|
}
|
|
@@ -2575,8 +2550,7 @@ async function executeWechatCliCommand(argv, options) {
|
|
|
2575
2550
|
async function runWechatCliCommand(argv, options = {}) {
|
|
2576
2551
|
return await withMachineE2ELease(() => executeWechatCliCommand(argv, options));
|
|
2577
2552
|
}
|
|
2578
|
-
|
|
2579
|
-
//#region src/cli/wechat-command-schema.ts
|
|
2553
|
+
// src/cli/wechat-command-schema.ts
|
|
2580
2554
|
const CACHE_CLEAN_TYPES = [
|
|
2581
2555
|
"storage",
|
|
2582
2556
|
"file",
|
|
@@ -2659,8 +2633,7 @@ function validateWechatCliCommandArgs(argv) {
|
|
|
2659
2633
|
if (!isNonEmptyText(output) || isDistribute === void 0) throw new Error(i18nText("build-ipa 命令缺少必填参数:--output/-o 和 --isDistribute", "build-ipa command requires both --output/-o and --isDistribute"));
|
|
2660
2634
|
}
|
|
2661
2635
|
}
|
|
2662
|
-
|
|
2663
|
-
//#region src/cli/wechat-commands.ts
|
|
2636
|
+
// src/cli/wechat-commands.ts
|
|
2664
2637
|
function selectionOptions(options) {
|
|
2665
2638
|
return Object.fromEntries([
|
|
2666
2639
|
"cliPath",
|
|
@@ -2974,8 +2947,7 @@ async function buildWechatIdeIpa(options) {
|
|
|
2974
2947
|
if (options.versionDesc) argv.push("--versionDesc", options.versionDesc);
|
|
2975
2948
|
await runSelectedCommand(argv, options);
|
|
2976
2949
|
}
|
|
2977
|
-
|
|
2978
|
-
//#region src/cli/wechat-dispatch.ts
|
|
2950
|
+
// src/cli/wechat-dispatch.ts
|
|
2979
2951
|
function hasOption(argv, optionName) {
|
|
2980
2952
|
return argv.includes(optionName) || argv.some((token) => token.startsWith(`${optionName}=`));
|
|
2981
2953
|
}
|
|
@@ -3164,8 +3136,7 @@ async function dispatchWechatCliCommand(argv) {
|
|
|
3164
3136
|
}
|
|
3165
3137
|
return false;
|
|
3166
3138
|
}
|
|
3167
|
-
|
|
3168
|
-
//#region src/cli/run.ts
|
|
3139
|
+
// src/cli/run.ts
|
|
3169
3140
|
const MINIDEV_NAMESPACE = new Set(MINIDEV_NAMESPACE_COMMAND_NAMES);
|
|
3170
3141
|
const ALIPAY_PLATFORM_ALIASES = new Set(MINIDEV_NAMESPACE_COMMAND_NAMES);
|
|
3171
3142
|
const ARG_TRANSFORMS = [
|
|
@@ -3272,7 +3243,7 @@ async function parseSelected(argv) {
|
|
|
3272
3243
|
return;
|
|
3273
3244
|
}
|
|
3274
3245
|
if (matchedCommand === "mcp") {
|
|
3275
|
-
const { runMcpCommand } = await import("./run-mcp-
|
|
3246
|
+
const { runMcpCommand } = await import("./run-mcp-D1w7-oPp.js");
|
|
3276
3247
|
await runMcpCommand(argv.slice(1));
|
|
3277
3248
|
return;
|
|
3278
3249
|
}
|
|
@@ -3301,5 +3272,4 @@ async function parse(argv) {
|
|
|
3301
3272
|
].includes(argv[0] ?? "") || argv.includes("--help") || argv.includes("-h")) return await parseSelected(argv);
|
|
3302
3273
|
return await withWechatDevtoolsSelectionArgs(argv, parseSelected);
|
|
3303
3274
|
}
|
|
3304
|
-
//#endregion
|
|
3305
3275
|
export { getConfig as $, queryWechatIdeLogin as A, WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES as B, refreshWechatIdeTicket as C, validateWechatCliCommandArgs as D, uploadWechatIde as E, startForwardConsole as F, startWechatIdeEngineBuildByHttp as G, pollWechatIdeEngineBuildResultByHttp as H, isWechatIdeEngineBuildEndpointMissingError as I, splitWechatDevtoolsSelectionArgs as J, getRuntimeWechatDevtoolsServicePort as K, prepareAcceptanceProject as L, createAlias as M, createPathCompat as N, runWechatCliWithRetry as O, transformArgv as P, promptForCliPath as Q, runWechatIdeEngineBuild as R, quitWechatIde as S, setWechatIdeTicket as T, requestWechatDevtoolsHttp as U, openWechatIdeProjectByHttp as V, resetWechatIdeFileUtilsByHttp as W, handleConfigCommand as X, withWechatDevtoolsSelectionArgs as Y, resolveCliPath as Z, isWechatIdeLoggedIn as _, readBooleanOption as _t, autoReplayWechatIde as a, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES as at, openWechatIdeOtherProject as b, buildWechatIdeIpa as c, AUTOMATOR_COMMAND_NAMES as ct, clearWechatIdeCacheByAutomator as d, runAutomatorCommand as dt, getConfiguredLocale as et, closeWechatIdeProject as f, parseScreenshotArgs as ft, getWechatIdeToolInfo as g, parseAutomatorArgs as gt, getWechatIdeTicket as h, printCompareHelp as ht, autoPreviewWechatIde as i, MINIDEV_NAMESPACE_COMMAND_NAMES as it, execute as j, runMinidev as k, buildWechatIdeNpm as l, getAutomatorCommandHelp as lt, getWechatIdeTestAccounts as m, parseCompareArgs as mt, parse as n, CONFIG_COMMAND_NAME as nt, autoWechatIde as o, WECHAT_CLI_COMMAND_NAMES as ot, compileWechatIdeByAutomator as p, printScreenshotHelp as pt, setRuntimeWechatDevtoolsServicePort as q, dispatchWechatCliCommand as r, MCP_COMMAND_NAME as rt, buildWechatIdeApk as s, isWeappIdeTopLevelCommand as st, createCli as t, resolveDevtoolsAutomationDefaults as tt, clearWechatIdeCache as u, isAutomatorCommand as ut, loginWechatIde as v, readOptionValue as vt, resetWechatIdeFileUtils as w, previewWechatIde as x, openWechatIde as y, removeOption as yt, runWechatIdeEngineBuildByHttp as z };
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { M as logger } from "./automatorProject-
|
|
2
|
-
import { n as parse } from "./cli-
|
|
1
|
+
import { M as logger } from "./automatorProject-DPU-pEF0.js";
|
|
2
|
+
import { n as parse } from "./cli-Dd1RJ5PH.js";
|
|
3
3
|
import process from "node:process";
|
|
4
|
-
|
|
4
|
+
// src/cli.ts
|
|
5
5
|
const argv = process.argv.slice(2);
|
|
6
6
|
try {
|
|
7
7
|
await parse(argv);
|
|
@@ -11,5 +11,4 @@ try {
|
|
|
11
11
|
else if (typeof err?.code === "number") process.exitCode = err.code;
|
|
12
12
|
else process.exitCode = 1;
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { M as logger, j as colors } from "./automatorProject-
|
|
2
|
-
import { M as i18nText } from "./automator-
|
|
3
|
-
import { l as withMiniProgram } from "./automator-session-
|
|
1
|
+
import { M as logger, j as colors } from "./automatorProject-DPU-pEF0.js";
|
|
2
|
+
import { M as i18nText } from "./automator-Esp3BjoT.js";
|
|
3
|
+
import { l as withMiniProgram } from "./automator-session-Ba27VW0_.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
7
7
|
import { PNG } from "pngjs";
|
|
8
|
-
|
|
8
|
+
// src/cli/fullPageScreenshot.ts
|
|
9
9
|
const MAX_FULL_PAGE_CAPTURES = 200;
|
|
10
10
|
const DEVTOOLS_INSPECTEE_REFERENCE_ERROR = /__inspectee__ is not defined|Can't find variable:\s*__inspectee__/i;
|
|
11
11
|
function decodeScreenshotBuffer(raw) {
|
|
@@ -224,8 +224,7 @@ async function captureFullPageScreenshotBuffer(options) {
|
|
|
224
224
|
}
|
|
225
225
|
return PNG.sync.write(merged);
|
|
226
226
|
}
|
|
227
|
-
|
|
228
|
-
//#region src/cli/commands.ts
|
|
227
|
+
// src/cli/commands.ts
|
|
229
228
|
function createTimeoutError(message, code) {
|
|
230
229
|
const error = new Error(message);
|
|
231
230
|
error.code = code;
|
|
@@ -525,5 +524,4 @@ async function remote(options) {
|
|
|
525
524
|
logger.success(enable ? i18nText("远程调试已开启", "Remote debugging enabled") : i18nText("远程调试已关闭", "Remote debugging disabled"));
|
|
526
525
|
});
|
|
527
526
|
}
|
|
528
|
-
//#endregion
|
|
529
527
|
export { navigateBack as a, pageStack as c, remote as d, scrollTo as f, tap as g, takeScreenshot as h, input as i, reLaunch as l, systemInfo as m, captureScreenshotBuffer as n, navigateTo as o, switchTab as p, currentPage as r, pageData as s, audit as t, redirectTo as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { h as takeScreenshot } from "./commands-5entj0Rh.js";
|