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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "../chunk-QBSVUTNO.mjs";
3
+ } from "../chunk-BQM4WPKJ.mjs";
4
4
 
5
5
  // src/auto-import-components/resolvers/index.ts
6
6
  init_esm_shims();
@@ -1,8 +1,16 @@
1
- import { A as AutoRoutes, a as AutoRoutesSubPackage } from './routes-C9hKJjXs.js';
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 };
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  getCompilerContext
3
- } from "./chunk-FVM35BZA.mjs";
4
- import "./chunk-W5TTICYZ.mjs";
5
- import "./chunk-O4WHKAL4.mjs";
6
- import "./chunk-IWKOTXCO.mjs";
7
- import "./chunk-3STNMT72.mjs";
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-QBSVUTNO.mjs";
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-QBSVUTNO.mjs";
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-FVRAZQTP.mjs");
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?.();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-QBSVUTNO.mjs";
3
+ } from "./chunk-BQM4WPKJ.mjs";
4
4
 
5
5
  // src/plugins/vue/runtime.ts
6
6
  init_esm_shims();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-QBSVUTNO.mjs";
3
+ } from "./chunk-BQM4WPKJ.mjs";
4
4
 
5
5
  // src/types/external.ts
6
6
  init_esm_shims();
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  default as default2
3
- } from "./chunk-3STNMT72.mjs";
3
+ } from "./chunk-VZEM2LX3.mjs";
4
4
  import {
5
5
  __export,
6
6
  init_esm_shims
7
- } from "./chunk-QBSVUTNO.mjs";
7
+ } from "./chunk-BQM4WPKJ.mjs";
8
8
 
9
9
  // src/mcp.ts
10
10
  init_esm_shims();
@@ -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.3__@swc+core@1.15.18_jiti@2_39d789450ee28bb5a56b1257ed860af4/node_modules/tsup/assets/esm_shims.js
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.3__@swc+core@1.15.18_jiti@2_39d789450ee28bb5a56b1257ed860af4/node_modules/tsup/assets/esm_shims.js"() {
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
  });