weapp-vite 7.5.0 → 7.7.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 +14 -6
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/bin/bootstrap.js +9 -4
- package/bin/bootstrap.test.ts +82 -1
- package/bin/nodeVersionWarning.js +17 -0
- package/bin/nodeVersionWarning.test.ts +30 -0
- package/dist/action-BD56SQh4.mjs +254 -0
- package/dist/action-CPtgEl6p.mjs +94 -0
- package/dist/action-le0bNff_.mjs +1102 -0
- package/dist/action-ytG5oFAw.mjs +138 -0
- package/dist/action-zmJrU8PC.mjs +245 -0
- package/dist/{analyze-ZJUvEdaY.mjs → analyze-DCZo-sJd.mjs} +4 -71
- package/dist/artifacts-TrTX9_jj.mjs +104 -0
- package/dist/assets-XyhpYtGl.mjs +630 -0
- package/dist/auto-import-components/resolvers.d.mts +1 -1
- package/dist/auto-import-components/resolvers.mjs +1 -1
- package/dist/auto-import-presets/wevu-router.d.mts +1 -1
- package/dist/auto-import-presets/wevu-router.mjs +1 -1
- package/dist/auto-import-presets/wevu.d.mts +1 -1
- package/dist/auto-import-presets/wevu.mjs +1 -1
- package/dist/auto-import-presets.d.mts +2 -2
- package/dist/auto-import-presets.mjs +2 -2
- package/dist/auto-routes.d.mts +1 -3
- package/dist/auto-routes.mjs +3 -4
- package/dist/{budget-BD7VqLCl.d.mts → budget-DTPngJU0.d.mts} +1 -10
- package/dist/budget-_Mu-4GKn.mjs +63 -0
- package/dist/builtProject-B145uOt5.mjs +534 -0
- package/dist/{package-7swhyLmf.mjs → classifier-CNTJOYQL.mjs} +5 -9
- package/dist/cli-acceptance.mjs +3 -4
- package/dist/cli.mjs +142 -4569
- package/dist/{config-DRGcCi3h.mjs → config-59ZWhCIf.mjs} +1 -2
- package/dist/{config-V0L-IAJf.d.mts → config-BNx2BODw.d.mts} +145 -150
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/{constants-DEZdcsMn.mjs → constants-BOe8mgqL.mjs} +2 -4
- package/dist/{createCompilerContextInstance-DJH_P_nZ.mjs → createCompilerContextInstance-BXSdH2E8.mjs} +19930 -14019
- package/dist/{createContext-BqYzHhY9.mjs → createContext-W0TeXxbo.mjs} +7 -5
- package/dist/dashboard/analyze.d.mts +1 -7
- package/dist/dashboard/analyze.mjs +3 -1
- package/dist/dashboard/vite.d.mts +2 -4
- package/dist/dashboard/vite.mjs +1 -2
- package/dist/dashboard.d.mts +2 -2
- package/dist/dashboard.mjs +1733 -1
- package/dist/dashboardTransport-C9290QgS.mjs +15 -0
- package/dist/{dashboardViteBridge-Dy3nAD4m.mjs → dashboardViteBridge-B7QgQo94.mjs} +11 -11
- package/dist/{dev-fR5GiJRO.mjs → dev-D1QSExwk.mjs} +6 -3
- package/dist/devProvider-Bcvz5nu4.mjs +4966 -0
- package/dist/docs/README.md +14 -6
- package/dist/docs/ai-workflows.md +2 -0
- package/dist/docs/mcp.md +11 -1
- package/dist/docs/troubleshooting.md +16 -0
- package/dist/docs/vue-sfc.md +25 -2
- package/dist/docs/weapp-config.md +29 -0
- package/dist/docs/wevu-authoring.md +2 -0
- package/dist/doctor-worker.mjs +5 -5
- package/dist/doctor.d.mts +2 -8
- package/dist/doctor.mjs +24 -31
- package/dist/engine-Mnnm_ALP.mjs +53 -0
- package/dist/file-5eEfbK60.mjs +1 -0
- package/dist/{file-sC3jD7Fh.mjs → file-D8mp5GmB.mjs} +50 -26
- package/dist/{files-BqxFIPRp.mjs → files-Cy9jURJu.mjs} +1 -2
- package/dist/forwardConsole-D2Q0RIqc.mjs +509 -0
- package/dist/getInstance-BXNVH7sU.mjs +1 -0
- package/dist/{getInstance-DiGSzBNI.mjs → getInstance-DfNlbr-X.mjs} +2 -3
- package/dist/history-dKxzoHmN.mjs +774 -0
- package/dist/i18n.d.mts +1 -3
- package/dist/i18n.mjs +1 -2
- package/dist/{index-C9HjUX5c.d.mts → index-DIZJRrvK.d.mts} +1 -24
- package/dist/{index-CaXAtb9e.d.mts → index-SnaW3cvA.d.mts} +0 -12
- package/dist/index.d.mts +3 -7
- package/dist/index.mjs +6 -6
- package/dist/{json-BL8Dhhk6.mjs → json-Cvon2mw5.mjs} +1 -2
- package/dist/json.d.mts +1 -1
- package/dist/json.mjs +1 -1
- package/dist/lib-CJyMBzoe.mjs +140 -0
- package/dist/{lifecycle-BROTlwSL.mjs → lifecycle-CUo8PMQc.mjs} +123 -33
- package/dist/{loadConfig-C3BQhz7F.mjs → loadConfig-CKIdfW4o.mjs} +2 -3
- package/dist/loadConfig-D4WGJcYp.mjs +1 -0
- package/dist/logBuildAppFinish-DOBoof6S.mjs +54 -0
- package/dist/mcp-D88QvQgG.mjs +84 -0
- package/dist/{mcp-Cj8Maqo6.mjs → mcp-ovJgl1N9.mjs} +2 -4
- package/dist/mcp.d.mts +1 -3
- package/dist/mcp.mjs +1 -1
- package/dist/mcpClient-C8JzVZ46.mjs +283 -0
- package/dist/{processCleanup-B6KA30Zc.mjs → metadata-HlDKtlsu.mjs} +2 -21
- package/dist/nodeEnv-zq1EymWj.mjs +6 -0
- package/dist/openIde-QoYKhuuM.mjs +643 -0
- package/dist/options-Cz8vZ-0w.mjs +33 -0
- package/dist/{chunkStrategy-DRA5WpB-.mjs → package-DR62fAzP.mjs} +32 -31
- package/dist/path-E1OjBJAl.mjs +43 -0
- package/dist/{platform-CnkySBKz.mjs → platform-BiMpsZIb.mjs} +1 -2
- package/dist/{pluginHost--CaeyWpA.mjs → pluginHost-vn8Vty1J.mjs} +1 -2
- package/dist/processCleanup-DzB64WI8.mjs +18 -0
- package/dist/{protocol-vg8HGJ4n.mjs → protocol-HiSJRrSO.mjs} +43 -41
- package/dist/reader-wzPH_W8A.mjs +92 -0
- package/dist/realpathScope-DwlLaCk3.mjs +22 -0
- package/dist/report-PJVyo-UZ.mjs +105 -0
- package/dist/{path-doV773b7.mjs → resolvedId-DaxPh_yV.mjs} +5 -50
- package/dist/{resolvers-Dod-euqX.mjs → resolvers-CKYqmRD_.mjs} +10 -20
- package/dist/resolvers.d.mts +1 -1
- package/dist/resolvers.mjs +1 -1
- package/dist/{routes-C7fCmf92.d.mts → routes-DvAFX29h.d.mts} +0 -2
- package/dist/{runtime-Ee2HY6gR.d.mts → runtime-BL4RjBRa.d.mts} +1 -9
- package/dist/runtime-CKtMVERT.mjs +42 -0
- package/dist/{runtime-D6VCNhNY.mjs → runtime-DDUCb7pP.mjs} +4 -8
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.mjs +1 -1
- package/dist/schematics-DikfOjMD.mjs +90 -0
- package/dist/{session-PskhD-nZ.mjs → session-COrQJYif.mjs} +81 -21
- package/dist/test.d.mts +1 -3
- package/dist/test.mjs +54 -30
- package/dist/types-BK2EQ3Jm.d.mts +37 -0
- package/dist/{types-CgZn5X6j.d.mts → types-e2BMP9NU.d.mts} +1 -4
- package/dist/types.d.mts +4 -4
- package/dist/{upload-D4msblBf.mjs → upload-Chal5b3w.mjs} +118 -24
- package/dist/upload-worker.mjs +3 -5
- package/dist/{utils-CJSCgEj6.mjs → utils-CTGSZp4j.mjs} +72 -146
- package/dist/vite.d.mts +2 -4
- package/dist/vite.mjs +55 -21
- package/dist/volar.mjs +1 -2
- package/dist/{wevu-BQWUU7br.mjs → wevu-BaihCXO9.mjs} +1 -2
- package/dist/wevu-DTtSOyxB.d.mts +3 -0
- package/dist/{wevu-router-Dg1LnBlg.mjs → wevu-router-BIoxDbnu.mjs} +1 -2
- package/dist/wevu-router-CdWurGQ4.d.mts +3 -0
- package/dist/wxs-7V7MPzeW.mjs +1 -0
- package/dist/wxs-BdHHXltv.mjs +110 -0
- package/package.json +62 -53
- 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
- package/dist/wevu-C4KEC5kO.d.mts +0 -5
- package/dist/wevu-router-Cg2sIkIE.d.mts +0 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
// 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
|
+
export { loadDashboardTransportModule as t };
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
+
import { t as loadDashboardTransportModule } from "./dashboardTransport-C9290QgS.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
|
+
// 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) => {
|
|
@@ -104,8 +102,7 @@ async function createDashboardMcp(instance, httpServer, options) {
|
|
|
104
102
|
}
|
|
105
103
|
};
|
|
106
104
|
}
|
|
107
|
-
|
|
108
|
-
//#region src/cli/analyze/dashboardPolicy.ts
|
|
105
|
+
// src/cli/analyze/dashboardPolicy.ts
|
|
109
106
|
const rejectDashboardSharedStateSet = defineRpcFunction({
|
|
110
107
|
name: "devframe:rpc:server-state:set",
|
|
111
108
|
type: "action",
|
|
@@ -131,8 +128,7 @@ function withStandaloneDashboardPolicy(definition) {
|
|
|
131
128
|
}
|
|
132
129
|
};
|
|
133
130
|
}
|
|
134
|
-
|
|
135
|
-
//#region src/cli/analyze/dashboardViteBridge.ts
|
|
131
|
+
// src/cli/analyze/dashboardViteBridge.ts
|
|
136
132
|
const ANALYZE_DASHBOARD_DEVFRAME_BASE = "/__weapp-vite/";
|
|
137
133
|
const ANALYZE_DASHBOARD_HUB_BASE = "/__devframes/";
|
|
138
134
|
const transportPaths = /* @__PURE__ */ new Set([
|
|
@@ -140,7 +136,7 @@ const transportPaths = /* @__PURE__ */ new Set([
|
|
|
140
136
|
`${ANALYZE_DASHBOARD_DEVFRAME_BASE}${DEVFRAME_SSE_ROUTE}`,
|
|
141
137
|
`${ANALYZE_DASHBOARD_DEVFRAME_BASE}${DEVFRAME_WS_ROUTE}`
|
|
142
138
|
]);
|
|
143
|
-
function createAnalyzeDashboardViteBridge(controller, options
|
|
139
|
+
function createAnalyzeDashboardViteBridge(controller, options) {
|
|
144
140
|
const hosts = /* @__PURE__ */ new WeakMap();
|
|
145
141
|
const ownedHosts = /* @__PURE__ */ new Set();
|
|
146
142
|
let activeHost;
|
|
@@ -168,6 +164,8 @@ function createAnalyzeDashboardViteBridge(controller, options = {}) {
|
|
|
168
164
|
if (closed) return;
|
|
169
165
|
if (!httpServer) throw new Error("Dashboard requires the Dashboard Vite HTTP server.");
|
|
170
166
|
if (options.uiHost === "hub") {
|
|
167
|
+
const [{ initHub }, { createUi }] = await Promise.all([loadDashboardTransportModule(options.packageJsonPath, "@devframes/hub/initiate"), loadDashboardTransportModule(options.packageJsonPath, "@devframes/hub-ui")]);
|
|
168
|
+
if (closed) return;
|
|
171
169
|
instance = initHub({
|
|
172
170
|
base: ANALYZE_DASHBOARD_HUB_BASE,
|
|
173
171
|
name: "weapp-vite DevTools",
|
|
@@ -188,6 +186,8 @@ function createAnalyzeDashboardViteBridge(controller, options = {}) {
|
|
|
188
186
|
});
|
|
189
187
|
await instance.ready;
|
|
190
188
|
} else {
|
|
189
|
+
const { initDevframe } = await loadDashboardTransportModule(options.packageJsonPath, "devframe/initiate");
|
|
190
|
+
if (closed) return;
|
|
191
191
|
instance = initDevframe(withStandaloneDashboardPolicy(controller.definition), {
|
|
192
192
|
base: ANALYZE_DASHBOARD_DEVFRAME_BASE,
|
|
193
193
|
distDir: false,
|
|
@@ -200,6 +200,7 @@ function createAnalyzeDashboardViteBridge(controller, options = {}) {
|
|
|
200
200
|
await instance.ready;
|
|
201
201
|
}
|
|
202
202
|
if (!closed) mcp = await createDashboardMcp(instance, httpServer, {
|
|
203
|
+
packageJsonPath: options.packageJsonPath,
|
|
203
204
|
projectRoot: options.projectRoot ?? process.cwd(),
|
|
204
205
|
id: controller.definition.id,
|
|
205
206
|
name: controller.definition.name,
|
|
@@ -295,5 +296,4 @@ function createAnalyzeDashboardViteBridge(controller, options = {}) {
|
|
|
295
296
|
}
|
|
296
297
|
};
|
|
297
298
|
}
|
|
298
|
-
//#endregion
|
|
299
299
|
export { ANALYZE_DASHBOARD_DEVFRAME_BASE, ANALYZE_DASHBOARD_HUB_BASE, createAnalyzeDashboardViteBridge };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { O as createViteWatchIgnored, m as notifyDevModuleGraphHost, t as createDevModuleGraphPlugin } from "./devProvider-Bcvz5nu4.mjs";
|
|
2
2
|
import { WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY } from "@weapp-core/constants";
|
|
3
|
-
|
|
3
|
+
// src/vite/dev.ts
|
|
4
4
|
/** 宿主仅提供依赖图和服务生命周期;小程序快照沿用原生构建落盘。 */
|
|
5
5
|
function prepareDevHostConfig(session, merged, user) {
|
|
6
6
|
const ctx = session.context;
|
|
@@ -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: [],
|
|
@@ -59,5 +63,4 @@ function prepareDevHostConfig(session, merged, user) {
|
|
|
59
63
|
}
|
|
60
64
|
};
|
|
61
65
|
}
|
|
62
|
-
//#endregion
|
|
63
66
|
export { prepareDevHostConfig };
|