weapp-vite 6.16.47 → 6.17.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/dist/auto-routes.mjs +1 -1
- package/dist/cli.mjs +121 -27
- package/dist/{config-Ds7MBgQm.d.mts → config-Cxi7xvCa.d.mts} +6 -0
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-BJPEU7dU.mjs → createContext-C-aCFA7T.mjs} +610 -148
- package/dist/file-BrdaHBHs.mjs +2 -0
- package/dist/{file-_O6M6mJG.mjs → file-Byezg0ta.mjs} +1 -1
- package/dist/getInstance-COXqNkGN.mjs +2 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/json.d.mts +1 -1
- package/dist/{mcp-YXCIQr-Z.mjs → mcp-BG6TliEg.mjs} +6 -2
- package/dist/mcp.d.mts +1 -1
- package/dist/mcp.mjs +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +9 -7
- package/dist/file-BQG0E0sq.mjs +0 -2
- package/dist/getInstance-BwXyeue5.mjs +0 -2
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getRouteRuntimeGlobalKeys, n as getCompilerContext } from "./createContext-
|
|
1
|
+
import { g as getRouteRuntimeGlobalKeys, n as getCompilerContext } from "./createContext-C-aCFA7T.mjs";
|
|
2
2
|
//#region src/auto-routes.ts
|
|
3
3
|
const ROUTE_RUNTIME_OVERRIDE_KEY = Symbol.for("weapp-vite.route-runtime");
|
|
4
4
|
function createGetter(resolver) {
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as createCjsConfigLoadError, E as isPathInside, S as parseCommentJson, T as shouldPassPlatformArgToIdeOpen, _ as createBuildScopeConfigFromCli, a as formatBytes, b as getProjectConfigFileName, d as syncProjectSupportFiles, f as syncManagedTsconfigBootstrapFiles, h as resolveHmrProfileJsonPath, m as SHARED_CHUNK_VIRTUAL_PREFIX, p as createSharedBuildConfig, t as createCompilerContext, u as resolveWeappViteTarget, v as resolveWeappConfigFile, w as getDefaultIdeProjectRoot, x as loadViteConfigFile, y as checkRuntime } from "./createContext-
|
|
1
|
+
import { C as createCjsConfigLoadError, E as isPathInside, S as parseCommentJson, T as shouldPassPlatformArgToIdeOpen, _ as createBuildScopeConfigFromCli, a as formatBytes, b as getProjectConfigFileName, d as syncProjectSupportFiles, f as syncManagedTsconfigBootstrapFiles, h as resolveHmrProfileJsonPath, m as SHARED_CHUNK_VIRTUAL_PREFIX, p as createSharedBuildConfig, t as createCompilerContext, u as resolveWeappViteTarget, v as resolveWeappConfigFile, w as getDefaultIdeProjectRoot, x as loadViteConfigFile, y as checkRuntime } from "./createContext-C-aCFA7T.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-mt4mSTqV.mjs";
|
|
3
|
-
import { h as VERSION } from "./file-
|
|
4
|
-
import { c as startWeappViteMcpServer, l as detectAiDevelopmentEnvironment, s as resolveWeappMcpConfig } from "./mcp-
|
|
3
|
+
import { h as VERSION } from "./file-Byezg0ta.mjs";
|
|
4
|
+
import { c as startWeappViteMcpServer, l as detectAiDevelopmentEnvironment, s as resolveWeappMcpConfig } from "./mcp-BG6TliEg.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import path, { posix } from "pathe";
|
|
7
7
|
import path$1 from "node:path";
|
|
@@ -247,6 +247,35 @@ async function closeIde$1() {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
//#endregion
|
|
250
|
+
//#region src/cli/openIde/diagnostics.ts
|
|
251
|
+
/**
|
|
252
|
+
* @description 输出微信开发者工具打开后的自助恢复步骤。
|
|
253
|
+
*/
|
|
254
|
+
function logWechatIdeRecoveryHint(options) {
|
|
255
|
+
const lines = [
|
|
256
|
+
`微信开发者工具打开后状态可能不稳定:${options.reason}`,
|
|
257
|
+
"可按下面顺序恢复:",
|
|
258
|
+
"1. 在微信开发者工具中确认:设置 -> 安全设置 -> 服务端口已开启。",
|
|
259
|
+
"2. 仅当项目索引刷新失败时,默认会自动关闭并重开一次当前目标项目;如需跳过,传入 `--no-open-recovery` 或设置 `WEAPP_VITE_DISABLE_IDE_OPEN_RECOVERY=1`。",
|
|
260
|
+
"3. 如果仍然回到项目选择页,手动导入 project.config.json 所在目录,并关闭多余的微信开发者工具窗口后重试。",
|
|
261
|
+
"4. 需要查看底层错误时,设置 `WEAPP_VITE_DEBUG_AUTOMATOR_OPEN=1` 后重试。"
|
|
262
|
+
];
|
|
263
|
+
if (options.projectPath) lines.push(`当前目标项目目录:${options.projectPath}`);
|
|
264
|
+
logger_default.warn(lines.join("\n"));
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* @description 输出服务端口关闭时的定向恢复提示。
|
|
268
|
+
*/
|
|
269
|
+
function logWechatIdeServicePortDisabledHint(projectPath) {
|
|
270
|
+
const lines = [
|
|
271
|
+
"检测到微信开发者工具服务端口当前处于关闭状态,已保留用户设置并回退到普通 open 流程。",
|
|
272
|
+
"自动刷新、截图、MCP 和 IDE 联动能力需要服务端口。",
|
|
273
|
+
"请在微信开发者工具中打开:设置 -> 安全设置 -> 服务端口,然后重新执行当前 dev/open 命令。"
|
|
274
|
+
];
|
|
275
|
+
if (projectPath) lines.push(`当前目标项目目录:${projectPath}`);
|
|
276
|
+
logger_default.warn(lines.join("\n"));
|
|
277
|
+
}
|
|
278
|
+
//#endregion
|
|
250
279
|
//#region src/cli/openIde/reuse.ts
|
|
251
280
|
function formatReuseOpenedWechatIdePrompt() {
|
|
252
281
|
return `目标项目已在微信开发者工具中打开,已跳过重复打开。按 ${colors.bold(colors.green("r"))} 关闭当前窗口后重新打开。`;
|
|
@@ -316,6 +345,11 @@ function shouldLogAutomatorFallbackError() {
|
|
|
316
345
|
const flag = process.env.WEAPP_VITE_DEBUG_AUTOMATOR_OPEN;
|
|
317
346
|
return flag === "1" || flag === "true";
|
|
318
347
|
}
|
|
348
|
+
function isWechatIdeOpenRecoveryDisabled(options) {
|
|
349
|
+
if (options.openRecovery === false) return true;
|
|
350
|
+
const flag = process.env.WEAPP_VITE_DISABLE_IDE_OPEN_RECOVERY;
|
|
351
|
+
return flag === "1" || flag === "true";
|
|
352
|
+
}
|
|
319
353
|
/**
|
|
320
354
|
* @description 执行 IDE 打开流程,并在登录失效时允许按键重试。
|
|
321
355
|
*/
|
|
@@ -366,6 +400,16 @@ function appendLoginRetryArgv(argv, options) {
|
|
|
366
400
|
if (options.loginRetryTimeout) argv.push("--login-retry-timeout", options.loginRetryTimeout);
|
|
367
401
|
return argv;
|
|
368
402
|
}
|
|
403
|
+
function createIdeOpenArgv(platform, projectPath, options = {}) {
|
|
404
|
+
const argv = ["open", "-p"];
|
|
405
|
+
if (projectPath) argv.push(projectPath);
|
|
406
|
+
if (platform === "weapp" && options.trustProject !== false) argv.push("--trust-project");
|
|
407
|
+
if (platform && shouldPassPlatformArgToIdeOpen(platform)) argv.push("--platform", platform);
|
|
408
|
+
if (options.nonInteractive) argv.push("--non-interactive");
|
|
409
|
+
if (options.loginRetry) argv.push("--login-retry", options.loginRetry);
|
|
410
|
+
if (options.loginRetryTimeout) argv.push("--login-retry-timeout", options.loginRetryTimeout);
|
|
411
|
+
return argv;
|
|
412
|
+
}
|
|
369
413
|
async function prepareOpenedWechatIdeAutomatorSession(projectPath, options) {
|
|
370
414
|
try {
|
|
371
415
|
(await launchAutomator({
|
|
@@ -376,13 +420,26 @@ async function prepareOpenedWechatIdeAutomatorSession(projectPath, options) {
|
|
|
376
420
|
timeout: 3e4,
|
|
377
421
|
trustProject: options.trustProject !== false
|
|
378
422
|
})).disconnect?.();
|
|
423
|
+
return { ok: true };
|
|
379
424
|
} catch (error) {
|
|
380
425
|
logger_default.warn("准备当前项目的微信开发者工具自动化会话失败,截图、MCP 或 IDE 联动命令首次运行时将重新连接。");
|
|
426
|
+
logWechatIdeRecoveryHint({
|
|
427
|
+
projectPath,
|
|
428
|
+
reason: "无法建立当前项目的自动化会话,常见原因是 DevTools 服务端口未就绪、窗口停留在项目选择页,或存在残留 DevTools 会话。"
|
|
429
|
+
});
|
|
381
430
|
if (shouldLogAutomatorFallbackError()) logger_default.error(error);
|
|
431
|
+
return {
|
|
432
|
+
ok: false,
|
|
433
|
+
reason: "automator-session-failed",
|
|
434
|
+
error
|
|
435
|
+
};
|
|
382
436
|
}
|
|
383
437
|
}
|
|
384
438
|
async function stabilizeOpenedWechatIdeProject(projectPath, servicePortEnabled, options = {}) {
|
|
385
|
-
if (servicePortEnabled === false) return
|
|
439
|
+
if (servicePortEnabled === false) return {
|
|
440
|
+
ok: false,
|
|
441
|
+
reason: "service-port-disabled"
|
|
442
|
+
};
|
|
386
443
|
try {
|
|
387
444
|
await executeWechatIdeCliCommand(appendLoginRetryArgv([
|
|
388
445
|
"reset-fileutils",
|
|
@@ -390,7 +447,7 @@ async function stabilizeOpenedWechatIdeProject(projectPath, servicePortEnabled,
|
|
|
390
447
|
projectPath
|
|
391
448
|
], options), {
|
|
392
449
|
automatorMode: options.useAutomatorOpen === false ? "skip" : "prefer",
|
|
393
|
-
httpMode: "
|
|
450
|
+
httpMode: "require",
|
|
394
451
|
onNonLoginError: (error) => logger_default.error(error),
|
|
395
452
|
preserveProjectRoot: options.useAutomatorOpen === false,
|
|
396
453
|
projectPath
|
|
@@ -422,21 +479,53 @@ async function stabilizeOpenedWechatIdeProject(projectPath, servicePortEnabled,
|
|
|
422
479
|
} catch (error) {
|
|
423
480
|
if (shouldLogAutomatorFallbackError()) logger_default.error(error);
|
|
424
481
|
}
|
|
482
|
+
return { ok: true };
|
|
425
483
|
} catch (error) {
|
|
426
484
|
if (isWechatIdeLoginRequiredExitError(error)) throw error;
|
|
427
485
|
logger_default.warn("刷新微信开发者工具项目索引失败,已保留当前打开状态;如模拟器仍显示旧状态,可手动刷新一次。");
|
|
486
|
+
logWechatIdeRecoveryHint({
|
|
487
|
+
projectPath,
|
|
488
|
+
reason: "打开项目后的文件索引刷新失败,DevTools 可能仍在使用旧项目状态或内部服务未就绪。"
|
|
489
|
+
});
|
|
428
490
|
if (shouldLogAutomatorFallbackError()) logger_default.error(error);
|
|
491
|
+
return {
|
|
492
|
+
ok: false,
|
|
493
|
+
reason: "index-refresh-failed",
|
|
494
|
+
error
|
|
495
|
+
};
|
|
429
496
|
}
|
|
430
497
|
}
|
|
431
|
-
function
|
|
432
|
-
const
|
|
433
|
-
if (
|
|
434
|
-
if (
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
if (
|
|
439
|
-
return
|
|
498
|
+
async function verifyOpenedWechatIdeProject(projectPath, servicePortEnabled, options) {
|
|
499
|
+
const stabilizeResult = await stabilizeOpenedWechatIdeProject(projectPath, servicePortEnabled, options);
|
|
500
|
+
if (!stabilizeResult.ok) return stabilizeResult;
|
|
501
|
+
if (options.useAutomatorOpen === false && servicePortEnabled !== false) return await prepareOpenedWechatIdeAutomatorSession(projectPath, options);
|
|
502
|
+
return stabilizeResult;
|
|
503
|
+
}
|
|
504
|
+
function formatWechatIdeOpenHealthReason(result) {
|
|
505
|
+
if (result.reason === "index-refresh-failed") return "项目索引刷新失败";
|
|
506
|
+
return "服务端口未开启";
|
|
507
|
+
}
|
|
508
|
+
async function recoverOpenedWechatIdeProject(platform, projectPath, servicePortEnabled, options, failedResult) {
|
|
509
|
+
if (failedResult.reason === "service-port-disabled") return failedResult;
|
|
510
|
+
if (failedResult.reason === "automator-session-failed") {
|
|
511
|
+
logger_default.warn("已跳过微信开发者工具自动恢复;自动化会话预热失败不影响当前项目打开,截图、MCP 或 IDE 联动命令首次运行时会重新连接。");
|
|
512
|
+
return failedResult;
|
|
513
|
+
}
|
|
514
|
+
if (isWechatIdeOpenRecoveryDisabled(options)) {
|
|
515
|
+
logger_default.warn("已跳过微信开发者工具自动恢复;请按上方提示手动关闭并重新打开目标项目。");
|
|
516
|
+
return failedResult;
|
|
517
|
+
}
|
|
518
|
+
logger_default.info(`检测到微信开发者工具打开后状态不稳定(${formatWechatIdeOpenHealthReason(failedResult)}),正在自动关闭并重新打开目标项目...`);
|
|
519
|
+
if (!await closeIde()) logger_default.warn("自动恢复时关闭当前微信开发者工具失败,仍继续尝试重新打开目标项目。");
|
|
520
|
+
await runWechatIdeOpenWithRetry(createIdeOpenArgv(platform, projectPath, options));
|
|
521
|
+
const recoveredResult = await verifyOpenedWechatIdeProject(projectPath, servicePortEnabled, options);
|
|
522
|
+
if (recoveredResult.ok) logger_default.info("微信开发者工具已完成自动恢复。");
|
|
523
|
+
else logger_default.warn("微信开发者工具自动恢复未完成;可设置 `WEAPP_VITE_DISABLE_IDE_OPEN_RECOVERY=1` 或传入 `--no-open-recovery` 跳过自动关闭重开,并按提示手动处理。");
|
|
524
|
+
return recoveredResult;
|
|
525
|
+
}
|
|
526
|
+
async function verifyAndRecoverOpenedWechatIdeProject(platform, projectPath, servicePortEnabled, options) {
|
|
527
|
+
const healthResult = await verifyOpenedWechatIdeProject(projectPath, servicePortEnabled, options);
|
|
528
|
+
if (!healthResult.ok) await recoverOpenedWechatIdeProject(platform, projectPath, servicePortEnabled, options, healthResult);
|
|
440
529
|
}
|
|
441
530
|
async function openIde(platform, projectPath, options = {}) {
|
|
442
531
|
let bootstrapResult;
|
|
@@ -454,12 +543,12 @@ async function openIde(platform, projectPath, options = {}) {
|
|
|
454
543
|
logger_default.warn("检测微信开发者工具服务端口或写入项目信任状态失败,继续执行 open 流程。");
|
|
455
544
|
logger_default.error(error);
|
|
456
545
|
}
|
|
457
|
-
if (platform === "weapp" && projectPath && bootstrapResult?.servicePortEnabled === false)
|
|
546
|
+
if (platform === "weapp" && projectPath && bootstrapResult?.servicePortEnabled === false) logWechatIdeServicePortDisabledHint(projectPath);
|
|
458
547
|
if (platform === "weapp" && projectPath && normalizedOptions.trustProject !== false && bootstrapResult?.servicePortEnabled !== false && useAutomatorOpen) try {
|
|
459
548
|
const openResult = await tryOpenWechatIdeByAutomator(projectPath, normalizedOptions);
|
|
460
549
|
if (openResult === "reused") return;
|
|
461
550
|
if (openResult) {
|
|
462
|
-
await
|
|
551
|
+
await verifyAndRecoverOpenedWechatIdeProject(platform, projectPath, bootstrapResult?.servicePortEnabled, normalizedOptions);
|
|
463
552
|
return;
|
|
464
553
|
}
|
|
465
554
|
} catch (error) {
|
|
@@ -474,10 +563,7 @@ async function openIde(platform, projectPath, options = {}) {
|
|
|
474
563
|
if (!await closeIde()) logger_default.warn("关闭当前微信开发者工具失败,仍继续尝试打开目标项目。");
|
|
475
564
|
}
|
|
476
565
|
await runWechatIdeOpenWithRetry(createIdeOpenArgv(platform, projectPath, normalizedOptions));
|
|
477
|
-
if (platform === "weapp" && projectPath)
|
|
478
|
-
await stabilizeOpenedWechatIdeProject(projectPath, bootstrapResult?.servicePortEnabled, normalizedOptions);
|
|
479
|
-
if (!useAutomatorOpen && bootstrapResult?.servicePortEnabled !== false) await prepareOpenedWechatIdeAutomatorSession(projectPath, normalizedOptions);
|
|
480
|
-
}
|
|
566
|
+
if (platform === "weapp" && projectPath) await verifyAndRecoverOpenedWechatIdeProject(platform, projectPath, bootstrapResult?.servicePortEnabled, normalizedOptions);
|
|
481
567
|
}
|
|
482
568
|
/**
|
|
483
569
|
* @description 解析 IDE 相关命令所需的平台、项目目录与配置上下文。
|
|
@@ -2475,7 +2561,7 @@ function emitDashboardEvents$1(handle, events) {
|
|
|
2475
2561
|
handle?.emitRuntimeEvents(events);
|
|
2476
2562
|
}
|
|
2477
2563
|
function registerBuildCommand(cli) {
|
|
2478
|
-
cli.command("build [root]", "build for production").option("--target <target>", `[string] transpile target (default: 'modules')`).option("--outDir <dir>", `[string] output directory (default: dist)`).option("-p, --platform <platform>", `[string] target platform (weapp | web | all)`).option("--project-config <path>", `[string] project config path (miniprogram only)`).option("--sourcemap [output]", `[boolean | "inline" | "hidden"] output source maps for build (default: false)`).option("--minify [minifier]", "[boolean | \"terser\" | \"esbuild\"] enable/disable minification, or specify minifier to use (default: esbuild)").option("--emptyOutDir", `[boolean] force empty outDir when it's outside of root`).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).option("--ui", `[boolean] 启动调试 UI(当前提供分析视图)`, { default: false }).option("--analyze", `[boolean] 输出分包分析仪表盘`, { default: false }).option("--scope <scope>", `[string] 局部构建范围,例如 main,packages/order`).action(async (root, options) => {
|
|
2564
|
+
cli.command("build [root]", "build for production").option("--target <target>", `[string] transpile target (default: 'modules')`).option("--outDir <dir>", `[string] output directory (default: dist)`).option("-p, --platform <platform>", `[string] target platform (weapp | web | all)`).option("--project-config <path>", `[string] project config path (miniprogram only)`).option("--sourcemap [output]", `[boolean | "inline" | "hidden"] output source maps for build (default: false)`).option("--minify [minifier]", "[boolean | \"terser\" | \"esbuild\"] enable/disable minification, or specify minifier to use (default: esbuild)").option("--emptyOutDir", `[boolean] force empty outDir when it's outside of root`).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).option("--no-open-recovery", "[boolean] disable automatic Wechat DevTools close-and-reopen recovery").option("--ui", `[boolean] 启动调试 UI(当前提供分析视图)`, { default: false }).option("--analyze", `[boolean] 输出分包分析仪表盘`, { default: false }).option("--scope <scope>", `[string] 局部构建范围,例如 main,packages/order`).action(async (root, options) => {
|
|
2479
2565
|
filterDuplicateOptions(options);
|
|
2480
2566
|
const cwd = root ?? process.cwd();
|
|
2481
2567
|
const configFile = resolveConfigFile(options);
|
|
@@ -2572,7 +2658,10 @@ function registerBuildCommand(cli) {
|
|
|
2572
2658
|
detail: "构建完成后准备打开 IDE 项目。",
|
|
2573
2659
|
tags: ["ide", "open"]
|
|
2574
2660
|
}]);
|
|
2575
|
-
await openIde(configService.platform, resolveIdeProjectPath(configService.mpDistRoot), {
|
|
2661
|
+
await openIde(configService.platform, resolveIdeProjectPath(configService.mpDistRoot), {
|
|
2662
|
+
openRecovery: options.openRecovery,
|
|
2663
|
+
trustProject: options.trustProject
|
|
2664
|
+
});
|
|
2576
2665
|
}
|
|
2577
2666
|
if (analyzeHandle) await analyzeHandle.waitForExit();
|
|
2578
2667
|
ctx.watcherService?.closeAll();
|
|
@@ -3017,7 +3106,10 @@ async function runIdeCommand(action, root, options) {
|
|
|
3017
3106
|
logger_default.info(`已完成微信开发者工具配置预热:扫描实例 ${result.touchedInstanceCount} 个,检测服务端口配置 ${result.detectedSecurityCount} 处,写入项目信任 ${result.trustedProjectCount} 处。`);
|
|
3018
3107
|
return;
|
|
3019
3108
|
}
|
|
3020
|
-
if (options.open) await openIde(resolved.platform, resolved.projectPath, {
|
|
3109
|
+
if (options.open) await openIde(resolved.platform, resolved.projectPath, {
|
|
3110
|
+
openRecovery: options.openRecovery,
|
|
3111
|
+
trustProject: options.trustProject
|
|
3112
|
+
});
|
|
3021
3113
|
if (action === "info") {
|
|
3022
3114
|
const result = await getWechatIdeToolInfo({ projectPath: resolved.projectPath });
|
|
3023
3115
|
logger_default.info(formatIdeOutput(result, options));
|
|
@@ -3076,7 +3168,7 @@ async function runIdeCommand(action, root, options) {
|
|
|
3076
3168
|
* @description 注册 IDE 相关子命令。
|
|
3077
3169
|
*/
|
|
3078
3170
|
function registerIdeCommand(cli) {
|
|
3079
|
-
cli.command("ide [action] [root]", "run Wechat DevTools utility actions and log bridge commands").option("-o, --open", "[boolean] open ide before attaching log bridge").option("-p, --platform <platform>", "[string] target platform (weapp | web)").option("--project-config <path>", "[string] project config path (miniprogram only)").option("--ticket <value>", "[string] ticket used by `ide ticket:set`").option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).action(async (action, root, options) => {
|
|
3171
|
+
cli.command("ide [action] [root]", "run Wechat DevTools utility actions and log bridge commands").option("-o, --open", "[boolean] open ide before attaching log bridge").option("-p, --platform <platform>", "[string] target platform (weapp | web)").option("--project-config <path>", "[string] project config path (miniprogram only)").option("--ticket <value>", "[string] ticket used by `ide ticket:set`").option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).option("--no-open-recovery", "[boolean] disable automatic Wechat DevTools close-and-reopen recovery").action(async (action, root, options) => {
|
|
3080
3172
|
await runIdeCommand(action, root, options);
|
|
3081
3173
|
});
|
|
3082
3174
|
}
|
|
@@ -3611,7 +3703,7 @@ function applyMcpCliOptions(config, options) {
|
|
|
3611
3703
|
//#endregion
|
|
3612
3704
|
//#region src/cli/commands/open.ts
|
|
3613
3705
|
function registerOpenCommand(cli) {
|
|
3614
|
-
cli.command("open [root]").option("-p, --platform <platform>", `[string] target platform (weapp | web)`).option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).option("--login-retry <mode>", "[string] login retry mode for Wechat DevTools (never | once | always)").option("--login-retry-timeout <ms>", "[number] login retry prompt timeout in milliseconds").option("--non-interactive", "[boolean] fail immediately when Wechat DevTools login has expired").option("--mcp", "[boolean] auto start MCP service before opening IDE").option("--no-mcp", "[boolean] disable MCP service before opening IDE").action(async (root, options) => {
|
|
3706
|
+
cli.command("open [root]").option("-p, --platform <platform>", `[string] target platform (weapp | web)`).option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).option("--login-retry <mode>", "[string] login retry mode for Wechat DevTools (never | once | always)").option("--login-retry-timeout <ms>", "[number] login retry prompt timeout in milliseconds").option("--non-interactive", "[boolean] fail immediately when Wechat DevTools login has expired").option("--no-open-recovery", "[boolean] disable automatic Wechat DevTools close-and-reopen recovery").option("--mcp", "[boolean] auto start MCP service before opening IDE").option("--no-mcp", "[boolean] disable MCP service before opening IDE").action(async (root, options) => {
|
|
3615
3707
|
filterDuplicateOptions(options);
|
|
3616
3708
|
const configFile = resolveConfigFile(options);
|
|
3617
3709
|
const targets = resolveRuntimeTargets(options);
|
|
@@ -3640,6 +3732,7 @@ function registerOpenCommand(cli) {
|
|
|
3640
3732
|
loginRetry: options.loginRetry,
|
|
3641
3733
|
loginRetryTimeout: options.loginRetryTimeout,
|
|
3642
3734
|
nonInteractive: options.nonInteractive,
|
|
3735
|
+
openRecovery: options.openRecovery,
|
|
3643
3736
|
trustProject: options.trustProject
|
|
3644
3737
|
});
|
|
3645
3738
|
});
|
|
@@ -3892,7 +3985,7 @@ function resolveRunnableHotkeyDefinition(input) {
|
|
|
3892
3985
|
}
|
|
3893
3986
|
//#endregion
|
|
3894
3987
|
//#region package.json
|
|
3895
|
-
var version = "6.
|
|
3988
|
+
var version = "6.17.0";
|
|
3896
3989
|
//#endregion
|
|
3897
3990
|
//#region src/cli/devHotkeys/format.ts
|
|
3898
3991
|
const FULLWIDTH_ASCII_START = 65281;
|
|
@@ -4546,7 +4639,7 @@ function waitForServeShutdownSignal() {
|
|
|
4546
4639
|
//#endregion
|
|
4547
4640
|
//#region src/cli/commands/serve/index.ts
|
|
4548
4641
|
function registerServeCommand(cli) {
|
|
4549
|
-
cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).option("-p, --platform <platform>", `[string] target platform (weapp | web | all)`).option("--project-config <path>", `[string] project config path (miniprogram only)`).option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).option("--login-retry <mode>", "[string] login retry mode for Wechat DevTools (never | once | always)").option("--login-retry-timeout <ms>", "[number] login retry prompt timeout in milliseconds").option("--non-interactive", "[boolean] fail immediately when Wechat DevTools login has expired").option("--mcp", "[boolean] auto start MCP service during dev").option("--no-mcp", "[boolean] disable MCP service during dev").option("--host [host]", `[string] web dev server host`).option("--ui", `[boolean] 启动调试 UI(当前提供分析视图)`, { default: false }).option("--analyze", `[boolean] 启动分包分析仪表盘 (实验特性)`, { default: false }).option("--scope <scope>", `[string] 局部构建范围,例如 main,packages/order`).action(async (root, options) => {
|
|
4642
|
+
cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).option("-p, --platform <platform>", `[string] target platform (weapp | web | all)`).option("--project-config <path>", `[string] project config path (miniprogram only)`).option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).option("--login-retry <mode>", "[string] login retry mode for Wechat DevTools (never | once | always)").option("--login-retry-timeout <ms>", "[number] login retry prompt timeout in milliseconds").option("--non-interactive", "[boolean] fail immediately when Wechat DevTools login has expired").option("--no-open-recovery", "[boolean] disable automatic Wechat DevTools close-and-reopen recovery").option("--mcp", "[boolean] auto start MCP service during dev").option("--no-mcp", "[boolean] disable MCP service during dev").option("--host [host]", `[string] web dev server host`).option("--ui", `[boolean] 启动调试 UI(当前提供分析视图)`, { default: false }).option("--analyze", `[boolean] 启动分包分析仪表盘 (实验特性)`, { default: false }).option("--scope <scope>", `[string] 局部构建范围,例如 main,packages/order`).action(async (root, options) => {
|
|
4550
4643
|
filterDuplicateOptions(options);
|
|
4551
4644
|
const cwd = root ?? process.cwd();
|
|
4552
4645
|
const configFile = resolveConfigFile(options);
|
|
@@ -4606,6 +4699,7 @@ function registerServeCommand(cli) {
|
|
|
4606
4699
|
loginRetry: options.loginRetry,
|
|
4607
4700
|
loginRetryTimeout: options.loginRetryTimeout,
|
|
4608
4701
|
nonInteractive: options.nonInteractive,
|
|
4702
|
+
openRecovery: options.openRecovery,
|
|
4609
4703
|
reuseOpenedProject: !openOptions?.forceReopen,
|
|
4610
4704
|
trustProject: options.trustProject,
|
|
4611
4705
|
useAutomatorOpen: false
|
|
@@ -1523,6 +1523,10 @@ interface RuntimeState {
|
|
|
1523
1523
|
independent: {
|
|
1524
1524
|
outputs: Map<string, RolldownOutput>;
|
|
1525
1525
|
};
|
|
1526
|
+
output: {
|
|
1527
|
+
emittedSource: Map<string, string>;
|
|
1528
|
+
wevuInternalRuntimeFileName?: string;
|
|
1529
|
+
};
|
|
1526
1530
|
hmr: {
|
|
1527
1531
|
loadedEntrySet: Set<string>;
|
|
1528
1532
|
dirtyEntrySet: Set<string>;
|
|
@@ -1535,10 +1539,12 @@ interface RuntimeState {
|
|
|
1535
1539
|
vueEntryHasTemplate: Map<string, boolean>;
|
|
1536
1540
|
vueEntryNonJsonSignatures: Map<string, string>;
|
|
1537
1541
|
vueEntryScriptSignatures: Map<string, string>;
|
|
1542
|
+
appEntryAutoRoutesSignature?: string;
|
|
1538
1543
|
dirtyVueEntryIds: Set<string>;
|
|
1539
1544
|
didEmitAllEntries: boolean;
|
|
1540
1545
|
lastHmrEntryIds: Set<string>;
|
|
1541
1546
|
lastEmittedEntryIds: Set<string>;
|
|
1547
|
+
lastEmittedChunkFileNames: Set<string>;
|
|
1542
1548
|
recentProfiles: Array<{
|
|
1543
1549
|
timestamp?: string;
|
|
1544
1550
|
totalMs: number;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Bn as WeappViteHostMeta, Hn as createWeappViteHostMeta, Un as isWeappViteHost, Vn as applyWeappViteHostMeta, Wn as resolveWeappViteHostMeta, Yn as WeappViteRuntime, _ as definePageJson, a as UserConfigFnNoEnvPlain, at as WeappViteConfig, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, y as defineThemeJson, zn as WEAPP_VITE_HOST_NAME } from "./config-
|
|
1
|
+
import { Bn as WeappViteHostMeta, Hn as createWeappViteHostMeta, Un as isWeappViteHost, Vn as applyWeappViteHostMeta, Wn as resolveWeappViteHostMeta, Yn as WeappViteRuntime, _ as definePageJson, a as UserConfigFnNoEnvPlain, at as WeappViteConfig, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, y as defineThemeJson, zn as WEAPP_VITE_HOST_NAME } from "./config-Cxi7xvCa.mjs";
|
|
2
2
|
export { type App, type Component, type Page, type Sitemap, type Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, WEAPP_VITE_HOST_NAME, type WeappViteConfig, WeappViteHostMeta, type WeappViteRuntime, applyWeappViteHostMeta, createWeappViteHostMeta, defineAppJson, defineComponentJson, defineConfig, definePageJson, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta };
|