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,7 +1,6 @@
|
|
|
1
|
-
import { a as AnalyzeSubpackagesResult } from "./budget-
|
|
1
|
+
import { a as AnalyzeSubpackagesResult } from "./budget-DTPngJU0.mjs";
|
|
2
2
|
import { DevframeDefinition } from "devframe";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
//#region src/dashboard/artifacts.d.ts
|
|
5
4
|
interface DashboardArtifactFile {
|
|
6
5
|
readonly size: number;
|
|
7
6
|
readonly content?: string;
|
|
@@ -13,16 +12,12 @@ declare function createDashboardArtifactSnapshot(): {
|
|
|
13
12
|
files: DashboardArtifactFiles;
|
|
14
13
|
capture(fileName: string, source: string | Uint8Array): void;
|
|
15
14
|
};
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/dashboard/paths.d.ts
|
|
18
15
|
type DashboardFileKind = 'artifact' | 'source';
|
|
19
16
|
interface DashboardContentRoots {
|
|
20
17
|
pluginRoot?: string;
|
|
21
18
|
projectRoot?: string;
|
|
22
19
|
srcRoot?: string;
|
|
23
20
|
}
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/dashboard/schema.d.ts
|
|
26
21
|
declare const dashboardFileRangeSchema: z.ZodObject<{
|
|
27
22
|
offset: z.ZodNumber;
|
|
28
23
|
totalCharacters: z.ZodNumber;
|
|
@@ -42,8 +37,6 @@ declare const dashboardFileReadRequestSchema: z.ZodObject<{
|
|
|
42
37
|
revision: z.ZodNumber;
|
|
43
38
|
}, z.core.$strip>;
|
|
44
39
|
type DashboardFileReadRequest = z.infer<typeof dashboardFileReadRequestSchema>;
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/dashboard/content.d.ts
|
|
47
40
|
interface DashboardFileContent {
|
|
48
41
|
content: string;
|
|
49
42
|
kind: DashboardFileKind;
|
|
@@ -52,8 +45,6 @@ interface DashboardFileContent {
|
|
|
52
45
|
size: number;
|
|
53
46
|
range?: DashboardFileRange;
|
|
54
47
|
}
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/dashboard/eventsQuery.d.ts
|
|
57
48
|
declare const dashboardRuntimeEventsQueryRequestSchema: z.ZodObject<{
|
|
58
49
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
59
50
|
command: "command";
|
|
@@ -133,8 +124,6 @@ declare const dashboardRuntimeEventsPageSchema: z.ZodObject<{
|
|
|
133
124
|
}, z.core.$strip>;
|
|
134
125
|
type DashboardRuntimeEventsQueryRequest = z.infer<typeof dashboardRuntimeEventsQueryRequestSchema>;
|
|
135
126
|
type DashboardRuntimeEventsPage = z.infer<typeof dashboardRuntimeEventsPageSchema>;
|
|
136
|
-
//#endregion
|
|
137
|
-
//#region src/dashboard/events.d.ts
|
|
138
127
|
type DashboardRuntimeEventKind = 'command' | 'build' | 'diagnostic' | 'hmr' | 'system';
|
|
139
128
|
type DashboardRuntimeEventLevel = 'info' | 'success' | 'warning' | 'error';
|
|
140
129
|
interface DashboardRuntimeEvent extends DashboardRuntimeEventInput {
|
|
@@ -178,8 +167,6 @@ interface DashboardRuntimeEventInput {
|
|
|
178
167
|
tags?: string[];
|
|
179
168
|
profile?: DashboardRuntimeEventProfile;
|
|
180
169
|
}
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region src/dashboard/investigations/types.d.ts
|
|
183
170
|
type DashboardInvestigationTarget = {
|
|
184
171
|
kind: 'package';
|
|
185
172
|
packageId: string;
|
|
@@ -294,8 +281,6 @@ interface DashboardVerifyInvestigationRequest extends DashboardInvestigationRequ
|
|
|
294
281
|
report: DashboardReportIdentity;
|
|
295
282
|
summary: string;
|
|
296
283
|
}
|
|
297
|
-
//#endregion
|
|
298
|
-
//#region src/dashboard/payload.d.ts
|
|
299
284
|
interface DashboardAnalyzePayloadDescriptor {
|
|
300
285
|
characters: number;
|
|
301
286
|
hash: string;
|
|
@@ -317,8 +302,6 @@ interface DashboardAnalyzePage {
|
|
|
317
302
|
revision: number;
|
|
318
303
|
target: DashboardAnalyzePageRequest['target'];
|
|
319
304
|
}
|
|
320
|
-
//#endregion
|
|
321
|
-
//#region src/dashboard/queries/schema.d.ts
|
|
322
305
|
declare const analyzeQuerySchema: z.ZodObject<{
|
|
323
306
|
revision: z.ZodNumber;
|
|
324
307
|
target: z.ZodDefault<z.ZodEnum<{
|
|
@@ -673,12 +656,8 @@ type DashboardModulesQuery = z.input<typeof modulesQuerySchema>;
|
|
|
673
656
|
type DashboardModulesPage = z.output<typeof modulesPageSchema>;
|
|
674
657
|
type DashboardComparisonQuery = z.input<typeof comparisonQuerySchema>;
|
|
675
658
|
type DashboardComparisonPage = z.output<typeof comparisonPageSchema>;
|
|
676
|
-
//#endregion
|
|
677
|
-
//#region src/dashboard/assets.d.ts
|
|
678
659
|
/** 定位可选仪表盘包的原生构建 SPA;未安装或尚未构建时返回 undefined。 */
|
|
679
660
|
declare function resolveDashboardClientAssets(cwd?: string): string | undefined;
|
|
680
|
-
//#endregion
|
|
681
|
-
//#region src/dashboard/index.d.ts
|
|
682
661
|
/** 报告与产物在发布后不可再修改;控制器只保留引用,不复制或清空调用方的 Map。 */
|
|
683
662
|
interface DashboardAnalyzeSnapshot {
|
|
684
663
|
current: AnalyzeSubpackagesResult;
|
|
@@ -736,5 +715,4 @@ declare module 'devframe' {
|
|
|
736
715
|
}
|
|
737
716
|
/** 创建只读分析与任务元数据能力,不执行外部工作,也不修改宿主认证策略。 */
|
|
738
717
|
declare function createAnalyzeDashboardDevframe({ snapshot: initialSnapshot, roots, initialEvents, clientAssets }: CreateAnalyzeDashboardDevframeOptions): AnalyzeDashboardDevframeController;
|
|
739
|
-
//#endregion
|
|
740
718
|
export { DashboardInvestigationReceiptInput as A, DashboardRuntimeEventInput as B, DashboardClaimInvestigationRequest as C, DashboardInvestigationClaim as D, DashboardInvestigation as E, DashboardObjectMeasurements as F, DashboardFileReadRequest as G, DashboardRuntimeEventsPage as H, DashboardProposeInvestigationRequest as I, DashboardArtifactFiles as J, DashboardContentRoots as K, DashboardReportIdentity as L, DashboardInvestigationStatus as M, DashboardInvestigationTarget as N, DashboardInvestigationProposal as O, DashboardInvestigationsState as P, DashboardVerifyInvestigationRequest as R, DashboardAuthorizeInvestigationRequest as S, DashboardCreateInvestigationRequest as T, DashboardRuntimeEventsQueryRequest as U, DashboardRuntimeEventProfile as V, DashboardFileContent as W, createDashboardArtifactSnapshot as Y, DashboardAnalyzePage as _, createAnalyzeDashboardDevframe as a, DashboardAnalyzePayloadsDescriptor as b, DashboardAnalyzeSummary as c, DashboardComparisonPage as d, DashboardComparisonQuery as f, DashboardPackagesQuery as g, DashboardPackagesPage as h, DashboardDevframeState as i, DashboardInvestigationRequest as j, DashboardInvestigationProposalInput as k, DashboardArtifactsPage as l, DashboardModulesQuery as m, CreateAnalyzeDashboardDevframeOptions as n, resolveDashboardClientAssets as o, DashboardModulesPage as p, DashboardArtifactFile as q, DashboardAnalyzeSnapshot as r, DashboardAnalyzeQuery as s, AnalyzeDashboardDevframeController as t, DashboardArtifactsQuery as u, DashboardAnalyzePageRequest as v, DashboardCompleteInvestigationRequest as w, DashboardAgentInvestigationRequest as x, DashboardAnalyzePayloadDescriptor as y, DashboardRuntimeEvent as z };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/auto-import-components/resolvers/types.d.ts
|
|
2
1
|
interface ResolvedValue {
|
|
3
2
|
name: string;
|
|
4
3
|
from: string;
|
|
@@ -64,11 +63,7 @@ interface Options {
|
|
|
64
63
|
};
|
|
65
64
|
}
|
|
66
65
|
type CreateResolver = (options?: Options) => Resolver;
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/auto-import-components/resolvers/tdesign.d.ts
|
|
69
66
|
declare const TDesignResolver: CreateResolver;
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/auto-import-components/resolvers/uviewPlus.d.ts
|
|
72
67
|
interface UviewPlusResolverOptions {
|
|
73
68
|
supportFilesStrategy?: ResolverSupportFilesStrategy;
|
|
74
69
|
}
|
|
@@ -76,14 +71,8 @@ interface UviewPlusResolverOptions {
|
|
|
76
71
|
* 创建 uview-plus 的 Vue SFC 自动导入解析器。
|
|
77
72
|
*/
|
|
78
73
|
declare function UviewPlusResolver(options?: UviewPlusResolverOptions): ResolverObject;
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/auto-import-components/resolvers/vant.d.ts
|
|
81
74
|
declare const VantResolver: CreateResolver;
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/auto-import-components/resolvers/weui.d.ts
|
|
84
75
|
declare const WeuiResolver: CreateResolver;
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/auto-import-components/resolvers/wotUi.d.ts
|
|
87
76
|
interface WotUiResolverOptions extends Pick<Options, 'supportFilesStrategy'> {
|
|
88
77
|
prefix?: string;
|
|
89
78
|
}
|
|
@@ -91,5 +80,4 @@ interface WotUiResolverOptions extends Pick<Options, 'supportFilesStrategy'> {
|
|
|
91
80
|
* 创建 Wot UI 的 Vue SFC 自动导入解析器。
|
|
92
81
|
*/
|
|
93
82
|
declare function WotUiResolver(options?: WotUiResolverOptions): ResolverObject;
|
|
94
|
-
//#endregion
|
|
95
83
|
export { UviewPlusResolver as a, CreateResolver as c, ResolvedValue as d, Resolver as f, ResolverSupportFilesStrategy as g, ResolverObject as h, VantResolver as i, ExternalMetadataFileCandidates as l, ResolverMeta as m, WotUiResolverOptions as n, UviewPlusResolverOptions as o, ResolverFn as p, WeuiResolver as r, TDesignResolver as s, WotUiResolver as t, Options as u };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { $ as WeappCompilerOutputRequest, A as Ref, Ar as WEAPP_VITE_HOST_NAME, Br as WeappViteRuntime, C as LoadConfigOptions, D as MethodDefinitions, E as InlineConfig, F as RolldownPlugin, Fr as resolveWeappViteHostMeta, Gn as JsonMergeContext, Gr as getSupportedWeappVitePlatforms, Hr as WeappViteTargetInput, I as RolldownPluginOption, Ir as ResolveWeappViteTargetOptions, Jn as JsonMergeStrategy, Jr as resolveWeappViteTarget, Kn as JsonMergeFunction, Kr as getSupportedWeappViteTargetDescriptors, L as RolldownWatchOptions, Lr as ResolvedWeappViteTarget, M as RolldownBuild, Mr as applyWeappViteHostMeta, N as RolldownOptions, Nr as createWeappViteHostMeta, O as Plugin, P as RolldownOutput, Pr as isWeappViteHost, Q as WeappCompilerHmrRequest, R as RolldownWatcher, Rr as WEB_PLATFORM_ALIASES, S as CompilerContext, St as WeappViteConfig, T as ConfigEnv, Ur as WeappViteTargetKind, Vr as WeappViteTargetDescriptor, Wn as JsonConfig, Wr as WebPlatform, X as WeappCompilerHmrAsset, Z as WeappCompilerHmrPreparation, _ as definePageJson, _n as WxmlTransformNode, a as UserConfigFnNoEnvPlain, an as WxmlRemoveAttrRule, at as WeappCompilerPluginOption, bn as MultiPlatformProjectConfig, c as UserConfigFnPromise, cn as WxmlValidationContext, ct as WeappCompilerSourceClaim, d as Component, dn as WxmlAttribute, et as WeappCompilerPlugin, f as Page, fn as WxmlAttributeValue, g as defineComponentJson, gn as WxmlTransformContext, h as defineAppJson, hn as WxmlTransform, i as UserConfigFnNoEnv, it as WeappCompilerPluginFactory, j as ResolvedConfig, jr as WeappViteHostMeta, k as PluginOption, l as defineConfig, ln as WxmlValidationDiagnostic, lt as WeappCompilerSourceRequest, m as Theme, mn as WxmlSourceLocation, n as UserConfigExport, nt as WeappCompilerPluginContext, o as UserConfigFnObject, on as WxmlRemoveOptions, ot as WeappCompilerPluginPhase, p as Sitemap, pn as WxmlElementInfo, qn as JsonMergeStage, qr as isWebPlatform, r as UserConfigFn, rt as WeappCompilerPluginController, s as UserConfigFnObjectPlain, sn as WxmlValidate, st as WeappCompilerResourceKind, t as UserConfig, tt as WeappCompilerPluginCapabilities, u as App, un as WxmlValidationVisitor, ut as WeappCompilerTransformResult, v as defineSitemapJson, vn as WxmlTransformResult, w as ComputedDefinitions, xn as MultiPlatformProjectConfigs, y as defineThemeJson, yn as WxmlTransformVisitor, z as ViteDevServer, zr as WeappVitePlatform } from "./config-
|
|
2
|
-
import { t as WeappI18nConfig } from "./types-
|
|
3
|
-
import { a as LayoutHostContext, c as LayoutHostResolver, d as unregisterLayoutHosts, f as waitForLayoutHost, i as LayoutHostBridge, l as registerLayoutHosts, m as createWevuComponent, n as defineProps, o as LayoutHostEntry, p as WevuComponentOptions, r as setPageLayout, s as LayoutHostResolveOptions, t as defineEmits, u as resolveLayoutHost } from "./runtime-
|
|
4
|
-
//#region src/runtime/compilerSession/context.d.ts
|
|
1
|
+
import { $ as WeappCompilerOutputRequest, A as Ref, Ar as WEAPP_VITE_HOST_NAME, Br as WeappViteRuntime, C as LoadConfigOptions, D as MethodDefinitions, E as InlineConfig, F as RolldownPlugin, Fr as resolveWeappViteHostMeta, Gn as JsonMergeContext, Gr as getSupportedWeappVitePlatforms, Hr as WeappViteTargetInput, I as RolldownPluginOption, Ir as ResolveWeappViteTargetOptions, Jn as JsonMergeStrategy, Jr as resolveWeappViteTarget, Kn as JsonMergeFunction, Kr as getSupportedWeappViteTargetDescriptors, L as RolldownWatchOptions, Lr as ResolvedWeappViteTarget, M as RolldownBuild, Mr as applyWeappViteHostMeta, N as RolldownOptions, Nr as createWeappViteHostMeta, O as Plugin, P as RolldownOutput, Pr as isWeappViteHost, Q as WeappCompilerHmrRequest, R as RolldownWatcher, Rr as WEB_PLATFORM_ALIASES, S as CompilerContext, St as WeappViteConfig, T as ConfigEnv, Ur as WeappViteTargetKind, Vr as WeappViteTargetDescriptor, Wn as JsonConfig, Wr as WebPlatform, X as WeappCompilerHmrAsset, Z as WeappCompilerHmrPreparation, _ as definePageJson, _n as WxmlTransformNode, a as UserConfigFnNoEnvPlain, an as WxmlRemoveAttrRule, at as WeappCompilerPluginOption, bn as MultiPlatformProjectConfig, c as UserConfigFnPromise, cn as WxmlValidationContext, ct as WeappCompilerSourceClaim, d as Component, dn as WxmlAttribute, et as WeappCompilerPlugin, f as Page, fn as WxmlAttributeValue, g as defineComponentJson, gn as WxmlTransformContext, h as defineAppJson, hn as WxmlTransform, i as UserConfigFnNoEnv, it as WeappCompilerPluginFactory, j as ResolvedConfig, jr as WeappViteHostMeta, k as PluginOption, l as defineConfig, ln as WxmlValidationDiagnostic, lt as WeappCompilerSourceRequest, m as Theme, mn as WxmlSourceLocation, n as UserConfigExport, nt as WeappCompilerPluginContext, o as UserConfigFnObject, on as WxmlRemoveOptions, ot as WeappCompilerPluginPhase, p as Sitemap, pn as WxmlElementInfo, qn as JsonMergeStage, qr as isWebPlatform, r as UserConfigFn, rt as WeappCompilerPluginController, s as UserConfigFnObjectPlain, sn as WxmlValidate, st as WeappCompilerResourceKind, t as UserConfig, tt as WeappCompilerPluginCapabilities, u as App, un as WxmlValidationVisitor, ut as WeappCompilerTransformResult, v as defineSitemapJson, vn as WxmlTransformResult, w as ComputedDefinitions, xn as MultiPlatformProjectConfigs, y as defineThemeJson, yn as WxmlTransformVisitor, z as ViteDevServer, zr as WeappVitePlatform } from "./config-BNx2BODw.mjs";
|
|
2
|
+
import { t as WeappI18nConfig } from "./types-e2BMP9NU.mjs";
|
|
3
|
+
import { a as LayoutHostContext, c as LayoutHostResolver, d as unregisterLayoutHosts, f as waitForLayoutHost, i as LayoutHostBridge, l as registerLayoutHosts, m as createWevuComponent, n as defineProps, o as LayoutHostEntry, p as WevuComponentOptions, r as setPageLayout, s as LayoutHostResolveOptions, t as defineEmits, u as resolveLayoutHost } from "./runtime-BL4RjBRa.mjs";
|
|
5
4
|
interface InitializeCompilerContextOptions extends Partial<LoadConfigOptions> {
|
|
6
5
|
syncSupportFiles?: boolean;
|
|
7
6
|
syncAutoImportSupportFiles?: boolean;
|
|
8
7
|
preloadAppEntry?: boolean;
|
|
9
8
|
}
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/createContext.d.ts
|
|
12
9
|
interface CreateCompilerContextOptions extends InitializeCompilerContextOptions {
|
|
13
10
|
key?: string;
|
|
14
11
|
}
|
|
15
12
|
/** 保留历史活动上下文适配;新宿主通过 CompilerSession 创建独立会话。 */
|
|
16
13
|
export declare function createCompilerContext(options?: CreateCompilerContextOptions): Promise<CompilerContext>;
|
|
17
|
-
//#endregion
|
|
18
14
|
export { type App, type Component, type ComputedDefinitions, type ConfigEnv, type InlineConfig, type JsonConfig, type JsonMergeContext, type JsonMergeFunction, type JsonMergeStage, type JsonMergeStrategy, type LayoutHostBridge, type LayoutHostContext, type LayoutHostEntry, type LayoutHostResolveOptions, type LayoutHostResolver, type MethodDefinitions, type MultiPlatformProjectConfig, type MultiPlatformProjectConfigs, type Page, type Plugin, type PluginOption, type Ref, ResolveWeappViteTargetOptions, type ResolvedConfig, ResolvedWeappViteTarget, type RolldownBuild, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatchOptions, type RolldownWatcher, type Sitemap, type Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, type ViteDevServer, WEAPP_VITE_HOST_NAME, WEB_PLATFORM_ALIASES, type WeappCompilerHmrAsset, type WeappCompilerHmrPreparation, type WeappCompilerHmrRequest, WeappCompilerOutputRequest, WeappCompilerPlugin, WeappCompilerPluginCapabilities, WeappCompilerPluginContext, WeappCompilerPluginController, WeappCompilerPluginFactory, WeappCompilerPluginOption, WeappCompilerPluginPhase, WeappCompilerResourceKind, WeappCompilerSourceClaim, WeappCompilerSourceRequest, WeappCompilerTransformResult, type WeappI18nConfig, type WeappViteConfig, WeappViteHostMeta, WeappVitePlatform, WeappViteRuntime, WeappViteTargetDescriptor, WeappViteTargetInput, WeappViteTargetKind, WebPlatform, type WevuComponentOptions, type WxmlAttribute, type WxmlAttributeValue, type WxmlElementInfo, type WxmlRemoveAttrRule, type WxmlRemoveOptions, type WxmlSourceLocation, type WxmlTransform, type WxmlTransformContext, type WxmlTransformNode, type WxmlTransformResult, type WxmlTransformVisitor, type WxmlValidate, type WxmlValidationContext, type WxmlValidationDiagnostic, type WxmlValidationVisitor, applyWeappViteHostMeta, createWeappViteHostMeta, createWevuComponent, defineAppJson, defineComponentJson, defineConfig, defineEmits, definePageJson, defineProps, defineSitemapJson, defineThemeJson, getSupportedWeappVitePlatforms, getSupportedWeappViteTargetDescriptors, isWeappViteHost, isWebPlatform, registerLayoutHosts, resolveLayoutHost, resolveWeappViteHostMeta, resolveWeappViteTarget, setPageLayout, unregisterLayoutHosts, waitForLayoutHost };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as resolveWeappViteHostMeta, i as isWeappViteHost, n as applyWeappViteHostMeta, r as createWeappViteHostMeta, t as WEAPP_VITE_HOST_NAME } from "./pluginHost
|
|
2
|
-
import { a as defineThemeJson, i as defineSitemapJson, n as defineComponentJson, r as definePageJson, t as defineAppJson } from "./json-
|
|
3
|
-
import { t as defineConfig } from "./config-
|
|
4
|
-
import { a as getSupportedWeappViteTargetDescriptors, i as getSupportedWeappVitePlatforms, o as isWebPlatform, r as WEB_PLATFORM_ALIASES, s as resolveWeappViteTarget } from "./createCompilerContextInstance-
|
|
5
|
-
import { t as createCompilerContext } from "./createContext-
|
|
6
|
-
import { a as resolveLayoutHost, c as createWevuComponent, i as registerLayoutHosts, n as defineProps, o as unregisterLayoutHosts, r as setPageLayout, s as waitForLayoutHost, t as defineEmits } from "./runtime-
|
|
1
|
+
import { a as resolveWeappViteHostMeta, i as isWeappViteHost, n as applyWeappViteHostMeta, r as createWeappViteHostMeta, t as WEAPP_VITE_HOST_NAME } from "./pluginHost-vn8Vty1J.mjs";
|
|
2
|
+
import { a as defineThemeJson, i as defineSitemapJson, n as defineComponentJson, r as definePageJson, t as defineAppJson } from "./json-Cvon2mw5.mjs";
|
|
3
|
+
import { t as defineConfig } from "./config-59ZWhCIf.mjs";
|
|
4
|
+
import { a as getSupportedWeappViteTargetDescriptors, i as getSupportedWeappVitePlatforms, o as isWebPlatform, r as WEB_PLATFORM_ALIASES, s as resolveWeappViteTarget } from "./createCompilerContextInstance-BXSdH2E8.mjs";
|
|
5
|
+
import { t as createCompilerContext } from "./createContext-W0TeXxbo.mjs";
|
|
6
|
+
import { a as resolveLayoutHost, c as createWevuComponent, i as registerLayoutHosts, n as defineProps, o as unregisterLayoutHosts, r as setPageLayout, s as waitForLayoutHost, t as defineEmits } from "./runtime-DDUCb7pP.mjs";
|
|
7
7
|
export { WEAPP_VITE_HOST_NAME, WEB_PLATFORM_ALIASES, applyWeappViteHostMeta, createCompilerContext, createWeappViteHostMeta, createWevuComponent, defineAppJson, defineComponentJson, defineConfig, defineEmits, definePageJson, defineProps, defineSitemapJson, defineThemeJson, getSupportedWeappVitePlatforms, getSupportedWeappViteTargetDescriptors, isWeappViteHost, isWebPlatform, registerLayoutHosts, resolveLayoutHost, resolveWeappViteHostMeta, resolveWeappViteTarget, setPageLayout, unregisterLayoutHosts, waitForLayoutHost };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/json.ts
|
|
2
2
|
/**
|
|
3
3
|
* @description 定义 app.json(支持直接对象或函数形式)
|
|
4
4
|
*/
|
|
@@ -29,5 +29,4 @@ const defineSitemapJson = (config) => {
|
|
|
29
29
|
const defineThemeJson = (config) => {
|
|
30
30
|
return config;
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { defineThemeJson as a, defineSitemapJson as i, defineComponentJson as n, definePageJson as r, defineAppJson as t };
|
package/dist/json.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as definePageJson, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, m as Theme, p as Sitemap, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-
|
|
1
|
+
import { _ as definePageJson, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, m as Theme, p as Sitemap, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-BNx2BODw.mjs";
|
|
2
2
|
export { type App, type Component, type Page, type Sitemap, type Theme, defineAppJson, defineComponentJson, definePageJson, defineSitemapJson, defineThemeJson };
|
package/dist/json.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as defineAppJson, n as defineComponentJson, r as definePageJson, i as defineSitemapJson, a as defineThemeJson } from "./json-
|
|
1
|
+
export { t as defineAppJson, n as defineComponentJson, r as definePageJson, i as defineSitemapJson, a as defineThemeJson } from "./json-Cvon2mw5.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { o as stripLeadingSlashes, r as normalizeRelativePath } from "./path-
|
|
2
|
-
import { c as findJsEntry, d as findVueEntry } from "./file-
|
|
1
|
+
import { o as stripLeadingSlashes, r as normalizeRelativePath } from "./path-E1OjBJAl.mjs";
|
|
2
|
+
import { c as findJsEntry, d as findVueEntry } from "./file-D8mp5GmB.mjs";
|
|
3
3
|
import path from "pathe";
|
|
4
4
|
import { isObject, removeExtensionDeep } from "@weapp-core/shared";
|
|
5
5
|
import { fs } from "@weapp-core/shared/fs";
|
|
6
|
-
|
|
6
|
+
// src/runtime/compilerSession/tasks.ts
|
|
7
7
|
/** 任一子构建失败后仍等待所有已启动任务,保留最先排列的原始错误。 */
|
|
8
8
|
async function waitForBuildTasks(tasks) {
|
|
9
9
|
const results = await Promise.allSettled(tasks);
|
|
@@ -11,13 +11,11 @@ async function waitForBuildTasks(tasks) {
|
|
|
11
11
|
if (failure?.status === "rejected") throw failure.reason;
|
|
12
12
|
return results.map((result) => result.value);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
//#region src/runtime/utils/object.ts
|
|
14
|
+
// src/runtime/utils/object.ts
|
|
16
15
|
function hasOwn(source, key) {
|
|
17
16
|
return Object.prototype.hasOwnProperty.call(source, key);
|
|
18
17
|
}
|
|
19
|
-
|
|
20
|
-
//#region src/runtime/lib.ts
|
|
18
|
+
// src/runtime/lib.ts
|
|
21
19
|
function hasLibEntry(entry) {
|
|
22
20
|
if (!entry) return false;
|
|
23
21
|
if (typeof entry === "string") return entry.trim().length > 0;
|
|
@@ -139,5 +137,4 @@ async function resolveWeappLibEntries(configService, libConfig) {
|
|
|
139
137
|
}
|
|
140
138
|
return resolved;
|
|
141
139
|
}
|
|
142
|
-
//#endregion
|
|
143
140
|
export { hasOwn as a, resolveWeappLibEntries as i, hasLibEntry as n, waitForBuildTasks as o, resolveWeappLibConfig as r, createLibEntryFileNameResolver as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
2
|
import { WEAPP_VITE_DEV_SERVER_CLOSE_KEY, WEAPP_VITE_HOST_RESTART_CONFIG_KEY } from "@weapp-core/constants";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
|
-
|
|
4
|
+
// src/devLifecycle/server.ts
|
|
5
5
|
const serverCloseRecord = Symbol.for(WEAPP_VITE_DEV_SERVER_CLOSE_KEY);
|
|
6
6
|
const dispatchedRecords = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
const dispatchedCloses = /* @__PURE__ */ new WeakMap();
|
|
@@ -79,8 +79,7 @@ function replaceDevServerClose(server, close) {
|
|
|
79
79
|
record.close = onceClose(() => close.call(server));
|
|
80
80
|
return previous;
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
//#region src/devLifecycle/shutdown.ts
|
|
82
|
+
// src/devLifecycle/shutdown.ts
|
|
84
83
|
const operations = new AsyncLocalStorage();
|
|
85
84
|
/** 获取当前开发命令的资源归属;异步回调可以继承归属,但不能继承已结束的内部操作权限。 */
|
|
86
85
|
function getDevShutdownScope() {
|
|
@@ -203,8 +202,7 @@ var DevShutdownScope = class {
|
|
|
203
202
|
function createDevShutdownScope(options) {
|
|
204
203
|
return new DevShutdownScope(options);
|
|
205
204
|
}
|
|
206
|
-
|
|
207
|
-
//#region src/vite/lifecycle.ts
|
|
205
|
+
// src/vite/lifecycle.ts
|
|
208
206
|
const hostLifecycleKey = Symbol.for("weapp-vite:host-lifecycle");
|
|
209
207
|
function createHostOperations() {
|
|
210
208
|
const operations = new AsyncLocalStorage();
|
|
@@ -409,5 +407,4 @@ function bindHostLifecycle(server, closeSession, preparedLifecycle, isRetired, f
|
|
|
409
407
|
});
|
|
410
408
|
};
|
|
411
409
|
}
|
|
412
|
-
//#endregion
|
|
413
410
|
export { takeHostRestartData as a, getDevServerCloseRecord as c, takeHostLifecycle as i, replaceDevServerClose as l, setHostRestartData as n, createDevShutdownScope as o, takeHostConfigRestartData as r, getDevShutdownScope as s, bindHostLifecycle as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as createCjsConfigLoadError, C as loadViteConfigFile, t as resolveWeappConfigFile } from "./utils-
|
|
1
|
+
import { A as createCjsConfigLoadError, C as loadViteConfigFile, t as resolveWeappConfigFile } from "./utils-CTGSZp4j.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import path from "pathe";
|
|
4
4
|
import { defu } from "@weapp-core/shared";
|
|
5
|
-
|
|
5
|
+
// src/cli/loadConfig.ts
|
|
6
6
|
async function loadConfig(configFile) {
|
|
7
7
|
const cwd = process.cwd();
|
|
8
8
|
let resolvedConfigFile = configFile;
|
|
@@ -55,5 +55,4 @@ async function loadConfig(configFile) {
|
|
|
55
55
|
dependencies: Array.from(dependencySet)
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
//#endregion
|
|
59
58
|
export { loadConfig as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as loadConfig } from "./loadConfig-CKIdfW4o.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { s as getProjectConfigFileName } from "./utils-
|
|
1
|
+
import { s as getProjectConfigFileName } from "./utils-CTGSZp4j.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-DGn5iEVN.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { resolveCommand } from "package-manager-detector/commands";
|
|
5
|
-
|
|
5
|
+
// src/cli/commands/build/completion.ts
|
|
6
6
|
function shouldScheduleCompletedProductionBuildExit(options, analyzeHandle) {
|
|
7
7
|
return process.env.VITEST !== "true" && process.env.NODE_ENV !== "test" && process.env.WEAPP_VITE_DISABLE_COMPLETED_BUILD_EXIT !== "1" && options.watch !== true && options.open !== true && analyzeHandle === void 0;
|
|
8
8
|
}
|
|
@@ -12,16 +12,14 @@ function scheduleCompletedProductionBuildExit(options, analyzeHandle) {
|
|
|
12
12
|
if (process.exitCode === void 0 || process.exitCode === 0) process.exit(0);
|
|
13
13
|
}, 0).unref?.();
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
//#region src/cli/formatDuration.ts
|
|
15
|
+
// src/cli/formatDuration.ts
|
|
17
16
|
/**
|
|
18
17
|
* 将毫秒耗时格式化为适合 CLI 展示的文本。
|
|
19
18
|
*/
|
|
20
19
|
function formatDuration(durationMs) {
|
|
21
20
|
return `${durationMs}ms`;
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
//#region src/cli/logBuildAppFinish.ts
|
|
22
|
+
// src/cli/logBuildAppFinish.ts
|
|
25
23
|
let logBuildAppFinishOnlyShowOnce = false;
|
|
26
24
|
function collectServerUrls(webServer) {
|
|
27
25
|
const urls = webServer?.resolvedUrls;
|
|
@@ -53,5 +51,4 @@ function logBuildAppFinish(configService, webServer, options = {}) {
|
|
|
53
51
|
if (!uiUrls.length && !webUrls.length) logger_default.info(`提示:手动打开对应平台开发者工具,导入根目录(${colors.green(projectConfigFileName)} 文件所在目录)`);
|
|
54
52
|
logBuildAppFinishOnlyShowOnce = true;
|
|
55
53
|
}
|
|
56
|
-
//#endregion
|
|
57
54
|
export { formatDuration as n, scheduleCompletedProductionBuildExit as r, logBuildAppFinish as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { writeFile } from "node:fs/promises";
|
|
4
|
-
|
|
4
|
+
// src/cli/commands/accept.ts
|
|
5
5
|
function registerAcceptCommand(cli) {
|
|
6
6
|
cli.command("accept [root]", "run deterministic mini-program acceptance without a model").option("--init", "create acceptance configuration without overwriting").option("--inspect", "inspect acceptance prerequisites without executing project code").option("--report <jobId>", "read a saved report and check source freshness").option("--acceptance-config <file>", "select an acceptance JSON configuration").option("--trust", "authorize the reviewed configuration for this invocation").option("--json", "write protocol data only to stdout").action(async (root = ".", options) => {
|
|
7
7
|
try {
|
|
@@ -74,13 +74,11 @@ function registerAcceptCommand(cli) {
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
//#region src/cli/commands/mcp/index.ts
|
|
77
|
+
// src/cli/commands/mcp/index.ts
|
|
79
78
|
function registerMcpCommand(cli) {
|
|
80
79
|
cli.command("mcp [...args]", "start weapp-vite MCP server or manage MCP client onboarding").option("--transport <type>", "[string] stdio | streamable-http | command | http", { default: "stdio" }).option("--host <host>", "[string] streamable-http host").option("--port <port>", "[number] streamable-http port").option("--endpoint <path>", "[string] streamable-http endpoint path").option("--rest-endpoint <path>", "[string] streamable-http REST runtime endpoint path").option("--no-rest", "[boolean] disable streamable-http REST runtime endpoints").option("--unref", "[boolean] unref HTTP server to not block process exit").option("--url <url>", "[string] explicit HTTP MCP url").option("--workspace-root <path>", "[string] workspace root path, defaults to cwd").option("-y, --yes", "[boolean] write config without prompt").action(async (args, options) => {
|
|
81
|
-
const { runMcpCommand } = await import("./action-
|
|
80
|
+
const { runMcpCommand } = await import("./action-ytG5oFAw.mjs");
|
|
82
81
|
return runMcpCommand(args, options);
|
|
83
82
|
});
|
|
84
83
|
}
|
|
85
|
-
//#endregion
|
|
86
84
|
export { registerAcceptCommand as n, registerMcpCommand as t };
|
|
@@ -2,7 +2,7 @@ import { r as logger_default } from "./logger-DGn5iEVN.mjs";
|
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { DEFAULT_MCP_ENDPOINT, DEFAULT_MCP_HOST, DEFAULT_MCP_PORT, DEFAULT_RUNTIME_REST_ENDPOINT } from "@weapp-core/constants";
|
|
4
4
|
import { determineAgent } from "@vercel/detect-agent";
|
|
5
|
-
|
|
5
|
+
// src/aiEnvironment.ts
|
|
6
6
|
const AI_ENV_KEYS = [
|
|
7
7
|
"CODEX_HOME",
|
|
8
8
|
"CODEX_SANDBOX",
|
|
@@ -71,8 +71,7 @@ function resolveBooleanLikeEnv(value) {
|
|
|
71
71
|
"off"
|
|
72
72
|
].includes(normalized)) return false;
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
//#region src/mcp.ts
|
|
74
|
+
// src/mcp.ts
|
|
76
75
|
/** 创建服务时才加载 MCP 运行时;配置解析与公开常量保持同步。 */
|
|
77
76
|
async function createWeappViteMcpServer(options) {
|
|
78
77
|
const { createWeappViteMcpServer } = await import("@weapp-vite/mcp");
|
|
@@ -133,5 +132,4 @@ async function startWeappViteMcpServer(options) {
|
|
|
133
132
|
})
|
|
134
133
|
});
|
|
135
134
|
}
|
|
136
|
-
//#endregion
|
|
137
135
|
export { createWeappViteMcpServer as a, startWeappViteMcpServer as c, DEFAULT_RUNTIME_REST_ENDPOINT as i, detectAiDevelopmentEnvironment as l, DEFAULT_MCP_HOST as n, resolveProjectMcpPort as o, DEFAULT_MCP_PORT as r, resolveWeappMcpConfig as s, DEFAULT_MCP_ENDPOINT as t };
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Ut as WeappMcpConfig } from "./config-
|
|
1
|
+
import { Ut as WeappMcpConfig } from "./config-BNx2BODw.mjs";
|
|
2
2
|
import { DEFAULT_MCP_ENDPOINT, DEFAULT_MCP_HOST, DEFAULT_MCP_PORT, DEFAULT_RUNTIME_REST_ENDPOINT } from "@weapp-core/constants";
|
|
3
3
|
import { CreateServerOptions, McpServerHandle, StartMcpServerOptions, createWeappViteMcpServer as createWeappViteMcpServer$1 } from "@weapp-vite/mcp";
|
|
4
|
-
//#region src/mcp.d.ts
|
|
5
4
|
/** 创建服务时才加载 MCP 运行时;配置解析与公开常量保持同步。 */
|
|
6
5
|
export declare function createWeappViteMcpServer(options?: CreateServerOptions): ReturnType<typeof createWeappViteMcpServer$1>;
|
|
7
6
|
export interface ResolvedWeappMcpConfig {
|
|
@@ -24,5 +23,4 @@ export interface ResolveWeappMcpConfigOptions {
|
|
|
24
23
|
export declare function resolveProjectMcpPort(projectRoot?: string): number;
|
|
25
24
|
export declare function resolveWeappMcpConfig(config?: boolean | WeappMcpConfig, options?: ResolveWeappMcpConfigOptions): ResolvedWeappMcpConfig;
|
|
26
25
|
export declare function startWeappViteMcpServer(options?: WeappViteMcpServerOptions): Promise<WeappViteMcpServerHandle>;
|
|
27
|
-
//#endregion
|
|
28
26
|
export { type CreateServerOptions, DEFAULT_MCP_ENDPOINT, DEFAULT_MCP_HOST, DEFAULT_MCP_PORT, DEFAULT_RUNTIME_REST_ENDPOINT };
|
package/dist/mcp.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as DEFAULT_MCP_ENDPOINT, n as DEFAULT_MCP_HOST, r as DEFAULT_MCP_PORT, i as DEFAULT_RUNTIME_REST_ENDPOINT, a as createWeappViteMcpServer, o as resolveProjectMcpPort, s as resolveWeappMcpConfig, c as startWeappViteMcpServer } from "./mcp-
|
|
1
|
+
export { t as DEFAULT_MCP_ENDPOINT, n as DEFAULT_MCP_HOST, r as DEFAULT_MCP_PORT, i as DEFAULT_RUNTIME_REST_ENDPOINT, a as createWeappViteMcpServer, o as resolveProjectMcpPort, s as resolveWeappMcpConfig, c as startWeappViteMcpServer } from "./mcp-ovJgl1N9.mjs";
|
|
@@ -3,7 +3,7 @@ import path from "pathe";
|
|
|
3
3
|
import { fs } from "@weapp-core/shared/fs";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import { clearTimeout, setTimeout } from "node:timers";
|
|
6
|
-
|
|
6
|
+
// src/cli/mcpClient/shared.ts
|
|
7
7
|
const CODEX_BLOCK_PREFIX = "# >>> weapp-vite mcp ";
|
|
8
8
|
const CODEX_BLOCK_SUFFIX = " >>>";
|
|
9
9
|
const CODEX_BLOCK_END_PREFIX = "# <<< weapp-vite mcp ";
|
|
@@ -130,8 +130,7 @@ function resolveTarget(client, workspaceRoot) {
|
|
|
130
130
|
serverName
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
//#region src/cli/mcpClient/inspect.ts
|
|
133
|
+
// src/cli/mcpClient/inspect.ts
|
|
135
134
|
async function probeHttpEndpoint(url) {
|
|
136
135
|
const controller = new AbortController();
|
|
137
136
|
const timer = setTimeout(() => {
|
|
@@ -236,8 +235,7 @@ async function inspectMcpClientConfig(options) {
|
|
|
236
235
|
if (target.client === "codex") return await inspectCodexConfig(target);
|
|
237
236
|
return await inspectJsonConfig(target);
|
|
238
237
|
}
|
|
239
|
-
|
|
240
|
-
//#region src/cli/mcpClient/plan.ts
|
|
238
|
+
// src/cli/mcpClient/plan.ts
|
|
241
239
|
function resolveSupportedMcpClient(input) {
|
|
242
240
|
if (input === "codex" || input === "claude-code" || input === "cursor") return input;
|
|
243
241
|
throw new Error(`不支持的 MCP 客户端:${input}。当前仅支持 codex、claude-code、cursor。`);
|
|
@@ -263,8 +261,7 @@ function formatMcpQuickStart(options) {
|
|
|
263
261
|
` - Cursor: wv mcp init cursor${suffix}`
|
|
264
262
|
];
|
|
265
263
|
}
|
|
266
|
-
|
|
267
|
-
//#region src/cli/mcpClient/index.ts
|
|
264
|
+
// src/cli/mcpClient/index.ts
|
|
268
265
|
async function writeMcpClientConfig(plan) {
|
|
269
266
|
await fs.ensureDir(path.dirname(plan.target.configPath));
|
|
270
267
|
const existing = await fs.readFile(plan.target.configPath, "utf8").catch(() => "");
|
|
@@ -283,5 +280,4 @@ async function writeMcpClientConfig(plan) {
|
|
|
283
280
|
};
|
|
284
281
|
await fs.writeFile(plan.target.configPath, `${JSON.stringify(nextConfig, null, 2)}\n`, "utf8");
|
|
285
282
|
}
|
|
286
|
-
//#endregion
|
|
287
283
|
export { inspectMcpClientConfig as a, resolveSupportedMcpClient as i, buildMcpClientConfigPlan as n, formatMcpQuickStart as r, writeMcpClientConfig as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "pathe";
|
|
2
|
-
|
|
2
|
+
// src/analyze/subpackages/metadata.ts
|
|
3
3
|
const defaultTotalBudgetBytes = 20971520;
|
|
4
4
|
const defaultPackageBudgetBytes = 2097152;
|
|
5
5
|
const defaultWarningRatio = .85;
|
|
@@ -55,5 +55,4 @@ function createAnalyzeMetadata(configService, now = /* @__PURE__ */ new Date())
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
//#endregion
|
|
59
58
|
export { resolveAnalyzeBudgets as n, resolveAnalyzeHistoryMetadata as r, createAnalyzeMetadata as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { n as getDefaultIdeProjectRoot, w as shouldPassPlatformArgToIdeOpen } from "./platform-
|
|
1
|
+
import { n as getDefaultIdeProjectRoot, w as shouldPassPlatformArgToIdeOpen } from "./platform-BiMpsZIb.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-DGn5iEVN.mjs";
|
|
3
|
-
import { t as createCompilerContext } from "./createContext-
|
|
4
|
-
import { i as resolveRuntimeTargets, t as createInlineConfig } from "./runtime-
|
|
3
|
+
import { t as createCompilerContext } from "./createContext-W0TeXxbo.mjs";
|
|
4
|
+
import { i as resolveRuntimeTargets, t as createInlineConfig } from "./runtime-CKtMVERT.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import path from "pathe";
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import { RETRY_CONFIRM_KEYS, bootstrapWechatDevtoolsSettings, clearWechatIdeCache, clearWechatIdeCacheByAutomator, closeWechatIdeProject, compileWechatIdeByAutomator, connectOpenedAutomator, createWechatIdeLoginRequiredExitError, formatAutomatorLoginError, isAutomatorLoginError, isWechatIdeEngineBuildEndpointMissingError, isWechatIdeLoginRequiredError, isWechatIdeLoginRequiredExitError, launchAutomator, parse, promptRetryKeypress, promptWechatIdeLoginRetry, quitWechatIde, resetWechatIdeFileUtilsByHttp, resolveProjectAutomatorPort, runRetryableCommand, runWechatIdeEngineBuild, runWithSuspendedSharedInput, withWechatDevtoolsSelection, withWechatDevtoolsSelectionArgs } from "weapp-ide-cli";
|
|
9
|
-
|
|
9
|
+
// src/cli/openIde/execute.ts
|
|
10
10
|
function readArgOption(argv, ...names) {
|
|
11
11
|
for (let index = 0; index < argv.length; index += 1) {
|
|
12
12
|
const current = argv[index];
|
|
@@ -139,8 +139,7 @@ async function executeSelectedWechatIdeCliCommand(argv, options = {}) {
|
|
|
139
139
|
async function executeWechatIdeCliCommand(argv, options = {}) {
|
|
140
140
|
return await withWechatDevtoolsSelectionArgs(argv, (args) => executeSelectedWechatIdeCliCommand(args, options));
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
//#region src/cli/openIde/close.ts
|
|
142
|
+
// src/cli/openIde/close.ts
|
|
144
143
|
/**
|
|
145
144
|
* @description 执行用户显式请求的 CLI close;失败时保留宿主,不升级为系统级退出。
|
|
146
145
|
*/
|
|
@@ -166,8 +165,7 @@ async function closeIde$1() {
|
|
|
166
165
|
return false;
|
|
167
166
|
}
|
|
168
167
|
}
|
|
169
|
-
|
|
170
|
-
//#region src/cli/openIde/diagnostics.ts
|
|
168
|
+
// src/cli/openIde/diagnostics.ts
|
|
171
169
|
/**
|
|
172
170
|
* @description 将 automator 启动错误归类为用户可执行的恢复提示。
|
|
173
171
|
*/
|
|
@@ -206,8 +204,7 @@ function logWechatIdeServicePortDisabledHint(projectPath) {
|
|
|
206
204
|
if (projectPath) lines.push(`当前目标项目目录:${projectPath}`);
|
|
207
205
|
logger_default.warn(lines.join("\n"));
|
|
208
206
|
}
|
|
209
|
-
|
|
210
|
-
//#region src/cli/openIde/reuse.ts
|
|
207
|
+
// src/cli/openIde/reuse.ts
|
|
211
208
|
const OPENED_PROJECT_HEALTH_CHECK_TIMEOUT = 3e3;
|
|
212
209
|
const OPEN_AUTOMATOR_TIMEOUT = 12e4;
|
|
213
210
|
function formatReuseOpenedWechatIdePrompt() {
|
|
@@ -311,8 +308,7 @@ async function reopenOpenedWechatIde(projectPath, options = {}) {
|
|
|
311
308
|
await openWechatIdeByAutomator(projectPath, options);
|
|
312
309
|
return true;
|
|
313
310
|
}
|
|
314
|
-
|
|
315
|
-
//#region src/cli/openIde/index.ts
|
|
311
|
+
// src/cli/openIde/index.ts
|
|
316
312
|
function shouldLogAutomatorFallbackError() {
|
|
317
313
|
const flag = process.env.WEAPP_VITE_DEBUG_AUTOMATOR_OPEN;
|
|
318
314
|
return flag === "1" || flag === "true";
|
|
@@ -644,5 +640,4 @@ async function openIde(platform, projectPath, options = {}) {
|
|
|
644
640
|
if (platform === "weapp") return await withWechatDevtoolsSelection(options, () => openSelectedIde(platform, projectPath, options));
|
|
645
641
|
return await openSelectedIde(platform, projectPath, options);
|
|
646
642
|
}
|
|
647
|
-
//#endregion
|
|
648
643
|
export { resolveIdeProjectRoot as a, resolveIdeProjectPath as i, openIde as n, shouldUseAutomatorProjectWrapper as o, resolveIdeCommandContext as r, executeWechatIdeCliCommand as s, closeIde as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/cli/options.ts
|
|
2
2
|
function filterDuplicateOptions(options) {
|
|
3
3
|
for (const [key, value] of Object.entries(options)) if (Array.isArray(value)) options[key] = value[value.length - 1];
|
|
4
4
|
}
|
|
@@ -30,5 +30,4 @@ function parseDashboardUiHost(value) {
|
|
|
30
30
|
function isUiEnabled(options) {
|
|
31
31
|
return Boolean(options.ui || options.analyze || options.uiHost !== void 0);
|
|
32
32
|
}
|
|
33
|
-
//#endregion
|
|
34
33
|
export { parseDashboardUiHost as a, isUiEnabled as i, convertBase as n, resolveConfigFile as o, filterDuplicateOptions as r, coerceBooleanOption as t };
|