weapp-vite 6.7.2 → 6.7.4
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.d.ts +10 -2
- package/dist/auto-routes.mjs +40 -7
- package/dist/{chunk-W5TTICYZ.mjs → chunk-3ULSPLMB.mjs} +2 -2
- package/dist/{chunk-XEK4R57H.mjs → chunk-72Q2Z45L.mjs} +1 -1
- package/dist/{chunk-2Q4QRCG5.mjs → chunk-7ZOXQLE2.mjs} +1 -1
- package/dist/{chunk-LVU2OZUF.mjs → chunk-ASAY7IOT.mjs} +2 -2
- package/dist/{chunk-QBSVUTNO.mjs → chunk-BQM4WPKJ.mjs} +2 -2
- package/dist/{chunk-FVM35BZA.mjs → chunk-MKXI5POD.mjs} +767 -43
- package/dist/{chunk-O4WHKAL4.mjs → chunk-MXJF2FFF.mjs} +1 -1
- package/dist/{chunk-IWKOTXCO.mjs → chunk-SE5GHZVY.mjs} +1 -1
- package/dist/{chunk-3STNMT72.mjs → chunk-VZEM2LX3.mjs} +1 -1
- package/dist/{chunk-7JSOF7N2.mjs → chunk-ZVP3HDW7.mjs} +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/{config-D2DJI97q.d.ts → config-DMCmCacG.d.ts} +11 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/{file-X4XT4UCA.mjs → file-IRTTGBIN.mjs} +2 -2
- package/dist/{getInstance-FVRAZQTP.mjs → getInstance-NUZWXHEY.mjs} +4 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +9 -9
- package/dist/json.d.ts +2 -2
- package/dist/json.mjs +2 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.mjs +3 -3
- package/dist/{routes-C9hKJjXs.d.ts → routes-74eLuiqj.d.ts} +1 -0
- package/dist/runtime.mjs +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/types.mjs +2 -2
- package/dist/volar.mjs +1 -1
- package/package.json +7 -7
package/dist/auto-routes.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { A as AutoRoutes, a as AutoRoutesSubPackage } from './routes-
|
|
1
|
+
import { A as AutoRoutes, a as AutoRoutesSubPackage } from './routes-74eLuiqj.js';
|
|
2
2
|
|
|
3
3
|
declare const routes: AutoRoutes;
|
|
4
4
|
declare const pages: string[];
|
|
5
5
|
declare const entries: string[];
|
|
6
6
|
declare const subPackages: AutoRoutesSubPackage[];
|
|
7
|
+
interface AutoRoutesWxRouter {
|
|
8
|
+
switchTab: (option: Record<string, any>) => unknown;
|
|
9
|
+
reLaunch: (option: Record<string, any>) => unknown;
|
|
10
|
+
redirectTo: (option: Record<string, any>) => unknown;
|
|
11
|
+
navigateTo: (option: Record<string, any>) => unknown;
|
|
12
|
+
navigateBack: (option?: Record<string, any>) => unknown;
|
|
13
|
+
}
|
|
14
|
+
declare const wxRouter: AutoRoutesWxRouter;
|
|
7
15
|
|
|
8
|
-
export { AutoRoutes, AutoRoutesSubPackage, routes as default, entries, pages, routes, subPackages };
|
|
16
|
+
export { AutoRoutes, AutoRoutesSubPackage, type AutoRoutesWxRouter, routes as default, entries, pages, routes, subPackages, wxRouter };
|
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-MKXI5POD.mjs";
|
|
4
|
+
import "./chunk-3ULSPLMB.mjs";
|
|
5
|
+
import "./chunk-MXJF2FFF.mjs";
|
|
6
|
+
import "./chunk-SE5GHZVY.mjs";
|
|
7
|
+
import "./chunk-VZEM2LX3.mjs";
|
|
8
8
|
import {
|
|
9
9
|
init_esm_shims
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BQM4WPKJ.mjs";
|
|
11
11
|
|
|
12
12
|
// src/auto-routes.ts
|
|
13
13
|
init_esm_shims();
|
|
@@ -43,11 +43,44 @@ Object.defineProperties(routes, {
|
|
|
43
43
|
var pages = routes.pages;
|
|
44
44
|
var entries = routes.entries;
|
|
45
45
|
var subPackages = routes.subPackages;
|
|
46
|
+
function resolveMiniProgramGlobal() {
|
|
47
|
+
const runtime = globalThis;
|
|
48
|
+
return runtime.wx ?? runtime.tt ?? runtime.my;
|
|
49
|
+
}
|
|
50
|
+
function callRouteMethod(methodName, option) {
|
|
51
|
+
const miniProgramGlobal = resolveMiniProgramGlobal();
|
|
52
|
+
const routeMethod = miniProgramGlobal?.[methodName];
|
|
53
|
+
if (typeof routeMethod !== "function") {
|
|
54
|
+
throw new TypeError(`[weapp-vite] \u5F53\u524D\u8FD0\u884C\u73AF\u5883\u4E0D\u652F\u6301\u8DEF\u7531\u65B9\u6CD5: ${methodName}`);
|
|
55
|
+
}
|
|
56
|
+
if (option === void 0) {
|
|
57
|
+
return routeMethod.call(miniProgramGlobal);
|
|
58
|
+
}
|
|
59
|
+
return routeMethod.call(miniProgramGlobal, option);
|
|
60
|
+
}
|
|
61
|
+
var wxRouter = {
|
|
62
|
+
switchTab(option) {
|
|
63
|
+
return callRouteMethod("switchTab", option);
|
|
64
|
+
},
|
|
65
|
+
reLaunch(option) {
|
|
66
|
+
return callRouteMethod("reLaunch", option);
|
|
67
|
+
},
|
|
68
|
+
redirectTo(option) {
|
|
69
|
+
return callRouteMethod("redirectTo", option);
|
|
70
|
+
},
|
|
71
|
+
navigateTo(option) {
|
|
72
|
+
return callRouteMethod("navigateTo", option);
|
|
73
|
+
},
|
|
74
|
+
navigateBack(option) {
|
|
75
|
+
return callRouteMethod("navigateBack", option);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
46
78
|
var auto_routes_default = routes;
|
|
47
79
|
export {
|
|
48
80
|
auto_routes_default as default,
|
|
49
81
|
entries,
|
|
50
82
|
pages,
|
|
51
83
|
routes,
|
|
52
|
-
subPackages
|
|
84
|
+
subPackages,
|
|
85
|
+
wxRouter
|
|
53
86
|
};
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
__commonJS,
|
|
3
3
|
__toESM,
|
|
4
4
|
init_esm_shims
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BQM4WPKJ.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({
|
|
@@ -145,7 +145,7 @@ function resolveAutoRoutesMacroImportPath() {
|
|
|
145
145
|
}
|
|
146
146
|
async function resolveAutoRoutesInlineSnapshot() {
|
|
147
147
|
try {
|
|
148
|
-
const { getCompilerContext } = await import("./getInstance-
|
|
148
|
+
const { getCompilerContext } = await import("./getInstance-NUZWXHEY.mjs");
|
|
149
149
|
const service = getCompilerContext().autoRoutesService;
|
|
150
150
|
await service?.ensureFresh?.();
|
|
151
151
|
const reference = service?.getReference?.();
|
|
@@ -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.6_@types+node@25.3.
|
|
34
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.6_@types+node@25.3.5__@swc+core@1.15.18_jiti@2_8931105c484ecfdc14f3dbd84ea9b191/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.6_@types+node@25.3.
|
|
38
|
+
"../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.6_@types+node@25.3.5__@swc+core@1.15.18_jiti@2_8931105c484ecfdc14f3dbd84ea9b191/node_modules/tsup/assets/esm_shims.js"() {
|
|
39
39
|
"use strict";
|
|
40
40
|
}
|
|
41
41
|
});
|