@constela/start 1.5.2 → 1.5.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.
@@ -2496,6 +2496,7 @@ h1 { color: #666; }
2496
2496
  import { existsSync as existsSync8, readFileSync as readFileSync5 } from "fs";
2497
2497
  import { mkdir as mkdir2, writeFile, cp, readdir } from "fs/promises";
2498
2498
  import { join as join9, dirname as dirname5, relative as relative3, basename as basename4, isAbsolute as isAbsolute3, resolve as resolve4 } from "path";
2499
+ import { isCookieInitialExpr as isCookieInitialExpr3 } from "@constela/core";
2499
2500
 
2500
2501
  // src/build/bundler.ts
2501
2502
  import * as esbuild from "esbuild";
@@ -3092,9 +3093,17 @@ async function renderPageToHtml(program, params, runtimePath, cssPath, externalI
3092
3093
  wrapOptions.importMap = externalImports;
3093
3094
  }
3094
3095
  const themeState = program.state?.["theme"];
3095
- if (themeState?.initial) {
3096
- wrapOptions.defaultTheme = themeState.initial;
3097
- wrapOptions.themeStorageKey = "theme";
3096
+ if (themeState) {
3097
+ let defaultTheme;
3098
+ if (isCookieInitialExpr3(themeState.initial)) {
3099
+ defaultTheme = themeState.initial.default;
3100
+ } else if (typeof themeState.initial === "string") {
3101
+ defaultTheme = themeState.initial;
3102
+ }
3103
+ if (defaultTheme) {
3104
+ wrapOptions.defaultTheme = defaultTheme;
3105
+ wrapOptions.themeStorageKey = "theme";
3106
+ }
3098
3107
  }
3099
3108
  return wrapHtml(
3100
3109
  content,
package/dist/cli/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  hyperlink,
5
5
  loadConfig,
6
6
  resolveConfig
7
- } from "../chunk-2QR63VOH.js";
7
+ } from "../chunk-FKQKP2UH.js";
8
8
  import "../chunk-PG3Y4EJN.js";
9
9
 
10
10
  // src/cli/index.ts
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  transformCsv,
29
29
  transformMdx,
30
30
  transformYaml
31
- } from "./chunk-2QR63VOH.js";
31
+ } from "./chunk-FKQKP2UH.js";
32
32
  import {
33
33
  evaluateMetaExpression,
34
34
  generateHydrationScript,
@@ -40,6 +40,7 @@ import {
40
40
  // src/build/ssg.ts
41
41
  import { mkdir, writeFile } from "fs/promises";
42
42
  import { join, dirname } from "path";
43
+ import { isCookieInitialExpr } from "@constela/core";
43
44
  var defaultProgram = {
44
45
  version: "1.0",
45
46
  state: {},
@@ -106,9 +107,17 @@ async function generateSinglePage(pattern, outDir, program, params = {}) {
106
107
  });
107
108
  const wrapOptions = {};
108
109
  const themeState = program.state?.["theme"];
109
- if (themeState?.initial) {
110
- wrapOptions.defaultTheme = themeState.initial;
111
- wrapOptions.themeStorageKey = "theme";
110
+ if (themeState) {
111
+ let defaultTheme;
112
+ if (isCookieInitialExpr(themeState.initial)) {
113
+ defaultTheme = themeState.initial.default;
114
+ } else if (typeof themeState.initial === "string") {
115
+ defaultTheme = themeState.initial;
116
+ }
117
+ if (defaultTheme) {
118
+ wrapOptions.defaultTheme = defaultTheme;
119
+ wrapOptions.themeStorageKey = "theme";
120
+ }
112
121
  }
113
122
  const html = wrapHtml(
114
123
  content,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constela/start",
3
- "version": "1.5.2",
3
+ "version": "1.5.5",
4
4
  "description": "Meta-framework for Constela applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,11 +43,11 @@
43
43
  "postcss": "^8.5.0",
44
44
  "@tailwindcss/postcss": "^4.0.0",
45
45
  "tailwindcss": "^4.0.0",
46
- "@constela/compiler": "0.11.1",
47
46
  "@constela/core": "0.12.0",
48
- "@constela/runtime": "0.15.0",
47
+ "@constela/runtime": "0.15.2",
48
+ "@constela/compiler": "0.11.1",
49
49
  "@constela/router": "13.0.0",
50
- "@constela/server": "8.0.0"
50
+ "@constela/server": "8.0.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/mdast": "^4.0.4",