@ubean/build 0.5.2 → 0.6.0-beta.2

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/vue.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as VirtualModule } from "./virtual-registry-BF0jYPle.js";
1
+ import { r as VirtualModuleRegistry, t as VirtualModule } from "./virtual-registry-CaU8k-YP.js";
2
2
  import { ResolvedConfig } from "@ubean/config";
3
3
  import { ScannedAppEntry, ScannedLayout, ScannedPageRoute, ScannedServerEntry } from "@ubean/scan";
4
4
  import { Plugin } from "vite";
@@ -6,6 +6,19 @@ import { Plugin } from "vite";
6
6
  interface UbeanViteOptions {
7
7
  config: ResolvedConfig;
8
8
  ssr?: boolean;
9
+ /** 虚拟模块注册表(RM-V02):与 `ubeanPlugin` 注入同一个实例,插件侧只读。 */
10
+ registry?: VirtualModuleRegistry;
11
+ /**
12
+ * 是否由本插件注册 `@vitejs/plugin-vue`(默认 **true**)。
13
+ *
14
+ * RM-V14:`ubeanPlugin()` 是用户 `vite.config.ts` 里的唯一入口,`vite dev` 要能独立
15
+ * 服务应用,.vue 就必须有人编译 —— 此前这一步由 CLI 的 dev server 代劳(`builtinPlugins`
16
+ * 里单独 `vue({ include: VUE_PLUGIN_INCLUDE })`),于是同一份 `ubeanPlugin()` 在
17
+ * `ubean dev` 下可用、在 `vite dev` 下直接报 “Install @vitejs/plugin-vue”。现在由本插件
18
+ * 拥有该注册,两条路径拿到的插件集合一致;CLI 不再重复添加(重复注册会让 .vue 被编译两次)。
19
+ * 需要自带 vue 插件配置(如自定义 `template.compilerOptions`)时传 `false`。
20
+ */
21
+ vue?: boolean;
9
22
  }
10
23
  export declare const VUE_PLUGIN_INCLUDE: RegExp[];
11
24
  export declare function ubeanVite(options: UbeanViteOptions): Plugin[];
package/dist/vue.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as createVueAppEntryVirtualModule, i as createServerEntryVirtualModule, n as ubeanVite, o as createVuePagesVirtualModule, r as createClientEntryVirtualModule, t as VUE_PLUGIN_INCLUDE } from "./vue-DcydGsvy.js";
1
+ import { a as createVueAppEntryVirtualModule, i as createServerEntryVirtualModule, n as ubeanVite, o as createVuePagesVirtualModule, r as createClientEntryVirtualModule, t as VUE_PLUGIN_INCLUDE } from "./vue-CKAJjBBR.js";
2
2
  export { VUE_PLUGIN_INCLUDE, createClientEntryVirtualModule, createServerEntryVirtualModule, createVueAppEntryVirtualModule, createVuePagesVirtualModule, ubeanVite as default, ubeanVite };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubean/build",
3
- "version": "0.5.2",
3
+ "version": "0.6.0-beta.2",
4
4
  "description": "Vite plugins, production build, SSG prerender, type codegen, and Server Actions plugin for ubean",
5
5
  "files": [
6
6
  "dist"
@@ -45,18 +45,20 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@intlify/unplugin-vue-i18n": "11.2.5",
48
- "@ubean/client": "0.5.2",
49
- "@ubean/config": "0.5.2",
50
- "@ubean/i18n": "0.5.2",
51
- "@ubean/islands": "0.5.2",
52
- "@ubean/markdown": "0.5.2",
53
- "@ubean/pages": "0.5.2",
54
- "@ubean/preset": "0.5.2",
55
- "@ubean/routes": "0.5.2",
56
- "@ubean/scan": "0.5.2",
57
- "@ubean/shared": "0.5.2",
58
- "@ubean/vue": "0.5.2",
59
- "@vitejs/plugin-vue": "^6.0.8",
48
+ "@ubean/app": "0.6.0-beta.2",
49
+ "@ubean/client": "0.6.0-beta.2",
50
+ "@ubean/config": "0.6.0-beta.2",
51
+ "@ubean/i18n": "0.6.0-beta.2",
52
+ "@ubean/islands": "0.6.0-beta.2",
53
+ "@ubean/markdown": "0.6.0-beta.2",
54
+ "@ubean/pages": "0.6.0-beta.2",
55
+ "@ubean/preset": "0.6.0-beta.2",
56
+ "@ubean/routes": "0.6.0-beta.2",
57
+ "@ubean/scan": "0.6.0-beta.2",
58
+ "@ubean/server": "0.6.0-beta.2",
59
+ "@ubean/shared": "0.6.0-beta.2",
60
+ "@ubean/vue": "0.6.0-beta.2",
61
+ "@vitejs/plugin-vue": "^6.0.9",
60
62
  "openapi-typescript": "^7.13.0",
61
63
  "pathe": "^2.0.3",
62
64
  "tinyglobby": "^0.2.17",
@@ -64,17 +66,17 @@
64
66
  "unplugin-auto-import": "21.1.0",
65
67
  "unplugin-vue-components": "^32.1.0",
66
68
  "unplugin-vue-markdown": "^32.1.1",
67
- "vue-i18n": "11.4.10"
69
+ "vue-i18n": "11.4.12"
68
70
  },
