weapp-vite 7.6.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 +6 -4
- package/THIRD_PARTY_NOTICES.md +3 -3
- 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-B3YZMA-h.mjs → action-BD56SQh4.mjs} +7 -8
- package/dist/{action-DlC6JYpt.mjs → action-CPtgEl6p.mjs} +9 -10
- package/dist/{action-BOk3vGI7.mjs → action-le0bNff_.mjs} +22 -30
- package/dist/{action-BELcDNNv.mjs → action-ytG5oFAw.mjs} +5 -6
- package/dist/{action-zEDY7oh_.mjs → action-zmJrU8PC.mjs} +11 -13
- package/dist/{analyze-DN79YOAH.mjs → analyze-DCZo-sJd.mjs} +3 -6
- package/dist/{artifacts-BOyC9Fy-.mjs → artifacts-TrTX9_jj.mjs} +2 -4
- package/dist/{assets-C5_YYXNk.mjs → assets-XyhpYtGl.mjs} +11 -18
- 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-CTLOHwgI.d.mts → budget-DTPngJU0.d.mts} +1 -9
- package/dist/{budget-EOeEycc_.mjs → budget-_Mu-4GKn.mjs} +2 -4
- package/dist/{builtProject-C29udgXY.mjs → builtProject-B145uOt5.mjs} +11 -18
- package/dist/{classifier-DBJY__kg.mjs → classifier-CNTJOYQL.mjs} +4 -5
- package/dist/cli-acceptance.mjs +3 -4
- package/dist/cli.mjs +55 -86
- package/dist/{config-DRGcCi3h.mjs → config-59ZWhCIf.mjs} +1 -2
- package/dist/{config-Bf6DWhyb.d.mts → config-BNx2BODw.d.mts} +13 -105
- 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-aYwi8wQt.mjs → createCompilerContextInstance-BXSdH2E8.mjs} +1710 -1511
- package/dist/{createContext-tApLtII-.mjs → createContext-W0TeXxbo.mjs} +3 -4
- package/dist/dashboard/analyze.d.mts +1 -7
- package/dist/dashboard/analyze.mjs +2 -2
- 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 +20 -36
- package/dist/{dashboardTransport-C_Y6jMp-.mjs → dashboardTransport-C9290QgS.mjs} +1 -2
- package/dist/{dashboardViteBridge-DCGR43aM.mjs → dashboardViteBridge-B7QgQo94.mjs} +4 -7
- package/dist/{dev-C2fgr_Xd.mjs → dev-D1QSExwk.mjs} +2 -3
- package/dist/devProvider-Bcvz5nu4.mjs +4966 -0
- package/dist/docs/README.md +6 -4
- package/dist/docs/ai-workflows.md +2 -0
- package/dist/docs/mcp.md +1 -1
- package/dist/docs/troubleshooting.md +8 -0
- package/dist/docs/weapp-config.md +29 -0
- package/dist/docs/wevu-authoring.md +2 -0
- package/dist/doctor-worker.mjs +5 -6
- package/dist/doctor.d.mts +2 -8
- package/dist/doctor.mjs +16 -25
- package/dist/{engine-C66J0HLz.mjs → engine-Mnnm_ALP.mjs} +1 -2
- package/dist/file-5eEfbK60.mjs +1 -0
- package/dist/{file-CcIOmqhC.mjs → file-D8mp5GmB.mjs} +6 -10
- package/dist/{files-BqxFIPRp.mjs → files-Cy9jURJu.mjs} +1 -2
- package/dist/{forwardConsole-B0Reo8Lf.mjs → forwardConsole-D2Q0RIqc.mjs} +5 -7
- package/dist/getInstance-BXNVH7sU.mjs +1 -0
- package/dist/{getInstance-Dt9IQDKr.mjs → getInstance-DfNlbr-X.mjs} +2 -3
- package/dist/{history-BIiRCzbq.mjs → history-dKxzoHmN.mjs} +18 -28
- package/dist/i18n.d.mts +1 -3
- package/dist/i18n.mjs +1 -2
- package/dist/{index-D5rgBzYZ.d.mts → index-DIZJRrvK.d.mts} +1 -23
- 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-DjccSI1B.mjs → lib-CJyMBzoe.mjs} +5 -8
- package/dist/{lifecycle-C36WSbQS.mjs → lifecycle-CUo8PMQc.mjs} +3 -6
- package/dist/{loadConfig-BWIsDXR4.mjs → loadConfig-CKIdfW4o.mjs} +2 -3
- package/dist/loadConfig-D4WGJcYp.mjs +1 -0
- package/dist/{logBuildAppFinish-ChjwATMv.mjs → logBuildAppFinish-DOBoof6S.mjs} +4 -7
- package/dist/{mcp-CYgX9HpO.mjs → mcp-D88QvQgG.mjs} +3 -5
- 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-DVLvFLZv.mjs → mcpClient-C8JzVZ46.mjs} +4 -8
- package/dist/{metadata-hwF7QRcS.mjs → metadata-HlDKtlsu.mjs} +1 -2
- package/dist/{nodeEnv-BmH8UZPR.mjs → nodeEnv-zq1EymWj.mjs} +1 -2
- package/dist/{openIde-CroqOgk5.mjs → openIde-QoYKhuuM.mjs} +8 -13
- package/dist/{options-jqFwfD1G.mjs → options-Cz8vZ-0w.mjs} +1 -2
- package/dist/{chunkStrategy-DY_LZIIe.mjs → package-DR62fAzP.mjs} +20 -31
- package/dist/{path-CYYIQGS7.mjs → path-E1OjBJAl.mjs} +1 -2
- package/dist/{platform-CnkySBKz.mjs → platform-BiMpsZIb.mjs} +1 -2
- package/dist/{pluginHost--CaeyWpA.mjs → pluginHost-vn8Vty1J.mjs} +1 -2
- package/dist/{processCleanup-BQn2kTcK.mjs → processCleanup-DzB64WI8.mjs} +1 -2
- package/dist/{protocol-Cg6Jdlvb.mjs → protocol-HiSJRrSO.mjs} +2 -3
- package/dist/{reader-sh_POQ9-.mjs → reader-wzPH_W8A.mjs} +1 -2
- package/dist/{realpathScope-Tf9mz-fh.mjs → realpathScope-DwlLaCk3.mjs} +1 -2
- package/dist/{report-hyonPGbZ.mjs → report-PJVyo-UZ.mjs} +2 -4
- package/dist/{resolvedId-CiDl7SC1.mjs → resolvedId-DaxPh_yV.mjs} +2 -4
- 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-DpVf714f.d.mts → runtime-BL4RjBRa.d.mts} +0 -8
- package/dist/{runtime-CLUhQsdA.mjs → runtime-CKtMVERT.mjs} +2 -3
- 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-kO26eQRT.mjs → schematics-DikfOjMD.mjs} +1 -2
- package/dist/{session-D3zsdzIy.mjs → session-COrQJYif.mjs} +16 -18
- package/dist/test.d.mts +1 -3
- package/dist/test.mjs +50 -28
- package/dist/{types-D0FFexRF.d.mts → types-BK2EQ3Jm.d.mts} +0 -2
- package/dist/{types-D-kfuyVa.d.mts → types-e2BMP9NU.d.mts} +0 -2
- package/dist/types.d.mts +4 -4
- package/dist/{upload-DozK8UdN.mjs → upload-Chal5b3w.mjs} +11 -21
- package/dist/upload-worker.mjs +3 -5
- package/dist/{utils-Dy51PYAC.mjs → utils-CTGSZp4j.mjs} +20 -34
- package/dist/vite.d.mts +2 -4
- package/dist/vite.mjs +9 -14
- 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-BT8btflA.mjs → wxs-BdHHXltv.mjs} +2 -4
- package/package.json +46 -43
- package/dist/devProvider-D-hTfsEO.mjs +0 -3027
- package/dist/file-DtcteQ4G.mjs +0 -1
- package/dist/getInstance-BAIaU2y9.mjs +0 -1
- package/dist/loadConfig-D-BpBgsk.mjs +0 -1
- package/dist/package-Cmakyy3J.mjs +0 -4
- package/dist/wevu-C4KEC5kO.d.mts +0 -5
- package/dist/wevu-router-Cg2sIkIE.d.mts +0 -5
- package/dist/wxs-Z4VQDeJ_.mjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as initializeCompilerContext } from "./createCompilerContextInstance-
|
|
2
|
-
import { n as resetCompilerContext, r as setActiveCompilerContextKey, t as getCompilerContext } from "./getInstance-
|
|
3
|
-
|
|
1
|
+
import { A as initializeCompilerContext } from "./createCompilerContextInstance-BXSdH2E8.mjs";
|
|
2
|
+
import { n as resetCompilerContext, r as setActiveCompilerContextKey, t as getCompilerContext } from "./getInstance-DfNlbr-X.mjs";
|
|
3
|
+
// src/createContext.ts
|
|
4
4
|
/** 保留历史活动上下文适配;新宿主通过 CompilerSession 创建独立会话。 */
|
|
5
5
|
async function createCompilerContext(options) {
|
|
6
6
|
const key = options?.key ?? "default";
|
|
@@ -11,5 +11,4 @@ async function createCompilerContext(options) {
|
|
|
11
11
|
setActiveCompilerContextKey(key);
|
|
12
12
|
return initializeCompilerContext(getCompilerContext(key), options);
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { createCompilerContext as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { a as AnalyzeSubpackagesResult, n as AnalyzeBudgetCheckItem, o as ModuleSourceType, r as createAnalyzeBudgetCheck, t as AnalyzeBudgetCheckInput } from "../budget-
|
|
2
|
-
//#region src/dashboard/analyze/types.d.ts
|
|
1
|
+
import { a as AnalyzeSubpackagesResult, n as AnalyzeBudgetCheckItem, o as ModuleSourceType, r as createAnalyzeBudgetCheck, t as AnalyzeBudgetCheckInput } from "../budget-DTPngJU0.mjs";
|
|
3
2
|
interface DuplicateModuleInsight {
|
|
4
3
|
id: string;
|
|
5
4
|
source: string;
|
|
@@ -36,13 +35,8 @@ interface AnalyzeComparison {
|
|
|
36
35
|
files: AnalyzeSizeChange[];
|
|
37
36
|
modules: AnalyzeSizeChange[];
|
|
38
37
|
}
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/dashboard/analyze/comparison.d.ts
|
|
41
38
|
/** 比较两个真实快照;模块仅按已记录的 chunk 贡献归并,缺失测量不视为零。 */
|
|
42
39
|
export declare function createAnalyzeComparison(current: Pick<AnalyzeSubpackagesResult, 'packages'>, previous: Pick<AnalyzeSubpackagesResult, 'packages'>): AnalyzeComparison;
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/dashboard/analyze/duplicates.d.ts
|
|
45
40
|
/** 按原始模块 ID 统计跨包重复,节省量是估算值,不代表可安全移除的字节。 */
|
|
46
41
|
export declare function createDuplicateModuleInsights(result: Pick<AnalyzeSubpackagesResult, 'packages' | 'modules'>): DuplicateModuleInsight[];
|
|
47
|
-
//#endregion
|
|
48
42
|
export { type AnalyzeBudgetCheckInput, type AnalyzeBudgetCheckItem, type AnalyzeComparison, type AnalyzeSizeChange, type AnalyzeSubpackagesResult, type DuplicateModuleInsight, createAnalyzeBudgetCheck };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as createAnalyzeBudgetCheck } from "../budget-
|
|
2
|
-
import { r as createAnalyzeComparison, t as createDuplicateModuleInsights } from "../analyze-
|
|
1
|
+
import { t as createAnalyzeBudgetCheck } from "../budget-_Mu-4GKn.mjs";
|
|
2
|
+
import { r as createAnalyzeComparison, t as createDuplicateModuleInsights } from "../analyze-DCZo-sJd.mjs";
|
|
3
3
|
export { createAnalyzeBudgetCheck, createAnalyzeComparison, createDuplicateModuleInsights };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { t as AnalyzeDashboardDevframeController } from "../index-
|
|
1
|
+
import { t as AnalyzeDashboardDevframeController } from "../index-DIZJRrvK.mjs";
|
|
2
2
|
import { Plugin } from "vite";
|
|
3
|
-
//#region src/dashboard/vite.d.ts
|
|
4
3
|
export interface AnalyzeDashboardPluginOptions {
|
|
5
4
|
base?: string;
|
|
6
5
|
}
|
|
7
6
|
/** 使用官方适配器挂载到现有 Vite DevTools;认证、Origin 与 MCP 策略由宿主负责。 */
|
|
8
|
-
export declare function createAnalyzeDashboardPlugin(controller: AnalyzeDashboardDevframeController, options?: AnalyzeDashboardPluginOptions): Plugin;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare function createAnalyzeDashboardPlugin(controller: AnalyzeDashboardDevframeController, options?: AnalyzeDashboardPluginOptions): Plugin;
|
package/dist/dashboard/vite.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { isAbsolute, join } from "node:path";
|
|
3
3
|
import { createPluginFromDevframe } from "@vitejs/devtools-kit/node";
|
|
4
|
-
|
|
4
|
+
// src/dashboard/vite.ts
|
|
5
5
|
/** 使用官方适配器挂载到现有 Vite DevTools;认证、Origin 与 MCP 策略由宿主负责。 */
|
|
6
6
|
function createAnalyzeDashboardPlugin(controller, options = {}) {
|
|
7
7
|
const plugin = createPluginFromDevframe(controller.definition, { base: options.base === void 0 ? void 0 : `/${options.base}/`.replace(/\/+/g, "/") });
|
|
@@ -40,5 +40,4 @@ function createAnalyzeDashboardPlugin(controller, options = {}) {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
//#endregion
|
|
44
43
|
export { createAnalyzeDashboardPlugin };
|
package/dist/dashboard.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as AnalyzeSubpackagesResult } from "./budget-
|
|
2
|
-
import { A as DashboardInvestigationReceiptInput, B as DashboardRuntimeEventInput, C as DashboardClaimInvestigationRequest, D as DashboardInvestigationClaim, E as DashboardInvestigation, F as DashboardObjectMeasurements, G as DashboardFileReadRequest, H as DashboardRuntimeEventsPage, I as DashboardProposeInvestigationRequest, J as DashboardArtifactFiles, K as DashboardContentRoots, L as DashboardReportIdentity, M as DashboardInvestigationStatus, N as DashboardInvestigationTarget, O as DashboardInvestigationProposal, P as DashboardInvestigationsState, R as DashboardVerifyInvestigationRequest, S as DashboardAuthorizeInvestigationRequest, T as DashboardCreateInvestigationRequest, U as DashboardRuntimeEventsQueryRequest, V as DashboardRuntimeEventProfile, W as DashboardFileContent, Y as createDashboardArtifactSnapshot, _ as DashboardAnalyzePage, a as createAnalyzeDashboardDevframe, b as DashboardAnalyzePayloadsDescriptor, c as DashboardAnalyzeSummary, d as DashboardComparisonPage, f as DashboardComparisonQuery, g as DashboardPackagesQuery, h as DashboardPackagesPage, i as DashboardDevframeState, j as DashboardInvestigationRequest, k as DashboardInvestigationProposalInput, l as DashboardArtifactsPage, m as DashboardModulesQuery, n as CreateAnalyzeDashboardDevframeOptions, o as resolveDashboardClientAssets, p as DashboardModulesPage, q as DashboardArtifactFile, r as DashboardAnalyzeSnapshot, s as DashboardAnalyzeQuery, t as AnalyzeDashboardDevframeController, u as DashboardArtifactsQuery, v as DashboardAnalyzePageRequest, w as DashboardCompleteInvestigationRequest, x as DashboardAgentInvestigationRequest, y as DashboardAnalyzePayloadDescriptor, z as DashboardRuntimeEvent } from "./index-
|
|
1
|
+
import { a as AnalyzeSubpackagesResult } from "./budget-DTPngJU0.mjs";
|
|
2
|
+
import { A as DashboardInvestigationReceiptInput, B as DashboardRuntimeEventInput, C as DashboardClaimInvestigationRequest, D as DashboardInvestigationClaim, E as DashboardInvestigation, F as DashboardObjectMeasurements, G as DashboardFileReadRequest, H as DashboardRuntimeEventsPage, I as DashboardProposeInvestigationRequest, J as DashboardArtifactFiles, K as DashboardContentRoots, L as DashboardReportIdentity, M as DashboardInvestigationStatus, N as DashboardInvestigationTarget, O as DashboardInvestigationProposal, P as DashboardInvestigationsState, R as DashboardVerifyInvestigationRequest, S as DashboardAuthorizeInvestigationRequest, T as DashboardCreateInvestigationRequest, U as DashboardRuntimeEventsQueryRequest, V as DashboardRuntimeEventProfile, W as DashboardFileContent, Y as createDashboardArtifactSnapshot, _ as DashboardAnalyzePage, a as createAnalyzeDashboardDevframe, b as DashboardAnalyzePayloadsDescriptor, c as DashboardAnalyzeSummary, d as DashboardComparisonPage, f as DashboardComparisonQuery, g as DashboardPackagesQuery, h as DashboardPackagesPage, i as DashboardDevframeState, j as DashboardInvestigationRequest, k as DashboardInvestigationProposalInput, l as DashboardArtifactsPage, m as DashboardModulesQuery, n as CreateAnalyzeDashboardDevframeOptions, o as resolveDashboardClientAssets, p as DashboardModulesPage, q as DashboardArtifactFile, r as DashboardAnalyzeSnapshot, s as DashboardAnalyzeQuery, t as AnalyzeDashboardDevframeController, u as DashboardArtifactsQuery, v as DashboardAnalyzePageRequest, w as DashboardCompleteInvestigationRequest, x as DashboardAgentInvestigationRequest, y as DashboardAnalyzePayloadDescriptor, z as DashboardRuntimeEvent } from "./index-DIZJRrvK.mjs";
|
|
3
3
|
export { AnalyzeDashboardDevframeController, type AnalyzeSubpackagesResult, CreateAnalyzeDashboardDevframeOptions, type DashboardAgentInvestigationRequest, type DashboardAnalyzePage, type DashboardAnalyzePageRequest, type DashboardAnalyzePayloadDescriptor, type DashboardAnalyzePayloadsDescriptor, type DashboardAnalyzeQuery, DashboardAnalyzeSnapshot, type DashboardAnalyzeSummary, type DashboardArtifactFile, type DashboardArtifactFiles, type DashboardArtifactsPage, type DashboardArtifactsQuery, type DashboardAuthorizeInvestigationRequest, type DashboardClaimInvestigationRequest, type DashboardComparisonPage, type DashboardComparisonQuery, type DashboardCompleteInvestigationRequest, type DashboardContentRoots, type DashboardCreateInvestigationRequest, DashboardDevframeState, type DashboardFileContent, type DashboardFileReadRequest, type DashboardInvestigation, type DashboardInvestigationClaim, type DashboardInvestigationProposal, type DashboardInvestigationProposalInput, type DashboardInvestigationReceiptInput, type DashboardInvestigationRequest, type DashboardInvestigationStatus, type DashboardInvestigationTarget, type DashboardInvestigationsState, type DashboardModulesPage, type DashboardModulesQuery, type DashboardObjectMeasurements, type DashboardPackagesPage, type DashboardPackagesQuery, type DashboardProposeInvestigationRequest, type DashboardReportIdentity, type DashboardRuntimeEvent, type DashboardRuntimeEventInput, type DashboardRuntimeEventProfile, type DashboardRuntimeEventsPage, type DashboardRuntimeEventsQueryRequest, type DashboardVerifyInvestigationRequest, createAnalyzeDashboardDevframe, createDashboardArtifactSnapshot, resolveDashboardClientAssets };
|
package/dist/dashboard.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as VERSION } from "./constants-
|
|
2
|
-
import { i as resolveDashboardClientAssets, n as createDashboardArtifactSnapshot, t as MAX_DASHBOARD_FILE_CONTENT_BYTES } from "./artifacts-
|
|
3
|
-
import { t as createAnalyzeBudgetCheck } from "./budget-
|
|
4
|
-
import { n as createModuleByteMap, r as createAnalyzeComparison, t as createDuplicateModuleInsights } from "./analyze-
|
|
1
|
+
import { t as VERSION } from "./constants-BOe8mgqL.mjs";
|
|
2
|
+
import { i as resolveDashboardClientAssets, n as createDashboardArtifactSnapshot, t as MAX_DASHBOARD_FILE_CONTENT_BYTES } from "./artifacts-TrTX9_jj.mjs";
|
|
3
|
+
import { t as createAnalyzeBudgetCheck } from "./budget-_Mu-4GKn.mjs";
|
|
4
|
+
import { n as createModuleByteMap, r as createAnalyzeComparison, t as createDuplicateModuleInsights } from "./analyze-DCZo-sJd.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import path from "pathe";
|
|
7
7
|
import fs from "node:fs";
|
|
@@ -9,7 +9,7 @@ import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
|
9
9
|
import { Buffer } from "node:buffer";
|
|
10
10
|
import { defineDevframe, defineRpcFunction } from "devframe";
|
|
11
11
|
import { z } from "zod";
|
|
12
|
-
|
|
12
|
+
// src/dashboard/excerpt.ts
|
|
13
13
|
/** 按已校验的 UTF-16 范围截取内容,保留换行与代理项,不改变完整文件大小。 */
|
|
14
14
|
function createDashboardFileExcerpt(content, range) {
|
|
15
15
|
if (!range) return { content };
|
|
@@ -25,8 +25,7 @@ function createDashboardFileExcerpt(content, range) {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
//#region src/dashboard/paths.ts
|
|
28
|
+
// src/dashboard/paths.ts
|
|
30
29
|
function normalizeDashboardRelativePath(value) {
|
|
31
30
|
return value.replaceAll("\\", "/");
|
|
32
31
|
}
|
|
@@ -121,8 +120,7 @@ function resolveDashboardArtifactPath(requestPath, allowedPaths) {
|
|
|
121
120
|
if (!normalizedPath || normalizedPath.includes("\0") || path.isAbsolute(normalizedPath) || path.posix.normalize(normalizedPath).startsWith("..") || !allowedPaths.has(normalizedPath)) return;
|
|
122
121
|
return normalizedPath;
|
|
123
122
|
}
|
|
124
|
-
|
|
125
|
-
//#region src/dashboard/investigations/schema.ts
|
|
123
|
+
// src/dashboard/investigations/schema.ts
|
|
126
124
|
const id = z.string().uuid();
|
|
127
125
|
const version = z.number().int().positive();
|
|
128
126
|
const text = z.string().trim().min(1).max(4096);
|
|
@@ -246,8 +244,7 @@ const verifyInvestigationRequestSchema = investigationRequestSchema.extend({
|
|
|
246
244
|
report: reportIdentitySchema,
|
|
247
245
|
summary: text
|
|
248
246
|
});
|
|
249
|
-
|
|
250
|
-
//#region src/dashboard/schema.ts
|
|
247
|
+
// src/dashboard/schema.ts
|
|
251
248
|
const nonnegativeInteger = z.number().int().nonnegative();
|
|
252
249
|
const revisionSchema = nonnegativeInteger.describe("Revision from get-dashboard-state; refresh state if it becomes stale.");
|
|
253
250
|
const analyzeTargetSchema = z.enum(["current", "previous"]);
|
|
@@ -348,8 +345,7 @@ const dashboardStateSchema = z.object({
|
|
|
348
345
|
revision: revisionSchema,
|
|
349
346
|
runtimeEvents: z.array(dashboardRuntimeEventSchema)
|
|
350
347
|
});
|
|
351
|
-
|
|
352
|
-
//#region src/dashboard/content.ts
|
|
348
|
+
// src/dashboard/content.ts
|
|
353
349
|
function isPathWithin(rootPath, targetPath) {
|
|
354
350
|
const relativePath = path.relative(rootPath, targetPath);
|
|
355
351
|
return !relativePath || !relativePath.startsWith("..") && !path.isAbsolute(relativePath);
|
|
@@ -579,8 +575,7 @@ function queryDashboardRuntimeEvents(events, dropped, input) {
|
|
|
579
575
|
}
|
|
580
576
|
};
|
|
581
577
|
}
|
|
582
|
-
|
|
583
|
-
//#region src/dashboard/events.ts
|
|
578
|
+
// src/dashboard/events.ts
|
|
584
579
|
function createDashboardRuntimeEvent(input) {
|
|
585
580
|
const occurredAt = /* @__PURE__ */ new Date();
|
|
586
581
|
return {
|
|
@@ -630,8 +625,7 @@ function createDashboardRuntimeEventStore(initialInputs) {
|
|
|
630
625
|
}
|
|
631
626
|
};
|
|
632
627
|
}
|
|
633
|
-
|
|
634
|
-
//#region src/dashboard/investigations/rpc.ts
|
|
628
|
+
// src/dashboard/investigations/rpc.ts
|
|
635
629
|
/** 浏览器所有者操作刻意不声明 agent,由 DevFrame 的默认拒绝边界隔离。 */
|
|
636
630
|
function createDashboardInvestigationRpc(store) {
|
|
637
631
|
return [
|
|
@@ -747,8 +741,7 @@ function createDashboardInvestigationRpc(store) {
|
|
|
747
741
|
})
|
|
748
742
|
];
|
|
749
743
|
}
|
|
750
|
-
|
|
751
|
-
//#region src/dashboard/investigations/target.ts
|
|
744
|
+
// src/dashboard/investigations/target.ts
|
|
752
745
|
/** 不把缺失测量计为零,也不混合原始、压缩与模块归因体积。 */
|
|
753
746
|
function sumMeasured(files, key) {
|
|
754
747
|
let total = 0;
|
|
@@ -792,8 +785,7 @@ function resolveInvestigationTarget(result, target) {
|
|
|
792
785
|
sourceBytes: occurrence?.originalBytes ?? null
|
|
793
786
|
};
|
|
794
787
|
}
|
|
795
|
-
|
|
796
|
-
//#region src/dashboard/investigations/store.ts
|
|
788
|
+
// src/dashboard/investigations/store.ts
|
|
797
789
|
const terminal = {
|
|
798
790
|
completed: true,
|
|
799
791
|
failed: true,
|
|
@@ -986,8 +978,7 @@ const dashboardLogo = `data:image/svg+xml,${encodeURIComponent(`<svg width="36"
|
|
|
986
978
|
</linearGradient>
|
|
987
979
|
</defs>
|
|
988
980
|
</svg>`)}`;
|
|
989
|
-
|
|
990
|
-
//#region src/dashboard/payload.ts
|
|
981
|
+
// src/dashboard/payload.ts
|
|
991
982
|
const MAX_DASHBOARD_ANALYZE_PAGE_CHARACTERS = 65536;
|
|
992
983
|
const STALE_DASHBOARD_ANALYZE_REVISION_MESSAGE = "Analyze revision 已变化,请重新获取 Dashboard 状态。";
|
|
993
984
|
function serializeDashboardAnalyzePayload(result) {
|
|
@@ -1023,8 +1014,7 @@ function readDashboardAnalyzePage(input, revision, snapshot) {
|
|
|
1023
1014
|
target: request.target
|
|
1024
1015
|
};
|
|
1025
1016
|
}
|
|
1026
|
-
|
|
1027
|
-
//#region src/dashboard/queries/schema.ts
|
|
1017
|
+
// src/dashboard/queries/schema.ts
|
|
1028
1018
|
const count = z.number().int().nonnegative();
|
|
1029
1019
|
const packageType = z.enum([
|
|
1030
1020
|
"main",
|
|
@@ -1240,8 +1230,7 @@ const comparisonPageSchema = z.object({
|
|
|
1240
1230
|
advice: z.string().optional()
|
|
1241
1231
|
}))
|
|
1242
1232
|
});
|
|
1243
|
-
|
|
1244
|
-
//#region src/dashboard/queries/shared.ts
|
|
1233
|
+
// src/dashboard/queries/shared.ts
|
|
1245
1234
|
function summarizeBudget(item) {
|
|
1246
1235
|
if (!item) return null;
|
|
1247
1236
|
const { id, label, scope, currentBytes, limitBytes, ratio, status, measurement } = item;
|
|
@@ -1333,8 +1322,7 @@ function createModulePlacementIndex(result) {
|
|
|
1333
1322
|
}
|
|
1334
1323
|
return index;
|
|
1335
1324
|
}
|
|
1336
|
-
|
|
1337
|
-
//#region src/dashboard/queries/analysis.ts
|
|
1325
|
+
// src/dashboard/queries/analysis.ts
|
|
1338
1326
|
function getAnalyzeSummary(read, input) {
|
|
1339
1327
|
const { result, context, previousAvailable } = selectAnalyzeReport(read, analyzeQuerySchema.parse(input));
|
|
1340
1328
|
const budgets = createAnalyzeBudgetCheck(result);
|
|
@@ -1395,8 +1383,7 @@ function compareAnalyzeBuilds(read, input) {
|
|
|
1395
1383
|
...paginate(items, request)
|
|
1396
1384
|
};
|
|
1397
1385
|
}
|
|
1398
|
-
|
|
1399
|
-
//#region src/dashboard/queries/catalog.ts
|
|
1386
|
+
// src/dashboard/queries/catalog.ts
|
|
1400
1387
|
function queryAnalyzePackages(read, input) {
|
|
1401
1388
|
const request = packagesQuerySchema.parse(input);
|
|
1402
1389
|
const { result, context } = selectAnalyzeReport(read, request);
|
|
@@ -1495,8 +1482,7 @@ function queryAnalyzeModules(read, input) {
|
|
|
1495
1482
|
...paginate(items, request)
|
|
1496
1483
|
};
|
|
1497
1484
|
}
|
|
1498
|
-
|
|
1499
|
-
//#region src/dashboard/queries/index.ts
|
|
1485
|
+
// src/dashboard/queries/index.ts
|
|
1500
1486
|
function createDashboardAnalyzeQueries(read) {
|
|
1501
1487
|
return {
|
|
1502
1488
|
summary: defineRpcFunction({
|
|
@@ -1566,8 +1552,7 @@ function createDashboardAnalyzeQueries(read) {
|
|
|
1566
1552
|
})
|
|
1567
1553
|
};
|
|
1568
1554
|
}
|
|
1569
|
-
|
|
1570
|
-
//#region src/dashboard/index.ts
|
|
1555
|
+
// src/dashboard/index.ts
|
|
1571
1556
|
const DEVFRAME_ID = "weapp-vite";
|
|
1572
1557
|
/** 创建只读分析与任务元数据能力,不执行外部工作,也不修改宿主认证策略。 */
|
|
1573
1558
|
function createAnalyzeDashboardDevframe({ snapshot: initialSnapshot, roots, initialEvents = [], clientAssets }) {
|
|
@@ -1745,5 +1730,4 @@ function createAnalyzeDashboardDevframe({ snapshot: initialSnapshot, roots, init
|
|
|
1745
1730
|
}
|
|
1746
1731
|
};
|
|
1747
1732
|
}
|
|
1748
|
-
//#endregion
|
|
1749
1733
|
export { createAnalyzeDashboardDevframe, createDashboardArtifactSnapshot, resolveDashboardClientAssets };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
|
-
|
|
3
|
+
// src/cli/analyze/dashboardTransport/index.ts
|
|
4
4
|
/** 从已选 Dashboard 的安装位置解析传输依赖,兼容嵌套安装和包管理器的虚拟目录。 */
|
|
5
5
|
async function loadDashboardTransportModule(packageJsonPath, specifier) {
|
|
6
6
|
const require = createRequire(packageJsonPath);
|
|
@@ -12,5 +12,4 @@ async function loadDashboardTransportModule(packageJsonPath, specifier) {
|
|
|
12
12
|
}
|
|
13
13
|
return import(pathToFileURL(resolved).href);
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { loadDashboardTransportModule as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as loadDashboardTransportModule } from "./dashboardTransport-
|
|
1
|
+
import { t as loadDashboardTransportModule } from "./dashboardTransport-C9290QgS.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import path from "pathe";
|
|
4
4
|
import { defineRpcFunction } from "devframe";
|
|
@@ -7,7 +7,7 @@ import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_SSE_ROUTE, DEVFRAME_WS_ROUT
|
|
|
7
7
|
import { toNodeHandler } from "@modelcontextprotocol/node";
|
|
8
8
|
import { registerDevframeInstance } from "devframe/internal";
|
|
9
9
|
import { isLoopbackAddress, validateOriginCandidate } from "devframe/utils/origin";
|
|
10
|
-
|
|
10
|
+
// src/cli/analyze/dashboardMcp.ts
|
|
11
11
|
const MCP_ROUTE = "__mcp";
|
|
12
12
|
/** MCP 只公开 Dashboard 的 Agent RPC,不继承宿主工具、浏览器 OTP 或共享状态。 */
|
|
13
13
|
async function createDashboardMcp(instance, httpServer, options) {
|
|
@@ -102,8 +102,7 @@ async function createDashboardMcp(instance, httpServer, options) {
|
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
|
|
106
|
-
//#region src/cli/analyze/dashboardPolicy.ts
|
|
105
|
+
// src/cli/analyze/dashboardPolicy.ts
|
|
107
106
|
const rejectDashboardSharedStateSet = defineRpcFunction({
|
|
108
107
|
name: "devframe:rpc:server-state:set",
|
|
109
108
|
type: "action",
|
|
@@ -129,8 +128,7 @@ function withStandaloneDashboardPolicy(definition) {
|
|
|
129
128
|
}
|
|
130
129
|
};
|
|
131
130
|
}
|
|
132
|
-
|
|
133
|
-
//#region src/cli/analyze/dashboardViteBridge.ts
|
|
131
|
+
// src/cli/analyze/dashboardViteBridge.ts
|
|
134
132
|
const ANALYZE_DASHBOARD_DEVFRAME_BASE = "/__weapp-vite/";
|
|
135
133
|
const ANALYZE_DASHBOARD_HUB_BASE = "/__devframes/";
|
|
136
134
|
const transportPaths = /* @__PURE__ */ new Set([
|
|
@@ -298,5 +296,4 @@ function createAnalyzeDashboardViteBridge(controller, options) {
|
|
|
298
296
|
}
|
|
299
297
|
};
|
|
300
298
|
}
|
|
301
|
-
//#endregion
|
|
302
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;
|
|
@@ -63,5 +63,4 @@ function prepareDevHostConfig(session, merged, user) {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
//#endregion
|
|
67
66
|
export { prepareDevHostConfig };
|