weapp-vite 7.3.0 → 7.5.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.
Files changed (91) hide show
  1. package/README.md +154 -6
  2. package/bin/bootstrap.js +14 -1
  3. package/dist/adapters-CcHrsYaj.mjs +1 -0
  4. package/dist/analyze-ZJUvEdaY.mjs +248 -0
  5. package/dist/auto-import-components/resolvers.mjs +1 -2
  6. package/dist/auto-import-presets/wevu-router.mjs +1 -2
  7. package/dist/auto-import-presets/wevu.mjs +1 -2
  8. package/dist/auto-routes.mjs +2 -1
  9. package/dist/budget-BD7VqLCl.d.mts +178 -0
  10. package/dist/chunkStrategy-DRA5WpB-.mjs +1436 -0
  11. package/dist/cli-acceptance.d.mts +1 -0
  12. package/dist/cli-acceptance.mjs +21 -0
  13. package/dist/cli.mjs +1918 -2089
  14. package/dist/compatibility.mjs +1 -2
  15. package/dist/{config-1J4rToMR.d.mts → config-V0L-IAJf.d.mts} +419 -39
  16. package/dist/config.d.mts +2 -2
  17. package/dist/config.mjs +1 -1
  18. package/dist/constants-DEZdcsMn.mjs +85 -0
  19. package/dist/{createContext-cqr9Y4EV.mjs → createCompilerContextInstance-DJH_P_nZ.mjs} +17602 -15886
  20. package/dist/createContext-BqYzHhY9.mjs +12 -0
  21. package/dist/dashboard/analyze.d.mts +48 -0
  22. package/dist/dashboard/analyze.mjs +1 -0
  23. package/dist/dashboard/vite.d.mts +9 -0
  24. package/dist/dashboard/vite.mjs +44 -0
  25. package/dist/dashboard-DvqF3Key.mjs +1842 -0
  26. package/dist/dashboard.d.mts +3 -0
  27. package/dist/dashboard.mjs +1 -0
  28. package/dist/dashboardViteBridge-Dy3nAD4m.mjs +299 -0
  29. package/dist/dev-fR5GiJRO.mjs +63 -0
  30. package/dist/devProvider-BGBkw28J.mjs +1050 -0
  31. package/dist/docs/README.md +154 -6
  32. package/dist/docs/ai-workflows.md +4 -0
  33. package/dist/docs/doctor.md +38 -0
  34. package/dist/docs/getting-started.md +52 -1
  35. package/dist/docs/index.md +6 -2
  36. package/dist/docs/mcp.md +94 -1
  37. package/dist/docs/testing.md +29 -2
  38. package/dist/docs/troubleshooting.md +8 -0
  39. package/dist/docs/uni-app-component-libraries.md +8 -7
  40. package/dist/docs/upload.md +226 -0
  41. package/dist/docs/vite-plugin.md +171 -0
  42. package/dist/docs/vue-sfc.md +19 -0
  43. package/dist/docs/weapp-config.md +374 -2
  44. package/dist/docs/wevu-authoring.md +10 -0
  45. package/dist/doctor-worker.d.mts +1 -0
  46. package/dist/doctor-worker.mjs +59 -0
  47. package/dist/doctor.d.mts +144 -0
  48. package/dist/doctor.mjs +848 -0
  49. package/dist/eslint.mjs +1 -2
  50. package/dist/file-DRb4eWqw.mjs +1 -0
  51. package/dist/{file-CKB0Tn8Z.mjs → file-sC3jD7Fh.mjs} +16 -93
  52. package/dist/files-BqxFIPRp.mjs +45 -0
  53. package/dist/getInstance-DiGSzBNI.mjs +28 -0
  54. package/dist/getInstance-SiE6WZRh.mjs +1 -0
  55. package/dist/index-C9HjUX5c.d.mts +741 -0
  56. package/dist/index.d.mts +10 -8
  57. package/dist/index.mjs +3 -2
  58. package/dist/json.d.mts +1 -1
  59. package/dist/json.mjs +1 -2
  60. package/dist/lifecycle-BROTlwSL.mjs +320 -0
  61. package/dist/loadConfig-C3BQhz7F.mjs +59 -0
  62. package/dist/loadConfig-VGtBF4qm.mjs +1 -0
  63. package/dist/logger-DGn5iEVN.mjs +1 -0
  64. package/dist/{mcp-BG6TliEg.mjs → mcp-Cj8Maqo6.mjs} +16 -7
  65. package/dist/mcp-D3Yh24Cj.mjs +529 -0
  66. package/dist/mcp.d.mts +6 -3
  67. package/dist/mcp.mjs +1 -2
  68. package/dist/package-7swhyLmf.mjs +91 -0
  69. package/dist/path-doV773b7.mjs +103 -0
  70. package/dist/platform-CnkySBKz.mjs +175 -0
  71. package/dist/processCleanup-B6KA30Zc.mjs +77 -0
  72. package/dist/protocol-vg8HGJ4n.mjs +138 -0
  73. package/dist/{resolvers-icNxkpcy.mjs → resolvers-Dod-euqX.mjs} +4 -1
  74. package/dist/resolvers.mjs +1 -2
  75. package/dist/runtime.mjs +1 -2
  76. package/dist/session-PskhD-nZ.mjs +390 -0
  77. package/dist/test.d.mts +1 -0
  78. package/dist/test.mjs +201 -44
  79. package/dist/types.d.mts +2 -2
  80. package/dist/upload-D4msblBf.mjs +562 -0
  81. package/dist/upload-worker.d.mts +1 -0
  82. package/dist/upload-worker.mjs +161 -0
  83. package/dist/utils-CJSCgEj6.mjs +1094 -0
  84. package/dist/vite.d.mts +9 -0
  85. package/dist/vite.mjs +270 -0
  86. package/dist/volar.d.mts +2 -2
  87. package/dist/web-apis.mjs +1 -2
  88. package/package.json +85 -37
  89. package/dist/file-CvgkbGIx.mjs +0 -2
  90. package/dist/getInstance-CZ1s63zd.mjs +0 -2
  91. package/dist/logger-mt4mSTqV.mjs +0 -2
