weapp-vite 7.5.0 → 7.6.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 +8 -2
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/dist/action-B3YZMA-h.mjs +255 -0
- package/dist/action-BELcDNNv.mjs +139 -0
- package/dist/action-BOk3vGI7.mjs +1110 -0
- package/dist/action-DlC6JYpt.mjs +95 -0
- package/dist/action-zEDY7oh_.mjs +247 -0
- package/dist/{analyze-ZJUvEdaY.mjs → analyze-DN79YOAH.mjs} +1 -65
- package/dist/artifacts-BOyC9Fy-.mjs +106 -0
- package/dist/assets-C5_YYXNk.mjs +637 -0
- package/dist/auto-routes.mjs +2 -2
- package/dist/{budget-BD7VqLCl.d.mts → budget-CTLOHwgI.d.mts} +1 -2
- package/dist/budget-EOeEycc_.mjs +65 -0
- package/dist/builtProject-C29udgXY.mjs +541 -0
- package/dist/{chunkStrategy-DRA5WpB-.mjs → chunkStrategy-DY_LZIIe.mjs} +15 -3
- package/dist/{package-7swhyLmf.mjs → classifier-DBJY__kg.mjs} +4 -7
- package/dist/cli-acceptance.mjs +1 -1
- package/dist/cli.mjs +110 -4506
- package/dist/{config-V0L-IAJf.d.mts → config-Bf6DWhyb.d.mts} +136 -49
- package/dist/config.d.mts +2 -2
- package/dist/{createCompilerContextInstance-DJH_P_nZ.mjs → createCompilerContextInstance-aYwi8wQt.mjs} +15235 -9523
- package/dist/{createContext-BqYzHhY9.mjs → createContext-tApLtII-.mjs} +6 -3
- package/dist/dashboard/analyze.d.mts +1 -1
- package/dist/dashboard/analyze.mjs +3 -1
- package/dist/dashboard/vite.d.mts +1 -1
- package/dist/dashboard.d.mts +2 -2
- package/dist/dashboard.mjs +1749 -1
- package/dist/dashboardTransport-C_Y6jMp-.mjs +16 -0
- package/dist/{dashboardViteBridge-Dy3nAD4m.mjs → dashboardViteBridge-DCGR43aM.mjs} +8 -5
- package/dist/{dev-fR5GiJRO.mjs → dev-C2fgr_Xd.mjs} +5 -1
- package/dist/devProvider-D-hTfsEO.mjs +3027 -0
- package/dist/docs/README.md +8 -2
- package/dist/docs/mcp.md +10 -0
- package/dist/docs/troubleshooting.md +8 -0
- package/dist/docs/vue-sfc.md +25 -2
- package/dist/doctor-worker.mjs +3 -2
- package/dist/doctor.d.mts +2 -2
- package/dist/doctor.mjs +15 -13
- package/dist/engine-C66J0HLz.mjs +54 -0
- package/dist/{file-sC3jD7Fh.mjs → file-CcIOmqhC.mjs} +47 -19
- package/dist/file-DtcteQ4G.mjs +1 -0
- package/dist/forwardConsole-B0Reo8Lf.mjs +511 -0
- package/dist/getInstance-BAIaU2y9.mjs +1 -0
- package/dist/{getInstance-DiGSzBNI.mjs → getInstance-Dt9IQDKr.mjs} +1 -1
- package/dist/history-BIiRCzbq.mjs +784 -0
- package/dist/i18n.d.mts +1 -1
- package/dist/{index-C9HjUX5c.d.mts → index-D5rgBzYZ.d.mts} +1 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/json.d.mts +1 -1
- package/dist/lib-DjccSI1B.mjs +143 -0
- package/dist/{lifecycle-BROTlwSL.mjs → lifecycle-C36WSbQS.mjs} +120 -27
- package/dist/{loadConfig-C3BQhz7F.mjs → loadConfig-BWIsDXR4.mjs} +1 -1
- package/dist/loadConfig-D-BpBgsk.mjs +1 -0
- package/dist/logBuildAppFinish-ChjwATMv.mjs +57 -0
- package/dist/mcp-CYgX9HpO.mjs +86 -0
- package/dist/mcp.d.mts +1 -1
- package/dist/mcpClient-DVLvFLZv.mjs +287 -0
- package/dist/{processCleanup-B6KA30Zc.mjs → metadata-hwF7QRcS.mjs} +1 -19
- package/dist/nodeEnv-BmH8UZPR.mjs +7 -0
- package/dist/openIde-CroqOgk5.mjs +648 -0
- package/dist/options-jqFwfD1G.mjs +34 -0
- package/dist/package-Cmakyy3J.mjs +4 -0
- package/dist/path-CYYIQGS7.mjs +44 -0
- package/dist/processCleanup-BQn2kTcK.mjs +19 -0
- package/dist/{protocol-vg8HGJ4n.mjs → protocol-Cg6Jdlvb.mjs} +42 -39
- package/dist/reader-sh_POQ9-.mjs +93 -0
- package/dist/realpathScope-Tf9mz-fh.mjs +23 -0
- package/dist/report-hyonPGbZ.mjs +107 -0
- package/dist/{path-doV773b7.mjs → resolvedId-CiDl7SC1.mjs} +3 -46
- package/dist/runtime-CLUhQsdA.mjs +43 -0
- package/dist/{runtime-Ee2HY6gR.d.mts → runtime-DpVf714f.d.mts} +1 -1
- package/dist/runtime.d.mts +1 -1
- package/dist/schematics-kO26eQRT.mjs +91 -0
- package/dist/{session-PskhD-nZ.mjs → session-D3zsdzIy.mjs} +71 -9
- package/dist/test.mjs +10 -8
- package/dist/{types-CgZn5X6j.d.mts → types-D-kfuyVa.d.mts} +1 -2
- package/dist/types-D0FFexRF.d.mts +39 -0
- package/dist/types.d.mts +2 -2
- package/dist/{upload-D4msblBf.mjs → upload-DozK8UdN.mjs} +109 -5
- package/dist/upload-worker.mjs +1 -1
- package/dist/{utils-CJSCgEj6.mjs → utils-Dy51PYAC.mjs} +56 -116
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +51 -12
- package/dist/wxs-BT8btflA.mjs +112 -0
- package/dist/wxs-Z4VQDeJ_.mjs +1 -0
- package/package.json +52 -46
- package/dist/dashboard-DvqF3Key.mjs +0 -1842
- package/dist/devProvider-BGBkw28J.mjs +0 -1050
- package/dist/file-DRb4eWqw.mjs +0 -1
- package/dist/getInstance-SiE6WZRh.mjs +0 -1
- package/dist/loadConfig-VGtBF4qm.mjs +0 -1
- package/dist/mcp-D3Yh24Cj.mjs +0 -529
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
//#region src/cli/analyze/dashboardTransport/index.ts
|
|
4
|
+
/** 从已选 Dashboard 的安装位置解析传输依赖,兼容嵌套安装和包管理器的虚拟目录。 */
|
|
5
|
+
async function loadDashboardTransportModule(packageJsonPath, specifier) {
|
|
6
|
+
const require = createRequire(packageJsonPath);
|
|
7
|
+
let resolved;
|
|
8
|
+
try {
|
|
9
|
+
resolved = require.resolve(specifier);
|
|
10
|
+
} catch (error) {
|
|
11
|
+
throw new Error(`[weapp-vite ui] 已安装的 Dashboard 无法解析传输依赖 ${specifier},请重新安装或更新 @weapp-vite/dashboard。`, { cause: error });
|
|
12
|
+
}
|
|
13
|
+
return import(pathToFileURL(resolved).href);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { loadDashboardTransportModule as t };
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
+
import { t as loadDashboardTransportModule } from "./dashboardTransport-C_Y6jMp-.mjs";
|
|
1
2
|
import process from "node:process";
|
|
2
3
|
import path from "pathe";
|
|
3
4
|
import { defineRpcFunction } from "devframe";
|
|
4
5
|
import { Server } from "node:http";
|
|
5
|
-
import { createUi } from "@devframes/hub-ui";
|
|
6
|
-
import { initHub } from "@devframes/hub/initiate";
|
|
7
6
|
import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_SSE_ROUTE, DEVFRAME_WS_ROUTE } from "devframe/constants";
|
|
8
|
-
import { initDevframe } from "devframe/initiate";
|
|
9
7
|
import { toNodeHandler } from "@modelcontextprotocol/node";
|
|
10
|
-
import { createMcpFetchHandler } from "devframe/adapters/mcp";
|
|
11
8
|
import { registerDevframeInstance } from "devframe/internal";
|
|
12
9
|
import { isLoopbackAddress, validateOriginCandidate } from "devframe/utils/origin";
|
|
13
10
|
//#region src/cli/analyze/dashboardMcp.ts
|
|
14
11
|
const MCP_ROUTE = "__mcp";
|
|
15
12
|
/** MCP 只公开 Dashboard 的 Agent RPC,不继承宿主工具、浏览器 OTP 或共享状态。 */
|
|
16
13
|
async function createDashboardMcp(instance, httpServer, options) {
|
|
14
|
+
const { createMcpFetchHandler } = await loadDashboardTransportModule(options.packageJsonPath, "@devframes/agentic/mcp");
|
|
17
15
|
const context = await instance.context;
|
|
18
16
|
const prefix = `${options.id}:`;
|
|
19
17
|
const getTool = (id) => {
|
|
@@ -140,7 +138,7 @@ const transportPaths = /* @__PURE__ */ new Set([
|
|
|
140
138
|
`${ANALYZE_DASHBOARD_DEVFRAME_BASE}${DEVFRAME_SSE_ROUTE}`,
|
|
141
139
|
`${ANALYZE_DASHBOARD_DEVFRAME_BASE}${DEVFRAME_WS_ROUTE}`
|
|
142
140
|
]);
|
|
143
|
-
function createAnalyzeDashboardViteBridge(controller, options
|
|
141
|
+
function createAnalyzeDashboardViteBridge(controller, options) {
|
|
144
142
|
const hosts = /* @__PURE__ */ new WeakMap();
|
|
145
143
|
const ownedHosts = /* @__PURE__ */ new Set();
|
|
146
144
|
let activeHost;
|
|
@@ -168,6 +166,8 @@ function createAnalyzeDashboardViteBridge(controller, options = {}) {
|
|
|
168
166
|
if (closed) return;
|
|
169
167
|
if (!httpServer) throw new Error("Dashboard requires the Dashboard Vite HTTP server.");
|
|
170
168
|
if (options.uiHost === "hub") {
|
|
169
|
+
const [{ initHub }, { createUi }] = await Promise.all([loadDashboardTransportModule(options.packageJsonPath, "@devframes/hub/initiate"), loadDashboardTransportModule(options.packageJsonPath, "@devframes/hub-ui")]);
|
|
170
|
+
if (closed) return;
|
|
171
171
|
instance = initHub({
|
|
172
172
|
base: ANALYZE_DASHBOARD_HUB_BASE,
|
|
173
173
|
name: "weapp-vite DevTools",
|
|
@@ -188,6 +188,8 @@ function createAnalyzeDashboardViteBridge(controller, options = {}) {
|
|
|
188
188
|
});
|
|
189
189
|
await instance.ready;
|
|
190
190
|
} else {
|
|
191
|
+
const { initDevframe } = await loadDashboardTransportModule(options.packageJsonPath, "devframe/initiate");
|
|
192
|
+
if (closed) return;
|
|
191
193
|
instance = initDevframe(withStandaloneDashboardPolicy(controller.definition), {
|
|
192
194
|
base: ANALYZE_DASHBOARD_DEVFRAME_BASE,
|
|
193
195
|
distDir: false,
|
|
@@ -200,6 +202,7 @@ function createAnalyzeDashboardViteBridge(controller, options = {}) {
|
|
|
200
202
|
await instance.ready;
|
|
201
203
|
}
|
|
202
204
|
if (!closed) mcp = await createDashboardMcp(instance, httpServer, {
|
|
205
|
+
packageJsonPath: options.packageJsonPath,
|
|
203
206
|
projectRoot: options.projectRoot ?? process.cwd(),
|
|
204
207
|
id: controller.definition.id,
|
|
205
208
|
name: controller.definition.name,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as createViteWatchIgnored, m as notifyDevModuleGraphHost, t as createDevModuleGraphPlugin } from "./devProvider-
|
|
1
|
+
import { E as createViteWatchIgnored, m as notifyDevModuleGraphHost, t as createDevModuleGraphPlugin } from "./devProvider-D-hTfsEO.mjs";
|
|
2
2
|
import { WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY } from "@weapp-core/constants";
|
|
3
3
|
//#region src/vite/dev.ts
|
|
4
4
|
/** 宿主仅提供依赖图和服务生命周期;小程序快照沿用原生构建落盘。 */
|
|
@@ -50,6 +50,10 @@ function prepareDevHostConfig(session, merged, user) {
|
|
|
50
50
|
appType: "custom",
|
|
51
51
|
resolve: merged.resolve,
|
|
52
52
|
define: merged.define,
|
|
53
|
+
experimental: {
|
|
54
|
+
...merged.experimental,
|
|
55
|
+
bundledDev: false
|
|
56
|
+
},
|
|
53
57
|
optimizeDeps: {
|
|
54
58
|
noDiscovery: true,
|
|
55
59
|
include: [],
|