weapp-vite 6.7.6 → 6.8.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/dist/auto-import-components/resolvers.mjs +1 -1
- package/dist/auto-routes.mjs +7 -7
- package/dist/{chunk-W3UG2WZQ.mjs → chunk-3BOPS2AF.mjs} +1 -1
- package/dist/{chunk-XQYQD5CM.mjs → chunk-6N2JYDJN.mjs} +1 -1
- package/dist/{chunk-6AH5XOPG.mjs → chunk-BKU4KQJE.mjs} +18 -14
- package/dist/{chunk-QD76G22N.mjs → chunk-EZOXN44U.mjs} +2 -2
- package/dist/{chunk-O2IN5LBB.mjs → chunk-FXWNWYDN.mjs} +1 -1
- package/dist/{chunk-ZHLTHMZA.mjs → chunk-GJOF3MJY.mjs} +1305 -938
- package/dist/{chunk-XSPLO6IT.mjs → chunk-JFV2DERD.mjs} +3 -6
- package/dist/{chunk-6YAZCQOZ.mjs → chunk-LDBSARE6.mjs} +2 -2
- package/dist/{chunk-XIEFUUA5.mjs → chunk-MIQZQK74.mjs} +1 -1
- package/dist/{chunk-BGBLJUWD.mjs → chunk-OU5WM7WT.mjs} +1 -1
- package/dist/{chunk-KV5GZOAZ.mjs → chunk-X4YQFGKK.mjs} +1 -1
- package/dist/cli.mjs +92 -8
- package/dist/{config-BngmcXkt.d.ts → config-D8v221vL.d.ts} +244 -671
- package/dist/config.d.ts +5 -5
- package/dist/config.mjs +4 -4
- package/dist/{file-OMYHHYLC.mjs → file-W4JJII65.mjs} +2 -2
- package/dist/{getInstance-W5DSUGSZ.mjs → getInstance-W65F2IS7.mjs} +5 -5
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +10 -10
- package/dist/json.d.ts +5 -5
- package/dist/json.mjs +2 -2
- package/dist/mcp.d.ts +5 -5
- package/dist/mcp.mjs +3 -3
- package/dist/runtime.mjs +2 -2
- package/dist/types.d.ts +4 -4
- package/dist/types.mjs +14 -2
- package/dist/volar.mjs +1 -1
- package/package.json +12 -12
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-GJOF3MJY.mjs";
|
|
4
|
+
import "./chunk-BKU4KQJE.mjs";
|
|
5
|
+
import "./chunk-6N2JYDJN.mjs";
|
|
6
|
+
import "./chunk-OU5WM7WT.mjs";
|
|
7
|
+
import "./chunk-X4YQFGKK.mjs";
|
|
8
|
+
import "./chunk-MIQZQK74.mjs";
|
|
9
9
|
import {
|
|
10
10
|
init_esm_shims
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EZOXN44U.mjs";
|
|
12
12
|
|
|
13
13
|
// src/auto-routes.ts
|
|
14
14
|
init_esm_shims();
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
__commonJS,
|
|
3
3
|
__toESM,
|
|
4
4
|
init_esm_shims
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EZOXN44U.mjs";
|
|
6
6
|
|
|
7
7
|
// ../../node_modules/.pnpm/merge@2.1.1/node_modules/merge/lib/src/index.js
|
|
8
8
|
var require_src = __commonJS({
|
|
@@ -118,10 +118,12 @@ var pathExistsInFlight = /* @__PURE__ */ new Map();
|
|
|
118
118
|
var vueConfigCache = /* @__PURE__ */ new Map();
|
|
119
119
|
var configMtimeInFlight = /* @__PURE__ */ new Map();
|
|
120
120
|
var NODE_MODULES_RE = /[\\/]node_modules[\\/]/;
|
|
121
|
+
var JS_OR_TS_RE = /\.[jt]s$/;
|
|
121
122
|
var nodeRequire = createRequire(import.meta.url);
|
|
122
123
|
var AUTO_ROUTES_SPECIFIER_RE = /(['"])(?:weapp-vite\/auto-routes|virtual:weapp-vite-auto-routes)\1/g;
|
|
123
124
|
var AUTO_ROUTES_DEFAULT_IMPORT_RE = /import\s+([A-Za-z_$][\w$]*)\s+from\s+['"](?:weapp-vite\/auto-routes|virtual:weapp-vite-auto-routes)['"];?/g;
|
|
124
125
|
var AUTO_ROUTES_DYNAMIC_IMPORT_RE = /import\(\s*['"](?:weapp-vite\/auto-routes|virtual:weapp-vite-auto-routes)['"]\s*\)/g;
|
|
126
|
+
var JSON_MACRO_HINT_RE = /\bdefine(?:App|Page|Component|Sitemap|Theme)Json\s*\(/;
|
|
125
127
|
function resolveAutoRoutesMacroImportPath() {
|
|
126
128
|
const fallbackCandidates = [
|
|
127
129
|
path.resolve(import.meta.dirname, "auto-routes.mjs"),
|
|
@@ -145,14 +147,18 @@ function resolveAutoRoutesMacroImportPath() {
|
|
|
145
147
|
}
|
|
146
148
|
async function resolveAutoRoutesInlineSnapshot() {
|
|
147
149
|
try {
|
|
148
|
-
const { getCompilerContext } = await import("./getInstance-
|
|
149
|
-
const
|
|
150
|
-
|
|
150
|
+
const { getCompilerContext } = await import("./getInstance-W65F2IS7.mjs");
|
|
151
|
+
const compilerContext = getCompilerContext();
|
|
152
|
+
const service = compilerContext.autoRoutesService;
|
|
151
153
|
const reference = service?.getReference?.();
|
|
154
|
+
if (!compilerContext.runtimeState.autoRoutes.loadingAppConfig) {
|
|
155
|
+
await service?.ensureFresh?.();
|
|
156
|
+
}
|
|
157
|
+
const nextReference = service?.getReference?.() ?? reference;
|
|
152
158
|
return {
|
|
153
|
-
pages:
|
|
154
|
-
entries:
|
|
155
|
-
subPackages:
|
|
159
|
+
pages: nextReference?.pages ?? [],
|
|
160
|
+
entries: nextReference?.entries ?? [],
|
|
161
|
+
subPackages: nextReference?.subPackages ?? []
|
|
156
162
|
};
|
|
157
163
|
} catch {
|
|
158
164
|
return {
|
|
@@ -206,7 +212,7 @@ async function isVueConfigCacheValid(vueFilePath, cache) {
|
|
|
206
212
|
}
|
|
207
213
|
function isJsOrTs(name) {
|
|
208
214
|
if (typeof name === "string") {
|
|
209
|
-
return
|
|
215
|
+
return JS_OR_TS_RE.test(name);
|
|
210
216
|
}
|
|
211
217
|
return false;
|
|
212
218
|
}
|
|
@@ -347,7 +353,7 @@ async function extractConfigFromVue(vueFilePath) {
|
|
|
347
353
|
}
|
|
348
354
|
}
|
|
349
355
|
const setupContent = descriptor.scriptSetup?.content;
|
|
350
|
-
const hasMacroHint = typeof setupContent === "string" &&
|
|
356
|
+
const hasMacroHint = typeof setupContent === "string" && JSON_MACRO_HINT_RE.test(setupContent);
|
|
351
357
|
if (hasMacroHint) {
|
|
352
358
|
const { extractJsonMacroFromScriptSetup } = await import("wevu/compiler");
|
|
353
359
|
try {
|
|
@@ -373,11 +379,9 @@ async function extractConfigFromVue(vueFilePath) {
|
|
|
373
379
|
}
|
|
374
380
|
}
|
|
375
381
|
}
|
|
376
|
-
const normalizedDependencies =
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
)
|
|
380
|
-
);
|
|
382
|
+
const normalizedDependencies = [...new Set(
|
|
383
|
+
macroDependencies.filter((dep) => dep && !NODE_MODULES_RE.test(dep)).map((dep) => path.normalize(dep))
|
|
384
|
+
)];
|
|
381
385
|
const dependencyMtimeMs = /* @__PURE__ */ new Map();
|
|
382
386
|
await Promise.all(
|
|
383
387
|
normalizedDependencies.map(async (dep) => {
|
|
@@ -31,11 +31,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
mod
|
|
32
32
|
));
|
|
33
33
|
|
|
34
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.7_@types+node@25.
|
|
34
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.7_@types+node@25.5.0__@swc+core@1.15.18_jiti@2_141d6d50a92397c7075c9a8e05e4d761/node_modules/tsup/assets/esm_shims.js
|
|
35
35
|
import path from "path";
|
|
36
36
|
import { fileURLToPath } from "url";
|
|
37
37
|
var init_esm_shims = __esm({
|
|
38
|
-
"../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.7_@types+node@25.
|
|
38
|
+
"../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.7_@types+node@25.5.0__@swc+core@1.15.18_jiti@2_141d6d50a92397c7075c9a8e05e4d761/node_modules/tsup/assets/esm_shims.js"() {
|
|
39
39
|
"use strict";
|
|
40
40
|
}
|
|
41
41
|
});
|