@@ -0,0 +1,144 @@
1
+ import { Xn as MpPlatform } from "./config-V0L-IAJf.mjs";
2
+ import { i as AnalyzeBudgetConfig } from "./budget-BD7VqLCl.mjs";
3
+ import { OperationDiagnostics } from "@weapp-vite/miniprogram-automator";
4
+ //#region src/doctor/types.d.ts
5
+ type DoctorLayer = 'project' | 'source' | 'artifact' | 'runtime';
6
+ interface DoctorCoverage {
7
+ target: string;
8
+ layer: DoctorLayer;
9
+ check: string;
10
+ status: 'complete' | 'incomplete' | 'not-requested';
11
+ reason?: string;
12
+ }
13
+ interface DoctorDiagnostic {
14
+ ruleId: string;
15
+ target: string;
16
+ layer: DoctorLayer;
17
+ severity: 'error' | 'warning';
18
+ message: string;
19
+ location?: {
20
+ file: string;
21
+ line?: number;
22
+ column?: number;
23
+ };
24
+ evidence: {
25
+ expected: string;
26
+ actual: string;
27
+ };
28
+ responsibility: {
29
+ owner: 'project' | 'framework' | 'platform' | 'unknown';
30
+ confidence: 'confirmed' | 'suspected';
31
+ };
32
+ suggestion: string;
33
+ fingerprint: string;
34
+ }
35
+ interface DoctorFile {
36
+ path: string;
37
+ size: number;
38
+ sha256: string;
39
+ text?: string;
40
+ }
41
+ interface DoctorArtifactSnapshot {
42
+ files: readonly DoctorFile[];
43
+ origin: 'build' | 'existing';
44
+ capturedAt: string;
45
+ /** 既有目录只证明当前字节,不证明来自当前源码。 */
46
+ freshness: 'current-build' | 'unverified';
47
+ budgets?: AnalyzeBudgetConfig;
48
+ /** 相对项目目录的实际编译源码目录。 */
49
+ sourceRoot?: string;
50
+ /** 相对项目目录的本轮输出目录。 */
51
+ outputRoot?: string;
52
+ limitations?: readonly string[];
53
+ }
54
+ interface DoctorRuntimeEvidence {
55
+ host: string;
56
+ deviceSystem?: string;
57
+ route: string;
58
+ provider: string;
59
+ checks: readonly string[];
60
+ /** false 表示已有部分事实,但请求的运行时探针没有全部完成。 */
61
+ complete?: boolean;
62
+ facts?: readonly DoctorRuntimeFact[];
63
+ bundle?: DoctorRuntimeBundle;
64
+ }
65
+ type DoctorRuntimeStage = 'cli-executable' | 'service-listener' | 'login-query' | 'login-state' | 'project-connection' | 'tool-info' | 'host-version' | 'sdk-version' | 'current-page' | 'session-release';
66
+ interface DoctorRuntimeFact {
67
+ stage: DoctorRuntimeStage;
68
+ status: 'passed' | 'failed' | 'unknown' | 'not-run';
69
+ code: string;
70
+ }
71
+ interface DoctorRuntimeProbeOptions {
72
+ /** 所有已请求探针的总预算,包含本次连接清理。 */
73
+ timeout?: number;
74
+ signal?: AbortSignal;
75
+ /** 只读检查的显式 CLI;仅 login 为 true 时执行原生查询。 */
76
+ cliPath?: string;
77
+ /** 显式允许原生 islogin,可能启动 IDE,必须同时指定 cliPath。 */
78
+ login?: boolean;
79
+ /** 只检查指定回环 TCP 端口,不据此认定监听者是微信 IDE。 */
80
+ servicePort?: number;
81
+ }
82
+ interface DoctorRuntimeBundle {
83
+ /** 仅含固定阶段、预算与资源类别,不包含原始错误文本。 */
84
+ operation?: OperationDiagnostics;
85
+ frameworkVersion: string;
86
+ nodeVersion: string;
87
+ versions: {
88
+ ide?: string;
89
+ sdk?: string;
90
+ };
91
+ configuration: {
92
+ target: string;
93
+ provider: string;
94
+ explicitCli: boolean;
95
+ explicitAutomatorPort: boolean;
96
+ explicitServicePort: boolean;
97
+ loginRequested: boolean;
98
+ };
99
+ lastSuccessfulStage?: DoctorRuntimeStage;
100
+ /** 只记录固定阶段与分类,不包含宿主原始输出、凭据或源码。 */
101
+ events: readonly DoctorRuntimeFact[];
102
+ reproduction: string;
103
+ }
104
+ interface DoctorReport {
105
+ schemaVersion: 1;
106
+ generatedAt: string;
107
+ targets: string[];
108
+ coverage: DoctorCoverage[];
109
+ diagnostics: DoctorDiagnostic[];
110
+ artifacts: Record<string, Omit<DoctorArtifactSnapshot, 'files'> & {
111
+ files: Array<Omit<DoctorFile, 'text'>>;
112
+ }>;
113
+ runtime: Record<string, DoctorRuntimeEvidence>;
114
+ exitCode: 0 | 1 | 2;
115
+ }
116
+ interface DoctorOptions {
117
+ cwd?: string;
118
+ targets?: readonly string[];
119
+ /** 静态检查的显式源码目录;不执行配置推断。 */
120
+ source?: string;
121
+ artifact?: string;
122
+ build?: boolean;
123
+ runtime?: boolean;
124
+ /** 连接已有 automator 会话的端口;省略时使用项目派生端口。 */
125
+ runtimePort?: number;
126
+ runtimeCliPath?: string;
127
+ runtimeLogin?: boolean;
128
+ runtimeServicePort?: number;
129
+ configFile?: string;
130
+ onBuildLog?: (text: string) => void;
131
+ }
132
+ interface DoctorAdapters {
133
+ build: (options: DoctorOptions, target: MpPlatform) => Promise<DoctorArtifactSnapshot>;
134
+ runtime: (cwd: string, target: MpPlatform, port?: number, options?: DoctorRuntimeProbeOptions) => Promise<DoctorRuntimeEvidence>;
135
+ }
136
+ //#endregion
137
+ //#region src/doctor/report.d.ts
138
+ export declare function formatDoctorReport(report: DoctorReport, format?: 'terminal' | 'json' | 'sarif'): string;
139
+ //#endregion
140
+ //#region src/doctor/index.d.ts
141
+ /** 分层收集事实;静态路径永不调用配置加载器、构建或宿主连接。 */
142
+ export declare function runDoctor(options?: DoctorOptions, adapters?: Partial<DoctorAdapters>): Promise<DoctorReport>;
143
+ //#endregion
144
+ export type { DoctorAdapters, DoctorArtifactSnapshot, DoctorCoverage, DoctorDiagnostic, DoctorFile, DoctorLayer, DoctorOptions, DoctorReport, DoctorRuntimeBundle, DoctorRuntimeEvidence, DoctorRuntimeFact, DoctorRuntimeProbeOptions, DoctorRuntimeStage };