@ubean/build 0.1.11 → 0.1.13

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.
@@ -27,7 +27,7 @@ function toVitePath(p) {
27
27
  }
28
28
  async function generateVirtualModulesToDisk(cwd, config, scanResult, virtualDir) {
29
29
  const mode = config.mode;
30
- const ssrEnabled = mode === "fullstack" && config.ssr || mode === "ssg";
30
+ const ssrEnabled = mode === "fullstack" && config.ssr.enabled || mode === "ssg";
31
31
  const hasPages = mode !== "backend";
32
32
  const hasServer = mode !== "spa";
33
33
  await mkdir(virtualDir, { recursive: true });
@@ -59,7 +59,7 @@ async function generateVirtualModulesToDisk(cwd, config, scanResult, virtualDir)
59
59
  isDefault: l.isDefault
60
60
  })), cwd));
61
61
  registry.register(createMetaVirtualModule());
62
- registry.register(createVuePagesVirtualModule(scanResult.pages, scanResult.layouts));
62
+ registry.register(createVuePagesVirtualModule(scanResult.pages, scanResult.layouts, scanResult.notFoundPage, scanResult.loadingPage, scanResult.errorPage));
63
63
  registry.register(createVueAppEntryVirtualModule(scanResult.appEntry));
64
64
  registry.register(createClientEntryVirtualModule());
65
65
  }
@@ -112,6 +112,13 @@ async function generateVirtualModulesToDisk(cwd, config, scanResult, virtualDir)
112
112
  relativePath: l.relativePath,
113
113
  isDefault: l.isDefault
114
114
  })));
115
+ const notFoundPageJson = JSON.stringify(scanResult.notFoundPage ? {
116
+ relativePath: scanResult.notFoundPage.relativePath,
117
+ name: scanResult.notFoundPage.name,
118
+ route: scanResult.notFoundPage.route,
119
+ layout: scanResult.notFoundPage.layout,
120
+ pageMeta: scanResult.notFoundPage.pageMeta
121
+ } : null);
115
122
  const rendererImport = ssrEnabled ? `import { createVueRenderer } from 'ubean/vue-ssr';` : "";
116
123
  const rendererSetup = ssrEnabled ? `
117
124
  // --- SSR renderer setup ---
@@ -159,7 +166,7 @@ const _pageRenderer = createVueRenderer({
159
166
  resolveAppConfig: () => _resolveAppConfig('server')
160
167
  });
161
168
  ` : `
162
- // --- SSR disabled (mode=${mode}, ssr=${config.ssr}) ---
169
+ // --- SSR disabled (mode=${mode}, ssr=${config.ssr.enabled}) ---
163
170
  // pageRenderer is null; page requests fall back to a client-only HTML shell.
164
171
  const _pageRenderer = null;`;
165
172
  if (hasServer) {
@@ -217,10 +224,11 @@ const _routes = ${routesJson};
217
224
  const _middleware = ${middlewareJson};
218
225
  const _pages = ${pagesJson};
219
226
  const _layouts = ${layoutsJson};
227
+ const _notFoundPage = ${notFoundPageJson};
220
228
  ${rendererSetup}
221
229
  // --- Client asset tags from Vite manifest ---
222
230
  const __dirname = dirname(fileURLToPath(import.meta.url));
223
- let _assetTags = { css: '', preloads: '', body: '' };
231
+ let _assetTags = { css: '', preloads: '', body: '', favicon: ${JSON.stringify(config.favicon)} };
224
232
  try {
225
233
  const manifestPath = join(__dirname, '..', 'public', '.vite', 'manifest.json');
226
234
  const manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));
@@ -249,6 +257,8 @@ export async function createApp(options = {}) {
249
257
  pageAssetTags: _assetTags,
250
258
  publicDir: ${JSON.stringify(publicDir)},
251
259
  i18nConfig: ${JSON.stringify(config.i18n)},
260
+ ssrExclude: ${JSON.stringify(config.ssr?.exclude ?? [])},
261
+ notFoundPage: _notFoundPage || undefined,
252
262
  ...options
253
263
  });
254
264
 
@@ -420,10 +430,10 @@ async function buildProduction(options) {
420
430
  const outDirs = getOutDirs(cwd, config.build.outputDir);
421
431
  const srcDir = resolve(cwd, config.srcDir);
422
432
  const mode = config.mode;
423
- const ssrEnabled = mode === "fullstack" && config.ssr || mode === "ssg";
433
+ const ssrEnabled = mode === "fullstack" && config.ssr.enabled || mode === "ssg";
424
434
  const hasPages = mode !== "backend";
425
435
  const hasServer = mode !== "spa";
426
- logger.info(`Cleaning output directory... (mode=${mode}${mode === "fullstack" ? `, ssr=${config.ssr}` : ""})`);
436
+ logger.info(`Cleaning output directory... (mode=${mode}${mode === "fullstack" ? `, ssr=${config.ssr.enabled}` : ""})`);
427
437
  if (existsSync(outDirs.root)) await rm(outDirs.root, {
428
438
  recursive: true,
429
439
  force: true
package/dist/vite.js CHANGED
@@ -107,7 +107,6 @@ function ubeanPlugin(options) {
107
107
  event: "ubean:locale-update",
108
108
  data: { file }
109
109
  });
110
- else server.ws.send({ type: "full-reload" });
111
110
  }
112
111
  }
113
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubean/build",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Core Vite plugin (framework-agnostic) for ubean (ubeanPlugin, virtual modules: routes/pages/meta/app-config/locales, macros)",
5
5
  "files": [
6
6
  "dist"
@@ -28,14 +28,14 @@
28
28
  "consola": "^3.4.2",
29
29
  "oxc-transform": "^0.142.0",
30
30
  "pathe": "^2.0.3",
31
- "@ubean/config": "0.1.11",
32
- "@ubean/islands": "0.1.11",
33
- "@ubean/modules": "0.1.11",
34
- "@ubean/ssr": "0.1.11",
35
- "@ubean/preset": "0.1.11",
36
- "@ubean/routing": "0.1.11",
37
- "@ubean/vite": "0.1.11",
38
- "@ubean/utils": "0.1.11"
31
+ "@ubean/config": "0.1.13",
32
+ "@ubean/islands": "0.1.13",
33
+ "@ubean/modules": "0.1.13",
34
+ "@ubean/preset": "0.1.13",
35
+ "@ubean/ssr": "0.1.13",
36
+ "@ubean/utils": "0.1.13",
37
+ "@ubean/routing": "0.1.13",
38
+ "@ubean/vite": "0.1.13"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^26.1.2",