@ubean/build 0.3.3 → 0.3.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.
@@ -34,6 +34,13 @@ declare const UBEAN_CLIENT_PRESET: InlinePreset;
34
34
  * Server-only symbols that come from the main `ubean` package.
35
35
  * These import the full ubean entry (which includes build tools like `vite`),
36
36
  * so they must only be used in server-side files (API routes, middleware, etc.).
37
+ *
38
+ * Note: the isomorphic data composables (`useData` / `useAsyncData` /
39
+ * `useFetch`) are intentionally NOT listed here — they are exported from
40
+ * `ubean/client` (see UBEAN_CLIENT_PRESET) and re-exported from the same
41
+ * `@ubean/pages` source. Declaring them in both presets makes
42
+ * unplugin-auto-import emit a "Duplicated imports" warning, so they live in
43
+ * the client preset only.
37
44
  */
38
45
  declare const UBEAN_SERVER_PRESET: InlinePreset;
39
46
  declare const HONO_OPENAPI_PRESET: InlinePreset;
@@ -1,2 +1,2 @@
1
- import { _ as generateImportsTransform, a as generateOpenApiTypesFromServer, b as getUbeanComponentsConfig, c as generateI18nTypes, d as HONO_OPENAPI_PRESET, f as UBEAN_CLIENT_PRESET, g as generateAutoImports, h as VUE_PRESET, i as generateOpenApiTypes, l as messagesToTsType, m as VUE_MACROS_PRESET, n as CODEGEN_FILES, o as generatePageTypes, p as UBEAN_SERVER_PRESET, r as generateTypes, s as generateRouteTypes, t as CODEGEN_CONTRACT_VERSION, u as BUILTIN_PRESETS, v as getBuiltinComposables, y as getUbeanAutoImportConfig } from "../codegen-CYk6X-Hn.js";
1
+ import { _ as generateImportsTransform, a as generateOpenApiTypesFromServer, b as getUbeanComponentsConfig, c as generateI18nTypes, d as HONO_OPENAPI_PRESET, f as UBEAN_CLIENT_PRESET, g as generateAutoImports, h as VUE_PRESET, i as generateOpenApiTypes, l as messagesToTsType, m as VUE_MACROS_PRESET, n as CODEGEN_FILES, o as generatePageTypes, p as UBEAN_SERVER_PRESET, r as generateTypes, s as generateRouteTypes, t as CODEGEN_CONTRACT_VERSION, u as BUILTIN_PRESETS, v as getBuiltinComposables, y as getUbeanAutoImportConfig } from "../codegen-C4Y0V3iD.js";
2
2
  export { BUILTIN_PRESETS, CODEGEN_CONTRACT_VERSION, CODEGEN_FILES, HONO_OPENAPI_PRESET, UBEAN_CLIENT_PRESET, UBEAN_SERVER_PRESET, VUE_MACROS_PRESET, VUE_PRESET, generateAutoImports, generateI18nTypes, generateImportsTransform, generateOpenApiTypes, generateOpenApiTypesFromServer, generatePageTypes, generateRouteTypes, generateTypes, getBuiltinComposables, getUbeanAutoImportConfig, getUbeanComponentsConfig, messagesToTsType };