69
71
  "devDependencies": {
70
- "@types/node": "^26.5.0",
71
- "hono": "4.13.7",
72
+ "@types/node": "^26.6.1",
73
+ "hono": "4.13.8",
72
74
  "typescript": "npm:typescript-native-bridge@latest",
73
- "vite": "npm:@voidzero-dev/vite-plus-core@0.3.1",
74
- "vite-plus": "0.3.1"
75
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.3.3",
76
+ "vite-plus": "0.3.3"
75
77
  },
76
78
  "peerDependencies": {
77
- "vite": "npm:@voidzero-dev/vite-plus-core@0.3.1"
79
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.3.3"
78
80
  },
79
81
  "peerDependenciesMeta": {
80
82
  "vite": {
@@ -1,113 +0,0 @@
1
- //#region src/registry.ts
2
- const REGISTRY_KEY = "__ubean_module_registry__";
3
- function getRegistry() {
4
- const g = globalThis;
5
- if (!g[REGISTRY_KEY]) g[REGISTRY_KEY] = {
6
- componentResolvers: [],
7
- cssImports: []
8
- };
9
- return g[REGISTRY_KEY];
10
- }
11
- /**
12
- * Register a component resolver (e.g. `UiResolver()` from `@soybeanjs/ui/resolver`).
13
- * The resolver will be merged into `unplugin-vue-components`'s `resolvers` array.
14
- */
15
- function registerComponentResolver(resolver) {
16
- getRegistry().componentResolvers.push(resolver);
17
- }
18
- /**
19
- * Get all registered component resolvers.
20
- * Called by `ubeanVite` when constructing the `Components()` plugin.
21
- */
22
- function getComponentResolvers() {
23
- return [...getRegistry().componentResolvers];
24
- }
25
- /**
26
- * Register a CSS import path to be injected into the client entry.
27
- * e.g. `registerCssImport('@soybeanjs/ui/styles.css')` makes the client
28
- * entry module prepend `import '@soybeanjs/ui/styles.css'`.
29
- */
30
- function registerCssImport(cssPath) {
31
- const reg = getRegistry();
32
- if (!reg.cssImports.includes(cssPath)) reg.cssImports.push(cssPath);
33
- }
34
- /**
35
- * Get all registered CSS import paths.
36
- * Called by `createClientEntryVirtualModule` to prepend CSS imports.
37
- */
38
- function getCssImports() {
39
- return [...getRegistry().cssImports];
40
- }
41
- /**
42
- * Reset the registry (for testing).
43
- * @internal
44
- */
45
- function resetModuleRegistry() {
46
- const reg = getRegistry();
47
- reg.componentResolvers.length = 0;
48
- reg.cssImports.length = 0;
49
- }
50
- //#endregion
51
- //#region src/ssr-singleton.ts
52
- /**
53
- * Single-copy runtime policy for Vite client / SSR graphs.
54
- *
55
- * `@ubean/i18n` (ALS + catalogs) and `@ubean/client` (locale runtime) must
56
- * resolve to one module instance per process. Dev and production use the
57
- * same package lists; only the SSR externalization differs:
58
- *
59
- * - Dev: Vite `ssrLoadModule` and the CLI-created app share Node's
60
- * `@ubean/i18n` (external). `ubean` stays noExternal so virtual ids resolve.
61
- * - Prod: `ubean` is bundled (`noExternal`). Do **not** also externalize
62
- * `@ubean/i18n` — that would create a second copy beside the bundle.
63
- */
64
- const SSR_SINGLETON_PACKAGES = [
65
- "ubean",
66
- "@ubean/client",
67
- "@ubean/i18n",
68
- "vue-i18n",
69
- "@intlify/core",
70
- "@intlify/core-base"
71
- ];
72
- const SSR_SINGLETON_DEDUPE = [
73
- "vue",
74
- "vue-i18n",
75
- "@ubean/client",
76
- "@ubean/i18n"
77
- ];
78
- const SSR_SINGLETON_OPTIMIZE_EXCLUDE = [
79
- "ubean",
80
- "@ubean/client",
81
- "@ubean/i18n"
82
- ];
83
- function ssrSingletonDevPolicy() {
84
- return {
85
- resolve: { dedupe: [...SSR_SINGLETON_DEDUPE] },
86
- optimizeDeps: {
87
- exclude: [...SSR_SINGLETON_OPTIMIZE_EXCLUDE],
88
- include: ["vue-i18n"]
89
- },
90
- ssr: {
91
- noExternal: [
92
- "ubean",
93
- "vue-i18n",
94
- "@intlify/core",
95
- "@intlify/core-base"
96
- ],
97
- external: ["@ubean/i18n"]
98
- }
99
- };
100
- }
101
- function ssrSingletonProdSsr() {
102
- return { noExternal: [
103
- "ubean",
104
- "vue-i18n",
105
- "@intlify/core",
106
- "@intlify/core-base"
107
- ] };
108
- }
109
- function ssrSingletonProdOptimizeExclude(extra = []) {
110
- return [...SSR_SINGLETON_OPTIMIZE_EXCLUDE, ...extra];
111
- }
112
- //#endregion
113
- export { ssrSingletonProdOptimizeExclude as a, getCssImports as c, resetModuleRegistry as d, ssrSingletonDevPolicy as i, registerComponentResolver as l, SSR_SINGLETON_OPTIMIZE_EXCLUDE as n, ssrSingletonProdSsr as o, SSR_SINGLETON_PACKAGES as r, getComponentResolvers as s, SSR_SINGLETON_DEDUPE as t, registerCssImport as u };
@@ -1,30 +0,0 @@
1
- //#region src/virtual-registry.d.ts
2
- interface VirtualModuleContext {
3
- resolveId(id: string): string | undefined;
4
- load(id: string): string | undefined;
5
- invalidate(id: string): void;
6
- }
7
- type VirtualModuleTransform = (id: string, code: string) => string | Promise<string>;
8
- interface VirtualModule {
9
- id: string;
10
- resolve(id: string, importer?: string): string | undefined;
11
- load(id?: string): string | Promise<string>;
12
- }
13
- declare class VirtualModuleRegistry {
14
- private modules;
15
- private invalidated;
16
- register(mod: VirtualModule): void;
17
- resolveId(id: string, importer?: string): string | undefined;
18
- load(id: string): Promise<string | undefined>;
19
- invalidate(id: string): void;
20
- isInvalidated(id: string): boolean;
21
- clearInvalidated(): void;
22
- getModules(): VirtualModule[];
23
- clear(): void;
24
- }
25
- declare function useVirtualRegistry(): VirtualModuleRegistry;
26
- declare function resetVirtualRegistry(): void;
27
- declare function defineVirtualModule(id: string, loader: () => string | Promise<string>): VirtualModule;
28
- declare function defineVirtualModulePrefix(prefix: string, loader: (id: string) => string | Promise<string>): VirtualModule;
29
- //#endregion
30
- export { defineVirtualModule as a, useVirtualRegistry as c, VirtualModuleTransform as i, VirtualModuleContext as n, defineVirtualModulePrefix as o, VirtualModuleRegistry as r, resetVirtualRegistry as s, VirtualModule as t };
@@ -1,69 +0,0 @@
1
- //#region src/virtual-registry.ts
2
- var VirtualModuleRegistry = class {
3
- modules = /* @__PURE__ */ new Map();
4
- invalidated = /* @__PURE__ */ new Set();
5
- register(mod) {
6
- this.modules.set(mod.id, mod);
7
- }
8
- resolveId(id, importer) {
9
- if (this.modules.has(id)) return id;
10
- for (const mod of this.modules.values()) {
11
- const resolved = mod.resolve(id, importer);
12
- if (resolved) return resolved;
13
- }
14
- }
15
- async load(id) {
16
- const exactMod = this.modules.get(id);
17
- if (exactMod) return exactMod.load(id);
18
- for (const [modId, mod] of this.modules) {
19
- if (modId === id) continue;
20
- if (mod.resolve(id)) return mod.load(id);
21
- }
22
- }
23
- invalidate(id) {
24
- this.invalidated.add(id);
25
- }
26
- isInvalidated(id) {
27
- return this.invalidated.has(id);
28
- }
29
- clearInvalidated() {
30
- this.invalidated.clear();
31
- }
32
- getModules() {
33
- return [...this.modules.values()];
34
- }
35
- clear() {
36
- this.modules.clear();
37
- this.invalidated.clear();
38
- }
39
- };
40
- let _registry = null;
41
- function useVirtualRegistry() {
42
- if (!_registry) _registry = new VirtualModuleRegistry();
43
- return _registry;
44
- }
45
- function resetVirtualRegistry() {
46
- _registry = null;
47
- }
48
- function defineVirtualModule(id, loader) {
49
- return {
50
- id,
51
- resolve(resolvedId) {
52
- return resolvedId === id ? id : void 0;
53
- },
54
- load: loader
55
- };
56
- }
57
- function defineVirtualModulePrefix(prefix, loader) {
58
- return {
59
- id: prefix,
60
- resolve(id) {
61
- if (id.startsWith(prefix)) return id;
62
- },
63
- load(id) {
64
- return loader(id || prefix);
65
- }
66
- };
67
- }
68
- //#endregion
69
- export { useVirtualRegistry as a, resetVirtualRegistry as i, defineVirtualModule as n, defineVirtualModulePrefix as r, VirtualModuleRegistry as t };
@@ -1,226 +0,0 @@
1
- import { a as useVirtualRegistry } from "./virtual-registry-BWkaQHXN.js";
2
- import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, r as createMetaVirtualModule, s as transformMacros, t as createAppVirtualModule } from "./virtual-modules-vLkLkAfT.js";
3
- import { join, relative, resolve } from "pathe";
4
- import { loadUbeanConfig, tryGetConfig } from "@ubean/config";
5
- import { createServerRouter } from "@ubean/routes";
6
- import { scanProject } from "@ubean/scan";
7
- import { getVueLocaleParam } from "@ubean/i18n";
8
- //#region src/i18n-config.ts
9
- function serializeI18nConfig(config) {
10
- return JSON.stringify(config);
11
- }
12
- function localeVueParamFromI18n(config) {
13
- if (!config.enabled) return void 0;
14
- return getVueLocaleParam({
15
- defaultLocale: config.defaultLocale,
16
- locales: config.locales.map((l) => l.code),
17
- strategy: config.strategy
18
- }) || void 0;
19
- }
20
- //#endregion
21
- //#region src/vite.ts
22
- const VIRTUAL_MODULES = [
23
- "ubean:routes",
24
- "ubean:pages",
25
- "ubean:meta",
26
- "ubean:app-config",
27
- "ubean:locales"
28
- ];
29
- const VIRTUAL_PREFIX = "\0ubean:";
30
- /**
31
- * ubean 核心 Vite 插件(框架无关部分)。
32
- *
33
- * 提供:
34
- * - 虚拟模块(`ubean:routes`、`ubean:pages`、`ubean:meta`、`ubean:app-config`、`ubean:locales`)
35
- * - 宏转换(`definePage` / `defineMeta` 在 `.ts` / `.vue` 中被剥离)
36
- * - 文件监听(dev 模式下扫描 `routes` / `middleware` / `pages` / `layouts` / `plugins` / `locales`)
37
- * - 实体路由文件生成(当 `routing.mode` 为 `'file'` 或 `'both'` 时触发 `@ubean/vue/generator`)
38
- *
39
- * Vue 专属的虚拟模块(`virtual:ubean-pages`、`virtual:ubean-app` 等)由 `@ubean/build/vue` 的
40
- * `ubeanVite` 提供,二者共用 `useVirtualRegistry()` 注册表。
41
- *
42
- * @example 在 vite.config.ts 中使用(自动加载 ubean.config)
43
- * ```typescript
44
- * import { defineConfig } from 'vite';
45
- * import { ubeanPlugin } from '@ubean/build/vite';
46
- *
47
- * export default defineConfig({
48
- * plugins: [ubeanPlugin()]
49
- * });
50
- * ```
51
- *
52
- * @example 显式传入配置(ubean dev/build 内部使用)
53
- * ```typescript
54
- * ubeanPlugin({ config: resolvedConfig })
55
- * ```
56
- */
57
- function ubeanPlugin(options) {
58
- const virtualRegistry = useVirtualRegistry();
59
- let ubeanConfig = options?.config ?? tryGetConfig() ?? void 0;
60
- let srcDirAbs = "";
61
- let viteSrcDir = "";
62
- let viteSrcPrefix = "";
63
- function ensureDerived() {
64
- if (!ubeanConfig) return;
65
- srcDirAbs = resolve(ubeanConfig.rootDir, ubeanConfig.srcDir);
66
- viteSrcDir = relative(ubeanConfig.rootDir, srcDirAbs).replace(/\\/g, "/");
67
- viteSrcPrefix = viteSrcDir ? `/${viteSrcDir}` : "";
68
- }
69
- if (ubeanConfig) ensureDerived();
70
- return {
71
- name: "ubean:core",
72
- enforce: "pre",
73
- async buildStart() {
74
- if (!ubeanConfig) {
75
- ubeanConfig = await loadUbeanConfig();
76
- ensureDerived();
77
- }
78
- await scanAndRegister();
79
- },
80
- resolveId(id) {
81
- if (VIRTUAL_MODULES.includes(id)) return VIRTUAL_PREFIX + id;
82
- },
83
- async load(id) {
84
- if (id.startsWith(VIRTUAL_PREFIX)) {
85
- const moduleId = id.slice(7);
86
- const mod = virtualRegistry.getModules().find((m) => m.id === moduleId);
87
- if (mod) return await mod.load();
88
- }
89
- },
90
- transform(code, id) {
91
- const result = transformMacros(code, id);
92
- if (result !== null && result !== code) return {
93
- code: result,
94
- map: null
95
- };
96
- return null;
97
- },
98
- configureServer(server) {
99
- const watchDirs = [
100
- "routes",
101
- "middleware",
102
- "pages",
103
- "layouts",
104
- "plugins",
105
- "locales"
106
- ];
107
- const config = ubeanConfig;
108
- const srcDir = resolve(config.rootDir, config.srcDir);
109
- for (const dir of watchDirs) server.watcher.add(join(srcDir, dir));
110
- server.watcher.on("add", handleFileChange);
111
- server.watcher.on("unlink", handleFileChange);
112
- server.watcher.on("change", handleFileChange);
113
- async function handleFileChange(file) {
114
- const relativePath = file.replace(`${srcDir}/`, "");
115
- if (watchDirs.some((d) => relativePath.startsWith(`${d}/`))) {
116
- await scanAndRegister();
117
- for (const mod of VIRTUAL_MODULES) {
118
- const module = server.moduleGraph.getModuleById(VIRTUAL_PREFIX + mod);
119
- if (module) server.moduleGraph.invalidateModule(module);
120
- }
121
- if (relativePath.startsWith("locales/")) server.ws.send({
122
- type: "custom",
123
- event: "ubean:locale-update",
124
- data: { file }
125
- });
126
- }
127
- }
128
- }
129
- };
130
- async function scanAndRegister() {
131
- if (!ubeanConfig) return;
132
- const result = await scanProject({
133
- cwd: ubeanConfig.rootDir,
134
- srcDir: ubeanConfig.srcDir,
135
- dirs: ubeanConfig.dir,
136
- ignore: ubeanConfig.scanOptions?.ignore
137
- });
138
- const router = createServerRouter();
139
- for (const mw of result.middlewares) router.addMiddleware(mw);
140
- for (const route of result.apiRoutes) router.addApiRoute(route);
141
- for (const page of result.pages) router.addPage(page);
142
- for (const layout of result.layouts) router.addLayout(layout);
143
- virtualRegistry.register(createRoutingVirtualModule(result.apiRoutes.map((r) => ({
144
- method: r.method?.toUpperCase() || "ALL",
145
- path: r.route,
146
- id: `${r.method}:${r.route}`,
147
- filePath: r.fullPath
148
- })), result.middlewares.map((m) => ({
149
- path: "/**",
150
- filePath: m.fullPath,
151
- order: m.order,
152
- global: m.global
153
- })), ubeanConfig.rootDir));
154
- virtualRegistry.register(createPagesVirtualModule(result.pages.map((p) => ({
155
- name: p.name,
156
- path: p.route,
157
- filePath: p.fullPath,
158
- layout: p.layout,
159
- reuseTarget: p.reuseTarget
160
- })), result.layouts.map((l) => ({
161
- name: l.name,
162
- filePath: l.fullPath,
163
- isDefault: l.isDefault
164
- })), ubeanConfig.rootDir));
165
- virtualRegistry.register(createMetaVirtualModule());
166
- virtualRegistry.register(createAppVirtualModule(result.apiRoutes, result.middlewares, result.pages, viteSrcPrefix || "/"));
167
- virtualRegistry.register(createLocalesVirtualModule(result.locales, result.defaultLocale, viteSrcPrefix || "/", serializeI18nConfig(ubeanConfig.i18n)));
168
- await maybeGenerateRouteFiles(ubeanConfig, result).catch((err) => {
169
- console.warn("[ubean:core] Route file generation failed:", err?.message || err);
170
- });
171
- }
172
- }
173
- /**
174
- * 根据 `routing.mode` 决定是否触发实体文件生成。
175
- *
176
- * - `'virtual'`(默认):仅生成 `.ubean/typed-router.d.ts`(类型声明,所有模式都生成)
177
- * - `'file'`:额外生成 `routes.ts`/`imports.ts` 到 `outputDir`(实体文件,可编辑 `meta`)
178
- * - `'both'`:同 `'file'`,且虚拟模块也加载实体文件
179
- *
180
- * `typed-router.d.ts` 包含 `@ubean/scan` 和 `vue-router`/`vue-router/auto-routes`
181
- * 的模块增强(让 `useRoute<Name>(name)` 能推断 `route.params` 类型),所有模式
182
- * 都会生成到 `.ubean/typed-router.d.ts`,与 `auto-imports.d.ts`/`components.d.ts`
183
- * 等其他纯类型声明产物同目录,由 `.gitignore` 忽略。
184
- *
185
- * 由于 `@ubean/vue/generator` 通过动态 import 加载,前端-only 项目
186
- * (不依赖实体路由文件)即使没有安装 generator 相关依赖也能运行。
187
- *
188
- * 注意:`@ubean/config` 与 `@ubean/vue/generator` 的 `getRouteMeta` /
189
- * `onGenerated` 签名略有差异(配置层面向用户,生成器层面向内部)。本函数
190
- * 负责适配:把 `(filePath, frontmatter) => meta` 包装为 `(page) => meta`,
191
- * 把 `GeneratorResult` 转换为 `string[]` 文件路径列表。
192
- */
193
- async function maybeGenerateRouteFiles(config, scanResult) {
194
- const mode = config.routing?.mode;
195
- const generateEntityFiles = mode === "file" || mode === "both";
196
- const routing = config.routing;
197
- const outDir = resolve(config.rootDir, routing.outputDir);
198
- const dtsPath = resolve(config.rootDir, ".ubean", "typed-router.d.ts");
199
- const configGetRouteMeta = routing.getRouteMeta;
200
- const generatorGetRouteMeta = configGetRouteMeta ? (page) => configGetRouteMeta(page.relativePath, page.frontmatter ?? {}) : void 0;
201
- const { generateRouteFiles } = await import("@ubean/vue/generator");
202
- const result = await generateRouteFiles(scanResult, {
203
- cwd: config.rootDir,
204
- srcDir: config.srcDir,
205
- outDir,
206
- dtsPath,
207
- generateRoutes: generateEntityFiles,
208
- generateImports: generateEntityFiles,
209
- generateDts: true,
210
- routeLazy: routing.routeLazy,
211
- layoutLazy: routing.layoutLazy,
212
- getRouteMeta: generatorGetRouteMeta,
213
- headerComment: void 0,
214
- localeVueParam: localeVueParamFromI18n(config.i18n)
215
- });
216
- if (routing.onGenerated) {
217
- const files = [
218
- result.routesPath,
219
- result.importsPath,
220
- result.dtsPath
221
- ].filter((p) => Boolean(p));
222
- routing.onGenerated(files);
223
- }
224
- }
225
- //#endregion
226
- export { localeVueParamFromI18n as n, serializeI18nConfig as r, ubeanPlugin as t };