@ubean/build 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/production.js +9 -1
  2. package/package.json +12 -12
@@ -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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubean/build",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
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.2",
45
- "@ubean/config": "0.3.2",
46
- "@ubean/i18n": "0.3.2",
47
- "@ubean/islands": "0.3.2",
48
- "@ubean/markdown": "0.3.2",
49
- "@ubean/pages": "0.3.2",
50
- "@ubean/preset": "0.3.2",
51
- "@ubean/routes": "0.3.2",
52
- "@ubean/scan": "0.3.2",
53
- "@ubean/shared": "0.3.2",
54
- "@ubean/vue": "0.3.2",
44
+ "@ubean/client": "0.3.4",
45
+ "@ubean/config": "0.3.4",
46
+ "@ubean/i18n": "0.3.4",
47
+ "@ubean/islands": "0.3.4",
48
+ "@ubean/markdown": "0.3.4",
49
+ "@ubean/pages": "0.3.4",
50
+ "@ubean/preset": "0.3.4",
51
+ "@ubean/routes": "0.3.4",
52
+ "@ubean/scan": "0.3.4",
53
+ "@ubean/shared": "0.3.4",
54
+ "@ubean/vue": "0.3.4",
55
55
  "@vitejs/plugin-vue": "^6.0.8",
56
56
  "openapi-typescript": "^7.13.0",
57
57
  "oxc-transform": "^0.147.0",