@@ -107,6 +107,7 @@ const UBEAN_CLIENT_PRESET = {
107
107
  "useRouter",
108
108
  "useHead",
109
109
  "useViewTransition",
110
+ "useData",
110
111
  "useAsyncData",
111
112
  "useFetch",
112
113
  "useCacheViews",
@@ -130,14 +131,18 @@ const UBEAN_CLIENT_PRESET = {
130
131
  * Server-only symbols that come from the main `ubean` package.
131
132
  * These import the full ubean entry (which includes build tools like `vite`),
132
133
  * so they must only be used in server-side files (API routes, middleware, etc.).
134
+ *
135
+ * Note: the isomorphic data composables (`useData` / `useAsyncData` /
136
+ * `useFetch`) are intentionally NOT listed here — they are exported from
137
+ * `ubean/client` (see UBEAN_CLIENT_PRESET) and re-exported from the same
138
+ * `@ubean/pages` source. Declaring them in both presets makes
139
+ * unplugin-auto-import emit a "Duplicated imports" warning, so they live in
140
+ * the client preset only.
133
141
  */
134
142
  const UBEAN_SERVER_PRESET = {
135
143
  from: "ubean",
136
144
  imports: [
137
145
  "defineHandlerMeta",
138
- "useData",
139
- "useAsyncData",
140
- "useFetch",
141
146
  "defineAction",
142
147
  "defineServerFn",
143
148
  "invokeServerFn",
@@ -2,7 +2,7 @@ import { a as useVirtualRegistry } from "./virtual-registry-BWkaQHXN.js";
2
2
  import { a as createRoutingVirtualModule, i as createPagesVirtualModule, n as createLocalesVirtualModule, r as createMetaVirtualModule, t as createAppVirtualModule } from "./virtual-modules-D5WBA3u7.js";
3
3
  import { a as ssrSingletonProdOptimizeExclude, o as ssrSingletonProdSsr } from "./ssr-singleton-CEQi_H6-.js";
4
4
  import { n as localeVueParamFromI18n, r as serializeI18nConfig, t as ubeanPlugin } from "./vite-B3y8Qoan.js";
5
- import { a as createVueAppEntryVirtualModule, i as createServerEntryVirtualModule, n as ubeanVite, o as createVuePagesVirtualModule, r as createClientEntryVirtualModule, t as VUE_PLUGIN_INCLUDE } from "./vue-CL_djWZL.js";
5
+ import { a as createVueAppEntryVirtualModule, i as createServerEntryVirtualModule, n as ubeanVite, o as createVuePagesVirtualModule, r as createClientEntryVirtualModule, t as VUE_PLUGIN_INCLUDE } from "./vue-DtV9bO4I.js";
6
6
  import { join, relative, resolve } from "pathe";
7
7
  import { resolveModules } from "@ubean/config";
8
8
  import { build } from "vite";
@@ -133,17 +133,24 @@ async function generateVirtualModulesToDisk(cwd, config, scanResult, virtualDir,
133
133
  } : null);
134
134
  const colorModeScript = config.colorMode !== false ? getColorModeScript(resolveColorModeConfig(config.colorMode)) : "";
135
135
  const rendererImport = ssrEnabled ? `import { createVueRenderer } from 'ubean/vue-ssr';` : "";
136
+ const prodLocaleVueParam = localeVueParamFromI18n(config.i18n) || "";
136
137
  const rendererSetup = ssrEnabled ? `
137
138
  // --- SSR renderer setup ---
138
139
  const _defaultLayout = _layouts.find(l => l.isDefault)?.name || null;
139
140
 
141
+ // Same i18n locale param as the client virtual:ubean-pages route table, so
142
+ // language-prefixed URLs (e.g. /zh/playground) match the real page on SSR too.
143
+ const _localeVueParam = ${JSON.stringify(prodLocaleVueParam)};
144
+
140
145
  const _rendererRoutes = _pages.map(p => {
141
146
  // For reuse routes, load the target page's module (the .reuse.ts file
142
147
  // only contains definePage metadata, not a Vue component).
143
148
  const _targetPage = p.isReuse && p.reuseTarget ? _pages.find(tp => tp.name === p.reuseTarget) : undefined;
144
149
  const _loaderKey = _targetPage?.relativePath || p.relativePath;
145
150
  return {
146
- path: p.route.replace(/\\*\\*:(\\w[\\w-]*)/g, ':$1(.*)*'),
151
+ path: _localeVueParam
152
+ ? toVueRouterLocalePath(p.route.replace(/\\*\\*:(\\w[\\w-]*)/g, ':$1(.*)*'), _localeVueParam)
153
+ : p.route.replace(/\\*\\*:(\\w[\\w-]*)/g, ':$1(.*)*'),
147
154
  name: p.name,
148
155
  component: async () => {
149
156
  const loader = pageLoaders[_loaderKey];
@@ -196,6 +203,7 @@ ${contentEntries.map(([name, docs]) => `registerContent(${JSON.stringify(name)},
196
203
  if (hasServer) {
197
204
  const serverEntry = `// Auto-generated server entry
198
205
  import { createUbeanApp, applyServerConfig } from 'ubean/runtime/app';
206
+ import { toVueRouterLocalePath } from '@ubean/i18n';
199
207
  import 'ubean:locales';
200
208
  ${rendererImport}
201
209
  import { resolveAppConfig as _resolveAppConfig } from 'virtual:ubean-app';
@@ -1,6 +1,6 @@
1
1
  import { a as useVirtualRegistry, n as defineVirtualModule } from "./virtual-registry-BWkaQHXN.js";
2
2
  import { c as getCssImports, i as ssrSingletonDevPolicy, s as getComponentResolvers } from "./ssr-singleton-CEQi_H6-.js";
3
- import { f as UBEAN_CLIENT_PRESET, p as UBEAN_SERVER_PRESET } from "./codegen-CYk6X-Hn.js";
3
+ import { f as UBEAN_CLIENT_PRESET, p as UBEAN_SERVER_PRESET } from "./codegen-C4Y0V3iD.js";
4
4
  import { createRequire } from "node:module";
5
5
  import { join, resolve } from "pathe";
6
6
  import { scanProject } from "@ubean/scan";
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-CL_djWZL.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-DtV9bO4I.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.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Vite plugins, production build, SSG prerender, type codegen, and Server Actions plugin for ubean",
5
5
  "files": [
6
6
  "dist"
@@ -41,17 +41,17 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@intlify/unplugin-vue-i18n": "11.2.5",
44
- "@ubean/client": "0.3.3",
45
- "@ubean/config": "0.3.3",
46
- "@ubean/i18n": "0.3.3",
47
- "@ubean/islands": "0.3.3",
48
- "@ubean/markdown": "0.3.3",
49
- "@ubean/pages": "0.3.3",
50
- "@ubean/preset": "0.3.3",
51
- "@ubean/routes": "0.3.3",
52
- "@ubean/scan": "0.3.3",
53
- "@ubean/shared": "0.3.3",
54
- "@ubean/vue": "0.3.3",
44
+ "@ubean/client": "0.3.5",
45
+ "@ubean/config": "0.3.5",
46
+ "@ubean/i18n": "0.3.5",
47
+ "@ubean/islands": "0.3.5",
48
+ "@ubean/markdown": "0.3.5",
49
+ "@ubean/pages": "0.3.5",
50
+ "@ubean/preset": "0.3.5",
51
+ "@ubean/routes": "0.3.5",
52
+ "@ubean/scan": "0.3.5",
53
+ "@ubean/shared": "0.3.5",
54
+ "@ubean/vue": "0.3.5",
55
55
  "@vitejs/plugin-vue": "^6.0.8",
56
56
  "openapi-typescript": "^7.13.0",
57
57
  "oxc-transform": "^0.147.0",