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.
Files changed (55) hide show
  1. package/dist/auto-import-components/resolvers.d.mts +2 -0
  2. package/dist/auto-import-components/resolvers.mjs +309 -350
  3. package/dist/auto-routes.d.mts +17 -0
  4. package/dist/auto-routes.mjs +48 -78
  5. package/dist/cli.d.mts +1 -0
  6. package/dist/cli.mjs +2171 -2398
  7. package/dist/config-IEj3IfSy.d.mts +3128 -0
  8. package/dist/config.d.mts +2 -0
  9. package/dist/config.mjs +8 -31
  10. package/dist/createContext-CDgRHY26.mjs +19 -0
  11. package/dist/file-UprqcX9e.mjs +356 -0
  12. package/dist/getInstance-jl4yXdc0.mjs +31841 -0
  13. package/dist/index-B5wBsuYI.d.mts +56 -0
  14. package/dist/index.d.mts +13 -0
  15. package/dist/index.mjs +9 -51
  16. package/dist/json.d.mts +2 -0
  17. package/dist/json.mjs +32 -14
  18. package/dist/logger-gutcwWKE.mjs +2 -0
  19. package/dist/mcp-pzGAH7ob.mjs +6415 -0
  20. package/dist/mcp.d.mts +30 -0
  21. package/dist/mcp.mjs +3 -18
  22. package/dist/pluginHost-SJdl15d3.mjs +24 -0
  23. package/dist/routes-o20IHwXa.d.mts +13 -0
  24. package/dist/{runtime.d.ts → runtime.d.mts} +12 -11
  25. package/dist/runtime.mjs +32 -11
  26. package/dist/types.d.mts +4 -0
  27. package/dist/types.mjs +1 -37
  28. package/dist/volar.d.mts +2 -0
  29. package/dist/volar.mjs +3 -9
  30. package/package.json +26 -31
  31. package/dist/auto-import-components/resolvers.d.ts +0 -10
  32. package/dist/auto-routes.d.ts +0 -16
  33. package/dist/chunk-3BOPS2AF.mjs +0 -34
  34. package/dist/chunk-6N2JYDJN.mjs +0 -13
  35. package/dist/chunk-BKU4KQJE.mjs +0 -430
  36. package/dist/chunk-EZOXN44U.mjs +0 -48
  37. package/dist/chunk-FXWNWYDN.mjs +0 -6
  38. package/dist/chunk-GJOF3MJY.mjs +0 -39428
  39. package/dist/chunk-JFV2DERD.mjs +0 -30
  40. package/dist/chunk-LDBSARE6.mjs +0 -9911
  41. package/dist/chunk-MIQZQK74.mjs +0 -14
  42. package/dist/chunk-OU5WM7WT.mjs +0 -41
  43. package/dist/chunk-X4YQFGKK.mjs +0 -29
  44. package/dist/cli.d.ts +0 -2
  45. package/dist/config-D8v221vL.d.ts +0 -1051
  46. package/dist/config.d.ts +0 -18
  47. package/dist/file-W4JJII65.mjs +0 -29
  48. package/dist/getInstance-W65F2IS7.mjs +0 -18
  49. package/dist/index.d.ts +0 -29
  50. package/dist/json.d.ts +0 -18
  51. package/dist/mcp.d.ts +0 -47
  52. package/dist/routes-74eLuiqj.d.ts +0 -12
  53. package/dist/types-B6irZnLM.d.ts +0 -46
  54. package/dist/types.d.ts +0 -29
  55. 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 };
@@ -1,87 +1,57 @@
1
- import {
2
- getCompilerContext
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
- 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
- return {
25
- configurable: false,
26
- enumerable: true,
27
- get: resolver
28
- };
6
+ return {
7
+ configurable: false,
8
+ enumerable: true,
9
+ get: resolver
10
+ };
29
11
  }
30
- var ctx = getCompilerContext();
31
- var service = ctx.autoRoutesService;
32
- var routes = {};
12
+ const service = getCompilerContext().autoRoutesService;
13
+ const routes = {};
33
14
  Object.defineProperties(routes, {
34
- pages: createGetter(() => {
35
- return service?.getReference().pages ?? [];
36
- }),
37
- entries: createGetter(() => {
38
- return service?.getReference().entries ?? [];
39
- }),
40
- subPackages: createGetter(() => {
41
- return service?.getReference().subPackages ?? [];
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
- var pages = routes.pages;
45
- var entries = routes.entries;
46
- var subPackages = routes.subPackages;
25
+ const pages = routes.pages;
26
+ const entries = routes.entries;
27
+ const subPackages = routes.subPackages;
47
28
  function resolveMiniProgramGlobal() {
48
- const runtime = globalThis;
49
- return runtime.wx ?? runtime.tt ?? runtime.my;
29
+ const runtime = globalThis;
30
+ return runtime.wx ?? runtime.tt ?? runtime.my;
50
31
  }
51
32
  function callRouteMethod(methodName, option) {
52
- const miniProgramGlobal = resolveMiniProgramGlobal();
53
- const routeMethod = miniProgramGlobal?.[methodName];
54
- if (typeof routeMethod !== "function") {
55
- throw new TypeError(`[weapp-vite] \u5F53\u524D\u8FD0\u884C\u73AF\u5883\u4E0D\u652F\u6301\u8DEF\u7531\u65B9\u6CD5: ${methodName}`);
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
- var wxRouter = {
63
- switchTab(option) {
64
- return callRouteMethod("switchTab", option);
65
- },
66
- reLaunch(option) {
67
- return callRouteMethod("reLaunch", option);
68
- },
69
- redirectTo(option) {
70
- return callRouteMethod("redirectTo", option);
71
- },
72
- navigateTo(option) {
73
- return callRouteMethod("navigateTo", option);
74
- },
75
- navigateBack(option) {
76
- return callRouteMethod("navigateBack", option);
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 { };