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.
- package/README.md +59 -3
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/bin/bootstrap.js +14 -1
- package/dist/action-B3YZMA-h.mjs +255 -0
- package/dist/action-BELcDNNv.mjs +139 -0
- package/dist/action-BOk3vGI7.mjs +1110 -0
- package/dist/action-DlC6JYpt.mjs +95 -0
- package/dist/action-zEDY7oh_.mjs +247 -0
- package/dist/adapters-CcHrsYaj.mjs +1 -0
- package/dist/analyze-DN79YOAH.mjs +184 -0
- package/dist/artifacts-BOyC9Fy-.mjs +106 -0
- package/dist/assets-C5_YYXNk.mjs +637 -0
- package/dist/auto-import-components/resolvers.mjs +1 -2
- package/dist/auto-import-presets/wevu-router.mjs +1 -2
- package/dist/auto-import-presets/wevu.mjs +1 -2
- package/dist/auto-routes.mjs +2 -1
- package/dist/budget-CTLOHwgI.d.mts +177 -0
- package/dist/budget-EOeEycc_.mjs +65 -0
- package/dist/builtProject-C29udgXY.mjs +541 -0
- package/dist/chunkStrategy-DY_LZIIe.mjs +1448 -0
- package/dist/classifier-DBJY__kg.mjs +88 -0
- package/dist/cli-acceptance.d.mts +1 -0
- package/dist/cli-acceptance.mjs +21 -0
- package/dist/cli.mjs +519 -5049
- package/dist/compatibility.mjs +1 -2
- package/dist/{config-Dbvj5yK7.d.mts → config-Bf6DWhyb.d.mts} +220 -76
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +1 -1
- package/dist/{constants-WOsG3Eqd.mjs → constants-DEZdcsMn.mjs} +1 -1
- package/dist/{createContext-UOEgeYnA.mjs → createCompilerContextInstance-aYwi8wQt.mjs} +36862 -32020
- package/dist/createContext-tApLtII-.mjs +15 -0
- package/dist/dashboard/analyze.d.mts +48 -0
- package/dist/dashboard/analyze.mjs +3 -0
- package/dist/dashboard/vite.d.mts +1 -1
- package/dist/dashboard.d.mts +3 -2
- package/dist/dashboard.mjs +1748 -1
- package/dist/dashboardTransport-C_Y6jMp-.mjs +16 -0
- package/dist/dashboardViteBridge-DCGR43aM.mjs +302 -0
- package/dist/dev-C2fgr_Xd.mjs +67 -0
- package/dist/devProvider-D-hTfsEO.mjs +3027 -0
- package/dist/docs/README.md +59 -3
- package/dist/docs/ai-workflows.md +4 -0
- package/dist/docs/doctor.md +38 -0
- package/dist/docs/getting-started.md +3 -1
- package/dist/docs/index.md +3 -1
- package/dist/docs/mcp.md +104 -1
- package/dist/docs/testing.md +29 -2
- package/dist/docs/troubleshooting.md +16 -0
- package/dist/docs/uni-app-component-libraries.md +8 -7
- package/dist/docs/upload.md +40 -3
- package/dist/docs/vite-plugin.md +171 -0
- package/dist/docs/vue-sfc.md +42 -0
- package/dist/docs/weapp-config.md +54 -0
- package/dist/docs/wevu-authoring.md +10 -0
- package/dist/doctor-worker.d.mts +1 -0
- package/dist/doctor-worker.mjs +60 -0
- package/dist/doctor.d.mts +144 -0
- package/dist/doctor.mjs +850 -0
- package/dist/engine-C66J0HLz.mjs +54 -0
- package/dist/eslint.mjs +1 -2
- package/dist/{file-giE9UMZa.mjs → file-CcIOmqhC.mjs} +58 -24
- package/dist/file-DtcteQ4G.mjs +1 -0
- package/dist/files-BqxFIPRp.mjs +45 -0
- package/dist/forwardConsole-B0Reo8Lf.mjs +511 -0
- package/dist/getInstance-BAIaU2y9.mjs +1 -0
- package/dist/getInstance-Dt9IQDKr.mjs +28 -0
- package/dist/history-BIiRCzbq.mjs +784 -0
- package/dist/i18n.d.mts +1 -1
- package/dist/index-D5rgBzYZ.d.mts +740 -0
- package/dist/index.d.mts +12 -10
- package/dist/index.mjs +3 -2
- package/dist/json.d.mts +1 -1
- package/dist/json.mjs +1 -2
- package/dist/lib-DjccSI1B.mjs +143 -0
- package/dist/lifecycle-C36WSbQS.mjs +413 -0
- package/dist/loadConfig-BWIsDXR4.mjs +59 -0
- package/dist/loadConfig-D-BpBgsk.mjs +1 -0
- package/dist/logBuildAppFinish-ChjwATMv.mjs +57 -0
- package/dist/logger-DGn5iEVN.mjs +1 -0
- package/dist/mcp-CYgX9HpO.mjs +86 -0
- package/dist/{mcp-BG6TliEg.mjs → mcp-Cj8Maqo6.mjs} +16 -7
- package/dist/mcp.d.mts +6 -3
- package/dist/mcp.mjs +1 -2
- package/dist/mcpClient-DVLvFLZv.mjs +287 -0
- package/dist/metadata-hwF7QRcS.mjs +59 -0
- package/dist/nodeEnv-BmH8UZPR.mjs +7 -0
- package/dist/openIde-CroqOgk5.mjs +648 -0
- package/dist/options-jqFwfD1G.mjs +34 -0
- package/dist/package-Cmakyy3J.mjs +4 -0
- package/dist/path-CYYIQGS7.mjs +44 -0
- package/dist/{platform-DTWs5QRi.mjs → platform-CnkySBKz.mjs} +1 -1
- package/dist/processCleanup-BQn2kTcK.mjs +19 -0
- package/dist/protocol-Cg6Jdlvb.mjs +141 -0
- package/dist/reader-sh_POQ9-.mjs +93 -0
- package/dist/realpathScope-Tf9mz-fh.mjs +23 -0
- package/dist/report-hyonPGbZ.mjs +107 -0
- package/dist/resolvedId-CiDl7SC1.mjs +60 -0
- package/dist/{resolvers-icNxkpcy.mjs → resolvers-Dod-euqX.mjs} +4 -1
- package/dist/resolvers.mjs +1 -2
- package/dist/runtime-CLUhQsdA.mjs +43 -0
- package/dist/{runtime-Ee2HY6gR.d.mts → runtime-DpVf714f.d.mts} +1 -1
- package/dist/runtime.d.mts +1 -1
- package/dist/runtime.mjs +1 -2
- package/dist/schematics-kO26eQRT.mjs +91 -0
- package/dist/session-D3zsdzIy.mjs +452 -0
- package/dist/test.d.mts +1 -0
- package/dist/test.mjs +204 -45
- package/dist/{types-CgZn5X6j.d.mts → types-D-kfuyVa.d.mts} +1 -2
- package/dist/types-D0FFexRF.d.mts +39 -0
- package/dist/types.d.mts +3 -3
- package/dist/{upload-D0RcEWrq.mjs → upload-DozK8UdN.mjs} +278 -15
- package/dist/upload-worker.mjs +136 -3
- package/dist/utils-Dy51PYAC.mjs +1034 -0
- package/dist/vite.d.mts +9 -0
- package/dist/vite.mjs +309 -0
- package/dist/volar.d.mts +2 -2
- package/dist/web-apis.mjs +1 -2
- package/dist/wxs-BT8btflA.mjs +112 -0
- package/dist/wxs-Z4VQDeJ_.mjs +1 -0
- package/package.json +80 -48
- package/dist/adapters-BwnMMIZR.mjs +0 -2
- package/dist/dashboard-BzaVesmQ.mjs +0 -558
- package/dist/file-D19nbDoN.mjs +0 -2
- package/dist/getInstance-CYF1vl5l.mjs +0 -2
- package/dist/index-DbqVupg0.d.mts +0 -246
- 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 {};
|