weapp-vite 6.8.0 → 6.9.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.d.mts +2 -0
- package/dist/auto-import-components/resolvers.mjs +309 -350
- package/dist/auto-routes.d.mts +17 -0
- package/dist/auto-routes.mjs +48 -78
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +2171 -2398
- package/dist/config-IEj3IfSy.d.mts +3128 -0
- package/dist/config.d.mts +2 -0
- package/dist/config.mjs +8 -31
- package/dist/createContext-CDgRHY26.mjs +19 -0
- package/dist/file-UprqcX9e.mjs +356 -0
- package/dist/getInstance-jl4yXdc0.mjs +31841 -0
- package/dist/index-B5wBsuYI.d.mts +56 -0
- package/dist/index.d.mts +13 -0
- package/dist/index.mjs +9 -51
- package/dist/json.d.mts +2 -0
- package/dist/json.mjs +32 -14
- package/dist/logger-gutcwWKE.mjs +2 -0
- package/dist/mcp-pzGAH7ob.mjs +6415 -0
- package/dist/mcp.d.mts +30 -0
- package/dist/mcp.mjs +3 -18
- package/dist/pluginHost-SJdl15d3.mjs +24 -0
- package/dist/routes-o20IHwXa.d.mts +13 -0
- package/dist/{runtime.d.ts → runtime.d.mts} +12 -11
- package/dist/runtime.mjs +32 -11
- package/dist/types.d.mts +4 -0
- package/dist/types.mjs +1 -37
- package/dist/volar.d.mts +2 -0
- package/dist/volar.mjs +3 -9
- package/package.json +26 -31
- package/dist/auto-import-components/resolvers.d.ts +0 -10
- package/dist/auto-routes.d.ts +0 -16
- package/dist/chunk-3BOPS2AF.mjs +0 -34
- package/dist/chunk-6N2JYDJN.mjs +0 -13
- package/dist/chunk-BKU4KQJE.mjs +0 -430
- package/dist/chunk-EZOXN44U.mjs +0 -48
- package/dist/chunk-FXWNWYDN.mjs +0 -6
- package/dist/chunk-GJOF3MJY.mjs +0 -39428
- package/dist/chunk-JFV2DERD.mjs +0 -30
- package/dist/chunk-LDBSARE6.mjs +0 -9911
- package/dist/chunk-MIQZQK74.mjs +0 -14
- package/dist/chunk-OU5WM7WT.mjs +0 -41
- package/dist/chunk-X4YQFGKK.mjs +0 -29
- package/dist/cli.d.ts +0 -2
- package/dist/config-D8v221vL.d.ts +0 -1051
- package/dist/config.d.ts +0 -18
- package/dist/file-W4JJII65.mjs +0 -29
- package/dist/getInstance-W65F2IS7.mjs +0 -18
- package/dist/index.d.ts +0 -29
- package/dist/json.d.ts +0 -18
- package/dist/mcp.d.ts +0 -47
- package/dist/routes-74eLuiqj.d.ts +0 -12
- package/dist/types-B6irZnLM.d.ts +0 -46
- package/dist/types.d.ts +0 -29
- package/dist/volar.d.ts +0 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { n as AutoRoutesSubPackage, t as AutoRoutes } from "./routes-o20IHwXa.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/auto-routes.d.ts
|
|
4
|
+
declare const routes: AutoRoutes;
|
|
5
|
+
declare const pages: string[];
|
|
6
|
+
declare const entries: string[];
|
|
7
|
+
declare const subPackages: AutoRoutesSubPackage[];
|
|
8
|
+
interface AutoRoutesWxRouter {
|
|
9
|
+
switchTab: (option: Record<string, any>) => unknown;
|
|
10
|
+
reLaunch: (option: Record<string, any>) => unknown;
|
|
11
|
+
redirectTo: (option: Record<string, any>) => unknown;
|
|
12
|
+
navigateTo: (option: Record<string, any>) => unknown;
|
|
13
|
+
navigateBack: (option?: Record<string, any>) => unknown;
|
|
14
|
+
}
|
|
15
|
+
declare const wxRouter: AutoRoutesWxRouter;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { type AutoRoutes, type AutoRoutesSubPackage, AutoRoutesWxRouter, routes as default, routes, entries, pages, subPackages, wxRouter };
|
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,87 +1,57 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "./chunk-6N2JYDJN.mjs";
|
|
6
|
-
import "./chunk-OU5WM7WT.mjs";
|
|
7
|
-
import "./chunk-X4YQFGKK.mjs";
|
|
8
|
-
import "./chunk-MIQZQK74.mjs";
|
|
9
|
-
import {
|
|
10
|
-
init_esm_shims
|
|
11
|
-
} from "./chunk-EZOXN44U.mjs";
|
|
12
|
-
|
|
13
|
-
// src/auto-routes.ts
|
|
14
|
-
init_esm_shims();
|
|
15
|
-
|
|
16
|
-
// src/context/index.ts
|
|
17
|
-
init_esm_shims();
|
|
18
|
-
|
|
19
|
-
// src/context/CompilerContext.ts
|
|
20
|
-
init_esm_shims();
|
|
21
|
-
|
|
22
|
-
// src/auto-routes.ts
|
|
1
|
+
import "./file-UprqcX9e.mjs";
|
|
2
|
+
import { t as getCompilerContext } from "./getInstance-jl4yXdc0.mjs";
|
|
3
|
+
import "./logger-gutcwWKE.mjs";
|
|
4
|
+
//#region src/auto-routes.ts
|
|
23
5
|
function createGetter(resolver) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
6
|
+
return {
|
|
7
|
+
configurable: false,
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: resolver
|
|
10
|
+
};
|
|
29
11
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var routes = {};
|
|
12
|
+
const service = getCompilerContext().autoRoutesService;
|
|
13
|
+
const routes = {};
|
|
33
14
|
Object.defineProperties(routes, {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
15
|
+
pages: createGetter(() => {
|
|
16
|
+
return service?.getReference().pages ?? [];
|
|
17
|
+
}),
|
|
18
|
+
entries: createGetter(() => {
|
|
19
|
+
return service?.getReference().entries ?? [];
|
|
20
|
+
}),
|
|
21
|
+
subPackages: createGetter(() => {
|
|
22
|
+
return service?.getReference().subPackages ?? [];
|
|
23
|
+
})
|
|
43
24
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
const pages = routes.pages;
|
|
26
|
+
const entries = routes.entries;
|
|
27
|
+
const subPackages = routes.subPackages;
|
|
47
28
|
function resolveMiniProgramGlobal() {
|
|
48
|
-
|
|
49
|
-
|
|
29
|
+
const runtime = globalThis;
|
|
30
|
+
return runtime.wx ?? runtime.tt ?? runtime.my;
|
|
50
31
|
}
|
|
51
32
|
function callRouteMethod(methodName, option) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (option === void 0) {
|
|
58
|
-
return routeMethod.call(miniProgramGlobal);
|
|
59
|
-
}
|
|
60
|
-
return routeMethod.call(miniProgramGlobal, option);
|
|
33
|
+
const miniProgramGlobal = resolveMiniProgramGlobal();
|
|
34
|
+
const routeMethod = miniProgramGlobal?.[methodName];
|
|
35
|
+
if (typeof routeMethod !== "function") throw new TypeError(`[weapp-vite] 当前运行环境不支持路由方法: ${methodName}`);
|
|
36
|
+
if (option === void 0) return routeMethod.call(miniProgramGlobal);
|
|
37
|
+
return routeMethod.call(miniProgramGlobal, option);
|
|
61
38
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
var auto_routes_default = routes;
|
|
80
|
-
export {
|
|
81
|
-
auto_routes_default as default,
|
|
82
|
-
entries,
|
|
83
|
-
pages,
|
|
84
|
-
routes,
|
|
85
|
-
subPackages,
|
|
86
|
-
wxRouter
|
|
39
|
+
const wxRouter = {
|
|
40
|
+
switchTab(option) {
|
|
41
|
+
return callRouteMethod("switchTab", option);
|
|
42
|
+
},
|
|
43
|
+
reLaunch(option) {
|
|
44
|
+
return callRouteMethod("reLaunch", option);
|
|
45
|
+
},
|
|
46
|
+
redirectTo(option) {
|
|
47
|
+
return callRouteMethod("redirectTo", option);
|
|
48
|
+
},
|
|
49
|
+
navigateTo(option) {
|
|
50
|
+
return callRouteMethod("navigateTo", option);
|
|
51
|
+
},
|
|
52
|
+
navigateBack(option) {
|
|
53
|
+
return callRouteMethod("navigateBack", option);
|
|
54
|
+
}
|
|
87
55
|
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { routes as default, routes, entries, pages, subPackages, wxRouter };
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|