@constela/start 1.2.25 → 1.2.27
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.
|
@@ -108,7 +108,9 @@ ${importMapJson}
|
|
|
108
108
|
themeScript = `<script>
|
|
109
109
|
(function() {
|
|
110
110
|
try {
|
|
111
|
-
var
|
|
111
|
+
var raw = localStorage.getItem('${options.themeStorageKey}');
|
|
112
|
+
var theme = raw;
|
|
113
|
+
try { theme = JSON.parse(raw); } catch (e) {}
|
|
112
114
|
if (theme === 'dark') {
|
|
113
115
|
document.documentElement.classList.add('dark');
|
|
114
116
|
} else if (theme === 'light') {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
generateHydrationScript,
|
|
3
3
|
renderPage,
|
|
4
4
|
wrapHtml
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CYMS3K6V.js";
|
|
6
6
|
|
|
7
7
|
// src/router/file-router.ts
|
|
8
8
|
import fg from "fast-glob";
|
|
@@ -2131,7 +2131,11 @@ async function createDevServer(options = {}) {
|
|
|
2131
2131
|
"monaco-editor": "/node_modules/monaco-editor/esm/vs/editor/editor.api.js"
|
|
2132
2132
|
};
|
|
2133
2133
|
const html = wrapHtml(content, hydrationScript, cssHead, {
|
|
2134
|
-
...initialTheme ? {
|
|
2134
|
+
...initialTheme ? {
|
|
2135
|
+
theme: initialTheme,
|
|
2136
|
+
defaultTheme: initialTheme,
|
|
2137
|
+
themeStorageKey: "theme"
|
|
2138
|
+
} : {},
|
|
2135
2139
|
importMap
|
|
2136
2140
|
});
|
|
2137
2141
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -23,12 +23,12 @@ import {
|
|
|
23
23
|
transformCsv,
|
|
24
24
|
transformMdx,
|
|
25
25
|
transformYaml
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-HMNS6TTL.js";
|
|
27
27
|
import {
|
|
28
28
|
generateHydrationScript,
|
|
29
29
|
renderPage,
|
|
30
30
|
wrapHtml
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-CYMS3K6V.js";
|
|
32
32
|
|
|
33
33
|
// src/build/ssg.ts
|
|
34
34
|
import { mkdir, writeFile } from "fs/promises";
|
|
@@ -317,7 +317,13 @@ function createAdapter(options) {
|
|
|
317
317
|
path: url.pathname
|
|
318
318
|
};
|
|
319
319
|
const hydrationScript = generateHydrationScript(program, void 0, routeContext);
|
|
320
|
-
const
|
|
320
|
+
const themeState = program.state?.["theme"];
|
|
321
|
+
const initialTheme = themeState?.initial;
|
|
322
|
+
const html = wrapHtml(content, hydrationScript, void 0, initialTheme ? {
|
|
323
|
+
theme: initialTheme,
|
|
324
|
+
defaultTheme: initialTheme,
|
|
325
|
+
themeStorageKey: "theme"
|
|
326
|
+
} : void 0);
|
|
321
327
|
return new Response(html, {
|
|
322
328
|
status: 200,
|
|
323
329
|
headers: { "Content-Type": "text/html; charset=utf-8" }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constela/start",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.27",
|
|
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.8.0",
|
|
47
46
|
"@constela/core": "0.8.0",
|
|
48
|
-
"@constela/
|
|
47
|
+
"@constela/compiler": "0.8.0",
|
|
48
|
+
"@constela/runtime": "0.11.0",
|
|
49
49
|
"@constela/router": "9.0.0",
|
|
50
|
-
"@constela/
|
|
50
|
+
"@constela/server": "4.1.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/mdast": "^4.0.4",
|