weapp-vite 7.1.4 → 7.2.1

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.
@@ -6,7 +6,7 @@ import { WeappAstConfig } from "@weapp-vite/ast";
6
6
  import "@weapp-vite/ast/operations/onPageScroll";
7
7
  import { LoggerConfig } from "@weapp-core/logger";
8
8
  import "@weapp-vite/ast/babel";
9
- import { ComponentStyleOptions, VueSfcBlockSignatures } from "wevu/compiler";
9
+ import { ComponentStyleOptions, ResolveSfcBlockSrcOptions, StaticRouteValue, VueSfcBlockSignatures } from "wevu/compiler";
10
10
  import { ConfigEnv, ConfigEnv as ConfigEnv$1, InlineConfig, InlineConfig as InlineConfig$1, Plugin as Plugin$1, PluginOption, ResolvedConfig, UserConfig, ViteDevServer, ViteDevServer as ViteDevServer$1, build } from "vite";
11
11
  import { LRUCache } from "lru-cache";
12
12
  import { fdir } from "fdir";
@@ -1661,6 +1661,13 @@ interface LocalAutoImportMatch {
1661
1661
  value: ResolvedValue;
1662
1662
  }
1663
1663
  //#endregion
1664
+ //#region src/runtime/autoRoutesPlugin/types.d.ts
1665
+ interface NamedAutoRoute {
1666
+ name: string;
1667
+ path: string;
1668
+ meta: Record<string, StaticRouteValue>;
1669
+ }
1670
+ //#endregion
1664
1671
  //#region src/runtime/watcher/types.d.ts
1665
1672
  interface WatcherInstance {
1666
1673
  close: () => void | Promise<void>;
@@ -1696,9 +1703,18 @@ interface RuntimeState {
1696
1703
  };
1697
1704
  autoRoutes: {
1698
1705
  routes: AutoRoutes;
1706
+ namedRoutes: NamedAutoRoute[];
1699
1707
  serialized: string;
1700
1708
  moduleCode: string;
1709
+ namedModuleCode: string;
1710
+ signature: string;
1711
+ topologyKey: string;
1701
1712
  typedDefinition: string;
1713
+ pageDeclarationDependencies: Map<string, Set<string>>;
1714
+ pageDeclarationFingerprints: Map<string, string>;
1715
+ usesOpaquePageDeclarationResolver: boolean;
1716
+ pageSourceFiles: Set<string>;
1717
+ namedRouteSourceFiles: Set<string>;
1702
1718
  watchFiles: Set<string>;
1703
1719
  watchDirs: Set<string>;
1704
1720
  dirty: boolean;
@@ -1749,6 +1765,7 @@ interface RuntimeState {
1749
1765
  lastHmrEntryIds: Set<string>;
1750
1766
  lastEmittedEntryIds: Set<string>;
1751
1767
  lastEmittedChunkFileNames: Set<string>;
1768
+ forceEmitUnchangedChunks: boolean;
1752
1769
  sharedChunkSourceModuleIds: Set<string>;
1753
1770
  recentProfiles: Array<{
1754
1771
  timestamp?: string;
@@ -2029,10 +2046,16 @@ interface AutoImportService {
2029
2046
  awaitManifestWrites: () => Promise<void>;
2030
2047
  }
2031
2048
  //#endregion
2049
+ //#region src/runtime/autoRoutesPlugin/routes/scan.d.ts
2050
+ interface ScanRoutesOptions {
2051
+ resolvePageDeclarationSource?: ResolveSfcBlockSrcOptions['resolveId'];
2052
+ }
2053
+ //#endregion
2032
2054
  //#region src/runtime/autoRoutesPlugin/watch.d.ts
2033
2055
  type AutoRoutesFileEvent = ChangeEvent | 'rename';
2034
2056
  //#endregion
2035
2057
  //#region src/runtime/autoRoutesPlugin/service.d.ts
2058
+ type PageDeclarationSourceResolver = NonNullable<ScanRoutesOptions['resolvePageDeclarationSource']>;
2036
2059
  interface AutoRoutesService {
2037
2060
  ensureFresh: () => Promise<void>;
2038
2061
  markDirty: () => void;
@@ -2040,9 +2063,17 @@ interface AutoRoutesService {
2040
2063
  getReference: () => AutoRoutes;
2041
2064
  getSignature: () => string;
2042
2065
  getModuleCode: () => string;
2066
+ getNamedModuleCode: () => string;
2043
2067
  getWatchFiles: () => Iterable<string>;
2044
2068
  getWatchDirectories: () => Iterable<string>;
2069
+ /** 返回声明源对应的全部逻辑页面源文件。 */
2070
+ getPageDeclarationOwners: (filePath: string) => Iterable<string>;
2045
2071
  isRouteFile: (filePath: string) => boolean;
2072
+ isPageSource: (filePath: string) => boolean;
2073
+ /** 判断文件是否属于逻辑页面声明或其外部脚本依赖。 */
2074
+ isPageDeclarationSource: (filePath: string) => boolean;
2075
+ /** 注册当前构建上下文已有的模块解析器。 */
2076
+ setPageDeclarationSourceResolver: (resolve?: PageDeclarationSourceResolver) => void;
2046
2077
  handleFileChange: (filePath: string, event?: AutoRoutesFileEvent) => Promise<boolean>;
2047
2078
  isInitialized: () => boolean;
2048
2079
  isEnabled: () => boolean;
package/dist/config.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { $n as applyWeappViteHostMeta, Qn as WeappViteHostMeta, Zn as WEAPP_VITE_HOST_NAME, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, er as createWeappViteHostMeta, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, nr as resolveWeappViteHostMeta, o as UserConfigFnObject, ot as WeappViteConfig, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, sr as WeappViteRuntime, t as UserConfig, tr as isWeappViteHost, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-CDlfnbbb.mjs";
1
+ import { $n as applyWeappViteHostMeta, Qn as WeappViteHostMeta, Zn as WEAPP_VITE_HOST_NAME, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, er as createWeappViteHostMeta, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, nr as resolveWeappViteHostMeta, o as UserConfigFnObject, ot as WeappViteConfig, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, sr as WeappViteRuntime, t as UserConfig, tr as isWeappViteHost, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-JdEU9lCP.mjs";
2
2
  import { t as WeappI18nConfig } from "./types-CgZn5X6j.mjs";
3
3
  export { type App, type Component, type Page, type Sitemap, type Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, WEAPP_VITE_HOST_NAME, type WeappI18nConfig, type WeappViteConfig, WeappViteHostMeta, type WeappViteRuntime, applyWeappViteHostMeta, createWeappViteHostMeta, defineAppJson, defineComponentJson, defineConfig, definePageJson, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta };