@constela/start 1.5.1 → 1.5.2

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.
@@ -3,7 +3,7 @@ import {
3
3
  generateMetaTags,
4
4
  renderPage,
5
5
  wrapHtml
6
- } from "./chunk-LCCIX5MB.js";
6
+ } from "./chunk-PG3Y4EJN.js";
7
7
 
8
8
  // src/router/file-router.ts
9
9
  import fg from "fast-glob";
@@ -121,9 +121,23 @@ ${importMapJson}
121
121
  themeScript = `<script>
122
122
  (function() {
123
123
  try {
124
- var raw = localStorage.getItem('${options.themeStorageKey}');
125
- var theme = raw;
126
- try { theme = JSON.parse(raw); } catch (e) {}
124
+ var theme;
125
+ // Check cookie first (for SSR/SSG sync)
126
+ var cookies = document.cookie.split(';');
127
+ for (var i = 0; i < cookies.length; i++) {
128
+ var cookie = cookies[i].trim();
129
+ if (cookie.indexOf('${options.themeStorageKey}=') === 0) {
130
+ theme = decodeURIComponent(cookie.substring('${options.themeStorageKey}='.length));
131
+ break;
132
+ }
133
+ }
134
+ // Fallback to localStorage
135
+ if (!theme) {
136
+ var raw = localStorage.getItem('${options.themeStorageKey}');
137
+ theme = raw;
138
+ try { theme = JSON.parse(raw); } catch (e) {}
139
+ }
140
+ // Apply theme
127
141
  if (theme === 'dark') {
128
142
  document.documentElement.classList.add('dark');
129
143
  } else if (theme === 'light') {
package/dist/cli/index.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  hyperlink,
5
5
  loadConfig,
6
6
  resolveConfig
7
- } from "../chunk-W6SJTQAP.js";
8
- import "../chunk-LCCIX5MB.js";
7
+ } from "../chunk-2QR63VOH.js";
8
+ import "../chunk-PG3Y4EJN.js";
9
9
 
10
10
  // src/cli/index.ts
11
11
  import { Command } from "commander";
package/dist/index.js CHANGED
@@ -28,14 +28,14 @@ import {
28
28
  transformCsv,
29
29
  transformMdx,
30
30
  transformYaml
31
- } from "./chunk-W6SJTQAP.js";
31
+ } from "./chunk-2QR63VOH.js";
32
32
  import {
33
33
  evaluateMetaExpression,
34
34
  generateHydrationScript,
35
35
  generateMetaTags,
36
36
  renderPage,
37
37
  wrapHtml
38
- } from "./chunk-LCCIX5MB.js";
38
+ } from "./chunk-PG3Y4EJN.js";
39
39
 
40
40
  // src/build/ssg.ts
41
41
  import { mkdir, writeFile } from "fs/promises";
@@ -4,7 +4,7 @@ import {
4
4
  generateMetaTags,
5
5
  renderPage,
6
6
  wrapHtml
7
- } from "../chunk-LCCIX5MB.js";
7
+ } from "../chunk-PG3Y4EJN.js";
8
8
  export {
9
9
  evaluateMetaExpression,
10
10
  generateHydrationScript,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constela/start",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Meta-framework for Constela applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -46,8 +46,8 @@
46
46
  "@constela/compiler": "0.11.1",
47
47
  "@constela/core": "0.12.0",
48
48
  "@constela/runtime": "0.15.0",
49
- "@constela/server": "8.0.0",
50
- "@constela/router": "13.0.0"
49
+ "@constela/router": "13.0.0",
50
+ "@constela/server": "8.0.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/mdast": "^4.0.4",