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,11 +1,11 @@
|
|
|
1
|
-
import { a as parseSidecarModuleId, i as parseLogicalEntryId, s as parseSidecarSourceRequest } from "./protocol-
|
|
2
|
-
import { r as normalizeRelativePath } from "./path-
|
|
1
|
+
import { a as parseSidecarModuleId, i as parseLogicalEntryId, s as parseSidecarSourceRequest } from "./protocol-HiSJRrSO.mjs";
|
|
2
|
+
import { r as normalizeRelativePath } from "./path-E1OjBJAl.mjs";
|
|
3
3
|
import { posix } from "pathe";
|
|
4
4
|
import { removeExtensionDeep } from "@weapp-core/shared";
|
|
5
5
|
import { Buffer } from "node:buffer";
|
|
6
6
|
import MagicString from "magic-string";
|
|
7
7
|
import remapping from "@jridgewell/remapping";
|
|
8
|
-
|
|
8
|
+
// src/runtime/chunkStrategy/state.ts
|
|
9
9
|
const sharedChunkDiagnostics = /* @__PURE__ */ new Map();
|
|
10
10
|
const takeImportersMap = /* @__PURE__ */ new Map();
|
|
11
11
|
const forceDuplicateSharedChunks = /* @__PURE__ */ new Set();
|
|
@@ -57,8 +57,7 @@ function setCachedSharedChunkName(moduleId, value) {
|
|
|
57
57
|
if (!moduleId) return;
|
|
58
58
|
sharedChunkNameCache.set(moduleId, value ?? null);
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
//#region src/utils/sourcemap.ts
|
|
60
|
+
// src/utils/sourcemap.ts
|
|
62
61
|
function isEncodedSourceMapLike(value) {
|
|
63
62
|
return Boolean(value && typeof value === "object" && "version" in value && typeof value.version === "number" && "mappings" in value && "names" in value && "sources" in value);
|
|
64
63
|
}
|
|
@@ -89,8 +88,7 @@ function labelSourceMapInput(value, fileName, code) {
|
|
|
89
88
|
sourcesContent: map.sources.map((source, index) => map.sourcesContent?.[index] ?? (source === "" ? code : null))
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
|
-
|
|
93
|
-
//#region src/utils/outputChunk.ts
|
|
91
|
+
// src/utils/outputChunk.ts
|
|
94
92
|
const INLINE_SOURCE_MAP_RE = /\n?\/\/[#@]\s*sourceMappingURL=(data:application\/json\S*)\s*$/u;
|
|
95
93
|
function resolveInlineSourceMap(code) {
|
|
96
94
|
const match = INLINE_SOURCE_MAP_RE.exec(code);
|
|
@@ -246,15 +244,13 @@ function syncOutputChunkSourceMapAssets(bundle) {
|
|
|
246
244
|
}
|
|
247
245
|
return synced;
|
|
248
246
|
}
|
|
249
|
-
|
|
250
|
-
//#region src/runtime/chunkStrategy/utils.ts
|
|
247
|
+
// src/runtime/chunkStrategy/utils.ts
|
|
251
248
|
function createRelativeImport(fromFile, toFile) {
|
|
252
249
|
const relative = posix.relative(posix.dirname(fromFile), toFile);
|
|
253
250
|
if (!relative || relative.startsWith(".")) return relative || "./";
|
|
254
251
|
return `./${relative}`;
|
|
255
252
|
}
|
|
256
|
-
|
|
257
|
-
//#region src/runtime/chunkStrategy/bundle.ts
|
|
253
|
+
// src/runtime/chunkStrategy/bundle.ts
|
|
258
254
|
function escapeRegExp(value) {
|
|
259
255
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
260
256
|
}
|
|
@@ -548,8 +544,7 @@ function updateImporters(bundle, importerToChunk, originalFileName, index) {
|
|
|
548
544
|
}
|
|
549
545
|
}
|
|
550
546
|
}
|
|
551
|
-
|
|
552
|
-
//#region src/runtime/chunkStrategy/collector.ts
|
|
547
|
+
// src/runtime/chunkStrategy/collector.ts
|
|
553
548
|
function resolveChunkGraphSourceId(id) {
|
|
554
549
|
return parseLogicalEntryId(id)?.sourceId ?? parseSidecarModuleId(id)?.ownerId ?? parseSidecarSourceRequest(id)?.ownerId ?? id;
|
|
555
550
|
}
|
|
@@ -673,8 +668,7 @@ function assertModuleScopedToRoot(options) {
|
|
|
673
668
|
}
|
|
674
669
|
}
|
|
675
670
|
}
|
|
676
|
-
|
|
677
|
-
//#region src/runtime/chunkStrategy/sourcemap.ts
|
|
671
|
+
// src/runtime/chunkStrategy/sourcemap.ts
|
|
678
672
|
function isSourceLike(source) {
|
|
679
673
|
return typeof source === "string" || source instanceof Uint8Array || Buffer.isBuffer(source);
|
|
680
674
|
}
|
|
@@ -735,8 +729,7 @@ function emitSourceMapAsset(ctx, targetFileName, sourceMapAssetInfo, fallbackSou
|
|
|
735
729
|
source: cloneSourceLike(fallbackSource)
|
|
736
730
|
});
|
|
737
731
|
}
|
|
738
|
-
|
|
739
|
-
//#region src/runtime/chunkStrategy/apply/runtime.ts
|
|
732
|
+
// src/runtime/chunkStrategy/apply/runtime.ts
|
|
740
733
|
const ROLLDOWN_RUNTIME_FILE_NAME$2 = "rolldown-runtime.js";
|
|
741
734
|
function applyRuntimeChunkLocalization(bundle, options) {
|
|
742
735
|
if (!this) throw new Error("applyRuntimeChunkLocalization 需要 PluginContext。");
|
|
@@ -845,13 +838,11 @@ function dedupeLookupKeys(values) {
|
|
|
845
838
|
function isRuntimeBundleOutput(output) {
|
|
846
839
|
return output?.type === "chunk" || output?.type === "asset";
|
|
847
840
|
}
|
|
848
|
-
|
|
849
|
-
//#region src/runtime/chunkStrategy/constants.ts
|
|
841
|
+
// src/runtime/chunkStrategy/constants.ts
|
|
850
842
|
const SHARED_CHUNK_VIRTUAL_PREFIX = "weapp_shared_virtual";
|
|
851
843
|
const SUB_PACKAGE_SHARED_DIR = "weapp-shared";
|
|
852
844
|
const DEFAULT_SHARED_CHUNK_STRATEGY = "hoist";
|
|
853
|
-
|
|
854
|
-
//#region src/runtime/chunkStrategy/apply/rewrite.ts
|
|
845
|
+
// src/runtime/chunkStrategy/apply/rewrite.ts
|
|
855
846
|
const ROLLDOWN_RUNTIME_FILE_NAME$1 = "rolldown-runtime.js";
|
|
856
847
|
const REGEXP_ESCAPE_PATTERN = /[.*+?^${}()|[\]\\]/g;
|
|
857
848
|
function createChunkSourceFileNameCandidates(fileName) {
|
|
@@ -918,8 +909,7 @@ function createRelativeImportPath(fromFileName, toFileName) {
|
|
|
918
909
|
if (!relativePath || relativePath.startsWith(".")) return relativePath || "./";
|
|
919
910
|
return `./${relativePath}`;
|
|
920
911
|
}
|
|
921
|
-
|
|
922
|
-
//#region src/runtime/chunkStrategy/apply/shared/runtime.ts
|
|
912
|
+
// src/runtime/chunkStrategy/apply/shared/runtime.ts
|
|
923
913
|
const ROLLDOWN_RUNTIME_FILE_NAME = "rolldown-runtime.js";
|
|
924
914
|
const SLASHES_PATTERN = /[\\/]+/g;
|
|
925
915
|
function createCrossSubPackageDuplicateBaseName(sourceRoot, fileName) {
|
|
@@ -1031,8 +1021,7 @@ function buildDuplicateDiagnostics(args) {
|
|
|
1031
1021
|
requiresRuntimeLocalization: chunkReferencesRuntime(args.chunk, ROLLDOWN_RUNTIME_FILE_NAME, new Set(args.sourceRoot ? [posix.join(args.sourceRoot, ROLLDOWN_RUNTIME_FILE_NAME), ROLLDOWN_RUNTIME_FILE_NAME] : [ROLLDOWN_RUNTIME_FILE_NAME]))
|
|
1032
1022
|
};
|
|
1033
1023
|
}
|
|
1034
|
-
|
|
1035
|
-
//#region src/runtime/chunkStrategy/apply/shared/leaks.ts
|
|
1024
|
+
// src/runtime/chunkStrategy/apply/shared/leaks.ts
|
|
1036
1025
|
function localizeCrossSubPackageChunkLeaks(bundle, options) {
|
|
1037
1026
|
const { subPackageRoots, reservedFileNames, localizedDuplicateFileMap, onDuplicate } = options;
|
|
1038
1027
|
if (subPackageRoots.length === 0) return;
|
|
@@ -1131,8 +1120,7 @@ function localizeCrossSubPackageChunkLeaks(bundle, options) {
|
|
|
1131
1120
|
});
|
|
1132
1121
|
}
|
|
1133
1122
|
}
|
|
1134
|
-
|
|
1135
|
-
//#region src/runtime/chunkStrategy/apply/shared.ts
|
|
1123
|
+
// src/runtime/chunkStrategy/apply/shared.ts
|
|
1136
1124
|
function applySharedChunkStrategy(bundle, options) {
|
|
1137
1125
|
if (options.strategy !== "duplicate" && !hasForceDuplicateSharedChunks()) return;
|
|
1138
1126
|
if (!this) throw new Error("applySharedChunkStrategy 需要 PluginContext。");
|
|
@@ -1311,8 +1299,7 @@ function shouldAnalyzeSharedChunkBundle(entries, subPackageRoots) {
|
|
|
1311
1299
|
}
|
|
1312
1300
|
return false;
|
|
1313
1301
|
}
|
|
1314
|
-
|
|
1315
|
-
//#region src/runtime/chunkStrategy/naming.ts
|
|
1302
|
+
// src/runtime/chunkStrategy/naming.ts
|
|
1316
1303
|
function resolveTakeSharedChunkName(options) {
|
|
1317
1304
|
const { ctx, relativeAbsoluteSrcRoot, subPackageRoots, importers } = options;
|
|
1318
1305
|
if (!importers.length) return;
|
|
@@ -1444,5 +1431,7 @@ function resolveSharedChunkName(options) {
|
|
|
1444
1431
|
setCachedSharedChunkName(id, "common");
|
|
1445
1432
|
return "common";
|
|
1446
1433
|
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1434
|
+
// package.json
|
|
1435
|
+
var version = "7.7.0";
|
|
1436
|
+
var engines = { "node": "^22.23.4 || ^24.22.1 || >=26.12.1" };
|
|
1437
|
+
export { normalizeEncodedSourceMapLike as C, labelSourceMapInput as S, replaceOutputChunkCode as _, DEFAULT_SHARED_CHUNK_STRATEGY as a, syncOutputChunkSourceMapAssets as b, applyRuntimeChunkLocalization as c, appendOutputChunkCode as d, applyAtomicMagicStringChunkRewrite as f, prependOutputChunkCode as g, editOutputChunkCode as h, applySharedChunkStrategy as i, assertModuleScopedToRoot as l, applyOutputChunkTransform as m, version as n, SHARED_CHUNK_VIRTUAL_PREFIX as o, applyMagicStringChunkRewrite as p, resolveSharedChunkName as r, SUB_PACKAGE_SHARED_DIR as s, engines as t, resolveSubPackagePrefix as u, replaceOutputChunkCodeRanges as v, resetTakeImportRegistry as w, composeSourceMaps as x, resolveOutputChunkTransformCode as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "pathe";
|
|
2
2
|
import { normalize } from "node:path";
|
|
3
|
-
|
|
3
|
+
// src/utils/path.ts
|
|
4
4
|
const BACKSLASH_RE = /\\/g;
|
|
5
5
|
const LEADING_SLASH_RE = /^[\\/]+/;
|
|
6
6
|
const DUPLICATE_SLASH_RE = /\/{2,}/g;
|
|
@@ -40,5 +40,4 @@ function isPathInside(parent, target) {
|
|
|
40
40
|
const relative = path.relative(normalizePath(parent), normalizePath(target));
|
|
41
41
|
return relative === "" || relative !== ".." && !relative.startsWith("../") && !path.isAbsolute(relative);
|
|
42
42
|
}
|
|
43
|
-
//#endregion
|
|
44
43
|
export { normalizeWatchPath as a, normalizeRoot as i, normalizePath as n, stripLeadingSlashes as o, normalizeRelativePath as r, toPosixPath as s, isPathInside as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as MINI_PROGRAM_PLATFORM_ADAPTERS } from "./adapters-CcHrsYaj.mjs";
|
|
2
2
|
import { MINI_PROGRAM_PLATFORM_ALIASES, getDefaultMiniProgramPlatform, getMiniProgramAppTypesPackage, getMiniProgramDirectivePrefix, getSupportedMiniProgramPlatforms, normalizeMiniProgramPlatform, resolveMiniProgramPlatform } from "@weapp-core/shared";
|
|
3
|
-
|
|
3
|
+
// src/platform.ts
|
|
4
4
|
const DEFAULT_MP_PLATFORM = getDefaultMiniProgramPlatform();
|
|
5
5
|
const NPM_PROTOCOL_RE = /^npm:/;
|
|
6
6
|
const EXPLICIT_NPM_DIR_RE = /^\/(?:miniprogram_npm|node_modules)\//;
|
|
@@ -171,5 +171,4 @@ function getTypeScriptPlatformOptions(platform) {
|
|
|
171
171
|
function getPlatformAppTypesPackage(platform) {
|
|
172
172
|
return getTypeScriptPlatformOptions(platform).appTypesPackage;
|
|
173
173
|
}
|
|
174
|
-
//#endregion
|
|
175
174
|
export { shouldNormalizeVueTemplateForPlatform as C, shouldUseProjectRootNpmDir as D, shouldRewriteBundleNpmImports as E, shouldNormalizeUsingComponents as S, shouldRebuildCachedMiniprogramPackage as T, shouldEmitGenericPlaceholderAsset as _, getPlatformNpmDistDirName as a, shouldNormalizeMiniprogramPackage as b, getPreservedNpmDirNames as c, getWxmlDirectivePrefix as d, getWxmlPlatformTransformOptions as f, shouldCopyEsModuleDirectory as g, resolveMiniPlatformWithDefault as h, getPlatformAppTypesPackage as i, getProjectPlatformOptions as l, resolveMiniPlatform as m, getDefaultIdeProjectRoot as n, getPlatformOutputExtensions as o, normalizePlatformNpmImportPath as p, getJsonPlatformOptions as r, getPlatformScriptModuleTag as s, DEFAULT_MP_PLATFORM as t, getSupportedMiniProgramPlatforms$1 as u, shouldFillComponentGenericsDefault as v, shouldPassPlatformArgToIdeOpen as w, shouldNormalizePlatformNpmImportPath as x, shouldHoistNestedMiniprogramDependencies as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/pluginHost.ts
|
|
2
2
|
const WEAPP_VITE_HOST_NAME = "weapp-vite";
|
|
3
3
|
function createWeappViteHostMeta(runtime, platform) {
|
|
4
4
|
const meta = {
|
|
@@ -23,5 +23,4 @@ function resolveWeappViteHostMeta(config) {
|
|
|
23
23
|
function isWeappViteHost(config) {
|
|
24
24
|
return resolveWeappViteHostMeta(config) !== void 0;
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { resolveWeappViteHostMeta as a, isWeappViteHost as i, applyWeappViteHostMeta as n, createWeappViteHostMeta as r, WEAPP_VITE_HOST_NAME as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
|
-
|
|
2
|
+
// src/cli/processCleanup.ts
|
|
3
3
|
function isSassEmbeddedChild(handle) {
|
|
4
4
|
if (!handle || typeof handle !== "object") return false;
|
|
5
5
|
const child = handle;
|
|
@@ -15,5 +15,4 @@ function terminateStaleSassEmbeddedProcess() {
|
|
|
15
15
|
handle.kill();
|
|
16
16
|
} catch {}
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { terminateStaleSassEmbeddedProcess as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as resolveRealpath } from "./realpathScope-
|
|
1
|
+
import { t as resolveRealpath } from "./realpathScope-DwlLaCk3.mjs";
|
|
2
2
|
import { WEAPP_VITE_LOGICAL_ENTRY_RESOLVED_PREFIX, WEAPP_VITE_LOGICAL_ENTRY_VIRTUAL_PREFIX, WEAPP_VITE_SIDECAR_OWNER_QUERY_MARKER, WEAPP_VITE_SIDECAR_QUERY_MARKER, WEAPP_VITE_SIDECAR_RESOLVED_PREFIX, WEAPP_VITE_SIDECAR_VIRTUAL_PREFIX } from "@weapp-core/constants";
|
|
3
3
|
import path from "pathe";
|
|
4
|
-
|
|
4
|
+
// src/moduleGraph/protocol.ts
|
|
5
5
|
const VIRTUAL_MODULE_SUFFIX = ":module.js";
|
|
6
6
|
const SIDECAR_SOURCE_JS_SUFFIX = "&lang.js";
|
|
7
7
|
const SIDECAR_SOURCE_STYLE_SUFFIX = "&lang.css";
|
|
@@ -137,5 +137,4 @@ function resolveVirtualModuleId(id) {
|
|
|
137
137
|
const sidecar = parseSidecarModuleId(id);
|
|
138
138
|
if (sidecar) return serializeSidecarModule(sidecar, WEAPP_VITE_SIDECAR_RESOLVED_PREFIX);
|
|
139
139
|
}
|
|
140
|
-
//#endregion
|
|
141
140
|
export { parseSidecarModuleId as a, resolveVirtualModuleId as c, parseLogicalEntryId as i, createSidecarModuleId as n, parseSidecarSourceMetadata as o, createSidecarSourceSpecifier as r, parseSidecarSourceRequest as s, createLogicalEntryId as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/analyze/hmr/reader.ts
|
|
2
2
|
const stringFields = [
|
|
3
3
|
"timestamp",
|
|
4
4
|
"eventId",
|
|
@@ -89,5 +89,4 @@ function readHmrProfileLines(content) {
|
|
|
89
89
|
skippedLineCount: coverage.incompatible + coverage.incomplete + coverage.invalid
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
//#endregion
|
|
93
92
|
export { readHmrProfileLines as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { realpathSync } from "node:fs";
|
|
2
|
-
|
|
2
|
+
// src/utils/realpathScope.ts
|
|
3
3
|
let activePaths;
|
|
4
4
|
/** 仅在同步图遍历中复用成功的真实路径解析;不跨事件、构建或异步边界保留。 */
|
|
5
5
|
function withRealpathScope(read) {
|
|
@@ -19,5 +19,4 @@ function resolveRealpath(file) {
|
|
|
19
19
|
activePaths?.set(file, resolved);
|
|
20
20
|
return resolved;
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { withRealpathScope as n, resolveRealpath as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
2
|
import { parseArgs } from "node:util";
|
|
3
|
-
|
|
3
|
+
// src/cli/upload/options.ts
|
|
4
4
|
function readUploadMetadata(cli) {
|
|
5
5
|
for (const name of [
|
|
6
6
|
"uv",
|
|
@@ -46,8 +46,7 @@ function resolveBuildUploadOptions(cli, options) {
|
|
|
46
46
|
...readUploadMetadata(cli)
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
//#region src/cli/upload/report.ts
|
|
49
|
+
// src/cli/upload/report.ts
|
|
51
50
|
var UploadCommandError = class extends Error {
|
|
52
51
|
report;
|
|
53
52
|
constructor(report) {
|
|
@@ -103,5 +102,4 @@ async function outputUploadReport(json, run) {
|
|
|
103
102
|
process.stdout.write = stdoutWrite;
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
|
-
//#endregion
|
|
107
105
|
export { resolveBuildUploadOptions as a, readUploadMetadata as i, outputUploadReport as n, resolveUploadTimeout as o, printUploadProgress as r, UploadCommandError as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
|
-
|
|
2
|
+
// src/utils/viteId.ts
|
|
3
3
|
const VUE_VIRTUAL_MODULE_PREFIX = "\0vue:";
|
|
4
4
|
const BACKSLASH_RE = /\\/g;
|
|
5
5
|
const WINDOWS_VITE_AT_FS_DRIVE_RE = /^\/[A-Z]:\//i;
|
|
@@ -30,8 +30,7 @@ function normalizeViteId(id, options) {
|
|
|
30
30
|
if (clean.includes("\\")) clean = clean.replace(BACKSLASH_RE, "/");
|
|
31
31
|
return clean;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
//#region src/utils/resolvedId.ts
|
|
33
|
+
// src/utils/resolvedId.ts
|
|
35
34
|
function isSkippableResolvedId(id) {
|
|
36
35
|
if (!id) return true;
|
|
37
36
|
return id.startsWith("\0") || id.startsWith("node:");
|
|
@@ -56,5 +55,4 @@ function resolveFsResolvedIdNormalizeOptions(options) {
|
|
|
56
55
|
function normalizeFsResolvedId(id, options) {
|
|
57
56
|
return normalizeViteId(id, resolveFsResolvedIdNormalizeOptions(options));
|
|
58
57
|
}
|
|
59
|
-
//#endregion
|
|
60
58
|
export { normalizeFsResolvedId as n, normalizeViteId as r, isSkippableResolvedId as t };
|
|
@@ -2,7 +2,7 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import path from "pathe";
|
|
4
4
|
import { defu } from "@weapp-core/shared";
|
|
5
|
-
|
|
5
|
+
// src/auto-import-components/resolvers/json/tdesign.json
|
|
6
6
|
var tdesign_default = [
|
|
7
7
|
"action-sheet",
|
|
8
8
|
"avatar",
|
|
@@ -93,8 +93,7 @@ var tdesign_default = [
|
|
|
93
93
|
"upload",
|
|
94
94
|
"watermark"
|
|
95
95
|
];
|
|
96
|
-
|
|
97
|
-
//#region src/auto-import-components/resolvers/tdesign.ts
|
|
96
|
+
// src/auto-import-components/resolvers/tdesign.ts
|
|
98
97
|
const defaultPrefix$2 = "t-";
|
|
99
98
|
const TDesignResolver = (opts) => {
|
|
100
99
|
const { prefix, resolve, supportFilesStrategy } = defu(opts, {
|
|
@@ -153,8 +152,7 @@ const TDesignResolver = (opts) => {
|
|
|
153
152
|
}
|
|
154
153
|
};
|
|
155
154
|
};
|
|
156
|
-
|
|
157
|
-
//#region src/auto-import-components/resolvers/json/uviewPlus.json
|
|
155
|
+
// src/auto-import-components/resolvers/json/uviewPlus.json
|
|
158
156
|
var uviewPlus_default = [
|
|
159
157
|
"u-action-sheet",
|
|
160
158
|
"u-action-sheet-data",
|
|
@@ -298,8 +296,7 @@ var uviewPlus_default = [
|
|
|
298
296
|
"u-virtual-list",
|
|
299
297
|
"u-waterfall"
|
|
300
298
|
];
|
|
301
|
-
|
|
302
|
-
//#region src/auto-import-components/resolvers/uviewPlus.ts
|
|
299
|
+
// src/auto-import-components/resolvers/uviewPlus.ts
|
|
303
300
|
const PACKAGE_NAME$1 = "uview-plus";
|
|
304
301
|
const require = createRequire(import.meta.url);
|
|
305
302
|
function resolveComponentId(from, importerBaseName) {
|
|
@@ -355,8 +352,7 @@ function UviewPlusResolver(options = {}) {
|
|
|
355
352
|
}
|
|
356
353
|
};
|
|
357
354
|
}
|
|
358
|
-
|
|
359
|
-
//#region src/auto-import-components/resolvers/json/vant.json
|
|
355
|
+
// src/auto-import-components/resolvers/json/vant.json
|
|
360
356
|
var vant_default = [
|
|
361
357
|
"action-sheet",
|
|
362
358
|
"area",
|
|
@@ -428,8 +424,7 @@ var vant_default = [
|
|
|
428
424
|
"tree-select",
|
|
429
425
|
"uploader"
|
|
430
426
|
];
|
|
431
|
-
|
|
432
|
-
//#region src/auto-import-components/resolvers/vant.ts
|
|
427
|
+
// src/auto-import-components/resolvers/vant.ts
|
|
433
428
|
const defaultPrefix$1 = "van-";
|
|
434
429
|
const VantResolver = (opts) => {
|
|
435
430
|
const { prefix, resolve, supportFilesStrategy } = defu(opts, {
|
|
@@ -474,8 +469,7 @@ const VantResolver = (opts) => {
|
|
|
474
469
|
}
|
|
475
470
|
};
|
|
476
471
|
};
|
|
477
|
-
|
|
478
|
-
//#region src/auto-import-components/resolvers/json/weui.json
|
|
472
|
+
// src/auto-import-components/resolvers/json/weui.json
|
|
479
473
|
var weui_default = [
|
|
480
474
|
"actionsheet",
|
|
481
475
|
"badge",
|
|
@@ -499,8 +493,7 @@ var weui_default = [
|
|
|
499
493
|
"toptips",
|
|
500
494
|
"uploader"
|
|
501
495
|
];
|
|
502
|
-
|
|
503
|
-
//#region src/auto-import-components/resolvers/weui.ts
|
|
496
|
+
// src/auto-import-components/resolvers/weui.ts
|
|
504
497
|
const defaultPrefix = "mp-";
|
|
505
498
|
const WeuiResolver = (opts) => {
|
|
506
499
|
const { prefix, resolve, supportFilesStrategy } = defu(opts, {
|
|
@@ -535,8 +528,7 @@ const WeuiResolver = (opts) => {
|
|
|
535
528
|
}
|
|
536
529
|
};
|
|
537
530
|
};
|
|
538
|
-
|
|
539
|
-
//#region src/auto-import-components/resolvers/json/wotUi.json
|
|
531
|
+
// src/auto-import-components/resolvers/json/wotUi.json
|
|
540
532
|
var wotUi_default = [
|
|
541
533
|
"wd-action-sheet",
|
|
542
534
|
"wd-avatar",
|
|
@@ -639,8 +631,7 @@ var wotUi_default = [
|
|
|
639
631
|
"wd-video-preview",
|
|
640
632
|
"wd-watermark"
|
|
641
633
|
];
|
|
642
|
-
|
|
643
|
-
//#region src/auto-import-components/resolvers/wotUi.ts
|
|
634
|
+
// src/auto-import-components/resolvers/wotUi.ts
|
|
644
635
|
const PACKAGE_NAME = "@wot-ui/ui";
|
|
645
636
|
/**
|
|
646
637
|
* 创建 Wot UI 的 Vue SFC 自动导入解析器。
|
|
@@ -685,5 +676,4 @@ function WotUiResolver(options) {
|
|
|
685
676
|
}
|
|
686
677
|
};
|
|
687
678
|
}
|
|
688
|
-
//#endregion
|
|
689
679
|
export { TDesignResolver as a, UviewPlusResolver as i, WeuiResolver as n, VantResolver as r, WotUiResolver as t };
|
package/dist/resolvers.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as UviewPlusResolver, c as CreateResolver, d as ResolvedValue, f as Resolver, g as ResolverSupportFilesStrategy, h as ResolverObject, i as VantResolver, l as ExternalMetadataFileCandidates, m as ResolverMeta, n as WotUiResolverOptions, o as UviewPlusResolverOptions, p as ResolverFn, r as WeuiResolver, s as TDesignResolver, t as WotUiResolver, u as Options } from "./index-
|
|
1
|
+
import { a as UviewPlusResolver, c as CreateResolver, d as ResolvedValue, f as Resolver, g as ResolverSupportFilesStrategy, h as ResolverObject, i as VantResolver, l as ExternalMetadataFileCandidates, m as ResolverMeta, n as WotUiResolverOptions, o as UviewPlusResolverOptions, p as ResolverFn, r as WeuiResolver, s as TDesignResolver, t as WotUiResolver, u as Options } from "./index-SnaW3cvA.mjs";
|
|
2
2
|
export { CreateResolver, ExternalMetadataFileCandidates, Options, ResolvedValue, Resolver, ResolverFn, ResolverMeta, ResolverObject, ResolverSupportFilesStrategy, TDesignResolver, UviewPlusResolver, UviewPlusResolverOptions, VantResolver, WeuiResolver, WotUiResolver, WotUiResolverOptions };
|
package/dist/resolvers.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as TDesignResolver, i as UviewPlusResolver, r as VantResolver, n as WeuiResolver, t as WotUiResolver } from "./resolvers-
|
|
1
|
+
export { a as TDesignResolver, i as UviewPlusResolver, r as VantResolver, n as WeuiResolver, t as WotUiResolver } from "./resolvers-CKYqmRD_.mjs";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types/routes.d.ts
|
|
2
1
|
interface AutoRoutesSubPackage {
|
|
3
2
|
root: string;
|
|
4
3
|
pages: string[];
|
|
@@ -9,5 +8,4 @@ interface AutoRoutes {
|
|
|
9
8
|
entries: string[];
|
|
10
9
|
subPackages: AutoRoutesSubPackage[];
|
|
11
10
|
}
|
|
12
|
-
//#endregion
|
|
13
11
|
export { AutoRoutesSubPackage as n, AutoRoutes as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComputedDefinitions, MethodDefinitions, WevuPageLayoutMap } from "wevu/types";
|
|
2
|
-
//#region src/plugins/vue/createWevuComponent.d.ts
|
|
3
2
|
interface WevuComponentOptions<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> {
|
|
4
3
|
data?: () => D;
|
|
5
4
|
computed?: C;
|
|
@@ -19,8 +18,6 @@ interface WevuComponentOptions<D extends object = Record<string, any>, C extends
|
|
|
19
18
|
* 在微信小程序中,Component() 可以同时定义页面与组件。
|
|
20
19
|
*/
|
|
21
20
|
declare function createWevuComponent(options: WevuComponentOptions): void;
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/plugins/vue/nativeLayoutHost.d.ts
|
|
24
21
|
type LayoutHostContext = Record<string, any>;
|
|
25
22
|
type LayoutHostResolver = (key: string) => unknown;
|
|
26
23
|
type LayoutHostEntry = unknown | (() => unknown);
|
|
@@ -50,14 +47,10 @@ declare function resolveLayoutHost<T = any>(key: string, options?: LayoutHostRes
|
|
|
50
47
|
* 等待当前页面 layout 宿主组件可用。
|
|
51
48
|
*/
|
|
52
49
|
declare function waitForLayoutHost<T = any>(key: string, options?: LayoutHostResolveOptions): Promise<T | null>;
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/plugins/vue/nativePageLayout.d.ts
|
|
55
50
|
type ResolveTypedPageLayoutName = keyof WevuPageLayoutMap extends never ? string : Extract<keyof WevuPageLayoutMap, string>;
|
|
56
51
|
type ResolveTypedPageLayoutProps<Name extends string> = Name extends keyof WevuPageLayoutMap ? WevuPageLayoutMap[Name] : Record<string, any>;
|
|
57
52
|
declare function setPageLayout(layout: false): void;
|
|
58
53
|
declare function setPageLayout<Name extends ResolveTypedPageLayoutName>(layout: Name, props?: ResolveTypedPageLayoutProps<Name>): void;
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region src/plugins/vue/runtimeMacros.d.ts
|
|
61
54
|
/**
|
|
62
55
|
* 说明:Vue 3 风格的 props 声明(用于类型提示)
|
|
63
56
|
*/
|
|
@@ -66,5 +59,4 @@ declare function defineProps<T extends Record<string, any>>(props: T): T;
|
|
|
66
59
|
* 说明:Vue 3 风格的 emits 声明(用于类型提示)
|
|
67
60
|
*/
|
|
68
61
|
declare function defineEmits<T extends Record<string, any> | string[]>(emits: T): T;
|
|
69
|
-
//#endregion
|
|
70
62
|
export { LayoutHostContext as a, LayoutHostResolver as c, unregisterLayoutHosts as d, waitForLayoutHost as f, LayoutHostBridge as i, registerLayoutHosts as l, createWevuComponent as m, defineProps as n, LayoutHostEntry as o, WevuComponentOptions as p, setPageLayout as r, LayoutHostResolveOptions as s, defineEmits as t, resolveLayoutHost as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { l as resolveBackendExecution } from "./createCompilerContextInstance-
|
|
1
|
+
import { l as resolveBackendExecution } from "./createCompilerContextInstance-BXSdH2E8.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-DGn5iEVN.mjs";
|
|
3
3
|
import { defu } from "@weapp-core/shared";
|
|
4
|
-
|
|
4
|
+
// src/cli/runtime.ts
|
|
5
5
|
function logRuntimeTarget(targets, options = {}) {
|
|
6
6
|
if (options.silent) return;
|
|
7
7
|
if (targets.label === "config") {
|
|
@@ -39,5 +39,4 @@ function createInlineConfig(execution, options = {}) {
|
|
|
39
39
|
const merged = configs.slice(1).reduce((merged, config) => defu(merged, config), configs[0]);
|
|
40
40
|
return options.inlineConfig ? defu(options.inlineConfig, merged) : merged;
|
|
41
41
|
}
|
|
42
|
-
//#endregion
|
|
43
42
|
export { resolveRuntimeTargets as i, logRuntimeTarget as n, resolveConfiguredRuntimeTargets as r, createInlineConfig as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WEVU_PAGE_LAYOUT_SETTER_KEY } from "@weapp-core/constants";
|
|
2
2
|
import { createMiniProgramLayoutHostRegistry, resolveMiniProgramPageKeys, resolveMiniProgramPlatform, supportsMiniProgramRuntimeCapability } from "@weapp-core/shared";
|
|
3
3
|
import { defineComponent } from "wevu";
|
|
4
|
-
|
|
4
|
+
// src/plugins/vue/createWevuComponent.ts
|
|
5
5
|
/**
|
|
6
6
|
* 从 Vue SFC 的 options 创建 wevu 组件
|
|
7
7
|
* 同时支持 Vue 2 风格(Options API)与 Vue 3 风格(Composition API)
|
|
@@ -18,8 +18,7 @@ function createWevuComponent(options) {
|
|
|
18
18
|
...mpOptions
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
//#region src/plugins/vue/nativeLayoutHost.ts
|
|
21
|
+
// src/plugins/vue/nativeLayoutHost.ts
|
|
23
22
|
const layoutHostRegistry = createMiniProgramLayoutHostRegistry();
|
|
24
23
|
function resolveCurrentPageInstance$1() {
|
|
25
24
|
const compiledPlatform = resolveMiniProgramPlatform(import.meta.env?.PLATFORM);
|
|
@@ -81,8 +80,7 @@ function resolveLayoutHost(key, options = {}) {
|
|
|
81
80
|
function waitForLayoutHost(key, options = {}) {
|
|
82
81
|
return layoutHostRegistry.waitForHost(key, () => resolvePageKeys(resolvePageFromContext(options.context)), (bridge, key) => bridge.resolveHost(key), options);
|
|
83
82
|
}
|
|
84
|
-
|
|
85
|
-
//#region src/plugins/vue/nativePageLayout.ts
|
|
83
|
+
// src/plugins/vue/nativePageLayout.ts
|
|
86
84
|
function resolveCurrentPageInstance() {
|
|
87
85
|
const compiledPlatform = resolveMiniProgramPlatform(import.meta.env?.PLATFORM);
|
|
88
86
|
if (!supportsMiniProgramRuntimeCapability(compiledPlatform, "globalPageStack")) return;
|
|
@@ -106,8 +104,7 @@ function setPageLayout(layout, props) {
|
|
|
106
104
|
}
|
|
107
105
|
throw new Error("setPageLayout() 未找到当前页面实例。请在页面生命周期、事件回调或当前页面上下文中调用。");
|
|
108
106
|
}
|
|
109
|
-
|
|
110
|
-
//#region src/plugins/vue/runtimeMacros.ts
|
|
107
|
+
// src/plugins/vue/runtimeMacros.ts
|
|
111
108
|
/**
|
|
112
109
|
* 说明:Vue 3 风格的 props 声明(用于类型提示)
|
|
113
110
|
*/
|
|
@@ -120,5 +117,4 @@ function defineProps(props) {
|
|
|
120
117
|
function defineEmits(emits) {
|
|
121
118
|
return emits;
|
|
122
119
|
}
|
|
123
|
-
//#endregion
|
|
124
120
|
export { resolveLayoutHost as a, createWevuComponent as c, registerLayoutHosts as i, defineProps as n, unregisterLayoutHosts as o, setPageLayout as r, waitForLayoutHost as s, defineEmits as t };
|
package/dist/runtime.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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";
|
|
2
2
|
export { type LayoutHostBridge, type LayoutHostContext, type LayoutHostEntry, type LayoutHostResolveOptions, type LayoutHostResolver, type WevuComponentOptions, createWevuComponent, defineEmits, defineProps, registerLayoutHosts, resolveLayoutHost, setPageLayout, unregisterLayoutHosts, waitForLayoutHost };
|
package/dist/runtime.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as createWevuComponent, t as defineEmits, n as defineProps, i as registerLayoutHosts, a as resolveLayoutHost, r as setPageLayout, o as unregisterLayoutHosts, s as waitForLayoutHost } from "./runtime-
|
|
1
|
+
export { c as createWevuComponent, t as defineEmits, n as defineProps, i as registerLayoutHosts, a as resolveLayoutHost, r as setPageLayout, o as unregisterLayoutHosts, s as waitForLayoutHost } from "./runtime-DDUCb7pP.mjs";
|
|
@@ -4,7 +4,7 @@ import path from "pathe";
|
|
|
4
4
|
import { defu } from "@weapp-core/shared";
|
|
5
5
|
import { fs } from "@weapp-core/shared/fs";
|
|
6
6
|
import { generateJs, generateJson, generateWxml, generateWxss } from "@weapp-core/schematics";
|
|
7
|
-
|
|
7
|
+
// src/schematics.ts
|
|
8
8
|
function composePath(outDir, filename) {
|
|
9
9
|
return `${outDir}${outDir ? "/" : ""}${filename}`;
|
|
10
10
|
}
|
|
@@ -87,5 +87,4 @@ async function generate(options) {
|
|
|
87
87
|
logger_default.success(`${composePath(outDir, fileName)} 创建成功!`);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
//#endregion
|
|
91
90
|
export { generate };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { B as resolveHmrRuntimeDecision, D as getStatefulHmrHost, E as createStatefulHmrHostPlugins, F as prepareClassicIdeConfig, I as attachHmrRuntimeSession, L as createHmrRuntimeSession, N as syncManagedTsconfigFiles, O as createSharedBuildConfig, P as getInitialBuildInputObservation, S as createOxcRuntimeSupport, T as attachStatefulHmrHost, _ as clearStatefulHmrSnapshot, b as createPackageBuilder, d as buildStatefulHmrSnapshot, f as prepareStatefulHmrSnapshot, g as StatefulHmrSnapshotHandoff, h as prepareStatefulClassicHandoff, k as getHmrRuntimeCapabilityFallback, m as captureWatchDependencies, p as checkAppWorkersOptions, u as CompilerSession, v as offerStatefulHmrSnapshot, x as settlePackageBuilds, y as getPackNpmRelationList, z as findSkylineRendererFiles } from "./createCompilerContextInstance-
|
|
2
|
-
import { t as resolveRealpath } from "./realpathScope-
|
|
3
|
-
import { F as
|
|
4
|
-
import { g as pruneOwnedAssetFiles } from "./utils-
|
|
5
|
-
import { n as loadHostRolldownBuild } from "./engine-
|
|
1
|
+
import { B as resolveHmrRuntimeDecision, D as getStatefulHmrHost, E as createStatefulHmrHostPlugins, F as prepareClassicIdeConfig, I as attachHmrRuntimeSession, L as createHmrRuntimeSession, N as syncManagedTsconfigFiles, O as createSharedBuildConfig, P as getInitialBuildInputObservation, S as createOxcRuntimeSupport, T as attachStatefulHmrHost, _ as clearStatefulHmrSnapshot, b as createPackageBuilder, d as buildStatefulHmrSnapshot, f as prepareStatefulHmrSnapshot, g as StatefulHmrSnapshotHandoff, h as prepareStatefulClassicHandoff, k as getHmrRuntimeCapabilityFallback, m as captureWatchDependencies, p as checkAppWorkersOptions, u as CompilerSession, v as offerStatefulHmrSnapshot, x as settlePackageBuilds, y as getPackNpmRelationList, z as findSkylineRendererFiles } from "./createCompilerContextInstance-BXSdH2E8.mjs";
|
|
2
|
+
import { t as resolveRealpath } from "./realpathScope-DwlLaCk3.mjs";
|
|
3
|
+
import { F as resolveNpmBuildCandidateDependenciesSync, L as resolveNpmDistDirName, P as resolveMainBuildDependencyPatterns, f as attachDevModuleGraphHost, z as resolveTargetDependencies } from "./devProvider-Bcvz5nu4.mjs";
|
|
4
|
+
import { g as pruneOwnedAssetFiles } from "./utils-CTGSZp4j.mjs";
|
|
5
|
+
import { n as loadHostRolldownBuild } from "./engine-Mnnm_ALP.mjs";
|
|
6
6
|
import path from "pathe";
|
|
7
7
|
import { mkdtemp, readFile, readdir, rm } from "node:fs/promises";
|
|
8
8
|
import { build } from "vite";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
import os from "node:os";
|
|
11
11
|
import { Buffer } from "node:buffer";
|
|
12
|
-
|
|
12
|
+
// src/vite/npm/sourcemap.ts
|
|
13
13
|
const URL_SCHEME = /^[a-z][a-z\d+.-]*:/i;
|
|
14
14
|
const INLINE_MAP = /(\/\/[#@]\s*sourceMappingURL=data:application\/json(?:;charset=[^;,]*)?;base64,)([a-z\d+/=]+)/gi;
|
|
15
15
|
/** npm 镜像目录深度可能不同,重定位相对源码路径但保持 URL 与绝对来源不变。 */
|
|
@@ -40,8 +40,7 @@ function relocateNpmSourcemap(source, from, to) {
|
|
|
40
40
|
sources
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
//#region src/vite/npm/output.ts
|
|
43
|
+
// src/vite/npm/output.ts
|
|
45
44
|
function relativeOutput(root, target) {
|
|
46
45
|
const relative = path.relative(root, target);
|
|
47
46
|
return relative !== ".." && !relative.startsWith("../") && !path.isAbsolute(relative) ? relative : void 0;
|
|
@@ -155,8 +154,7 @@ function createNpmOutput(temporaryRoot, targetRoots) {
|
|
|
155
154
|
}
|
|
156
155
|
};
|
|
157
156
|
}
|
|
158
|
-
|
|
159
|
-
//#region src/vite/npm/index.ts
|
|
157
|
+
// src/vite/npm/index.ts
|
|
160
158
|
/** 复用依赖编译器和 npm 关联配置,最终输出统一交给宿主 emit/write。 */
|
|
161
159
|
async function prepareNpmAssets(ctx) {
|
|
162
160
|
const config = ctx.configService;
|
|
@@ -209,8 +207,7 @@ async function prepareNpmAssets(ctx) {
|
|
|
209
207
|
});
|
|
210
208
|
}
|
|
211
209
|
}
|
|
212
|
-
|
|
213
|
-
//#region src/vite/npm/publish.ts
|
|
210
|
+
// src/vite/npm/publish.ts
|
|
214
211
|
/** 手工映射到主目录外的依赖仍由宿主配套引擎写出,只清理上轮实际拥有的文件。 */
|
|
215
212
|
async function publishNpmAssets(outDir, assets, obsolete) {
|
|
216
213
|
const virtualEntry = "\0weapp-vite-npm-output";
|
|
@@ -243,8 +240,7 @@ async function publishNpmAssets(outDir, assets, obsolete) {
|
|
|
243
240
|
await bundle.close();
|
|
244
241
|
}
|
|
245
242
|
}
|
|
246
|
-
|
|
247
|
-
//#region src/vite/npm/ownership.ts
|
|
243
|
+
// src/vite/npm/ownership.ts
|
|
248
244
|
async function readOwnership(fileName) {
|
|
249
245
|
let value;
|
|
250
246
|
try {
|
|
@@ -276,8 +272,7 @@ async function publishOwnedNpmAssets(cwd, hostOutDir, external) {
|
|
|
276
272
|
source: JSON.stringify([...current])
|
|
277
273
|
}], []);
|
|
278
274
|
}
|
|
279
|
-
|
|
280
|
-
//#region src/vite/session.ts
|
|
275
|
+
// src/vite/session.ts
|
|
281
276
|
const runtimeOwners = /* @__PURE__ */ new WeakMap();
|
|
282
277
|
/** 标准插件的目标校验和依赖准备,共享底层编译会话生命周期。 */
|
|
283
278
|
var WeappBuildSession = class extends CompilerSession {
|
|
@@ -367,11 +362,15 @@ var WeappBuildSession = class extends CompilerSession {
|
|
|
367
362
|
/** 只释放仍未被替换宿主接管的 owner,初始化失败和遗弃交接使用同一关闭门禁。 */
|
|
368
363
|
async releaseClassicIdeConfig() {
|
|
369
364
|
await super.close();
|
|
370
|
-
if (runtimeOwners.get(this.hmrRuntimeSession) === this)
|
|
365
|
+
if (runtimeOwners.get(this.hmrRuntimeSession) === this) {
|
|
366
|
+
this.hmrRuntimeSession.sourcePublication.close();
|
|
367
|
+
await this.hmrRuntimeSession.classicIdeConfig.close();
|
|
368
|
+
}
|
|
371
369
|
}
|
|
372
370
|
/** 原生宿主链已完全退出后,连同尚未绑定宿主的失败替换代一起释放。 */
|
|
373
371
|
async releaseHostClassicIdeConfig() {
|
|
374
372
|
await runtimeOwners.get(this.hmrRuntimeSession)?.closeHostGeneration("close");
|
|
373
|
+
this.hmrRuntimeSession.sourcePublication.close();
|
|
375
374
|
await this.hmrRuntimeSession.classicIdeConfig.close();
|
|
376
375
|
}
|
|
377
376
|
validateEntries() {
|
|
@@ -448,5 +447,4 @@ var WeappBuildSession = class extends CompilerSession {
|
|
|
448
447
|
await this.run(() => publishOwnedNpmAssets(cwd, outDir, external));
|
|
449
448
|
}
|
|
450
449
|
};
|
|
451
|
-
//#endregion
|
|
452
450
|
export { WeappBuildSession };
|