@ubean/cli 0.4.4 → 0.4.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.
Files changed (2) hide show
  1. package/dist/cli.js +20 -2
  2. package/package.json +12 -12
package/dist/cli.js CHANGED
@@ -10,6 +10,7 @@ import { pathToFileURL } from "node:url";
10
10
  import { generateOpenApiTypesFromServer, generateTypes } from "@ubean/build/codegen";
11
11
  import { prerender } from "@ubean/build/prerender";
12
12
  import { buildProduction } from "@ubean/build/production";
13
+ import { createStaticSsgRenderer } from "@ubean/build/static-render";
13
14
  import { NODE_REQUIREMENTS, createCapabilitySet, diagnoseCapabilities, registerBuiltinPresets, resolvePresetByName } from "@ubean/preset";
14
15
  import { scanProject } from "@ubean/scan";
15
16
  import { applyServerConfig, createUbeanApp } from "@ubean/app";
@@ -402,7 +403,22 @@ const buildCommand = {
402
403
  const hasPrerenderRules = Object.values(config.routeRules || {}).some((r) => r?.prerender === true);
403
404
  if (config.prerender.enabled || hasPrerenderRules) {
404
405
  logger$9.info("Prerendering static pages...");
405
- const fetcher = await createSsrFetcher(cwd, manifest);
406
+ let fetcher;
407
+ let notFoundRoute = false;
408
+ let expandRoutes;
409
+ if (config.mode === "ssg") {
410
+ const staticRenderer = await createStaticSsgRenderer(cwd, manifest, {
411
+ pages: result.pages,
412
+ notFoundPage: result.notFoundPage ?? null,
413
+ i18n: config.i18n
414
+ });
415
+ if (staticRenderer) {
416
+ fetcher = staticRenderer.fetcher;
417
+ expandRoutes = staticRenderer.expandRoutes;
418
+ notFoundRoute = Boolean(result.notFoundPage);
419
+ logger$9.info("Using static SSG renderer (direct render, no HTTP pipeline)");
420
+ }
421
+ } else fetcher = await createSsrFetcher(cwd, manifest);
406
422
  await prerender({
407
423
  cwd,
408
424
  outputDir: config.build.outputDir,
@@ -410,7 +426,9 @@ const buildCommand = {
410
426
  prerender: config.prerender,
411
427
  routeRules: config.routeRules,
412
428
  contentRoutes,
413
- fetcher
429
+ fetcher,
430
+ notFoundRoute,
431
+ expandRoutes
414
432
  });
415
433
  }
416
434
  if (config.mode === "ssg" && !process.env.UBEAN_KEEP_SSR) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubean/cli",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "CLI for ubean (ubean-next binary: dev, build, prepare, init, preview, page, env, config, devtools, api/layout/middleware/cron/plugin scaffolds) plus the Vite dev server runner",
5
5
  "bin": {
6
6
  "ubean-next": "./bin/ubean-next.mjs"
@@ -24,15 +24,15 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@ubean/app": "0.4.4",
28
- "@ubean/build": "0.4.4",
29
- "@ubean/client": "0.4.4",
30
- "@ubean/config": "0.4.4",
31
- "@ubean/i18n": "0.4.4",
32
- "@ubean/islands": "0.4.4",
33
- "@ubean/preset": "0.4.4",
34
- "@ubean/scan": "0.4.4",
35
- "@ubean/shared": "0.4.4",
27
+ "@ubean/app": "0.4.5",
28
+ "@ubean/build": "0.4.5",
29
+ "@ubean/client": "0.4.5",
30
+ "@ubean/config": "0.4.5",
31
+ "@ubean/i18n": "0.4.5",
32
+ "@ubean/islands": "0.4.5",
33
+ "@ubean/preset": "0.4.5",
34
+ "@ubean/scan": "0.4.5",
35
+ "@ubean/shared": "0.4.5",
36
36
  "citty": "^0.2.2",
37
37
  "kolorist": "^1.8.0",
38
38
  "pathe": "^2.0.3"
@@ -45,8 +45,8 @@
45
45
  "vite-plus": "0.3.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "@ubean/content": "0.4.4",
49
- "@ubean/devtools": "0.4.4",
48
+ "@ubean/content": "0.4.5",
49
+ "@ubean/devtools": "0.4.5",
50
50
  "@vitejs/plugin-vue": "^6.0.8",
51
51
  "vite": "npm:@voidzero-dev/vite-plus-core@0.3.0"
52
52
  },