weapp-vite 7.4.0 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +59 -3
  2. package/THIRD_PARTY_NOTICES.md +60 -0
  3. package/bin/bootstrap.js +14 -1
  4. package/dist/action-B3YZMA-h.mjs +255 -0
  5. package/dist/action-BELcDNNv.mjs +139 -0
  6. package/dist/action-BOk3vGI7.mjs +1110 -0
  7. package/dist/action-DlC6JYpt.mjs +95 -0
  8. package/dist/action-zEDY7oh_.mjs +247 -0
  9. package/dist/adapters-CcHrsYaj.mjs +1 -0
  10. package/dist/analyze-DN79YOAH.mjs +184 -0
  11. package/dist/artifacts-BOyC9Fy-.mjs +106 -0
  12. package/dist/assets-C5_YYXNk.mjs +637 -0
  13. package/dist/auto-import-components/resolvers.mjs +1 -2
  14. package/dist/auto-import-presets/wevu-router.mjs +1 -2
  15. package/dist/auto-import-presets/wevu.mjs +1 -2
  16. package/dist/auto-routes.mjs +2 -1
  17. package/dist/budget-CTLOHwgI.d.mts +177 -0
  18. package/dist/budget-EOeEycc_.mjs +65 -0
  19. package/dist/builtProject-C29udgXY.mjs +541 -0
  20. package/dist/chunkStrategy-DY_LZIIe.mjs +1448 -0
  21. package/dist/classifier-DBJY__kg.mjs +88 -0
  22. package/dist/cli-acceptance.d.mts +1 -0
  23. package/dist/cli-acceptance.mjs +21 -0
  24. package/dist/cli.mjs +519 -5049
  25. package/dist/compatibility.mjs +1 -2
  26. package/dist/{config-Dbvj5yK7.d.mts → config-Bf6DWhyb.d.mts} +220 -76
  27. package/dist/config.d.mts +3 -3
  28. package/dist/config.mjs +1 -1
  29. package/dist/{constants-WOsG3Eqd.mjs → constants-DEZdcsMn.mjs} +1 -1
  30. package/dist/{createContext-UOEgeYnA.mjs → createCompilerContextInstance-aYwi8wQt.mjs} +36862 -32020
  31. package/dist/createContext-tApLtII-.mjs +15 -0
  32. package/dist/dashboard/analyze.d.mts +48 -0
  33. package/dist/dashboard/analyze.mjs +3 -0
  34. package/dist/dashboard/vite.d.mts +1 -1
  35. package/dist/dashboard.d.mts +3 -2
  36. package/dist/dashboard.mjs +1748 -1
  37. package/dist/dashboardTransport-C_Y6jMp-.mjs +16 -0
  38. package/dist/dashboardViteBridge-DCGR43aM.mjs +302 -0
  39. package/dist/dev-C2fgr_Xd.mjs +67 -0
  40. package/dist/devProvider-D-hTfsEO.mjs +3027 -0
  41. package/dist/docs/README.md +59 -3
  42. package/dist/docs/ai-workflows.md +4 -0
  43. package/dist/docs/doctor.md +38 -0
  44. package/dist/docs/getting-started.md +3 -1
  45. package/dist/docs/index.md +3 -1
  46. package/dist/docs/mcp.md +104 -1
  47. package/dist/docs/testing.md +29 -2
  48. package/dist/docs/troubleshooting.md +16 -0
  49. package/dist/docs/uni-app-component-libraries.md +8 -7
  50. package/dist/docs/upload.md +40 -3
  51. package/dist/docs/vite-plugin.md +171 -0
  52. package/dist/docs/vue-sfc.md +42 -0
  53. package/dist/docs/weapp-config.md +54 -0
  54. package/dist/docs/wevu-authoring.md +10 -0
  55. package/dist/doctor-worker.d.mts +1 -0
  56. package/dist/doctor-worker.mjs +60 -0
  57. package/dist/doctor.d.mts +144 -0
  58. package/dist/doctor.mjs +850 -0
  59. package/dist/engine-C66J0HLz.mjs +54 -0
  60. package/dist/eslint.mjs +1 -2
  61. package/dist/{file-giE9UMZa.mjs → file-CcIOmqhC.mjs} +58 -24
  62. package/dist/file-DtcteQ4G.mjs +1 -0
  63. package/dist/files-BqxFIPRp.mjs +45 -0
  64. package/dist/forwardConsole-B0Reo8Lf.mjs +511 -0
  65. package/dist/getInstance-BAIaU2y9.mjs +1 -0
  66. package/dist/getInstance-Dt9IQDKr.mjs +28 -0
  67. package/dist/history-BIiRCzbq.mjs +784 -0
  68. package/dist/i18n.d.mts +1 -1
  69. package/dist/index-D5rgBzYZ.d.mts +740 -0
  70. package/dist/index.d.mts +12 -10
  71. package/dist/index.mjs +3 -2
  72. package/dist/json.d.mts +1 -1
  73. package/dist/json.mjs +1 -2
  74. package/dist/lib-DjccSI1B.mjs +143 -0
  75. package/dist/lifecycle-C36WSbQS.mjs +413 -0
  76. package/dist/loadConfig-BWIsDXR4.mjs +59 -0
  77. package/dist/loadConfig-D-BpBgsk.mjs +1 -0
  78. package/dist/logBuildAppFinish-ChjwATMv.mjs +57 -0
  79. package/dist/logger-DGn5iEVN.mjs +1 -0
  80. package/dist/mcp-CYgX9HpO.mjs +86 -0
  81. package/dist/{mcp-BG6TliEg.mjs → mcp-Cj8Maqo6.mjs} +16 -7
  82. package/dist/mcp.d.mts +6 -3
  83. package/dist/mcp.mjs +1 -2
  84. package/dist/mcpClient-DVLvFLZv.mjs +287 -0
  85. package/dist/metadata-hwF7QRcS.mjs +59 -0
  86. package/dist/nodeEnv-BmH8UZPR.mjs +7 -0
  87. package/dist/openIde-CroqOgk5.mjs +648 -0
  88. package/dist/options-jqFwfD1G.mjs +34 -0
  89. package/dist/package-Cmakyy3J.mjs +4 -0
  90. package/dist/path-CYYIQGS7.mjs +44 -0
  91. package/dist/{platform-DTWs5QRi.mjs → platform-CnkySBKz.mjs} +1 -1
  92. package/dist/processCleanup-BQn2kTcK.mjs +19 -0
  93. package/dist/protocol-Cg6Jdlvb.mjs +141 -0
  94. package/dist/reader-sh_POQ9-.mjs +93 -0
  95. package/dist/realpathScope-Tf9mz-fh.mjs +23 -0
  96. package/dist/report-hyonPGbZ.mjs +107 -0
  97. package/dist/resolvedId-CiDl7SC1.mjs +60 -0
  98. package/dist/{resolvers-icNxkpcy.mjs → resolvers-Dod-euqX.mjs} +4 -1
  99. package/dist/resolvers.mjs +1 -2
  100. package/dist/runtime-CLUhQsdA.mjs +43 -0
  101. package/dist/{runtime-Ee2HY6gR.d.mts → runtime-DpVf714f.d.mts} +1 -1
  102. package/dist/runtime.d.mts +1 -1
  103. package/dist/runtime.mjs +1 -2
  104. package/dist/schematics-kO26eQRT.mjs +91 -0
  105. package/dist/session-D3zsdzIy.mjs +452 -0
  106. package/dist/test.d.mts +1 -0
  107. package/dist/test.mjs +204 -45
  108. package/dist/{types-CgZn5X6j.d.mts → types-D-kfuyVa.d.mts} +1 -2
  109. package/dist/types-D0FFexRF.d.mts +39 -0
  110. package/dist/types.d.mts +3 -3
  111. package/dist/{upload-D0RcEWrq.mjs → upload-DozK8UdN.mjs} +278 -15
  112. package/dist/upload-worker.mjs +136 -3
  113. package/dist/utils-Dy51PYAC.mjs +1034 -0
  114. package/dist/vite.d.mts +9 -0
  115. package/dist/vite.mjs +309 -0
  116. package/dist/volar.d.mts +2 -2
  117. package/dist/web-apis.mjs +1 -2
  118. package/dist/wxs-BT8btflA.mjs +112 -0
  119. package/dist/wxs-Z4VQDeJ_.mjs +1 -0
  120. package/package.json +80 -48
  121. package/dist/adapters-BwnMMIZR.mjs +0 -2
  122. package/dist/dashboard-BzaVesmQ.mjs +0 -558
  123. package/dist/file-D19nbDoN.mjs +0 -2
  124. package/dist/getInstance-CYF1vl5l.mjs +0 -2
  125. package/dist/index-DbqVupg0.d.mts +0 -246
  126. package/dist/logger-mt4mSTqV.mjs +0 -2
