@ubean/build 0.7.3 → 0.7.5
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/actions-plugin.d.ts +0 -2
- package/dist/actions-plugin.js +1 -2
- package/dist/codegen/index.d.ts +0 -10
- package/dist/codegen/index.js +1 -1
- package/dist/{codegen-DUQT79IR.js → codegen-D9q6Yu0z.js} +7 -13
- package/dist/env/plugin.d.ts +0 -4
- package/dist/env/plugin.js +2 -3
- package/dist/index.d.ts +1 -9
- package/dist/index.js +2 -2
- package/dist/prerender.d.ts +0 -2
- package/dist/prerender.js +1 -2
- package/dist/production.d.ts +2 -6
- package/dist/production.js +1 -1
- package/dist/{ssr-singleton-CUHZLgiO.js → ssr-singleton-CD6tSMIE.js} +4 -8
- package/dist/static-render.d.ts +1 -3
- package/dist/static-render.js +1 -2
- package/dist/{types-C2WT1hXQ.js → types-BvLO9ngd.js} +1 -2
- package/dist/{virtual-modules-AXf0lNb0.js → virtual-modules-Cy1CnBzY.js} +3 -5
- package/dist/{virtual-registry-CaU8k-YP.d.ts → virtual-registry-CKfuFd5w.d.ts} +0 -2
- package/dist/{vite-Cwx2gAN6.js → vite-DQ6nL0Kv.js} +21 -37
- package/dist/vite.d.ts +7 -23
- package/dist/vite.js +3 -3
- package/dist/{vue-Cr9byirH.js → vue-BSQATqn6.js} +29 -21
- package/dist/vue.d.ts +1 -5
- package/dist/vue.js +1 -1
- package/package.json +17 -17
package/dist/actions-plugin.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Plugin } from "vite";
|
|
2
|
-
//#region src/actions-plugin.d.ts
|
|
3
2
|
export interface ServerActionsPluginOptions {
|
|
4
3
|
/**
|
|
5
4
|
* The project root directory (used for computing stable action IDs).
|
|
@@ -58,5 +57,4 @@ export declare function transformActionsForClient(code: string, filePath: string
|
|
|
58
57
|
* - 客户端(浏览器):将 `defineAction(...)` 替换为 `createActionStub('<id>')`。
|
|
59
58
|
*/
|
|
60
59
|
export declare function ubeanServerActionsPlugin(options?: ServerActionsPluginOptions): Plugin;
|
|
61
|
-
//#endregion
|
|
62
60
|
export {};
|
package/dist/actions-plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { relative } from "pathe";
|
|
2
2
|
import { createActionId } from "@ubean/routes";
|
|
3
|
-
|
|
3
|
+
// src/actions-plugin.ts
|
|
4
4
|
/**
|
|
5
5
|
* 查找匹配的闭合括号(支持字符串/模板字面量/注释跳过)。
|
|
6
6
|
*/
|
|
@@ -430,5 +430,4 @@ function ubeanServerActionsPlugin(options = {}) {
|
|
|
430
430
|
}
|
|
431
431
|
};
|
|
432
432
|
}
|
|
433
|
-
//#endregion
|
|
434
433
|
export { findDefineActionCalls, hasDefineActionCall, transformActionsForClient, transformActionsForServer, ubeanServerActionsPlugin };
|
package/dist/codegen/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { ScanResult } from "@ubean/scan";
|
|
|
3
3
|
import { Import, InlinePreset } from "unimport";
|
|
4
4
|
import { Options } from "unplugin-vue-components/types";
|
|
5
5
|
import { Options as Options$1 } from "unplugin-auto-import/types";
|
|
6
|
-
//#region src/codegen/auto-imports.d.ts
|
|
7
6
|
interface GenerateAutoImportsOptions {
|
|
8
7
|
cwd: string;
|
|
9
8
|
srcDir: string;
|
|
@@ -141,8 +140,6 @@ export declare function generateImportsTransform(imports: Import[]): {
|
|
|
141
140
|
code: string;
|
|
142
141
|
map?: null;
|
|
143
142
|
};
|
|
144
|
-
//#endregion
|
|
145
|
-
//#region src/codegen/route-types.d.ts
|
|
146
143
|
interface RouteTypesOptions {
|
|
147
144
|
/** Project root directory (absolute). Used to compute portable relative `filePath` values. */
|
|
148
145
|
cwd: string;
|
|
@@ -155,8 +152,6 @@ interface PageTypesOptions {
|
|
|
155
152
|
fileName?: string;
|
|
156
153
|
}
|
|
157
154
|
export declare function generatePageTypes(result: ScanResult, options: PageTypesOptions): Promise<string>;
|
|
158
|
-
//#endregion
|
|
159
|
-
//#region src/codegen/i18n-types.d.ts
|
|
160
155
|
interface I18nTypesOptions {
|
|
161
156
|
outDir: string;
|
|
162
157
|
fileName?: string;
|
|
@@ -171,8 +166,6 @@ export declare function messagesToTsType(value: unknown, indent?: number): strin
|
|
|
171
166
|
* JSON source, the locale union only needs the locale files to exist.
|
|
172
167
|
*/
|
|
173
168
|
export declare function generateI18nTypes(result: ScanResult, options: I18nTypesOptions): Promise<string | null>;
|
|
174
|
-
//#endregion
|
|
175
|
-
//#region src/codegen/openapi-types.d.ts
|
|
176
169
|
/**
|
|
177
170
|
* OpenAPI 类型生成
|
|
178
171
|
*
|
|
@@ -199,8 +192,6 @@ export declare function generateOpenApiTypes(schema: unknown, options: GenerateO
|
|
|
199
192
|
* `Unexpected token '<'` 之类的误导性错误。
|
|
200
193
|
*/
|
|
201
194
|
export declare function generateOpenApiTypesFromServer(baseUrl: string, options: GenerateOpenApiTypesOptions): Promise<string | null>;
|
|
202
|
-
//#endregion
|
|
203
|
-
//#region src/codegen/index.d.ts
|
|
204
195
|
export declare const CODEGEN_CONTRACT_VERSION: 1;
|
|
205
196
|
export interface CodegenFileContract {
|
|
206
197
|
name: string;
|
|
@@ -255,5 +246,4 @@ export interface CodegenResult {
|
|
|
255
246
|
generated: string[];
|
|
256
247
|
}
|
|
257
248
|
export declare function generateTypes(result: ScanResult, options: CodegenOptions): Promise<CodegenResult>;
|
|
258
|
-
//#endregion
|
|
259
249
|
export type { AutoImportResult, ComponentInfo, GenerateAutoImportsOptions, GenerateOpenApiTypesOptions, I18nTypesOptions, Import, InlinePreset, PageTypesOptions, ResolvedAutoImports, ResolvedComponentsAutoImport, RouteTypesOptions };
|
package/dist/codegen/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { d as BUILTIN_PRESETS, t as CODEGEN_CONTRACT_VERSION, n as CODEGEN_FILES, r as CODEGEN_NON_CONTRACT_FILES, p as HONO_OPENAPI_PRESET, m as UBEAN_CLIENT_PRESET, h as UBEAN_SERVER_PRESET, g as VUE_I18N_PRESET, _ as VUE_MACROS_PRESET, v as VUE_PRESET, y as VUE_ROUTER_PRESET, b as generateAutoImports, l as generateI18nTypes, x as generateImportsTransform, a as generateOpenApiTypes, o as generateOpenApiTypesFromServer, s as generatePageTypes, c as generateRouteTypes, i as generateTypes, S as getAutoImportPresets, C as getBuiltinComposables, w as getUbeanAutoImportConfig, T as getUbeanComponentsConfig, u as messagesToTsType, E as resolveAutoImportsConfig, D as resolveComponentsConfig, O as toArray } from "../codegen-
|
|
1
|
+
export { d as BUILTIN_PRESETS, t as CODEGEN_CONTRACT_VERSION, n as CODEGEN_FILES, r as CODEGEN_NON_CONTRACT_FILES, p as HONO_OPENAPI_PRESET, m as UBEAN_CLIENT_PRESET, h as UBEAN_SERVER_PRESET, g as VUE_I18N_PRESET, _ as VUE_MACROS_PRESET, v as VUE_PRESET, y as VUE_ROUTER_PRESET, b as generateAutoImports, l as generateI18nTypes, x as generateImportsTransform, a as generateOpenApiTypes, o as generateOpenApiTypesFromServer, s as generatePageTypes, c as generateRouteTypes, i as generateTypes, S as getAutoImportPresets, C as getBuiltinComposables, w as getUbeanAutoImportConfig, T as getUbeanComponentsConfig, u as messagesToTsType, E as resolveAutoImportsConfig, D as resolveComponentsConfig, O as toArray } from "../codegen-D9q6Yu0z.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as resolveEnvModules } from "./types-
|
|
1
|
+
import { r as resolveEnvModules } from "./types-BvLO9ngd.js";
|
|
2
2
|
import { isAbsolute, join, normalize, relative } from "pathe";
|
|
3
3
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
4
4
|
import { glob } from "tinyglobby";
|
|
5
5
|
import { createUnimport, toTypeDeclarationFile } from "unimport";
|
|
6
6
|
import openapiTS, { astToString } from "openapi-typescript";
|
|
7
|
-
|
|
7
|
+
// src/env/codegen.ts
|
|
8
8
|
/**
|
|
9
9
|
* `.ubean/env.d.ts` 生成器。
|
|
10
10
|
*
|
|
@@ -109,8 +109,7 @@ ${renderModuleTypes("ubean:env/client", modules.client)}${renderModuleTypes("ube
|
|
|
109
109
|
await writeFile(outPath, contents, "utf8");
|
|
110
110
|
return outPath;
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
//#region src/codegen/auto-imports.ts
|
|
112
|
+
// src/codegen/auto-imports.ts
|
|
114
113
|
/** 将 `boolean | AutoImportOptions` 归一化为分库开关 + 透传选项。 */
|
|
115
114
|
function resolveAutoImportsConfig(input) {
|
|
116
115
|
const options = typeof input === "object" && input !== null ? input : {};
|
|
@@ -717,8 +716,7 @@ function generateImportsTransform(imports) {
|
|
|
717
716
|
for (const [from, names] of importGroups) importStatements.push(`import { ${Array.from(names).join(", ")} } from '${from}';`);
|
|
718
717
|
return { code: importStatements.join("\n") };
|
|
719
718
|
}
|
|
720
|
-
|
|
721
|
-
//#region src/codegen/i18n-types.ts
|
|
719
|
+
// src/codegen/i18n-types.ts
|
|
722
720
|
function isIdent(key) {
|
|
723
721
|
return /^[A-Za-z_$][\w$]*$/.test(key);
|
|
724
722
|
}
|
|
@@ -807,8 +805,7 @@ declare module '@intlify/core-base' {
|
|
|
807
805
|
await writeFile(outPath, contents, "utf8");
|
|
808
806
|
return outPath;
|
|
809
807
|
}
|
|
810
|
-
|
|
811
|
-
//#region src/codegen/route-types.ts
|
|
808
|
+
// src/codegen/route-types.ts
|
|
812
809
|
/**
|
|
813
810
|
* Compute a portable file path for a scanned route.
|
|
814
811
|
*
|
|
@@ -939,8 +936,7 @@ async function generatePageTypes(result, options) {
|
|
|
939
936
|
await writeFile(filePath, content, "utf-8");
|
|
940
937
|
return filePath;
|
|
941
938
|
}
|
|
942
|
-
|
|
943
|
-
//#region src/codegen/openapi-types.ts
|
|
939
|
+
// src/codegen/openapi-types.ts
|
|
944
940
|
/**
|
|
945
941
|
* OpenAPI 类型生成
|
|
946
942
|
*
|
|
@@ -985,8 +981,7 @@ async function generateOpenApiTypesFromServer(baseUrl, options) {
|
|
|
985
981
|
if (!(response.headers.get("content-type") || "").includes("json")) return null;
|
|
986
982
|
return generateOpenApiTypes(await response.json(), options);
|
|
987
983
|
}
|
|
988
|
-
|
|
989
|
-
//#region src/codegen/index.ts
|
|
984
|
+
// src/codegen/index.ts
|
|
990
985
|
const CODEGEN_CONTRACT_VERSION = 1;
|
|
991
986
|
const CODEGEN_FILES = [
|
|
992
987
|
{
|
|
@@ -1093,5 +1088,4 @@ async function generateTypes(result, options) {
|
|
|
1093
1088
|
generated
|
|
1094
1089
|
};
|
|
1095
1090
|
}
|
|
1096
|
-
//#endregion
|
|
1097
1091
|
export { getBuiltinComposables as C, resolveComponentsConfig as D, resolveAutoImportsConfig as E, toArray as O, getAutoImportPresets as S, getUbeanComponentsConfig as T, VUE_MACROS_PRESET as _, generateOpenApiTypes as a, generateAutoImports as b, generateRouteTypes as c, BUILTIN_PRESETS as d, COMPONENT_HALF_GLOBS as f, VUE_I18N_PRESET as g, UBEAN_SERVER_PRESET as h, generateTypes as i, generateI18nTypes as l, UBEAN_CLIENT_PRESET as m, CODEGEN_FILES as n, generateOpenApiTypesFromServer as o, HONO_OPENAPI_PRESET as p, CODEGEN_NON_CONTRACT_FILES as r, generatePageTypes as s, CODEGEN_CONTRACT_VERSION as t, messagesToTsType as u, VUE_PRESET as v, getUbeanAutoImportConfig as w, generateImportsTransform as x, VUE_ROUTER_PRESET as y };
|
package/dist/env/plugin.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ResolvedConfig } from "@ubean/config";
|
|
2
2
|
import { Plugin } from "vite";
|
|
3
|
-
//#region src/env/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* `env.schema` → 两个虚拟模块(`ubean:env/client` / `ubean:env/server`)的规范化与取值。
|
|
6
5
|
*
|
|
@@ -73,8 +72,6 @@ export declare function renderEnvClientModule(fields: EnvFieldSpec[]): string;
|
|
|
73
72
|
* 会把「部署忘了配环境变量」拖到第一次请求才炸。
|
|
74
73
|
*/
|
|
75
74
|
export declare function renderEnvServerModule(fields: EnvFieldSpec[], mode?: 'warn' | 'throw'): string;
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/env/plugin.d.ts
|
|
78
75
|
export declare const ENV_CLIENT_ID = "ubean:env/client";
|
|
79
76
|
export declare const ENV_SERVER_ID = "ubean:env/server";
|
|
80
77
|
export interface UbeanEnvPluginOptions {
|
|
@@ -87,5 +84,4 @@ export interface UbeanEnvPluginOptions {
|
|
|
87
84
|
* - 同一个钩子还会给出 `mode`,用于判定生产/开发(决定 warn 的措辞)
|
|
88
85
|
*/
|
|
89
86
|
export declare function ubeanEnvPlugin(options: UbeanEnvPluginOptions): Plugin;
|
|
90
|
-
//#endregion
|
|
91
87
|
export type { EnvFieldSpec, EnvModules, ResolveEnvModulesInput };
|
package/dist/env/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as renderEnvServerModule, r as resolveEnvModules, t as renderEnvClientModule } from "../types-
|
|
1
|
+
import { n as renderEnvServerModule, r as resolveEnvModules, t as renderEnvClientModule } from "../types-BvLO9ngd.js";
|
|
2
2
|
import { loadEnv } from "vite";
|
|
3
|
-
|
|
3
|
+
// src/env/plugin.ts
|
|
4
4
|
/**
|
|
5
5
|
* `ubean:env/*` 虚拟模块插件(Astro `astro:env` 的 Vite 版)。
|
|
6
6
|
*
|
|
@@ -76,5 +76,4 @@ or declare the field with \`context: 'client', access: 'public'\` if it is safe
|
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
//#endregion
|
|
80
79
|
export { ENV_CLIENT_ID, ENV_SERVER_ID, renderEnvClientModule, renderEnvServerModule, resolveEnvModules, ubeanEnvPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { a as VirtualModuleTransform, c as defineVirtualModulePrefix, i as VirtualModuleResolver, l as resetVirtualRegistry, n as VirtualModuleContext, o as createVirtualRegistry, r as VirtualModuleRegistry, s as defineVirtualModule, t as VirtualModule, u as useVirtualRegistry } from "./virtual-registry-
|
|
1
|
+
import { a as VirtualModuleTransform, c as defineVirtualModulePrefix, i as VirtualModuleResolver, l as resetVirtualRegistry, n as VirtualModuleContext, o as createVirtualRegistry, r as VirtualModuleRegistry, s as defineVirtualModule, t as VirtualModule, u as useVirtualRegistry } from "./virtual-registry-CKfuFd5w.js";
|
|
2
2
|
import "@ubean/vue/vite";
|
|
3
3
|
import { CompiledLayout, CompiledMiddleware, CompiledPage, CompiledRoute } from "@ubean/routes";
|
|
4
4
|
import { ScannedApiRoute, ScannedLocale, ScannedMiddleware, ScannedPageRoute } from "@ubean/scan";
|
|
5
|
-
//#region src/macros.d.ts
|
|
6
5
|
export declare function stripMacros(code: string, macros?: readonly string[]): string;
|
|
7
6
|
export declare function transformMacros(code: string, id: string): string | null;
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/registry.d.ts
|
|
10
7
|
/**
|
|
11
8
|
* Module extension registry.
|
|
12
9
|
*
|
|
@@ -70,8 +67,6 @@ export declare function getHeadScripts(): string;
|
|
|
70
67
|
* @internal
|
|
71
68
|
*/
|
|
72
69
|
export declare function resetModuleRegistry(): void;
|
|
73
|
-
//#endregion
|
|
74
|
-
//#region src/ssr-singleton.d.ts
|
|
75
70
|
/**
|
|
76
71
|
* Single-copy runtime policy for Vite client / SSR graphs.
|
|
77
72
|
*
|
|
@@ -104,8 +99,6 @@ export declare function ssrSingletonProdSsr(): {
|
|
|
104
99
|
noExternal: string[];
|
|
105
100
|
};
|
|
106
101
|
export declare function ssrSingletonProdOptimizeExclude(extra?: string[]): string[];
|
|
107
|
-
//#endregion
|
|
108
|
-
//#region src/virtual-modules.d.ts
|
|
109
102
|
/**
|
|
110
103
|
* `ubean:pages` 的输入页 —— 比 `CompiledPage` 多出宿主构菜单所需的扫描元数据。
|
|
111
104
|
*
|
|
@@ -129,5 +122,4 @@ export declare function createAppVirtualModule(apiRoutes: ScannedApiRoute[], mid
|
|
|
129
122
|
*/
|
|
130
123
|
pageExtensions?: string): VirtualModule;
|
|
131
124
|
export declare function createLocalesVirtualModule(_locales: ScannedLocale[], defaultLocale: string | undefined, srcDir?: string, i18nConfigJson?: string): VirtualModule;
|
|
132
|
-
//#endregion
|
|
133
125
|
export { type VirtualModule, type VirtualModuleContext, VirtualModuleRegistry, type VirtualModuleResolver, type VirtualModuleTransform, createVirtualRegistry, defineVirtualModule, defineVirtualModulePrefix, resetVirtualRegistry, useVirtualRegistry };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as defineVirtualModule, a as ssrSingletonProdOptimizeExclude, b as useVirtualRegistry, c as getComponentResolvers, d as registerComponentResolver, f as registerCssImport, g as createVirtualRegistry, h as VirtualModuleRegistry, i as ssrSingletonDevPolicy, l as getCssImports, m as resetModuleRegistry, n as SSR_SINGLETON_OPTIMIZE_EXCLUDE, o as ssrSingletonProdSsr, p as registerHeadScript, r as SSR_SINGLETON_PACKAGES, t as SSR_SINGLETON_DEDUPE, u as getHeadScripts, v as defineVirtualModulePrefix, y as resetVirtualRegistry } from "./ssr-singleton-
|
|
2
|
-
import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, o as stripMacros, r as createMetaVirtualModule, s as transformMacros, t as createAppVirtualModule } from "./virtual-modules-
|
|
1
|
+
import { _ as defineVirtualModule, a as ssrSingletonProdOptimizeExclude, b as useVirtualRegistry, c as getComponentResolvers, d as registerComponentResolver, f as registerCssImport, g as createVirtualRegistry, h as VirtualModuleRegistry, i as ssrSingletonDevPolicy, l as getCssImports, m as resetModuleRegistry, n as SSR_SINGLETON_OPTIMIZE_EXCLUDE, o as ssrSingletonProdSsr, p as registerHeadScript, r as SSR_SINGLETON_PACKAGES, t as SSR_SINGLETON_DEDUPE, u as getHeadScripts, v as defineVirtualModulePrefix, y as resetVirtualRegistry } from "./ssr-singleton-CD6tSMIE.js";
|
|
2
|
+
import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, o as stripMacros, r as createMetaVirtualModule, s as transformMacros, t as createAppVirtualModule } from "./virtual-modules-Cy1CnBzY.js";
|
|
3
3
|
export { SSR_SINGLETON_DEDUPE, SSR_SINGLETON_OPTIMIZE_EXCLUDE, SSR_SINGLETON_PACKAGES, VirtualModuleRegistry, createAppVirtualModule, createLocalesVirtualModule, createMetaVirtualModule, createPagesVirtualModule, createRoutingVirtualModule, createVirtualRegistry, defineVirtualModule, defineVirtualModulePrefix, getComponentResolvers, getCssImports, getHeadScripts, registerComponentResolver, registerCssImport, registerHeadScript, resetModuleRegistry, resetVirtualRegistry, ssrSingletonDevPolicy, ssrSingletonProdOptimizeExclude, ssrSingletonProdSsr, stripMacros, transformMacros, useVirtualRegistry };
|
package/dist/prerender.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PrerenderConfig, PrerenderResult, ResolvedPrerenderConfig, RouteRule } from "@ubean/config";
|
|
2
2
|
import { ScannedPageRoute } from "@ubean/scan";
|
|
3
3
|
import { RouteRule as RouteRule$1 } from "@ubean/shared";
|
|
4
|
-
//#region src/prerender.d.ts
|
|
5
4
|
export interface PrerendererOptions {
|
|
6
5
|
cwd: string;
|
|
7
6
|
outputDir: string;
|
|
@@ -157,5 +156,4 @@ export declare function generatePrerenderManifest(result: PrerenderResult, baseU
|
|
|
157
156
|
message: string;
|
|
158
157
|
}>;
|
|
159
158
|
};
|
|
160
|
-
//#endregion
|
|
161
159
|
export type { RouteRule };
|
package/dist/prerender.js
CHANGED
|
@@ -4,7 +4,7 @@ import { resolvePrerenderConfig } from "@ubean/config";
|
|
|
4
4
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
5
5
|
import { matchGlob } from "@ubean/shared";
|
|
6
6
|
import { DATA_PAYLOAD_ID } from "@ubean/pages";
|
|
7
|
-
|
|
7
|
+
// src/prerender.ts
|
|
8
8
|
const LINK_REGEX = /<a[^>]+href=["']([^"']+)["'][^>]*>/gi;
|
|
9
9
|
/**
|
|
10
10
|
* 匹配 `__UBEAN_DATA__` 内联 script 的正则。
|
|
@@ -343,5 +343,4 @@ function generatePrerenderManifest(result, baseUrl = "/") {
|
|
|
343
343
|
}))
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
|
-
//#endregion
|
|
347
346
|
export { collectPrerenderRoutes, extractDataPayload, extractLinks, extractPrerenderRoutesFromRules, generatePrerenderManifest, isRedirectPage, prerender, resolvePrerenderStaticDir, routeToDataFilePath, routeToFilePath, writePrerenderedFile };
|
package/dist/production.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { r as VirtualModuleRegistry } from "./virtual-registry-
|
|
1
|
+
import { r as VirtualModuleRegistry } from "./virtual-registry-CKfuFd5w.js";
|
|
2
2
|
import { ResolvedConfig } from "@ubean/config";
|
|
3
3
|
import { Preset } from "@ubean/preset";
|
|
4
4
|
import { ScanResult } from "@ubean/scan";
|
|
5
5
|
import { Plugin } from "vite";
|
|
6
|
-
//#region src/vite/build-app.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* 一次 `createBuilder` 完成整套生产构建(`ubean build` 与 `vite build` 共用的唯一编排)。
|
|
9
8
|
*
|
|
@@ -14,8 +13,6 @@ import { Plugin } from "vite";
|
|
|
14
13
|
* 环境变量,结束后还原,避免影响同进程内的其它调用。
|
|
15
14
|
*/
|
|
16
15
|
export declare function buildWithEnvironments(options: BuildOptions): Promise<BuildManifest>;
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/production.d.ts
|
|
19
16
|
export interface BuildOptions {
|
|
20
17
|
cwd: string;
|
|
21
18
|
config: ResolvedConfig;
|
|
@@ -85,5 +82,4 @@ export declare function getPresetBuildConfig(preset: Preset): {
|
|
|
85
82
|
export declare function createIslandsSsrStubPlugin(): Plugin;
|
|
86
83
|
export declare function generateNodeServerEntry(): string;
|
|
87
84
|
export declare function generateStandardHandlerEntry(): string;
|
|
88
|
-
export declare function generateCloudflareWorkerEntry(): string;
|
|
89
|
-
//#endregion
|
|
85
|
+
export declare function generateCloudflareWorkerEntry(): string;
|
package/dist/production.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { T as buildWithEnvironments, v as createIslandsSsrStubPlugin, y as generateCloudflareWorkerEntry, b as generateNodeServerEntry, x as generateStandardHandlerEntry, S as generateVirtualModulesToDisk, C as getPresetBuildConfig, w as serializePagesForEntry } from "./vite-
|
|
1
|
+
export { T as buildWithEnvironments, v as createIslandsSsrStubPlugin, y as generateCloudflareWorkerEntry, b as generateNodeServerEntry, x as generateStandardHandlerEntry, S as generateVirtualModulesToDisk, C as getPresetBuildConfig, w as serializePagesForEntry } from "./vite-DQ6nL0Kv.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __exportAll = (all, no_symbols) => {
|
|
5
5
|
let target = {};
|
|
@@ -10,8 +10,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
10
10
|
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
11
11
|
return target;
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
//#region src/virtual-registry.ts
|
|
13
|
+
// src/virtual-registry.ts
|
|
15
14
|
var VirtualModuleRegistry = class {
|
|
16
15
|
modules = /* @__PURE__ */ new Map();
|
|
17
16
|
invalidated = /* @__PURE__ */ new Set();
|
|
@@ -94,8 +93,7 @@ function defineVirtualModulePrefix(prefix, loader) {
|
|
|
94
93
|
}
|
|
95
94
|
};
|
|
96
95
|
}
|
|
97
|
-
|
|
98
|
-
//#region src/registry.ts
|
|
96
|
+
// src/registry.ts
|
|
99
97
|
const REGISTRY_KEY = "__ubean_module_registry__";
|
|
100
98
|
function getRegistry() {
|
|
101
99
|
const g = globalThis;
|
|
@@ -167,8 +165,7 @@ function resetModuleRegistry() {
|
|
|
167
165
|
reg.cssImports.length = 0;
|
|
168
166
|
reg.headScripts.length = 0;
|
|
169
167
|
}
|
|
170
|
-
|
|
171
|
-
//#region src/ssr-singleton.ts
|
|
168
|
+
// src/ssr-singleton.ts
|
|
172
169
|
var ssr_singleton_exports = /* @__PURE__ */ __exportAll({
|
|
173
170
|
SSR_SINGLETON_DEDUPE: () => SSR_SINGLETON_DEDUPE,
|
|
174
171
|
SSR_SINGLETON_OPTIMIZE_EXCLUDE: () => SSR_SINGLETON_OPTIMIZE_EXCLUDE,
|
|
@@ -237,5 +234,4 @@ function ssrSingletonProdSsr() {
|
|
|
237
234
|
function ssrSingletonProdOptimizeExclude(extra = []) {
|
|
238
235
|
return [...SSR_SINGLETON_OPTIMIZE_EXCLUDE, ...extra];
|
|
239
236
|
}
|
|
240
|
-
//#endregion
|
|
241
237
|
export { defineVirtualModule as _, ssrSingletonProdOptimizeExclude as a, useVirtualRegistry as b, getComponentResolvers as c, registerComponentResolver as d, registerCssImport as f, createVirtualRegistry as g, VirtualModuleRegistry as h, ssrSingletonDevPolicy as i, getCssImports as l, resetModuleRegistry as m, SSR_SINGLETON_OPTIMIZE_EXCLUDE as n, ssrSingletonProdSsr as o, registerHeadScript as p, SSR_SINGLETON_PACKAGES as r, ssr_singleton_exports as s, SSR_SINGLETON_DEDUPE as t, getHeadScripts as u, defineVirtualModulePrefix as v, __exportAll as x, resetVirtualRegistry as y };
|
package/dist/static-render.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ScannedPageRoute } from "@ubean/scan";
|
|
2
|
-
//#region src/static-render.d.ts
|
|
3
2
|
/** 哨兵路由:prerender 队列中的 404 页标记,产物映射为 `404.html` */
|
|
4
3
|
export declare const STATIC_NOT_FOUND_ROUTE = "/__ubean_404__";
|
|
5
4
|
export interface CompiledPageRoute {
|
|
@@ -99,5 +98,4 @@ export interface StaticSsgRenderer {
|
|
|
99
98
|
*/
|
|
100
99
|
export declare function createStaticSsgRenderer(cwd: string, manifest: {
|
|
101
100
|
serverDir: string;
|
|
102
|
-
}, init: StaticSsgRendererInit): Promise<StaticSsgRenderer | undefined>;
|
|
103
|
-
//#endregion
|
|
101
|
+
}, init: StaticSsgRendererInit): Promise<StaticSsgRenderer | undefined>;
|
package/dist/static-render.js
CHANGED
|
@@ -2,7 +2,7 @@ import { resolve } from "pathe";
|
|
|
2
2
|
import { getLogger } from "@ubean/shared/logger";
|
|
3
3
|
import { extractLocaleFromPath } from "@ubean/i18n";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
|
-
|
|
5
|
+
// src/static-render.ts
|
|
6
6
|
/**
|
|
7
7
|
* 静态 SSG 渲染器(mode: 'ssg' 专用,见 docs/adr/0011-lightweight-ssg-direct-render.md)。
|
|
8
8
|
*
|
|
@@ -260,5 +260,4 @@ async function createStaticSsgRenderer(cwd, manifest, init) {
|
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
|
-
//#endregion
|
|
264
263
|
export { STATIC_NOT_FOUND_ROUTE, compilePageRoute, createStaticSsgRenderer, expandRoutesForLocales, matchRoutePattern };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isEnvFieldMeta } from "@ubean/shared";
|
|
2
|
-
|
|
2
|
+
// src/env/types.ts
|
|
3
3
|
/**
|
|
4
4
|
* `env.schema` → 两个虚拟模块(`ubean:env/client` / `ubean:env/server`)的规范化与取值。
|
|
5
5
|
*
|
|
@@ -170,5 +170,4 @@ export function getSecret(key) {
|
|
|
170
170
|
}
|
|
171
171
|
`;
|
|
172
172
|
}
|
|
173
|
-
//#endregion
|
|
174
173
|
export { renderEnvServerModule as n, resolveEnvModules as r, renderEnvClientModule as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as defineVirtualModule } from "./ssr-singleton-
|
|
1
|
+
import { _ as defineVirtualModule } from "./ssr-singleton-CD6tSMIE.js";
|
|
2
2
|
import { extractScriptBlocks, parseScriptAst, statementCall } from "@ubean/vue/vite";
|
|
3
3
|
import { resolvePageKind } from "@ubean/vue";
|
|
4
4
|
import { isAbsolute, relative } from "pathe";
|
|
5
|
-
|
|
5
|
+
// src/macros.ts
|
|
6
6
|
/**
|
|
7
7
|
* 宏剥除(`definePage` 等编译期宏从产物中移除)。
|
|
8
8
|
*
|
|
@@ -126,8 +126,7 @@ function transformVueMacros(code) {
|
|
|
126
126
|
for (const edit of [...edits].sort((a, b) => b.start - a.start)) result = result.slice(0, edit.start) + edit.text + result.slice(edit.end);
|
|
127
127
|
return result;
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
//#region src/virtual-modules.ts
|
|
129
|
+
// src/virtual-modules.ts
|
|
131
130
|
function toVitePath(p) {
|
|
132
131
|
return p.replace(/\\/g, "/");
|
|
133
132
|
}
|
|
@@ -376,5 +375,4 @@ if (import.meta.hot) {
|
|
|
376
375
|
`;
|
|
377
376
|
});
|
|
378
377
|
}
|
|
379
|
-
//#endregion
|
|
380
378
|
export { createRoutingVirtualModule as a, createPagesVirtualModule as i, createLocalesVirtualModule as n, stripMacros as o, createMetaVirtualModule as r, transformMacros as s, createAppVirtualModule as t };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/virtual-registry.d.ts
|
|
2
1
|
interface VirtualModuleContext {
|
|
3
2
|
resolveId(id: string): string | undefined;
|
|
4
3
|
load(id: string): string | undefined;
|
|
@@ -49,5 +48,4 @@ declare function useVirtualRegistry(): VirtualModuleRegistry;
|
|
|
49
48
|
declare function resetVirtualRegistry(): void;
|
|
50
49
|
declare function defineVirtualModule(id: string, loader: () => string | Promise<string>): VirtualModule;
|
|
51
50
|
declare function defineVirtualModulePrefix(prefix: string, loader: (id: string) => string | Promise<string>): VirtualModule;
|
|
52
|
-
//#endregion
|
|
53
51
|
export { VirtualModuleTransform as a, defineVirtualModulePrefix as c, VirtualModuleResolver as i, resetVirtualRegistry as l, VirtualModuleContext as n, createVirtualRegistry as o, VirtualModuleRegistry as r, defineVirtualModule as s, VirtualModule as t, useVirtualRegistry as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as ssrSingletonProdOptimizeExclude, g as createVirtualRegistry, o as ssrSingletonProdSsr, x as __exportAll } from "./ssr-singleton-
|
|
2
|
-
import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, r as createMetaVirtualModule, s as transformMacros, t as createAppVirtualModule } from "./virtual-modules-
|
|
3
|
-
import { a as generateOpenApiTypes, i as generateTypes } from "./codegen-
|
|
4
|
-
import { _ as sendWebResponse, a as createServerEntryVirtualModule, d as ensureDevApp, i as createClientEntryVirtualModule, n as ubeanVite, o as createVueAppEntryVirtualModule, r as composeHeadScripts, s as createVuePagesVirtualModule, v as toWebRequest, x as getDevScanCoordinator } from "./vue-
|
|
1
|
+
import { a as ssrSingletonProdOptimizeExclude, g as createVirtualRegistry, o as ssrSingletonProdSsr, x as __exportAll } from "./ssr-singleton-CD6tSMIE.js";
|
|
2
|
+
import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, r as createMetaVirtualModule, s as transformMacros, t as createAppVirtualModule } from "./virtual-modules-Cy1CnBzY.js";
|
|
3
|
+
import { a as generateOpenApiTypes, i as generateTypes } from "./codegen-D9q6Yu0z.js";
|
|
4
|
+
import { _ as sendWebResponse, a as createServerEntryVirtualModule, d as ensureDevApp, i as createClientEntryVirtualModule, n as ubeanVite, o as createVueAppEntryVirtualModule, r as composeHeadScripts, s as createVuePagesVirtualModule, v as toWebRequest, x as getDevScanCoordinator } from "./vue-BSQATqn6.js";
|
|
5
5
|
import { createStaticSsgRenderer } from "./static-render.js";
|
|
6
6
|
import { prerender, resolvePrerenderStaticDir } from "./prerender.js";
|
|
7
7
|
import { resolvePageKind } from "@ubean/vue";
|
|
@@ -22,7 +22,7 @@ import { ubeanIslandsPlugin } from "@ubean/islands/vite";
|
|
|
22
22
|
import { findUserViteConfig } from "@ubean/shared/node";
|
|
23
23
|
import { dirname as dirname$1, extname, join as join$1, normalize as normalize$1, relative as relative$1, resolve as resolve$1, sep } from "node:path";
|
|
24
24
|
import { pathToFileURL } from "node:url";
|
|
25
|
-
|
|
25
|
+
// src/i18n-config.ts
|
|
26
26
|
function serializeI18nConfig(config) {
|
|
27
27
|
return JSON.stringify(config);
|
|
28
28
|
}
|
|
@@ -35,8 +35,7 @@ function localeVueParamFromI18n(config) {
|
|
|
35
35
|
paths: localePathsOf(config)
|
|
36
36
|
}) || void 0;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
//#region src/page-glob.ts
|
|
38
|
+
// src/page-glob.ts
|
|
40
39
|
/**
|
|
41
40
|
* 页面 glob 的扩展名集合。
|
|
42
41
|
*
|
|
@@ -64,8 +63,7 @@ function pageGlobExtensions(extensions, markdownExts = []) {
|
|
|
64
63
|
for (const ext of markdownExts) all.add(ext);
|
|
65
64
|
return [...all].join(",");
|
|
66
65
|
}
|
|
67
|
-
|
|
68
|
-
//#region src/ssg-entry.ts
|
|
66
|
+
// src/ssg-entry.ts
|
|
69
67
|
/**
|
|
70
68
|
* 生成 renderer setup 代码块(`_rendererRoutes` + `_pageRenderer`)。
|
|
71
69
|
*
|
|
@@ -378,8 +376,7 @@ export async function renderStaticPage(input) {
|
|
|
378
376
|
}
|
|
379
377
|
`;
|
|
380
378
|
}
|
|
381
|
-
|
|
382
|
-
//#region src/vite/asset-manifest.ts
|
|
379
|
+
// src/vite/asset-manifest.ts
|
|
383
380
|
/**
|
|
384
381
|
* 客户端资产清单的**构建期注入**(RM-V18)。
|
|
385
382
|
*
|
|
@@ -508,8 +505,7 @@ function ubeanAssetManifestPlugin(getManifest, getServerOutDir) {
|
|
|
508
505
|
}
|
|
509
506
|
};
|
|
510
507
|
}
|
|
511
|
-
|
|
512
|
-
//#region src/vite/cloudflare-preview.ts
|
|
508
|
+
// src/vite/cloudflare-preview.ts
|
|
513
509
|
/**
|
|
514
510
|
* Cloudflare 产物的本地预览 runner(RM-V26)。
|
|
515
511
|
*
|
|
@@ -720,8 +716,7 @@ function isDirectory(path) {
|
|
|
720
716
|
return false;
|
|
721
717
|
}
|
|
722
718
|
}
|
|
723
|
-
|
|
724
|
-
//#region src/vite/build-steps.ts
|
|
719
|
+
// src/vite/build-steps.ts
|
|
725
720
|
/**
|
|
726
721
|
* 构建步骤的**可复用切片**(Phase 2 地基)。
|
|
727
722
|
*
|
|
@@ -875,8 +870,7 @@ async function writeBuildManifest(options) {
|
|
|
875
870
|
}
|
|
876
871
|
return manifest;
|
|
877
872
|
}
|
|
878
|
-
|
|
879
|
-
//#region src/vite/build-configs.ts
|
|
873
|
+
// src/vite/build-configs.ts
|
|
880
874
|
var build_configs_exports = /* @__PURE__ */ __exportAll({
|
|
881
875
|
CLIENT_VIRTUAL_EXCLUDE: () => CLIENT_VIRTUAL_EXCLUDE,
|
|
882
876
|
clientOptimizeDepsExclude: () => clientOptimizeDepsExclude,
|
|
@@ -1013,8 +1007,7 @@ function createBuildEnvironments(input) {
|
|
|
1013
1007
|
}
|
|
1014
1008
|
};
|
|
1015
1009
|
}
|
|
1016
|
-
|
|
1017
|
-
//#region src/vite/openapi-step.ts
|
|
1010
|
+
// src/vite/openapi-step.ts
|
|
1018
1011
|
/**
|
|
1019
1012
|
* 构建期生成 `.ubean/openapi.d.ts`(OpenAPI → TypeScript 类型)。
|
|
1020
1013
|
*
|
|
@@ -1089,8 +1082,7 @@ async function runOpenApiTypesStep(options) {
|
|
|
1089
1082
|
} catch {}
|
|
1090
1083
|
}
|
|
1091
1084
|
}
|
|
1092
|
-
|
|
1093
|
-
//#region src/vite/prerender-step.ts
|
|
1085
|
+
// src/vite/prerender-step.ts
|
|
1094
1086
|
/**
|
|
1095
1087
|
* 预渲染步骤(RM-V21 的最后一环)。
|
|
1096
1088
|
*
|
|
@@ -1242,8 +1234,7 @@ async function runPrerenderStep(options) {
|
|
|
1242
1234
|
logger$3.warn(`Search index generation skipped: ${err instanceof Error ? err.message : String(err)}`);
|
|
1243
1235
|
}
|
|
1244
1236
|
}
|
|
1245
|
-
|
|
1246
|
-
//#region src/vite/build-app.ts
|
|
1237
|
+
// src/vite/build-app.ts
|
|
1247
1238
|
/**
|
|
1248
1239
|
* environment 驱动的生产构建(RM-V16 / RM-V21,ADR-0012 §4)。
|
|
1249
1240
|
*
|
|
@@ -1473,8 +1464,7 @@ async function runEnvOrchestration(options) {
|
|
|
1473
1464
|
})).buildApp();
|
|
1474
1465
|
return manifest;
|
|
1475
1466
|
}
|
|
1476
|
-
|
|
1477
|
-
//#region src/production.ts
|
|
1467
|
+
// src/production.ts
|
|
1478
1468
|
function toVitePath(p) {
|
|
1479
1469
|
return p.replace(/\\/g, "/");
|
|
1480
1470
|
}
|
|
@@ -1951,8 +1941,7 @@ export default {
|
|
|
1951
1941
|
};
|
|
1952
1942
|
`.trim();
|
|
1953
1943
|
}
|
|
1954
|
-
|
|
1955
|
-
//#region src/vite/preview.ts
|
|
1944
|
+
// src/vite/preview.ts
|
|
1956
1945
|
/**
|
|
1957
1946
|
* `vite preview` 接管(RM-V24,对齐 `nitro:src/build/vite/preview.ts`)。
|
|
1958
1947
|
*
|
|
@@ -2188,8 +2177,7 @@ function ubeanPreviewPlugin(options) {
|
|
|
2188
2177
|
}
|
|
2189
2178
|
};
|
|
2190
2179
|
}
|
|
2191
|
-
|
|
2192
|
-
//#region src/vite/shims/index.ts
|
|
2180
|
+
// src/vite/shims/index.ts
|
|
2193
2181
|
/**
|
|
2194
2182
|
* worker 目标下的 Node 内建桩(构建期重写为**虚拟模块**)。
|
|
2195
2183
|
*
|
|
@@ -2282,8 +2270,7 @@ function loadWorkerNodeStub(id) {
|
|
|
2282
2270
|
return STUB_SOURCES[id.slice(17)];
|
|
2283
2271
|
}
|
|
2284
2272
|
Object.freeze(Object.keys(STUB_SOURCES));
|
|
2285
|
-
|
|
2286
|
-
//#region src/dev/dev-worker.ts
|
|
2273
|
+
// src/dev/dev-worker.ts
|
|
2287
2274
|
/**
|
|
2288
2275
|
* dev worker 入口(RM-V09,ADR-0012 §3)。
|
|
2289
2276
|
*
|
|
@@ -2404,8 +2391,7 @@ function candidateFileKeys(file) {
|
|
|
2404
2391
|
} catch {}
|
|
2405
2392
|
return [...new Set(keys)];
|
|
2406
2393
|
}
|
|
2407
|
-
|
|
2408
|
-
//#region src/dev/dev-environment.ts
|
|
2394
|
+
// src/dev/dev-environment.ts
|
|
2409
2395
|
/**
|
|
2410
2396
|
* `UbeanDevEnvironment`(RM-V08,ADR-0012 §3)。
|
|
2411
2397
|
*
|
|
@@ -2519,8 +2505,7 @@ var UbeanDevEnvironment = class extends DevEnvironment {
|
|
|
2519
2505
|
function createUbeanDevEnvironmentFactory(runner) {
|
|
2520
2506
|
return (name, config, context) => new UbeanDevEnvironment(name, config, context, runner);
|
|
2521
2507
|
}
|
|
2522
|
-
|
|
2523
|
-
//#region src/vite.ts
|
|
2508
|
+
// src/vite.ts
|
|
2524
2509
|
const logger = getLogger("build");
|
|
2525
2510
|
const VIRTUAL_MODULES = [
|
|
2526
2511
|
"ubean:routes",
|
|
@@ -2569,7 +2554,7 @@ async function buildEnvironmentsForConfig(config) {
|
|
|
2569
2554
|
Promise.resolve().then(() => build_configs_exports),
|
|
2570
2555
|
import("./production.js"),
|
|
2571
2556
|
import("@ubean/preset"),
|
|
2572
|
-
import("./ssr-singleton-
|
|
2557
|
+
import("./ssr-singleton-CD6tSMIE.js").then((n) => n.s)
|
|
2573
2558
|
]);
|
|
2574
2559
|
registerBuiltinPresets();
|
|
2575
2560
|
const outDirs = getBuildOutDirsForConfig(config);
|
|
@@ -2987,5 +2972,4 @@ async function maybeGenerateRouteFiles(config, scanResult) {
|
|
|
2987
2972
|
routing.onGenerated(files);
|
|
2988
2973
|
}
|
|
2989
2974
|
}
|
|
2990
|
-
//#endregion
|
|
2991
2975
|
export { getPresetBuildConfig as C, createCloudflarePreviewRunner as D, MINIFLARE_INSTALL_HINT as E, defaultLoadMiniflare as O, generateVirtualModulesToDisk as S, buildWithEnvironments as T, ubeanPreviewPlugin as _, createEnvRunnerTransport as a, generateNodeServerEntry as b, getDevWorkerEntrySource as c, attachPreviewMiddleware as d, createPreviewMiddleware as f, sendPreviewStatus as g, sendPreviewFile as h, bridgeEnvRunnerInvokes as i, readCompatibilityDate as k, invalidateDevWorkerModules as l, resolvePreviewFile as m, UBEAN_DEV_ENV_NAME as n, createUbeanDevEnvironmentFactory as o, previewMimeType as p, UbeanDevEnvironment as r, DEV_WORKER_FILE as s, ubeanPlugin as t, writeDevWorkerEntry as u, createIslandsSsrStubPlugin as v, serializePagesForEntry as w, generateStandardHandlerEntry as x, generateCloudflareWorkerEntry as y };
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { i as VirtualModuleResolver, o as createVirtualRegistry, r as VirtualModuleRegistry } from "./virtual-registry-
|
|
1
|
+
import { i as VirtualModuleResolver, o as createVirtualRegistry, r as VirtualModuleRegistry } from "./virtual-registry-CKfuFd5w.js";
|
|
2
2
|
import { ResolvedConfig } from "@ubean/config";
|
|
3
3
|
import { ScanResult, ScannedLayout, ScannedPageRoute } from "@ubean/scan";
|
|
4
4
|
import { UbeanApp } from "@ubean/app";
|
|
5
5
|
import { Connect, DevEnvironment, DevEnvironmentContext, HotChannel, Logger, Plugin, ResolvedConfig as ResolvedConfig$1, ViteDevServer } from "vite";
|
|
6
6
|
import { PageRenderer, PageRenderer as PageRenderer$1 } from "@ubean/pages";
|
|
7
7
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
8
|
-
//#region src/dev/dev-worker.d.ts
|
|
9
8
|
/** 生成到 `.ubean/` 下的文件名。 */
|
|
10
9
|
export declare const DEV_WORKER_FILE = "dev-worker.mjs";
|
|
11
10
|
interface DevWorkerEntryOptions {
|
|
@@ -59,8 +58,6 @@ export declare function invalidateDevWorkerModules(environment: {
|
|
|
59
58
|
}, runner: {
|
|
60
59
|
sendMessage(message: unknown): void;
|
|
61
60
|
}, files: readonly string[]): DevWorkerInvalidation;
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/dev/dev-environment.d.ts
|
|
64
61
|
/**
|
|
65
62
|
* env-runner runner 在本模块用到的最小面。
|
|
66
63
|
*
|
|
@@ -105,8 +102,6 @@ export declare class UbeanDevEnvironment extends DevEnvironment {
|
|
|
105
102
|
* 全仓没有 `createEnvironment` 的注册点,原因见文件头「当前状态」)。
|
|
106
103
|
*/
|
|
107
104
|
export declare function createUbeanDevEnvironmentFactory(runner: EnvRunnerLike): (name: string, config: ResolvedConfig$1, context: DevEnvironmentContext) => UbeanDevEnvironment;
|
|
108
|
-
//#endregion
|
|
109
|
-
//#region src/dev/dev-request-router.d.ts
|
|
110
105
|
/**
|
|
111
106
|
* DevTools 相关、**必须交给 Vite** 的命名空间前缀(devframe hub 外壳 + ubean DevTools SPA)。
|
|
112
107
|
*
|
|
@@ -240,8 +235,6 @@ export declare function createUbeanRequestHandlers(server: ViteDevServer, option
|
|
|
240
235
|
* 未匹配请求正好落到我们的 post 中间件。
|
|
241
236
|
*/
|
|
242
237
|
export declare function ubeanDevRequestPlugin(options: DevRequestRouterOptions): Plugin;
|
|
243
|
-
//#endregion
|
|
244
|
-
//#region src/dev/node-web.d.ts
|
|
245
238
|
/**
|
|
246
239
|
* `node:http` 请求 → Web `Request`。
|
|
247
240
|
*
|
|
@@ -251,8 +244,6 @@ export declare function ubeanDevRequestPlugin(options: DevRequestRouterOptions):
|
|
|
251
244
|
export declare function toWebRequest(req: IncomingMessage, host: string, protocol: string): Promise<Request>;
|
|
252
245
|
/** Web `Response` → `node:http` 响应:写入状态与头,再流式转发 body(不整体缓冲)。 */
|
|
253
246
|
export declare function sendWebResponse(res: ServerResponse, webRes: Response): Promise<void>;
|
|
254
|
-
//#endregion
|
|
255
|
-
//#region src/vite/cloudflare-preview.d.ts
|
|
256
247
|
/** miniflare 实例的最小面(只声明用到的部分,避免把可选依赖的类型带进公共类型)。 */
|
|
257
248
|
interface MiniflareInstanceLike {
|
|
258
249
|
ready: Promise<unknown>;
|
|
@@ -309,8 +300,6 @@ export declare function defaultLoadMiniflare(): Promise<MiniflareConstructorLike
|
|
|
309
300
|
export declare function createCloudflarePreviewRunner(options: CloudflarePreviewOptions): Promise<CloudflarePreviewResult>;
|
|
310
301
|
/** 从 wrangler.toml 里取兼容性日期(preset 生成的文件就是它的产物契约)。 */
|
|
311
302
|
export declare function readCompatibilityDate(wranglerToml: string): string | undefined;
|
|
312
|
-
//#endregion
|
|
313
|
-
//#region src/vite/preview.d.ts
|
|
314
303
|
/** 静态文件的 MIME 推断(CLI 的静态服务器与本插件共用)。 */
|
|
315
304
|
export declare function previewMimeType(filePath: string): string;
|
|
316
305
|
/**
|
|
@@ -388,8 +377,6 @@ export declare function attachPreviewMiddleware(server: PreviewMiddlewareHost, c
|
|
|
388
377
|
* 「不走 `ubeanPlugin()`」的场景。
|
|
389
378
|
*/
|
|
390
379
|
export declare function ubeanPreviewPlugin(options?: UbeanPreviewPluginOptions): Plugin;
|
|
391
|
-
//#endregion
|
|
392
|
-
//#region src/dev/dev-ssr-routes.d.ts
|
|
393
380
|
/** 扫描器方言 `**:slug`(catch-all)→ vue-router 的 `:slug(.*)*`。 */
|
|
394
381
|
export declare function toVueRouterPagePath(route: string): string;
|
|
395
382
|
interface DevSsrRedirectLocation {
|
|
@@ -442,8 +429,6 @@ interface DevSsrRoutesOptions {
|
|
|
442
429
|
* 可以用 `/404`),必须与客户端同形才能让两侧 `useRoute()` 解析出同一份 matched 结构。
|
|
443
430
|
*/
|
|
444
431
|
export declare function buildDevSsrRoutes(options: DevSsrRoutesOptions): DevSsrRoute[];
|
|
445
|
-
//#endregion
|
|
446
|
-
//#region src/dev/dev-host-app.d.ts
|
|
447
432
|
/** `@ubean/app` 的 `UbeanApp` 在本模块用到的最小面。 */
|
|
448
433
|
interface DevHostAppLike {
|
|
449
434
|
options: {
|
|
@@ -492,6 +477,12 @@ interface EnhanceDevAppOptions {
|
|
|
492
477
|
localeVueParam?: string;
|
|
493
478
|
/** `backend` 模式无页面与 SSR,跳过 pageRenderer 创建。 */
|
|
494
479
|
backend?: boolean;
|
|
480
|
+
/**
|
|
481
|
+
* SSR 是否启用(`config.ssr.enabled`)。`false` 时不创建渲染器,页面请求落到
|
|
482
|
+
* CSR 外壳 —— 与生产构建一致(`ssrEnabled` 在 `production.ts` / `build-app.ts`)。
|
|
483
|
+
* 默认 `true`,与生产侧的 `(mode === 'fullstack' && config.ssr.enabled)` 同义。
|
|
484
|
+
*/
|
|
485
|
+
ssrEnabled?: boolean;
|
|
495
486
|
/** crons 加载完后的启动钩子(CLI 传 `@ubean/server/cron` 的 `startCronScheduler`)。 */
|
|
496
487
|
startCronScheduler?: () => unknown;
|
|
497
488
|
/** 诊断用日志(默认 `console.error`,与原先行为一致)。 */
|
|
@@ -504,8 +495,6 @@ interface EnhanceDevAppOptions {
|
|
|
504
495
|
* HMR 后需要重新指向新的扫描结果与 Vite 模块图。
|
|
505
496
|
*/
|
|
506
497
|
export declare function enhanceDevApp(options: EnhanceDevAppOptions): DevHostAppLike;
|
|
507
|
-
//#endregion
|
|
508
|
-
//#region src/dev/dev-scan.d.ts
|
|
509
498
|
/** `server.watcher` 用到的最小面(测试可传假实现)。 */
|
|
510
499
|
interface DevScanSource {
|
|
511
500
|
add(target: string): void;
|
|
@@ -573,8 +562,6 @@ export declare function peekDevScanCoordinator(server: ViteDevServer): DevScanCo
|
|
|
573
562
|
* 允许在协调器建立之前订阅:`getDevScanCoordinator` 会把已登记的订阅转交给新实例。
|
|
574
563
|
*/
|
|
575
564
|
export declare function onDevScan(server: ViteDevServer, handler: DevScanSubscriber): () => void;
|
|
576
|
-
//#endregion
|
|
577
|
-
//#region src/dev/dev-app.d.ts
|
|
578
565
|
/** 本模块用到的最小 logger 面(与 Vite 的 `Logger` 兼容,便于直接传 `server.config.logger`)。 */
|
|
579
566
|
type BootstrapLogger = Pick<Logger, 'warn' | 'error' | 'info'>;
|
|
580
567
|
interface CreateDevAppOptions {
|
|
@@ -659,8 +646,6 @@ export declare function resolveDevSecurityHeaders(config: ResolvedConfig): boole
|
|
|
659
646
|
* i18n 未启用或不需要前缀时返回空串。
|
|
660
647
|
*/
|
|
661
648
|
export declare function resolveLocaleVueParam(config: ResolvedConfig): string;
|
|
662
|
-
//#endregion
|
|
663
|
-
//#region src/vite.d.ts
|
|
664
649
|
export interface UbeanPluginOptions {
|
|
665
650
|
/**
|
|
666
651
|
* 已解析的 ubean 配置。如果未提供,插件会按以下顺序获取:
|
|
@@ -676,5 +661,4 @@ export interface UbeanPluginOptions {
|
|
|
676
661
|
registry?: VirtualModuleRegistry;
|
|
677
662
|
}
|
|
678
663
|
export declare function ubeanPlugin(options?: UbeanPluginOptions): Plugin;
|
|
679
|
-
//#endregion
|
|
680
664
|
export { type BootstrapDevAppOptions, type BootstrapLogger, type CloudflarePreviewOptions, type CloudflarePreviewResult, type CloudflarePreviewRunner, type CreateDevAppOptions, type DevApp, type DevAppBootstrap, type DevAppReady, type DevAppReadyOptions, type DevHostAppLike, type DevRendererOptions, type DevRequestHandlers, type DevRequestRouterOptions, type DevScanCoordinator, type DevScanCoordinatorOptions, type DevScanSource, type DevScanSubscriber, type DevSsrRoute, type DevSsrRoutesOptions, type DevWorkerEntryOptions, type EnhanceDevAppOptions, type EnvRunnerLike, type MiniflareConstructorLike, type MiniflareInstanceLike, type PreviewFileResolution, type PreviewMiddleware, type PreviewMiddlewareHost, type UbeanPreviewMiddlewareOptions, type UbeanPreviewPluginOptions, type VirtualModuleRegistry, type VirtualModuleResolver, createVirtualRegistry };
|
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as createVirtualRegistry } from "./ssr-singleton-
|
|
2
|
-
import { A as buildDevSsrRoutes, C as peekDevScanCoordinator, D as resolveDevSecurityHeaders, E as createDevAppReady, O as resolveLocaleVueParam, S as onDevScan, T as createDevApp, _ as sendWebResponse, b as createDevScanCoordinator, c as DEVTOOLS_PASS_THROUGH_PREFIXES, d as ensureDevApp, f as getDevApp, g as ubeanDevRequestPlugin, h as isViteResourceRequest, j as toVueRouterPagePath, k as enhanceDevApp, l as collectDevCssLinks, m as isFrameworkHtmlPage, p as injectStylesheetLinks, u as createUbeanRequestHandlers, v as toWebRequest, w as bootstrapDevApp, x as getDevScanCoordinator, y as DEV_SCAN_DIRS } from "./vue-
|
|
3
|
-
import { D as createCloudflarePreviewRunner, E as MINIFLARE_INSTALL_HINT, O as defaultLoadMiniflare, _ as ubeanPreviewPlugin, a as createEnvRunnerTransport, c as getDevWorkerEntrySource, d as attachPreviewMiddleware, f as createPreviewMiddleware, g as sendPreviewStatus, h as sendPreviewFile, i as bridgeEnvRunnerInvokes, k as readCompatibilityDate, l as invalidateDevWorkerModules, m as resolvePreviewFile, n as UBEAN_DEV_ENV_NAME, o as createUbeanDevEnvironmentFactory, p as previewMimeType, r as UbeanDevEnvironment, s as DEV_WORKER_FILE, t as ubeanPlugin, u as writeDevWorkerEntry } from "./vite-
|
|
1
|
+
import { g as createVirtualRegistry } from "./ssr-singleton-CD6tSMIE.js";
|
|
2
|
+
import { A as buildDevSsrRoutes, C as peekDevScanCoordinator, D as resolveDevSecurityHeaders, E as createDevAppReady, O as resolveLocaleVueParam, S as onDevScan, T as createDevApp, _ as sendWebResponse, b as createDevScanCoordinator, c as DEVTOOLS_PASS_THROUGH_PREFIXES, d as ensureDevApp, f as getDevApp, g as ubeanDevRequestPlugin, h as isViteResourceRequest, j as toVueRouterPagePath, k as enhanceDevApp, l as collectDevCssLinks, m as isFrameworkHtmlPage, p as injectStylesheetLinks, u as createUbeanRequestHandlers, v as toWebRequest, w as bootstrapDevApp, x as getDevScanCoordinator, y as DEV_SCAN_DIRS } from "./vue-BSQATqn6.js";
|
|
3
|
+
import { D as createCloudflarePreviewRunner, E as MINIFLARE_INSTALL_HINT, O as defaultLoadMiniflare, _ as ubeanPreviewPlugin, a as createEnvRunnerTransport, c as getDevWorkerEntrySource, d as attachPreviewMiddleware, f as createPreviewMiddleware, g as sendPreviewStatus, h as sendPreviewFile, i as bridgeEnvRunnerInvokes, k as readCompatibilityDate, l as invalidateDevWorkerModules, m as resolvePreviewFile, n as UBEAN_DEV_ENV_NAME, o as createUbeanDevEnvironmentFactory, p as previewMimeType, r as UbeanDevEnvironment, s as DEV_WORKER_FILE, t as ubeanPlugin, u as writeDevWorkerEntry } from "./vite-DQ6nL0Kv.js";
|
|
4
4
|
export { DEVTOOLS_PASS_THROUGH_PREFIXES, DEV_SCAN_DIRS, DEV_WORKER_FILE, MINIFLARE_INSTALL_HINT, UBEAN_DEV_ENV_NAME, UbeanDevEnvironment, attachPreviewMiddleware, bootstrapDevApp, bridgeEnvRunnerInvokes, buildDevSsrRoutes, collectDevCssLinks, createCloudflarePreviewRunner, createDevApp, createDevAppReady, createDevScanCoordinator, createEnvRunnerTransport, createPreviewMiddleware, createUbeanDevEnvironmentFactory, createUbeanRequestHandlers, createVirtualRegistry, defaultLoadMiniflare, enhanceDevApp, ensureDevApp, getDevApp, getDevScanCoordinator, getDevWorkerEntrySource, injectStylesheetLinks, invalidateDevWorkerModules, isFrameworkHtmlPage, isViteResourceRequest, onDevScan, peekDevScanCoordinator, previewMimeType, readCompatibilityDate, resolveDevSecurityHeaders, resolveLocaleVueParam, resolvePreviewFile, sendPreviewFile, sendPreviewStatus, sendWebResponse, toVueRouterPagePath, toWebRequest, ubeanDevRequestPlugin, ubeanPlugin, ubeanPreviewPlugin, writeDevWorkerEntry };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as defineVirtualModule, c as getComponentResolvers, g as createVirtualRegistry, i as ssrSingletonDevPolicy, l as getCssImports, u as getHeadScripts } from "./ssr-singleton-
|
|
2
|
-
import { D as resolveComponentsConfig, E as resolveAutoImportsConfig, O as toArray, S as getAutoImportPresets, f as COMPONENT_HALF_GLOBS } from "./codegen-
|
|
1
|
+
import { _ as defineVirtualModule, c as getComponentResolvers, g as createVirtualRegistry, i as ssrSingletonDevPolicy, l as getCssImports, u as getHeadScripts } from "./ssr-singleton-CD6tSMIE.js";
|
|
2
|
+
import { D as resolveComponentsConfig, E as resolveAutoImportsConfig, O as toArray, S as getAutoImportPresets, f as COMPONENT_HALF_GLOBS } from "./codegen-D9q6Yu0z.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { generatePagesModuleSource } from "@ubean/vue/vite";
|
|
5
5
|
import { NOT_FOUND_ROUTE_PATH, resolvePageKind, sortPagesForRouting } from "@ubean/vue";
|
|
@@ -18,7 +18,7 @@ import AutoImport from "unplugin-auto-import/vite";
|
|
|
18
18
|
import { ubeanMdxPlugin } from "@ubean/markdown";
|
|
19
19
|
import { renderFaviconLink } from "@ubean/pages";
|
|
20
20
|
import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";
|
|
21
|
-
|
|
21
|
+
// src/dev/dev-ssr-routes.ts
|
|
22
22
|
/**
|
|
23
23
|
* dev/SSR 路由表(RM-V11 的组成部件,从 CLI dev server 抽出)。
|
|
24
24
|
*
|
|
@@ -105,8 +105,7 @@ function buildDevSsrRoutes(options) {
|
|
|
105
105
|
}
|
|
106
106
|
return routes;
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
//#region src/dev/dev-host-app.ts
|
|
108
|
+
// src/dev/dev-host-app.ts
|
|
110
109
|
/**
|
|
111
110
|
* 把 Vite SSR 图的加载器与 SSR 渲染器接到 host app 上。
|
|
112
111
|
*
|
|
@@ -114,7 +113,7 @@ function buildDevSsrRoutes(options) {
|
|
|
114
113
|
* HMR 后需要重新指向新的扫描结果与 Vite 模块图。
|
|
115
114
|
*/
|
|
116
115
|
function enhanceDevApp(options) {
|
|
117
|
-
const { app, layouts = [], loadModule, localeVueParam, backend, startCronScheduler, onCronError } = options;
|
|
116
|
+
const { app, layouts = [], loadModule, localeVueParam, backend, ssrEnabled = true, startCronScheduler, onCronError } = options;
|
|
118
117
|
app.options.layouts = layouts;
|
|
119
118
|
const routeLoaders = {};
|
|
120
119
|
for (const route of app.options.routes || []) {
|
|
@@ -141,7 +140,7 @@ function enhanceDevApp(options) {
|
|
|
141
140
|
if (onCronError) onCronError(error);
|
|
142
141
|
else console.error("[ubean] Failed to load cron files:", error);
|
|
143
142
|
});
|
|
144
|
-
if (backend) {
|
|
143
|
+
if (backend || !ssrEnabled) {
|
|
145
144
|
app.resetInit();
|
|
146
145
|
return app;
|
|
147
146
|
}
|
|
@@ -175,8 +174,7 @@ function enhanceDevApp(options) {
|
|
|
175
174
|
});
|
|
176
175
|
return app;
|
|
177
176
|
}
|
|
178
|
-
|
|
179
|
-
//#region src/dev/dev-app.ts
|
|
177
|
+
// src/dev/dev-app.ts
|
|
180
178
|
/**
|
|
181
179
|
* 宿主 dev app 的创建与自举(RM-V11)。
|
|
182
180
|
*
|
|
@@ -344,6 +342,7 @@ async function bootstrapDevApp(options) {
|
|
|
344
342
|
createRenderer: options.createRenderer,
|
|
345
343
|
localeVueParam: resolveLocaleVueParam(options.config),
|
|
346
344
|
backend: options.config.mode === "backend",
|
|
345
|
+
ssrEnabled: options.config.ssr.enabled,
|
|
347
346
|
startCronScheduler: options.startCronScheduler,
|
|
348
347
|
onCronError: (error) => (options.logger ?? fallbackLogger).error(`[ubean] Failed to load cron files: ${String(error)}`)
|
|
349
348
|
});
|
|
@@ -402,8 +401,7 @@ function resolveLocaleVueParam(config) {
|
|
|
402
401
|
paths: localePathsOf(i18n)
|
|
403
402
|
});
|
|
404
403
|
}
|
|
405
|
-
|
|
406
|
-
//#region src/dev/dev-scan.ts
|
|
404
|
+
// src/dev/dev-scan.ts
|
|
407
405
|
/** 触发扫描的目录名(相对 `srcDir`)。并集来自 core 与 vue 两个插件此前的清单。 */
|
|
408
406
|
const DEV_SCAN_DIRS = [
|
|
409
407
|
"routes",
|
|
@@ -631,8 +629,7 @@ function onDevScan(server, handler) {
|
|
|
631
629
|
state.pending.add(handler);
|
|
632
630
|
return () => state.pending?.delete(handler);
|
|
633
631
|
}
|
|
634
|
-
|
|
635
|
-
//#region src/dev/node-web.ts
|
|
632
|
+
// src/dev/node-web.ts
|
|
636
633
|
/**
|
|
637
634
|
* `node:http` 请求 → Web `Request`。
|
|
638
635
|
*
|
|
@@ -675,8 +672,7 @@ async function sendWebResponse(res, webRes) {
|
|
|
675
672
|
}
|
|
676
673
|
res.end();
|
|
677
674
|
}
|
|
678
|
-
|
|
679
|
-
//#region src/dev/dev-request-router.ts
|
|
675
|
+
// src/dev/dev-request-router.ts
|
|
680
676
|
/**
|
|
681
677
|
* Vite 内部的 URL 前缀。这些路径与文件系统无关,交回 Vite 才能正确解析。
|
|
682
678
|
*
|
|
@@ -1147,8 +1143,7 @@ function ubeanDevRequestPlugin(options) {
|
|
|
1147
1143
|
}
|
|
1148
1144
|
};
|
|
1149
1145
|
}
|
|
1150
|
-
|
|
1151
|
-
//#region src/vue-virtual-modules.ts
|
|
1146
|
+
// src/vue-virtual-modules.ts
|
|
1152
1147
|
/**
|
|
1153
1148
|
* 页面虚拟模块(`virtual:ubean-pages`)。
|
|
1154
1149
|
*
|
|
@@ -1335,6 +1330,21 @@ export function resolveAppConfig(mode) {
|
|
|
1335
1330
|
return merged;
|
|
1336
1331
|
}
|
|
1337
1332
|
|
|
1333
|
+
/**
|
|
1334
|
+
* 容器里是否真有服务端渲染的标记。
|
|
1335
|
+
*
|
|
1336
|
+
* ssr: false 时服务端仍会下发 __UBEAN_PAGE_DATA__(客户端要靠它拿路由/参数),
|
|
1337
|
+
* 但 #app 是空的 —— 只按 initialPage 判断会走 createSSRApp 水合空容器,
|
|
1338
|
+
* Vue 报 "Attempting to hydrate existing markup but container is empty"。
|
|
1339
|
+
* CSR 外壳自带 data-ubean-ssr="false",直接用它做判据。
|
|
1340
|
+
*/
|
|
1341
|
+
function _hasSsrMarkup(rootId) {
|
|
1342
|
+
if (typeof document === 'undefined') return false;
|
|
1343
|
+
const el = document.getElementById(rootId || 'app');
|
|
1344
|
+
if (!el || el.getAttribute('data-ubean-ssr') === 'false') return false;
|
|
1345
|
+
return el.childNodes.length > 0;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1338
1348
|
export async function createApp() {
|
|
1339
1349
|
const config = resolveAppConfig('client');
|
|
1340
1350
|
const head = createClientHead();
|
|
@@ -1369,7 +1379,7 @@ export async function createApp() {
|
|
|
1369
1379
|
head,
|
|
1370
1380
|
viewTransitions: config.viewTransitions,
|
|
1371
1381
|
initialPage: initialPage || undefined,
|
|
1372
|
-
hydrate: !!initialPage,
|
|
1382
|
+
hydrate: !!initialPage && _hasSsrMarkup(config.rootId),
|
|
1373
1383
|
router: config.router,
|
|
1374
1384
|
loadingComponent,
|
|
1375
1385
|
errorComponent,
|
|
@@ -1550,8 +1560,7 @@ export function resolveServerConfig(mode) {
|
|
|
1550
1560
|
`.trim()}\n`;
|
|
1551
1561
|
});
|
|
1552
1562
|
}
|
|
1553
|
-
|
|
1554
|
-
//#region src/vue-plugin.ts
|
|
1563
|
+
// src/vue-plugin.ts
|
|
1555
1564
|
const VUE_PLUGIN_INCLUDE = [/\.vue$/, /\.md$/];
|
|
1556
1565
|
/**
|
|
1557
1566
|
* 懒加载 `@vitejs/plugin-vue-jsx`。
|
|
@@ -1914,5 +1923,4 @@ async function runPagefindIndexing(ubeanConfig, searchConfig) {
|
|
|
1914
1923
|
});
|
|
1915
1924
|
});
|
|
1916
1925
|
}
|
|
1917
|
-
//#endregion
|
|
1918
1926
|
export { buildDevSsrRoutes as A, peekDevScanCoordinator as C, resolveDevSecurityHeaders as D, createDevAppReady as E, resolveLocaleVueParam as O, onDevScan as S, createDevApp as T, sendWebResponse as _, createServerEntryVirtualModule as a, createDevScanCoordinator as b, DEVTOOLS_PASS_THROUGH_PREFIXES as c, ensureDevApp as d, getDevApp as f, ubeanDevRequestPlugin as g, isViteResourceRequest as h, createClientEntryVirtualModule as i, toVueRouterPagePath as j, enhanceDevApp as k, collectDevCssLinks as l, isFrameworkHtmlPage as m, ubeanVite as n, createVueAppEntryVirtualModule as o, injectStylesheetLinks as p, composeHeadScripts as r, createVuePagesVirtualModule as s, VUE_PLUGIN_INCLUDE as t, createUbeanRequestHandlers as u, toWebRequest as v, bootstrapDevApp as w, getDevScanCoordinator as x, DEV_SCAN_DIRS as y };
|
package/dist/vue.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { r as VirtualModuleRegistry, t as VirtualModule } from "./virtual-registry-
|
|
1
|
+
import { r as VirtualModuleRegistry, t as VirtualModule } from "./virtual-registry-CKfuFd5w.js";
|
|
2
2
|
import { ResolvedConfig } from "@ubean/config";
|
|
3
3
|
import { ScannedAppEntry, ScannedLayout, ScannedPageRoute, ScannedServerEntry } from "@ubean/scan";
|
|
4
4
|
import { Plugin } from "vite";
|
|
5
|
-
//#region src/vue-plugin.d.ts
|
|
6
5
|
interface UbeanViteOptions {
|
|
7
6
|
config: ResolvedConfig;
|
|
8
7
|
ssr?: boolean;
|
|
@@ -22,8 +21,6 @@ interface UbeanViteOptions {
|
|
|
22
21
|
}
|
|
23
22
|
export declare const VUE_PLUGIN_INCLUDE: RegExp[];
|
|
24
23
|
export declare function ubeanVite(options: UbeanViteOptions): Plugin[];
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/vue-virtual-modules.d.ts
|
|
27
24
|
/**
|
|
28
25
|
* 页面虚拟模块(`virtual:ubean-pages`)。
|
|
29
26
|
*
|
|
@@ -48,5 +45,4 @@ export declare function createVueAppEntryVirtualModule(appEntry?: ScannedAppEntr
|
|
|
48
45
|
export declare function composeHeadScripts(colorModeScript: string): string;
|
|
49
46
|
export declare function createClientEntryVirtualModule(): VirtualModule;
|
|
50
47
|
export declare function createServerEntryVirtualModule(serverEntry?: ScannedServerEntry): VirtualModule;
|
|
51
|
-
//#endregion
|
|
52
48
|
export { type UbeanViteOptions, ubeanVite as default };
|
package/dist/vue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as VUE_PLUGIN_INCLUDE, r as composeHeadScripts, i as createClientEntryVirtualModule, a as createServerEntryVirtualModule, o as createVueAppEntryVirtualModule, s as createVuePagesVirtualModule, n as default, n as ubeanVite } from "./vue-
|
|
1
|
+
export { t as VUE_PLUGIN_INCLUDE, r as composeHeadScripts, i as createClientEntryVirtualModule, a as createServerEntryVirtualModule, o as createVueAppEntryVirtualModule, s as createVuePagesVirtualModule, n as default, n as ubeanVite } from "./vue-BSQATqn6.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ubean/build",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "Vite plugins, production build, SSG prerender, type codegen, and Server Actions plugin for ubean",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -49,19 +49,19 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@intlify/unplugin-vue-i18n": "11.2.7",
|
|
52
|
-
"@ubean/app": "0.7.
|
|
53
|
-
"@ubean/client": "0.7.
|
|
54
|
-
"@ubean/config": "0.7.
|
|
55
|
-
"@ubean/i18n": "0.7.
|
|
56
|
-
"@ubean/islands": "0.7.
|
|
57
|
-
"@ubean/markdown": "0.7.
|
|
58
|
-
"@ubean/pages": "0.7.
|
|
59
|
-
"@ubean/preset": "0.7.
|
|
60
|
-
"@ubean/routes": "0.7.
|
|
61
|
-
"@ubean/scan": "0.7.
|
|
62
|
-
"@ubean/server": "0.7.
|
|
63
|
-
"@ubean/shared": "0.7.
|
|
64
|
-
"@ubean/vue": "0.7.
|
|
52
|
+
"@ubean/app": "0.7.5",
|
|
53
|
+
"@ubean/client": "0.7.5",
|
|
54
|
+
"@ubean/config": "0.7.5",
|
|
55
|
+
"@ubean/i18n": "0.7.5",
|
|
56
|
+
"@ubean/islands": "0.7.5",
|
|
57
|
+
"@ubean/markdown": "0.7.5",
|
|
58
|
+
"@ubean/pages": "0.7.5",
|
|
59
|
+
"@ubean/preset": "0.7.5",
|
|
60
|
+
"@ubean/routes": "0.7.5",
|
|
61
|
+
"@ubean/scan": "0.7.5",
|
|
62
|
+
"@ubean/server": "0.7.5",
|
|
63
|
+
"@ubean/shared": "0.7.5",
|
|
64
|
+
"@ubean/vue": "0.7.5",
|
|
65
65
|
"@vitejs/plugin-vue": "^6.0.10",
|
|
66
66
|
"@vitejs/plugin-vue-jsx": "^5.1.6",
|
|
67
67
|
"openapi-typescript": "^7.13.0",
|
|
@@ -78,11 +78,11 @@
|
|
|
78
78
|
"@vue/compiler-sfc": "^3.5.44",
|
|
79
79
|
"hono": "4.13.13",
|
|
80
80
|
"typescript": "npm:typescript-native-bridge@latest",
|
|
81
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@1.
|
|
82
|
-
"vite-plus": "1.
|
|
81
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
|
|
82
|
+
"vite-plus": "1.4.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@1.
|
|
85
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@1.4.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependenciesMeta": {
|
|
88
88
|
"vite": {
|