weapp-vite 6.13.3 → 6.13.4
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 +20 -1
- package/dist/auto-routes.mjs +1 -1
- package/dist/cli.mjs +67 -40
- package/dist/{config-Dec415jY.d.mts → config-CiuNcUYK.d.mts} +6 -0
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-3UhoQl2A.mjs → createContext-Bb4OSo1-.mjs} +951 -836
- package/dist/docs/README.md +20 -1
- package/dist/docs/ai-workflows.md +17 -1
- package/dist/docs/mcp.md +33 -2
- package/dist/{file-BAUXs16l.mjs → file-Cf3pf5w7.mjs} +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/json.d.mts +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -95,10 +95,20 @@ function handleClick() {
|
|
|
95
95
|
|
|
96
96
|
- 安装依赖后,优先阅读 `node_modules/weapp-vite/dist/docs/README.md`、`node_modules/weapp-vite/dist/docs/mcp.md` 等本地版本文档
|
|
97
97
|
- CLI 同时支持 `weapp-vite` 与 `wv`
|
|
98
|
-
-
|
|
98
|
+
- 需要做小程序截图采集时,优先使用 `weapp-vite screenshot` / `wv screenshot`
|
|
99
|
+
- 需要做小程序截图对比验收时,优先使用 `weapp-vite compare` / `wv compare`
|
|
99
100
|
- 不要把小程序运行时截图退化成通用浏览器截图
|
|
100
101
|
- 需要看 DevTools 终端日志时,优先使用 `weapp-vite ide logs --open` 或 `wv ide logs --open`
|
|
101
102
|
|
|
103
|
+
推荐把下面这组意图映射写进项目根 `AGENTS.md`,让常见 AI 更稳定命中:
|
|
104
|
+
|
|
105
|
+
- 提到 `截图`、`页面快照`、`runtime screenshot`
|
|
106
|
+
- 默认使用 `weapp-vite screenshot` / `wv screenshot`
|
|
107
|
+
- 提到 `截图对比`、`diff`、`baseline`、`视觉回归`、`像素对比`
|
|
108
|
+
- 默认使用 `weapp-vite compare` / `wv compare`
|
|
109
|
+
- 提到 `运行时日志`、`DevTools 日志`
|
|
110
|
+
- 默认使用 `weapp-vite ide logs --open` / `wv ide logs --open`
|
|
111
|
+
|
|
102
112
|
`dist/docs` 当前会内置这些文件:
|
|
103
113
|
|
|
104
114
|
- `README.md`
|
|
@@ -123,6 +133,15 @@ weapp-vite screenshot --project ./dist/build/mp-weixin --page pages/index/index
|
|
|
123
133
|
wv screenshot --project ./dist/build/mp-weixin --page pages/index/index --output .tmp/acceptance.png --json
|
|
124
134
|
```
|
|
125
135
|
|
|
136
|
+
推荐的截图对比命令示例:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
weapp-vite compare --project ./dist/build/mp-weixin --page pages/index/index --baseline .screenshots/baseline/index.png --diff-output .tmp/index.diff.png --max-diff-pixels 100 --json
|
|
140
|
+
|
|
141
|
+
# 等价写法
|
|
142
|
+
wv compare --project ./dist/build/mp-weixin --page pages/index/index --baseline .screenshots/baseline/index.png --diff-output .tmp/index.diff.png --max-diff-pixels 100 --json
|
|
143
|
+
```
|
|
144
|
+
|
|
126
145
|
## DevTools 日志桥接
|
|
127
146
|
|
|
128
147
|
`weapp-vite` 现在支持把微信开发者工具里的小程序 `console` 输出桥接到当前终端。
|
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getCompilerContext, l as getRouteRuntimeGlobalKeys } from "./createContext-
|
|
1
|
+
import { i as getCompilerContext, l as getRouteRuntimeGlobalKeys } from "./createContext-Bb4OSo1-.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,11 +1,10 @@
|
|
|
1
|
-
import { _ as getDefaultIdeProjectRoot, b as shouldPassPlatformArgToIdeOpen, c as SHARED_CHUNK_VIRTUAL_PREFIX, d as checkRuntime, f as getProjectConfigFileName, g as DEFAULT_MP_PLATFORM, h as createCjsConfigLoadError, m as parseCommentJson, n as syncProjectSupportFiles, o as formatBytes, p as loadViteConfigFile, r as syncManagedTsconfigBootstrapFiles, s as createSharedBuildConfig, t as createCompilerContext, u as resolveWeappConfigFile, v as normalizeMiniPlatform, x as isPathInside, y as resolveMiniPlatform } from "./createContext-
|
|
1
|
+
import { _ as getDefaultIdeProjectRoot, b as shouldPassPlatformArgToIdeOpen, c as SHARED_CHUNK_VIRTUAL_PREFIX, d as checkRuntime, f as getProjectConfigFileName, g as DEFAULT_MP_PLATFORM, h as createCjsConfigLoadError, m as parseCommentJson, n as syncProjectSupportFiles, o as formatBytes, p as loadViteConfigFile, r as syncManagedTsconfigBootstrapFiles, s as createSharedBuildConfig, t as createCompilerContext, u as resolveWeappConfigFile, v as normalizeMiniPlatform, x as isPathInside, y as resolveMiniPlatform } from "./createContext-Bb4OSo1-.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-gutcwWKE.mjs";
|
|
3
|
-
import { p as VERSION } from "./file-
|
|
3
|
+
import { p as VERSION } from "./file-Cf3pf5w7.mjs";
|
|
4
4
|
import { resolveWeappMcpConfig, startWeappViteMcpServer } from "./mcp.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
|
-
import { defu } from "@weapp-core/shared";
|
|
6
|
+
import { defu, fs } from "@weapp-core/shared";
|
|
7
7
|
import path, { posix } from "pathe";
|
|
8
|
-
import fs from "fs-extra";
|
|
9
8
|
import process from "node:process";
|
|
10
9
|
import fs$1 from "node:fs/promises";
|
|
11
10
|
import { build, createServer } from "vite";
|
|
@@ -857,6 +856,14 @@ function registerAnalyzeCommand(cli) {
|
|
|
857
856
|
});
|
|
858
857
|
}
|
|
859
858
|
//#endregion
|
|
859
|
+
//#region src/cli/formatDuration.ts
|
|
860
|
+
/**
|
|
861
|
+
* 将毫秒耗时格式化为适合 CLI 展示的文本。
|
|
862
|
+
*/
|
|
863
|
+
function formatDuration(durationMs) {
|
|
864
|
+
return `${durationMs}ms`;
|
|
865
|
+
}
|
|
866
|
+
//#endregion
|
|
860
867
|
//#region src/cli/logBuildAppFinish.ts
|
|
861
868
|
let logBuildAppFinishOnlyShowOnce = false;
|
|
862
869
|
function collectServerUrls(webServer) {
|
|
@@ -942,6 +949,13 @@ function logBuildPackageSizeReport(options) {
|
|
|
942
949
|
//#endregion
|
|
943
950
|
//#region src/cli/openIde.ts
|
|
944
951
|
const execFileAsync = promisify(execFile);
|
|
952
|
+
async function openWechatIdeByAutomator(projectPath) {
|
|
953
|
+
const { Launcher } = await import("@weapp-vite/miniprogram-automator");
|
|
954
|
+
(await new Launcher().launch({
|
|
955
|
+
projectPath,
|
|
956
|
+
trustProject: true
|
|
957
|
+
})).disconnect();
|
|
958
|
+
}
|
|
945
959
|
/**
|
|
946
960
|
* @description 执行 IDE 打开流程,并在登录失效时允许按键重试。
|
|
947
961
|
*/
|
|
@@ -1001,7 +1015,14 @@ function resolveIdeProjectPath(mpDistRoot) {
|
|
|
1001
1015
|
function resolveIdeProjectRoot(mpDistRoot, cwd) {
|
|
1002
1016
|
return resolveIdeProjectPath(mpDistRoot) ?? cwd;
|
|
1003
1017
|
}
|
|
1004
|
-
async function openIde(platform, projectPath) {
|
|
1018
|
+
async function openIde(platform, projectPath, options = {}) {
|
|
1019
|
+
if (platform === "weapp" && projectPath && options.trustProject !== false) try {
|
|
1020
|
+
await openWechatIdeByAutomator(projectPath);
|
|
1021
|
+
return;
|
|
1022
|
+
} catch (error) {
|
|
1023
|
+
logger_default.warn("通过 automator 启动微信开发者工具并自动信任项目失败,回退到普通 open 流程。");
|
|
1024
|
+
logger_default.error(error);
|
|
1025
|
+
}
|
|
1005
1026
|
const argv = ["open", "-p"];
|
|
1006
1027
|
if (projectPath) argv.push(projectPath);
|
|
1007
1028
|
if (shouldPassPlatformArgToIdeOpen(platform)) argv.push("--platform", platform);
|
|
@@ -1085,7 +1106,7 @@ function emitDashboardEvents$1(handle, events) {
|
|
|
1085
1106
|
handle?.emitRuntimeEvents(events);
|
|
1086
1107
|
}
|
|
1087
1108
|
function registerBuildCommand(cli) {
|
|
1088
|
-
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 | h5 | 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("--ui", `[boolean] 启动调试 UI(当前提供分析视图)`, { default: false }).option("--analyze", `[boolean] 输出分包分析仪表盘`, { default: false }).action(async (root, options) => {
|
|
1109
|
+
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 | h5 | 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 }).action(async (root, options) => {
|
|
1089
1110
|
filterDuplicateOptions(options);
|
|
1090
1111
|
const configFile = resolveConfigFile(options);
|
|
1091
1112
|
const targets = resolveRuntimeTargets(options);
|
|
@@ -1105,6 +1126,8 @@ function registerBuildCommand(cli) {
|
|
|
1105
1126
|
if (targets.runMini) {
|
|
1106
1127
|
const miniBuildStartedAt = Date.now();
|
|
1107
1128
|
const output = await buildService.build(options);
|
|
1129
|
+
const miniBuildDurationMs = Date.now() - miniBuildStartedAt;
|
|
1130
|
+
logger_default.success(`小程序构建完成,耗时:${colors.green(formatDuration(miniBuildDurationMs))}`);
|
|
1108
1131
|
if (!Array.isArray(output) && "output" in output) logBuildPackageSizeReport({
|
|
1109
1132
|
output,
|
|
1110
1133
|
subPackageMap: ctx.scanService?.subPackageMap,
|
|
@@ -1122,7 +1145,7 @@ function registerBuildCommand(cli) {
|
|
|
1122
1145
|
level: "success",
|
|
1123
1146
|
title: "mini build completed",
|
|
1124
1147
|
detail: `生产构建已完成,当前 analyze 结果包含 ${analyzeResult.packages.length} 个包。`,
|
|
1125
|
-
durationMs:
|
|
1148
|
+
durationMs: miniBuildDurationMs,
|
|
1126
1149
|
tags: ["build", "mini"]
|
|
1127
1150
|
}]);
|
|
1128
1151
|
}
|
|
@@ -1132,13 +1155,14 @@ function registerBuildCommand(cli) {
|
|
|
1132
1155
|
const webBuildStartedAt = Date.now();
|
|
1133
1156
|
try {
|
|
1134
1157
|
await webService?.build();
|
|
1135
|
-
|
|
1158
|
+
const webBuildDurationMs = Date.now() - webBuildStartedAt;
|
|
1159
|
+
logger_default.success(`Web 构建完成,输出目录:${colors.green(configService.relativeCwd(webConfig.outDir))},耗时:${colors.green(formatDuration(webBuildDurationMs))}`);
|
|
1136
1160
|
emitDashboardEvents$1(analyzeHandle, [{
|
|
1137
1161
|
kind: "build",
|
|
1138
1162
|
level: "success",
|
|
1139
1163
|
title: "web build completed",
|
|
1140
1164
|
detail: `Web 构建已完成,输出目录 ${configService.relativeCwd(webConfig.outDir)}。`,
|
|
1141
|
-
durationMs:
|
|
1165
|
+
durationMs: webBuildDurationMs,
|
|
1142
1166
|
tags: ["build", "web"]
|
|
1143
1167
|
}]);
|
|
1144
1168
|
} catch (error) {
|
|
@@ -1163,7 +1187,7 @@ function registerBuildCommand(cli) {
|
|
|
1163
1187
|
detail: "构建完成后准备打开 IDE 项目。",
|
|
1164
1188
|
tags: ["ide", "open"]
|
|
1165
1189
|
}]);
|
|
1166
|
-
await openIde(configService.platform, resolveIdeProjectPath(configService.mpDistRoot));
|
|
1190
|
+
await openIde(configService.platform, resolveIdeProjectPath(configService.mpDistRoot), { trustProject: options.trustProject });
|
|
1167
1191
|
}
|
|
1168
1192
|
if (analyzeHandle) await analyzeHandle.waitForExit();
|
|
1169
1193
|
ctx.watcherService?.closeAll();
|
|
@@ -1486,12 +1510,25 @@ function sleep(ms) {
|
|
|
1486
1510
|
}
|
|
1487
1511
|
//#endregion
|
|
1488
1512
|
//#region src/cli/commands/ide.ts
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1513
|
+
async function waitForTermination(cleanup) {
|
|
1514
|
+
await new Promise((resolve) => {
|
|
1515
|
+
const signals = ["SIGINT", "SIGTERM"];
|
|
1516
|
+
let cleaning = false;
|
|
1517
|
+
const handlers = /* @__PURE__ */ new Map();
|
|
1518
|
+
const teardown = async () => {
|
|
1519
|
+
if (cleaning) return;
|
|
1520
|
+
cleaning = true;
|
|
1521
|
+
for (const signal of signals) process.off(signal, handlers.get(signal));
|
|
1522
|
+
await cleanup();
|
|
1523
|
+
resolve();
|
|
1524
|
+
};
|
|
1525
|
+
for (const signal of signals) {
|
|
1526
|
+
const handler = () => {
|
|
1527
|
+
teardown();
|
|
1528
|
+
};
|
|
1529
|
+
handlers.set(signal, handler);
|
|
1530
|
+
process.on(signal, handler);
|
|
1531
|
+
}
|
|
1495
1532
|
});
|
|
1496
1533
|
}
|
|
1497
1534
|
/**
|
|
@@ -1511,7 +1548,7 @@ async function runIdeCommand(action, root, options) {
|
|
|
1511
1548
|
});
|
|
1512
1549
|
if (resolved.platform !== "weapp") throw new Error("`weapp-vite ide logs` 当前仅支持微信小程序平台。");
|
|
1513
1550
|
if (!resolved.projectPath) throw new Error("无法解析微信开发者工具项目目录,请显式传入 root 或检查 project.config.json。");
|
|
1514
|
-
if (options.open) await openIde(resolved.platform, resolved.projectPath);
|
|
1551
|
+
if (options.open) await openIde(resolved.platform, resolved.projectPath, { trustProject: options.trustProject });
|
|
1515
1552
|
const forwardConsoleOptions = await resolveForwardConsoleOptions({
|
|
1516
1553
|
...resolved.weappViteConfig,
|
|
1517
1554
|
forwardConsole: resolved.weappViteConfig?.forwardConsole === false ? { enabled: true } : {
|
|
@@ -1531,25 +1568,12 @@ async function runIdeCommand(action, root, options) {
|
|
|
1531
1568
|
await session.close();
|
|
1532
1569
|
});
|
|
1533
1570
|
}
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
cleaning = true;
|
|
1541
|
-
for (const signal of signals) process.off(signal, handlers.get(signal));
|
|
1542
|
-
await cleanup();
|
|
1543
|
-
resolve();
|
|
1544
|
-
};
|
|
1545
|
-
const handlers = /* @__PURE__ */ new Map();
|
|
1546
|
-
for (const signal of signals) {
|
|
1547
|
-
const handler = () => {
|
|
1548
|
-
teardown();
|
|
1549
|
-
};
|
|
1550
|
-
handlers.set(signal, handler);
|
|
1551
|
-
process.on(signal, handler);
|
|
1552
|
-
}
|
|
1571
|
+
/**
|
|
1572
|
+
* @description 注册 IDE 相关子命令。
|
|
1573
|
+
*/
|
|
1574
|
+
function registerIdeCommand(cli) {
|
|
1575
|
+
cli.command("ide [action] [root]", "forward Wechat DevTools console logs to terminal").option("-o, --open", "[boolean] open ide before attaching log bridge").option("-p, --platform <platform>", "[string] target platform (weapp | h5)").option("--project-config <path>", "[string] project config path (miniprogram only)").option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).action(async (action, root, options) => {
|
|
1576
|
+
await runIdeCommand(action, root, options);
|
|
1553
1577
|
});
|
|
1554
1578
|
}
|
|
1555
1579
|
//#endregion
|
|
@@ -1599,7 +1623,7 @@ function registerNpmCommand(cli) {
|
|
|
1599
1623
|
//#endregion
|
|
1600
1624
|
//#region src/cli/commands/open.ts
|
|
1601
1625
|
function registerOpenCommand(cli) {
|
|
1602
|
-
cli.command("open [root]").option("-p, --platform <platform>", `[string] target platform (weapp | h5)`).action(async (root, options) => {
|
|
1626
|
+
cli.command("open [root]").option("-p, --platform <platform>", `[string] target platform (weapp | h5)`).option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).action(async (root, options) => {
|
|
1603
1627
|
filterDuplicateOptions(options);
|
|
1604
1628
|
const configFile = resolveConfigFile(options);
|
|
1605
1629
|
const targets = resolveRuntimeTargets(options);
|
|
@@ -1610,7 +1634,7 @@ function registerOpenCommand(cli) {
|
|
|
1610
1634
|
projectPath: root,
|
|
1611
1635
|
cliPlatform: targets.rawPlatform
|
|
1612
1636
|
});
|
|
1613
|
-
await openIde(platform, projectPath ?? resolveIdeProjectRoot(mpDistRoot, process.cwd()));
|
|
1637
|
+
await openIde(platform, projectPath ?? resolveIdeProjectRoot(mpDistRoot, process.cwd()), { trustProject: options.trustProject });
|
|
1614
1638
|
});
|
|
1615
1639
|
}
|
|
1616
1640
|
//#endregion
|
|
@@ -1730,7 +1754,7 @@ async function analyzeUiFallback(ctx) {
|
|
|
1730
1754
|
};
|
|
1731
1755
|
}
|
|
1732
1756
|
function registerServeCommand(cli) {
|
|
1733
|
-
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 | h5 | all)`).option("--project-config <path>", `[string] project config path (miniprogram only)`).option("--host [host]", `[string] web dev server host`).option("--ui", `[boolean] 启动调试 UI(当前提供分析视图)`, { default: false }).option("--analyze", `[boolean] 启动分包分析仪表盘 (实验特性)`, { default: false }).action(async (root, options) => {
|
|
1757
|
+
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 | h5 | 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("--host [host]", `[string] web dev server host`).option("--ui", `[boolean] 启动调试 UI(当前提供分析视图)`, { default: false }).option("--analyze", `[boolean] 启动分包分析仪表盘 (实验特性)`, { default: false }).action(async (root, options) => {
|
|
1734
1758
|
filterDuplicateOptions(options);
|
|
1735
1759
|
const configFile = resolveConfigFile(options);
|
|
1736
1760
|
const targets = resolveRuntimeTargets(options);
|
|
@@ -1852,7 +1876,9 @@ function registerServeCommand(cli) {
|
|
|
1852
1876
|
}]);
|
|
1853
1877
|
};
|
|
1854
1878
|
if (targets.runMini) {
|
|
1879
|
+
const miniBuildStartedAt = Date.now();
|
|
1855
1880
|
const buildResult = await buildService.build(options);
|
|
1881
|
+
logger_default.success(`小程序初次构建完成,耗时:${formatDuration(Date.now() - miniBuildStartedAt)}`);
|
|
1856
1882
|
if (enableAnalyze) {
|
|
1857
1883
|
const initialAnalyze = await runAnalyze();
|
|
1858
1884
|
analyzeHandle = await startAnalyzeDashboard(initialAnalyze.result, {
|
|
@@ -1901,6 +1927,7 @@ function registerServeCommand(cli) {
|
|
|
1901
1927
|
const webServerStartedAt = Date.now();
|
|
1902
1928
|
try {
|
|
1903
1929
|
webServer = await webService?.startDevServer();
|
|
1930
|
+
logger_default.success(`Web 开发服务启动完成,耗时:${formatDuration(Date.now() - webServerStartedAt)}`);
|
|
1904
1931
|
emitDashboardEvents(analyzeHandle, [{
|
|
1905
1932
|
kind: "system",
|
|
1906
1933
|
level: "success",
|
|
@@ -1940,7 +1967,7 @@ function registerServeCommand(cli) {
|
|
|
1940
1967
|
mpDistRoot: configService.mpDistRoot,
|
|
1941
1968
|
cwd: configService.cwd,
|
|
1942
1969
|
weappViteConfig: configService.weappViteConfig
|
|
1943
|
-
})) await openIde(configService.platform, resolveIdeProjectRoot(configService.mpDistRoot, configService.cwd));
|
|
1970
|
+
})) await openIde(configService.platform, resolveIdeProjectRoot(configService.mpDistRoot, configService.cwd), { trustProject: options.trustProject });
|
|
1944
1971
|
}
|
|
1945
1972
|
if (analyzeHandle) await analyzeHandle.waitForExit();
|
|
1946
1973
|
});
|
|
@@ -1290,6 +1290,7 @@ interface RuntimeState {
|
|
|
1290
1290
|
};
|
|
1291
1291
|
wxml: {
|
|
1292
1292
|
depsMap: Map<string, Set<string>>;
|
|
1293
|
+
importerMap: Map<string, Set<string>>;
|
|
1293
1294
|
tokenMap: Map<string, ScanWxmlResult>;
|
|
1294
1295
|
componentsMap: Map<string, ComponentsMap>;
|
|
1295
1296
|
cache: FileCache<ScanWxmlResult>;
|
|
@@ -1298,6 +1299,7 @@ interface RuntimeState {
|
|
|
1298
1299
|
scan: {
|
|
1299
1300
|
subPackageMap: Map<string, SubPackageMetaValue>;
|
|
1300
1301
|
independentSubPackageMap: Map<string, SubPackageMetaValue>;
|
|
1302
|
+
warnedMessages: Set<string>;
|
|
1301
1303
|
appEntry?: AppEntry;
|
|
1302
1304
|
pluginJson?: Plugin;
|
|
1303
1305
|
pluginJsonPath?: string;
|
|
@@ -1355,9 +1357,13 @@ interface WebService {
|
|
|
1355
1357
|
//#region src/runtime/wxmlPlugin.d.ts
|
|
1356
1358
|
interface WxmlService {
|
|
1357
1359
|
depsMap: Map<string, Set<string>>;
|
|
1360
|
+
importerMap: Map<string, Set<string>>;
|
|
1358
1361
|
tokenMap: Map<string, ScanWxmlResult>;
|
|
1359
1362
|
wxmlComponentsMap: Map<string, ComponentsMap>;
|
|
1360
1363
|
addDeps: (filepath: string, deps?: string[]) => Promise<void>;
|
|
1364
|
+
setDeps: (filepath: string, deps?: string[]) => Promise<void>;
|
|
1365
|
+
collectDepsFromToken: (filepath: string, deps?: ScanWxmlResult['deps']) => string[];
|
|
1366
|
+
getImporters: (filepath: string) => Set<string>;
|
|
1361
1367
|
getAllDeps: () => Set<string>;
|
|
1362
1368
|
clearAll: () => void;
|
|
1363
1369
|
analyze: (wxml: string) => ScanWxmlResult;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { An as createWeappViteHostMeta, Dn as WeappViteHostMeta, En as WEAPP_VITE_HOST_NAME, Mn as resolveWeappViteHostMeta, On as WeappViteRuntime, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, jn as isWeappViteHost, kn as applyWeappViteHostMeta, l as defineConfig, m as Theme, n as UserConfigExport, nt as WeappViteConfig, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-
|
|
1
|
+
import { An as createWeappViteHostMeta, Dn as WeappViteHostMeta, En as WEAPP_VITE_HOST_NAME, Mn as resolveWeappViteHostMeta, On as WeappViteRuntime, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, jn as isWeappViteHost, kn as applyWeappViteHostMeta, l as defineConfig, m as Theme, n as UserConfigExport, nt as WeappViteConfig, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-CiuNcUYK.mjs";
|
|
2
2
|
export { App, Component, Page, Sitemap, Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, WEAPP_VITE_HOST_NAME, WeappViteConfig, WeappViteHostMeta, WeappViteRuntime, applyWeappViteHostMeta, createWeappViteHostMeta, defineAppJson, defineComponentJson, defineConfig, definePageJson, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta };
|