@@ -0,0 +1,88 @@
1
+ import { t as isPathInside } from "./path-CYYIQGS7.mjs";
2
+ import "./utils-Dy51PYAC.mjs";
3
+ import { i as SHARED_CHUNK_VIRTUAL_PREFIX } from "./chunkStrategy-DY_LZIIe.mjs";
4
+ import { posix } from "pathe";
5
+ //#region src/analyze/subpackages/classifier.ts
6
+ const VIRTUAL_MODULE_INDICATOR = "\0";
7
+ const VIRTUAL_PREFIX = `${SHARED_CHUNK_VIRTUAL_PREFIX}/`;
8
+ function classifyModuleSourceKind(options) {
9
+ if (options.isNodeModule) return "node_modules";
10
+ if (options.inSrc) return "src";
11
+ if (options.inPlugin) return "plugin";
12
+ return "workspace";
13
+ }
14
+ function resolvePluginAssetAbsolute(normalizedFileName, pluginRoot) {
15
+ if (!pluginRoot) return;
16
+ if (posix.isAbsolute(normalizedFileName)) return isPathInside(pluginRoot, normalizedFileName) ? normalizedFileName : void 0;
17
+ const pluginBase = posix.basename(pluginRoot);
18
+ if (normalizedFileName !== pluginBase && !normalizedFileName.startsWith(`${pluginBase}/`)) return;
19
+ const relative = normalizedFileName === pluginBase ? "" : normalizedFileName.slice(pluginBase.length + 1);
20
+ const absolute = posix.resolve(pluginRoot, relative);
21
+ return isPathInside(pluginRoot, absolute) ? absolute : void 0;
22
+ }
23
+ function resolveSubPackageRoot(fileName, context) {
24
+ const normalized = posix.normalize(fileName);
25
+ return Array.from(context.subPackageRoots).filter(Boolean).sort((left, right) => right.length - left.length).find((root) => normalized === root || normalized.startsWith(`${root}/`));
26
+ }
27
+ function classifyPackage(fileName, origin, context) {
28
+ if (fileName.startsWith(VIRTUAL_PREFIX)) {
29
+ const combination = fileName.slice(VIRTUAL_PREFIX.length).split("/")[0] || "shared";
30
+ return {
31
+ id: `virtual:${combination}`,
32
+ label: `共享虚拟包 ${combination}`,
33
+ type: "virtual"
34
+ };
35
+ }
36
+ const rootCandidate = resolveSubPackageRoot(fileName, context);
37
+ if (rootCandidate) {
38
+ const isIndependent = context.independentRoots.has(rootCandidate);
39
+ return {
40
+ id: rootCandidate,
41
+ label: `${isIndependent ? "独立分包" : "分包"} ${rootCandidate}`,
42
+ type: isIndependent || origin === "independent" ? "independent" : "subPackage"
43
+ };
44
+ }
45
+ return {
46
+ id: "__main__",
47
+ label: "主包",
48
+ type: "main"
49
+ };
50
+ }
51
+ function normalizeModuleId(id) {
52
+ if (!id || id.includes(VIRTUAL_MODULE_INDICATOR)) return;
53
+ if (!posix.isAbsolute(id)) return;
54
+ return posix.normalize(id);
55
+ }
56
+ function resolveModuleSourceType(absoluteId, ctx) {
57
+ const { configService } = ctx;
58
+ const isNodeModule = absoluteId.includes("/node_modules/") || absoluteId.includes("\\node_modules\\");
59
+ const pluginRoot = configService.absolutePluginRoot;
60
+ const srcRoot = configService.absoluteSrcRoot;
61
+ const sourceType = classifyModuleSourceKind({
62
+ isNodeModule,
63
+ inSrc: isPathInside(srcRoot, absoluteId),
64
+ inPlugin: pluginRoot ? isPathInside(pluginRoot, absoluteId) : false
65
+ });
66
+ return {
67
+ source: configService.relativeAbsoluteSrcRoot(absoluteId),
68
+ sourceType
69
+ };
70
+ }
71
+ function resolveAssetSource(fileName, ctx) {
72
+ const { configService } = ctx;
73
+ const normalized = posix.normalize(fileName);
74
+ const srcCandidate = posix.isAbsolute(normalized) ? normalized : posix.resolve(configService.absoluteSrcRoot, normalized);
75
+ if (isPathInside(configService.absoluteSrcRoot, srcCandidate)) return {
76
+ absolute: srcCandidate,
77
+ source: configService.relativeAbsoluteSrcRoot(srcCandidate),
78
+ sourceType: "src"
79
+ };
80
+ const pluginAbsolute = resolvePluginAssetAbsolute(normalized, configService.absolutePluginRoot);
81
+ if (pluginAbsolute) return {
82
+ absolute: pluginAbsolute,
83
+ source: configService.relativeAbsoluteSrcRoot(pluginAbsolute),
84
+ sourceType: "plugin"
85
+ };
86
+ }
87
+ //#endregion
88
+ export { resolveModuleSourceType as i, normalizeModuleId as n, resolveAssetSource as r, classifyPackage as t };
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,21 @@
1
+ import { t as VERSION } from "./constants-DEZdcsMn.mjs";
2
+ import { n as registerAcceptCommand, t as registerMcpCommand } from "./mcp-CYgX9HpO.mjs";
3
+ import process from "node:process";
4
+ import { cac } from "cac";
5
+ //#region src/cli-acceptance.ts
6
+ const cli = cac("weapp-vite");
7
+ cli.option("-c, --config <file>", "Vite configuration for explicit HTTP onboarding only");
8
+ registerAcceptCommand(cli);
9
+ registerMcpCommand(cli);
10
+ cli.option("--base <path>", "public base path").option("-l, --logLevel <level>", "info | warn | error | silent").option("--clearScreen", "allow/disable clear screen when logging").option("-d, --debug [feat]", "show debug logs").option("-f, --filter <filter>", "filter debug logs").option("-m, --mode <mode>", "set env mode");
11
+ cli.help();
12
+ cli.version(VERSION);
13
+ try {
14
+ cli.parse(process.argv, { run: false });
15
+ await cli.runMatchedCommand();
16
+ } catch (error) {
17
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
18
+ process.exitCode = 1;
19
+ }
20
+ //#endregion
21
+ export {};