@docubook/flame 2.0.0-beta.0 → 2.0.0-beta.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.
Files changed (54) hide show
  1. package/.docu/components/ScrollTo.tsx +17 -11
  2. package/.docu/components/Toc.tsx +32 -7
  3. package/.docu/lib/build.deno.js +6 -9
  4. package/.docu/lib/build.deno.js.map +1 -0
  5. package/.docu/lib/build.impl-BJsi28mD.js +377 -0
  6. package/.docu/lib/build.impl-BJsi28mD.js.map +1 -0
  7. package/.docu/lib/build.impl-yVLaa1eQ.js +2 -0
  8. package/.docu/lib/build.node.js +6 -9
  9. package/.docu/lib/build.node.js.map +1 -0
  10. package/.docu/lib/clean.js +25 -25
  11. package/.docu/lib/clean.js.map +1 -0
  12. package/.docu/lib/deno-DmEaKggj.js +20 -0
  13. package/.docu/lib/deno-DmEaKggj.js.map +1 -0
  14. package/.docu/lib/deploy.deno.js +9 -9
  15. package/.docu/lib/deploy.deno.js.map +1 -0
  16. package/.docu/lib/deploy.node.js +8 -8
  17. package/.docu/lib/deploy.node.js.map +1 -0
  18. package/.docu/lib/deploy.shared-D3UWafa6.js +295 -0
  19. package/.docu/lib/deploy.shared-D3UWafa6.js.map +1 -0
  20. package/.docu/lib/html.shared-DSn-7_6t.js +2467 -0
  21. package/.docu/lib/html.shared-DSn-7_6t.js.map +1 -0
  22. package/.docu/lib/logger-CycvLCrQ.js +312 -0
  23. package/.docu/lib/logger-CycvLCrQ.js.map +1 -0
  24. package/.docu/lib/node-DPTySdwG.js +80 -0
  25. package/.docu/lib/node-DPTySdwG.js.map +1 -0
  26. package/.docu/lib/paths-BtOIPBQ9.js +52 -0
  27. package/.docu/lib/paths-BtOIPBQ9.js.map +1 -0
  28. package/.docu/lib/preview.deno.js +7 -11
  29. package/.docu/lib/preview.deno.js.map +1 -0
  30. package/.docu/lib/preview.impl-CXJS2tQS.js +77 -0
  31. package/.docu/lib/preview.impl-CXJS2tQS.js.map +1 -0
  32. package/.docu/lib/preview.node.js +7 -11
  33. package/.docu/lib/preview.node.js.map +1 -0
  34. package/.docu/lib/server.deno.js +7 -12
  35. package/.docu/lib/server.deno.js.map +1 -0
  36. package/.docu/lib/server.impl-CJuWimfN.js +358 -0
  37. package/.docu/lib/server.impl-CJuWimfN.js.map +1 -0
  38. package/.docu/lib/server.node.js +7 -12
  39. package/.docu/lib/server.node.js.map +1 -0
  40. package/.docu/lib/utils-DA17MyQG.js +167 -0
  41. package/.docu/lib/utils-DA17MyQG.js.map +1 -0
  42. package/.docu/node/hydrate.node.ts +116 -166
  43. package/bin/compile-lib.mjs +30 -28
  44. package/package.json +6 -6
  45. package/.docu/lib/build.impl-S4DS5XPH.js +0 -12
  46. package/.docu/lib/chunk-4IQXHHPF.js +0 -62
  47. package/.docu/lib/chunk-C3RCUTUE.js +0 -470
  48. package/.docu/lib/chunk-D3QTSBR4.js +0 -434
  49. package/.docu/lib/chunk-EOK6KATZ.js +0 -191
  50. package/.docu/lib/chunk-IVM5UM44.js +0 -301
  51. package/.docu/lib/chunk-JMQI3FKV.js +0 -92
  52. package/.docu/lib/chunk-LXJLSXQI.js +0 -2691
  53. package/.docu/lib/chunk-O326MYJE.js +0 -330
  54. package/.docu/lib/chunk-UISOJ4RW.js +0 -114
@@ -0,0 +1,312 @@
1
+ import { d as loadDocuConfig } from "./paths-BtOIPBQ9.js";
2
+ var package_default = {
3
+ name: "@docubook/flame",
4
+ version: "2.0.0-beta.2",
5
+ description: "A blazing-fast React + MDX framework powered by Bun, built for modern documentation experiences.",
6
+ type: "module",
7
+ bin: { "flame": "./bin/cli.js" },
8
+ files: [
9
+ "bin",
10
+ "template",
11
+ "docu.schema.json",
12
+ ".docu",
13
+ "!.docu/__tests__",
14
+ "!.docu/dist",
15
+ "!.docu/build-cache.json",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
19
+ publishConfig: {
20
+ "registry": "https://registry.npmjs.org/",
21
+ "access": "public"
22
+ },
23
+ engines: {
24
+ "node": ">=20.11",
25
+ "bun": ">=1.1.0"
26
+ },
27
+ scripts: {
28
+ "dev": "bun .docu/node/server.ts",
29
+ "build": "NODE_ENV=production bun .docu/node/build.ts",
30
+ "clean": "bun .docu/node/clean.ts",
31
+ "preview": "bun .docu/node/preview.ts",
32
+ "deploy": "bun .docu/node/deploy.ts",
33
+ "compile:lib": "node bin/compile-lib.mjs",
34
+ "test": "vitest run",
35
+ "lint": "eslint .",
36
+ "prepublishOnly": "bun .docu/node/clean.ts && eslint . && vitest run && node bin/compile-lib.mjs"
37
+ },
38
+ keywords: [
39
+ "docubook",
40
+ "documentation",
41
+ "static-site",
42
+ "daisyui",
43
+ "bun",
44
+ "docs framework",
45
+ "react",
46
+ "react-dom"
47
+ ],
48
+ homepage: "https://github.com/DocuBook/docubook/tree/main/packages/flame",
49
+ repository: {
50
+ "type": "git",
51
+ "url": "git+https://github.com/DocuBook/docubook.git",
52
+ "directory": "packages/flame"
53
+ },
54
+ author: "wildan.nrs",
55
+ "author-url": "https://wildan.dev",
56
+ license: "MIT",
57
+ dependencies: {
58
+ "@docubook/core": "workspace:^",
59
+ "@docubook/markdown": "workspace:^",
60
+ "@docubook/themes-colors": "workspace:^",
61
+ "@docubook/ui-react": "workspace:^",
62
+ "@mdx-js/react": "^3.0.1",
63
+ "@tailwindcss/cli": "4.3.0",
64
+ "@tailwindcss/typography": "0.5.16",
65
+ "bun-plugin-tailwind": "^0.1.2",
66
+ "daisyui": "^5.5.19",
67
+ "vite": "^8.2.1",
68
+ "lucide-react": "^1.14.0",
69
+ "react": "^19.2.7",
70
+ "react-dom": "^19.2.7",
71
+ "unified": "^11.0.0",
72
+ "zod": "^4.4.3"
73
+ },
74
+ peerDependencies: { "@sentry/bun": "^10.0.0" },
75
+ peerDependenciesMeta: { "@sentry/bun": { "optional": true } },
76
+ devDependencies: {
77
+ "@eslint/js": "^10.0.1",
78
+ "@types/node": "^22.0.0",
79
+ "@types/react": "^19.0.0",
80
+ "@types/react-dom": "^19.0.0",
81
+ "bun-types": "^1.3.0",
82
+ "eslint": "^10.3.0",
83
+ "eslint-plugin-perfectionist": "^5.9.0",
84
+ "eslint-plugin-react": "^7.37.5",
85
+ "eslint-plugin-react-hooks": "^7.1.1",
86
+ "tailwindcss": "^4.3.0",
87
+ "typescript": "^5.9.3",
88
+ "typescript-eslint": "^8.59.2"
89
+ }
90
+ };
91
+ //#endregion
92
+ //#region .docu/node/logger.ts
93
+ /**
94
+ * Interactive CLI logger with spinner and tree-style route display.
95
+ * Inspired by Next.js/Turbopack build output.
96
+ *
97
+ * Supports structured logging via environment variables:
98
+ * - LOG_LEVEL: debug | info | warn | error (default: info)
99
+ * - LOG_FORMAT: json | pretty (default: pretty)
100
+ */
101
+ var docuConfig = loadDocuConfig();
102
+ var isCI = !!(process.env.CI || process.env.NO_COLOR || !process.stdout.isTTY);
103
+ var isJSON = (process.env.LOG_FORMAT || "pretty") === "json";
104
+ var LEVELS = {
105
+ debug: 0,
106
+ info: 1,
107
+ warn: 2,
108
+ error: 3
109
+ };
110
+ var currentLevel = LEVELS[process.env.LOG_LEVEL || "info"] ?? LEVELS.info;
111
+ function shouldLog(level) {
112
+ return LEVELS[level] >= currentLevel;
113
+ }
114
+ function jsonLog(level, msg, meta) {
115
+ if (!shouldLog(level)) return;
116
+ const entry = {
117
+ ts: (/* @__PURE__ */ new Date()).toISOString(),
118
+ ...meta,
119
+ level,
120
+ msg
121
+ };
122
+ (level === "error" ? console.error : level === "warn" ? console.warn : console.log)(JSON.stringify(entry));
123
+ }
124
+ /** Returns true if the caller should skip (already handled or filtered). */
125
+ function guard(level, msg, meta) {
126
+ if (isJSON) {
127
+ jsonLog(level, msg, meta);
128
+ return true;
129
+ }
130
+ return !shouldLog(level);
131
+ }
132
+ var c = isCI || isJSON ? {
133
+ reset: "",
134
+ bold: "",
135
+ dim: "",
136
+ green: "",
137
+ cyan: "",
138
+ magenta: "",
139
+ yellow: "",
140
+ red: "",
141
+ white: "",
142
+ gray: ""
143
+ } : {
144
+ reset: "\x1B[0m",
145
+ bold: "\x1B[1m",
146
+ dim: "\x1B[2m",
147
+ green: "\x1B[32m",
148
+ cyan: "\x1B[36m",
149
+ magenta: "\x1B[35m",
150
+ yellow: "\x1B[33m",
151
+ red: "\x1B[31m",
152
+ white: "\x1B[37m",
153
+ gray: "\x1B[90m"
154
+ };
155
+ var SPINNER_FRAMES = [
156
+ "⠋",
157
+ "⠙",
158
+ "⠹",
159
+ "⠸",
160
+ "⠼",
161
+ "⠴",
162
+ "⠦",
163
+ "⠧",
164
+ "⠇",
165
+ "⠏"
166
+ ];
167
+ var Spinner = class {
168
+ frame = 0;
169
+ message = "";
170
+ timer = null;
171
+ info(finalMsg) {
172
+ if (this.timer) clearInterval(this.timer);
173
+ this.timer = null;
174
+ if (isCI) console.log(`ℹ ${finalMsg}`);
175
+ else {
176
+ process.stdout.write(`\r\x1b[K${c.cyan}ℹ${c.reset} ${finalMsg}\n`);
177
+ process.stdout.write("\x1B[?25h");
178
+ }
179
+ }
180
+ start(msg) {
181
+ this.message = msg;
182
+ if (isCI) {
183
+ console.log(`… ${msg}`);
184
+ return;
185
+ }
186
+ this.frame = 0;
187
+ process.stdout.write("\x1B[?25l");
188
+ this.render();
189
+ this.timer = setInterval(() => this.render(), 80);
190
+ }
191
+ stop(finalMsg) {
192
+ if (this.timer) clearInterval(this.timer);
193
+ this.timer = null;
194
+ if (isCI) {
195
+ console.log(`✓ ${finalMsg}`);
196
+ return;
197
+ }
198
+ process.stdout.write(`\r\x1b[K${c.green}✓${c.reset} ${finalMsg}\n`);
199
+ process.stdout.write("\x1B[?25h");
200
+ }
201
+ render() {
202
+ const f = SPINNER_FRAMES[this.frame % SPINNER_FRAMES.length];
203
+ process.stdout.write(`\r${c.cyan}${f}${c.reset} ${this.message}`);
204
+ this.frame++;
205
+ }
206
+ };
207
+ var MAX_ROUTE_LINES = 5;
208
+ var routeLineCount = 0;
209
+ var routeTruncated = false;
210
+ function printRouteTree(routes, prefix = "", isRoot = true) {
211
+ for (let i = 0; i < routes.length; i++) {
212
+ if (routeTruncated) return;
213
+ if (routeLineCount >= MAX_ROUTE_LINES) {
214
+ routeTruncated = true;
215
+ process.stdout.write(`${prefix}${c.dim}...${c.reset}\n`);
216
+ return;
217
+ }
218
+ const route = routes[i];
219
+ const last = i === routes.length - 1;
220
+ const connector = isRoot ? "" : last ? "└── " : "├── ";
221
+ const childPrefix = isRoot ? "" : last ? " " : "│ ";
222
+ const path = route.noLink ? `${c.dim}${route.href}${c.reset}` : `${c.white}${route.href}${c.reset}`;
223
+ const label = route.noLink ? `${c.gray}(group)${c.reset}` : "";
224
+ process.stdout.write(`${prefix}${connector}${path} ${label}\n`);
225
+ routeLineCount++;
226
+ if (route.items?.length) printRouteTree(route.items, prefix + childPrefix, false);
227
+ }
228
+ }
229
+ var logger = {
230
+ spinner: new Spinner(),
231
+ buildStart() {
232
+ if (guard("info", "build_start", {
233
+ package: "@docubook/flame",
234
+ version: package_default.version
235
+ })) return;
236
+ console.log(`\n${c.bold}${c.cyan} 🔥 DocuBook Flame${c.reset} ${c.dim}v${package_default.version}${c.reset}\n`);
237
+ },
238
+ bundleStart() {
239
+ if (guard("info", "bundle_start")) return;
240
+ this.spinner.start("Building client bundle...");
241
+ },
242
+ bundleDone(ms) {
243
+ if (guard("info", "bundle_done", { duration_ms: ms })) return;
244
+ this.spinner.stop(`Client bundle compiled ${c.dim}(${ms}ms)${c.reset}`);
245
+ },
246
+ indexStart() {
247
+ if (guard("info", "index_start")) return;
248
+ this.spinner.start("Generating search index...");
249
+ },
250
+ indexDone(records, ms, skipped = false) {
251
+ if (guard("info", "index_done", {
252
+ records,
253
+ duration_ms: ms,
254
+ skipped
255
+ })) return;
256
+ this.spinner.stop(skipped ? `Search index cached ${c.dim}(${ms}ms)${c.reset}` : `Search index generated ${c.dim}(${records} records, ${ms}ms)${c.reset}`);
257
+ },
258
+ routes() {
259
+ if (guard("debug", "routes")) return;
260
+ const routes = docuConfig.routes;
261
+ if (!routes?.length) return;
262
+ console.log(`\n${c.bold} Routes${c.reset} ${c.dim}(${countRoutes(routes)} pages)${c.reset}\n`);
263
+ routeLineCount = 0;
264
+ routeTruncated = false;
265
+ printRouteTree(routes, " ");
266
+ },
267
+ ready(port, hmr = false) {
268
+ if (guard("info", "server_ready", {
269
+ port,
270
+ hmr
271
+ })) return;
272
+ console.log(`\n${c.green}${c.bold} ✓ Ready${c.reset} in ${c.bold}http://localhost:${port}/docs/${c.reset}`);
273
+ if (hmr) console.log(`${c.dim} HMR enabled — watching docs/ for changes${c.reset}`);
274
+ console.log("");
275
+ },
276
+ request(method, pathname, status, duration_ms) {
277
+ if (guard("info", "http_request", {
278
+ method,
279
+ path: pathname,
280
+ status,
281
+ duration_ms
282
+ })) return;
283
+ const color = status >= 500 ? c.red : status >= 400 ? c.gray : c.green;
284
+ const ts = (/* @__PURE__ */ new Date()).toLocaleTimeString();
285
+ const dur = duration_ms != null ? ` ${c.dim}${duration_ms}ms${c.reset}` : "";
286
+ console.log(`${c.dim} ${ts}${c.reset} ${method} ${pathname} ${color}${status}${c.reset}${dur}`);
287
+ },
288
+ debug(msg, meta) {
289
+ if (guard("debug", msg, meta)) return;
290
+ console.log(`${c.gray} [debug] ${msg}${c.reset}`);
291
+ },
292
+ warn(msg, meta) {
293
+ if (guard("warn", msg, meta)) return;
294
+ console.warn(`${c.yellow} ⚠ ${msg}${c.reset}`);
295
+ },
296
+ error(msg, meta) {
297
+ if (guard("error", msg, meta)) return;
298
+ console.error(`${c.red} ✖ ${msg}${c.reset}`);
299
+ }
300
+ };
301
+ function countRoutes(routes) {
302
+ let count = 0;
303
+ for (const r of routes) {
304
+ if (!r.noLink) count++;
305
+ if (r.items) count += countRoutes(r.items);
306
+ }
307
+ return count;
308
+ }
309
+ //#endregion
310
+ export { logger as t };
311
+
312
+ //# sourceMappingURL=logger-CycvLCrQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger-CycvLCrQ.js","names":[],"sources":["../../package.json","../node/logger.ts"],"sourcesContent":["{\n \"name\": \"@docubook/flame\",\n \"version\": \"2.0.0-beta.2\",\n \"description\": \"A blazing-fast React + MDX framework powered by Bun, built for modern documentation experiences.\",\n \"type\": \"module\",\n \"bin\": {\n \"flame\": \"./bin/cli.js\"\n },\n \"files\": [\n \"bin\",\n \"template\",\n \"docu.schema.json\",\n \".docu\",\n \"!.docu/__tests__\",\n \"!.docu/dist\",\n \"!.docu/build-cache.json\",\n \"README.md\",\n \"LICENSE\"\n ],\n \"publishConfig\": {\n \"registry\": \"https://registry.npmjs.org/\",\n \"access\": \"public\"\n },\n \"engines\": {\n \"node\": \">=20.11\",\n \"bun\": \">=1.1.0\"\n },\n \"scripts\": {\n \"dev\": \"bun .docu/node/server.ts\",\n \"build\": \"NODE_ENV=production bun .docu/node/build.ts\",\n \"clean\": \"bun .docu/node/clean.ts\",\n \"preview\": \"bun .docu/node/preview.ts\",\n \"deploy\": \"bun .docu/node/deploy.ts\",\n \"compile:lib\": \"node bin/compile-lib.mjs\",\n \"test\": \"vitest run\",\n \"lint\": \"eslint .\",\n \"prepublishOnly\": \"bun .docu/node/clean.ts && eslint . && vitest run && node bin/compile-lib.mjs\"\n },\n \"keywords\": [\n \"docubook\",\n \"documentation\",\n \"static-site\",\n \"daisyui\",\n \"bun\",\n \"docs framework\",\n \"react\",\n \"react-dom\"\n ],\n \"homepage\": \"https://github.com/DocuBook/docubook/tree/main/packages/flame\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/DocuBook/docubook.git\",\n \"directory\": \"packages/flame\"\n },\n \"author\": \"wildan.nrs\",\n \"author-url\": \"https://wildan.dev\",\n \"license\": \"MIT\",\n \"dependencies\": {\n \"@docubook/core\": \"workspace:^\",\n \"@docubook/markdown\": \"workspace:^\",\n \"@docubook/themes-colors\": \"workspace:^\",\n \"@docubook/ui-react\": \"workspace:^\",\n \"@mdx-js/react\": \"^3.0.1\",\n \"@tailwindcss/cli\": \"4.3.0\",\n \"@tailwindcss/typography\": \"0.5.16\",\n \"bun-plugin-tailwind\": \"^0.1.2\",\n \"daisyui\": \"^5.5.19\",\n \"vite\": \"^8.2.1\",\n \"lucide-react\": \"^1.14.0\",\n \"react\": \"^19.2.7\",\n \"react-dom\": \"^19.2.7\",\n \"unified\": \"^11.0.0\",\n \"zod\": \"^4.4.3\"\n },\n \"peerDependencies\": {\n \"@sentry/bun\": \"^10.0.0\"\n },\n \"peerDependenciesMeta\": {\n \"@sentry/bun\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^10.0.1\",\n \"@types/node\": \"^22.0.0\",\n \"@types/react\": \"^19.0.0\",\n \"@types/react-dom\": \"^19.0.0\",\n \"bun-types\": \"^1.3.0\",\n \"eslint\": \"^10.3.0\",\n \"eslint-plugin-perfectionist\": \"^5.9.0\",\n \"eslint-plugin-react\": \"^7.37.5\",\n \"eslint-plugin-react-hooks\": \"^7.1.1\",\n \"tailwindcss\": \"^4.3.0\",\n \"typescript\": \"^5.9.3\",\n \"typescript-eslint\": \"^8.59.2\"\n }\n}\n","/**\n * Interactive CLI logger with spinner and tree-style route display.\n * Inspired by Next.js/Turbopack build output.\n *\n * Supports structured logging via environment variables:\n * - LOG_LEVEL: debug | info | warn | error (default: info)\n * - LOG_FORMAT: json | pretty (default: pretty)\n */\n\nimport { loadDocuConfig } from \"./paths\";\nimport pkg from \"../../package.json\" with { type: \"json\" };\n\nconst docuConfig = loadDocuConfig();\nconst isCI = !!(process.env.CI || process.env.NO_COLOR || !process.stdout.isTTY);\nconst LOG_FORMAT = process.env.LOG_FORMAT || \"pretty\";\nconst isJSON = LOG_FORMAT === \"json\";\n\ntype LogLevel = \"debug\" | \"info\" | \"warn\" | \"error\";\nconst LEVELS: Record<LogLevel, number> = { debug: 0, info: 1, warn: 2, error: 3 };\nconst currentLevel = LEVELS[(process.env.LOG_LEVEL as LogLevel) || \"info\"] ?? LEVELS.info;\n\nfunction shouldLog(level: LogLevel): boolean {\n return LEVELS[level] >= currentLevel;\n}\n\nfunction jsonLog(level: LogLevel, msg: string, meta?: Record<string, unknown>) {\n if (!shouldLog(level)) return;\n const entry = { ts: new Date().toISOString(), ...meta, level, msg };\n const out = level === \"error\" ? console.error : level === \"warn\" ? console.warn : console.log;\n out(JSON.stringify(entry));\n}\n\n/** Returns true if the caller should skip (already handled or filtered). */\nfunction guard(level: LogLevel, msg: string, meta?: Record<string, unknown>): boolean {\n if (isJSON) {\n jsonLog(level, msg, meta);\n return true;\n }\n return !shouldLog(level);\n}\n\nconst c =\n isCI || isJSON\n ? {\n reset: \"\",\n bold: \"\",\n dim: \"\",\n green: \"\",\n cyan: \"\",\n magenta: \"\",\n yellow: \"\",\n red: \"\",\n white: \"\",\n gray: \"\",\n }\n : {\n reset: \"\\x1b[0m\",\n bold: \"\\x1b[1m\",\n dim: \"\\x1b[2m\",\n green: \"\\x1b[32m\",\n cyan: \"\\x1b[36m\",\n magenta: \"\\x1b[35m\",\n yellow: \"\\x1b[33m\",\n red: \"\\x1b[31m\",\n white: \"\\x1b[37m\",\n gray: \"\\x1b[90m\",\n };\n\nconst SPINNER_FRAMES = [\"⠋\", \"⠙\", \"⠹\", \"⠸\", \"⠼\", \"⠴\", \"⠦\", \"⠧\", \"⠇\", \"⠏\"];\n\nclass Spinner {\n private frame = 0;\n private message = \"\";\n private timer: ReturnType<typeof setInterval> | null = null;\n\n info(finalMsg: string) {\n if (this.timer) clearInterval(this.timer);\n this.timer = null;\n if (isCI) {\n console.log(`ℹ ${finalMsg}`);\n } else {\n process.stdout.write(`\\r\\x1b[K${c.cyan}ℹ${c.reset} ${finalMsg}\\n`);\n process.stdout.write(\"\\x1b[?25h\");\n }\n }\n\n start(msg: string) {\n this.message = msg;\n if (isCI) {\n console.log(`… ${msg}`);\n return;\n }\n this.frame = 0;\n process.stdout.write(\"\\x1b[?25l\");\n this.render();\n this.timer = setInterval(() => this.render(), 80);\n }\n\n stop(finalMsg: string) {\n if (this.timer) clearInterval(this.timer);\n this.timer = null;\n if (isCI) {\n console.log(`✓ ${finalMsg}`);\n return;\n }\n process.stdout.write(`\\r\\x1b[K${c.green}✓${c.reset} ${finalMsg}\\n`);\n process.stdout.write(\"\\x1b[?25h\");\n }\n\n private render() {\n const f = SPINNER_FRAMES[this.frame % SPINNER_FRAMES.length];\n process.stdout.write(`\\r${c.cyan}${f}${c.reset} ${this.message}`);\n this.frame++;\n }\n}\n\ninterface RouteItem {\n title: string;\n href: string;\n noLink?: boolean;\n items?: RouteItem[];\n}\n\nconst MAX_ROUTE_LINES = 5;\nlet routeLineCount = 0;\nlet routeTruncated = false;\n\nfunction printRouteTree(routes: RouteItem[], prefix = \"\", isRoot = true) {\n for (let i = 0; i < routes.length; i++) {\n if (routeTruncated) return;\n if (routeLineCount >= MAX_ROUTE_LINES) {\n routeTruncated = true;\n process.stdout.write(`${prefix}${c.dim}...${c.reset}\\n`);\n return;\n }\n\n const route = routes[i];\n const last = i === routes.length - 1;\n const connector = isRoot ? \"\" : last ? \"└── \" : \"├── \";\n const childPrefix = isRoot ? \"\" : last ? \" \" : \"│ \";\n\n const path = route.noLink\n ? `${c.dim}${route.href}${c.reset}`\n : `${c.white}${route.href}${c.reset}`;\n\n const label = route.noLink ? `${c.gray}(group)${c.reset}` : \"\";\n\n process.stdout.write(`${prefix}${connector}${path} ${label}\\n`);\n routeLineCount++;\n\n if (route.items?.length) {\n printRouteTree(route.items, prefix + childPrefix, false);\n }\n }\n}\n\nexport const logger = {\n spinner: new Spinner(),\n\n buildStart() {\n if (guard(\"info\", \"build_start\", { package: \"@docubook/flame\", version: pkg.version })) return;\n console.log(\n `\\n${c.bold}${c.cyan} 🔥 DocuBook Flame${c.reset} ${c.dim}v${pkg.version}${c.reset}\\n`\n );\n },\n\n bundleStart() {\n if (guard(\"info\", \"bundle_start\")) return;\n this.spinner.start(\"Building client bundle...\");\n },\n\n bundleDone(ms: number) {\n if (guard(\"info\", \"bundle_done\", { duration_ms: ms })) return;\n this.spinner.stop(`Client bundle compiled ${c.dim}(${ms}ms)${c.reset}`);\n },\n\n indexStart() {\n if (guard(\"info\", \"index_start\")) return;\n this.spinner.start(\"Generating search index...\");\n },\n\n indexDone(records: number, ms: number, skipped = false) {\n if (guard(\"info\", \"index_done\", { records, duration_ms: ms, skipped })) return;\n this.spinner.stop(\n skipped\n ? `Search index cached ${c.dim}(${ms}ms)${c.reset}`\n : `Search index generated ${c.dim}(${records} records, ${ms}ms)${c.reset}`\n );\n },\n\n routes() {\n if (guard(\"debug\", \"routes\")) return;\n const routes = docuConfig.routes as RouteItem[] | undefined;\n if (!routes?.length) return;\n\n console.log(`\\n${c.bold} Routes${c.reset} ${c.dim}(${countRoutes(routes)} pages)${c.reset}\\n`);\n routeLineCount = 0;\n routeTruncated = false;\n printRouteTree(routes, \" \");\n },\n\n ready(port: number, hmr = false) {\n if (guard(\"info\", \"server_ready\", { port, hmr })) return;\n console.log(\n `\\n${c.green}${c.bold} ✓ Ready${c.reset} in ${c.bold}http://localhost:${port}/docs/${c.reset}`\n );\n if (hmr) console.log(`${c.dim} HMR enabled — watching docs/ for changes${c.reset}`);\n console.log(\"\");\n },\n\n request(method: string, pathname: string, status: number, duration_ms?: number) {\n if (guard(\"info\", \"http_request\", { method, path: pathname, status, duration_ms })) return;\n const color = status >= 500 ? c.red : status >= 400 ? c.gray : c.green;\n const ts = new Date().toLocaleTimeString();\n const dur = duration_ms != null ? ` ${c.dim}${duration_ms}ms${c.reset}` : \"\";\n console.log(\n `${c.dim} ${ts}${c.reset} ${method} ${pathname} ${color}${status}${c.reset}${dur}`\n );\n },\n\n debug(msg: string, meta?: Record<string, unknown>) {\n if (guard(\"debug\", msg, meta)) return;\n console.log(`${c.gray} [debug] ${msg}${c.reset}`);\n },\n\n warn(msg: string, meta?: Record<string, unknown>) {\n if (guard(\"warn\", msg, meta)) return;\n console.warn(`${c.yellow} ⚠ ${msg}${c.reset}`);\n },\n\n error(msg: string, meta?: Record<string, unknown>) {\n if (guard(\"error\", msg, meta)) return;\n console.error(`${c.red} ✖ ${msg}${c.reset}`);\n },\n};\n\nfunction countRoutes(routes: RouteItem[]): number {\n let count = 0;\n for (const r of routes) {\n if (!r.noLink) count++;\n if (r.items) count += countRoutes(r.items);\n }\n return count;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACYA,IAAM,aAAa,eAAe;AAClC,IAAM,OAAO,CAAC,EAAE,QAAQ,IAAI,MAAM,QAAQ,IAAI,YAAY,CAAC,QAAQ,OAAO;AAE1E,IAAM,UADa,QAAQ,IAAI,cAAc,cACf;AAG9B,IAAM,SAAmC;CAAE,OAAO;CAAG,MAAM;CAAG,MAAM;CAAG,OAAO;AAAE;AAChF,IAAM,eAAe,OAAQ,QAAQ,IAAI,aAA0B,WAAW,OAAO;AAErF,SAAS,UAAU,OAA0B;CAC3C,OAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,QAAQ,OAAiB,KAAa,MAAgC;CAC7E,IAAI,CAAC,UAAU,KAAK,GAAG;CACvB,MAAM,QAAQ;EAAE,qBAAI,IAAI,KAAK,EAAA,CAAE,YAAY;EAAG,GAAG;EAAM;EAAO;CAAI;CAElE,CADY,UAAU,UAAU,QAAQ,QAAQ,UAAU,SAAS,QAAQ,OAAO,QAAQ,IAAA,CACtF,KAAK,UAAU,KAAK,CAAC;AAC3B;;AAGA,SAAS,MAAM,OAAiB,KAAa,MAAyC;CACpF,IAAI,QAAQ;EACV,QAAQ,OAAO,KAAK,IAAI;EACxB,OAAO;CACT;CACA,OAAO,CAAC,UAAU,KAAK;AACzB;AAEA,IAAM,IACJ,QAAQ,SACJ;CACE,OAAO;CACP,MAAM;CACN,KAAK;CACL,OAAO;CACP,MAAM;CACN,SAAS;CACT,QAAQ;CACR,KAAK;CACL,OAAO;CACP,MAAM;AACR,IACA;CACE,OAAO;CACP,MAAM;CACN,KAAK;CACL,OAAO;CACP,M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N,GAAG,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,SAAS,EAAE,QAAQ,KAChF;CACF;CAEA,MAAM,KAAa,MAAgC;EACjD,IAAI,MAAM,SAAS,KAAK,IAAI,GAAG;EAC/B,QAAQ,IAAI,GAAG,EAAE,KAAK,YAAY,MAAM,EAAE,OAAO;CACnD;CAEA,KAAK,KAAa,MAAgC;EAChD,IAAI,MAAM,QAAQ,KAAK,IAAI,GAAG;EAC9B,QAAQ,KAAK,GAAG,EAAE,OAAO,MAAM,MAAM,EAAE,OAAO;CAChD;CAEA,MAAM,KAAa,MAAgC;EACjD,IAAI,MAAM,SAAS,KAAK,IAAI,GAAG;EAC/B,QAAQ,MAAM,GAAG,EAAE,IAAI,MAAM,MAAM,EAAE,OAAO;CAC9C;AACF;AAEA,SAAS,YAAY,QAA6B;CAChD,IAAI,QAAQ;CACZ,KAAK,MAAM,KAAK,QAAQ;EACtB,IAAI,CAAC,EAAE,QAAQ;EACf,IAAI,EAAE,OAAO,SAAS,YAAY,EAAE,KAAK;CAC3C;CACA,OAAO;AACT"}
@@ -0,0 +1,80 @@
1
+ import { createServer } from "node:http";
2
+ //#region .docu/node/runtime/node.ts
3
+ function toWebRequest(req, port, hostname) {
4
+ const url = `http://${req.headers.host ?? `${hostname}:${port}`}${req.url ?? "/"}`;
5
+ const headers = new Headers();
6
+ for (const [key, value] of Object.entries(req.headers)) {
7
+ if (value === void 0) continue;
8
+ if (Array.isArray(value)) for (const v of value) headers.append(key, v);
9
+ else headers.set(key, value);
10
+ }
11
+ const method = req.method ?? "GET";
12
+ const hasBody = method !== "GET" && method !== "HEAD";
13
+ return new Request(url, {
14
+ method,
15
+ headers,
16
+ body: hasBody ? req : void 0,
17
+ duplex: hasBody ? "half" : void 0
18
+ });
19
+ }
20
+ async function writeResponse(response, res) {
21
+ const headers = {};
22
+ const setCookie = response.headers.getSetCookie?.() ?? [];
23
+ response.headers.forEach((value, key) => {
24
+ if (key === "set-cookie") return;
25
+ headers[key] = value;
26
+ });
27
+ if (setCookie.length > 0) headers["set-cookie"] = setCookie;
28
+ res.writeHead(response.status, headers);
29
+ if (!response.body) {
30
+ res.end();
31
+ return;
32
+ }
33
+ const reader = response.body.getReader();
34
+ try {
35
+ for (;;) {
36
+ const { done, value } = await reader.read();
37
+ if (done) break;
38
+ if (!res.write(value)) await new Promise((resolve) => res.once("drain", resolve));
39
+ }
40
+ res.end();
41
+ } catch {
42
+ await reader.cancel().catch(() => {});
43
+ res.destroy();
44
+ }
45
+ }
46
+ var nodeAdapter = {
47
+ name: "node",
48
+ serve(fetch, options) {
49
+ const hostname = options.hostname ?? "localhost";
50
+ const server = createServer((req, res) => {
51
+ Promise.resolve().then(() => fetch(toWebRequest(req, options.port, hostname))).then((response) => writeResponse(response, res)).catch((err) => {
52
+ console.error(err);
53
+ if (!res.headersSent) res.writeHead(500, { "Content-Type": "text/plain" });
54
+ res.end("Internal Server Error");
55
+ });
56
+ });
57
+ if (options.idleTimeout !== void 0) {
58
+ server.timeout = options.idleTimeout * 1e3;
59
+ server.keepAliveTimeout = options.idleTimeout * 1e3;
60
+ }
61
+ return new Promise((resolve, reject) => {
62
+ server.once("error", reject);
63
+ server.listen(options.port, () => {
64
+ const address = server.address();
65
+ resolve({
66
+ port: typeof address === "object" && address ? address.port : options.port,
67
+ hostname,
68
+ stop: () => new Promise((res2, rej2) => {
69
+ server.closeAllConnections?.();
70
+ server.close((err) => err ? rej2(err) : res2());
71
+ })
72
+ });
73
+ });
74
+ });
75
+ }
76
+ };
77
+ //#endregion
78
+ export { nodeAdapter as t };
79
+
80
+ //# sourceMappingURL=node-DPTySdwG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-DPTySdwG.js","names":[],"sources":["../node/runtime/node.ts"],"sourcesContent":["import { createServer, type IncomingMessage, type ServerResponse } from \"node:http\";\nimport type { FetchHandler, RuntimeAdapter, ServerHandle, ServerOptions } from \"./types\";\n\nfunction toWebRequest(req: IncomingMessage, port: number, hostname: string): Request {\n const host = req.headers.host ?? `${hostname}:${port}`;\n const url = `http://${host}${req.url ?? \"/\"}`;\n const headers = new Headers();\n for (const [key, value] of Object.entries(req.headers)) {\n if (value === undefined) continue;\n if (Array.isArray(value)) {\n for (const v of value) headers.append(key, v);\n } else {\n headers.set(key, value);\n }\n }\n const method = req.method ?? \"GET\";\n const hasBody = method !== \"GET\" && method !== \"HEAD\";\n return new Request(url, {\n method,\n headers,\n // IncomingMessage is an async iterable of Buffer chunks; Request accepts\n // an async iterable body when half-duplex is declared.\n body: hasBody ? (req as unknown as BodyInit) : undefined,\n // @ts-expect-error -- required by undici for streaming request bodies\n duplex: hasBody ? \"half\" : undefined,\n });\n}\n\nasync function writeResponse(response: Response, res: ServerResponse): Promise<void> {\n const headers: Record<string, string | string[]> = {};\n const setCookie = response.headers.getSetCookie?.() ?? [];\n response.headers.forEach((value, key) => {\n if (key === \"set-cookie\") return;\n headers[key] = value;\n });\n if (setCookie.length > 0) headers[\"set-cookie\"] = setCookie;\n\n // Flush headers immediately so streaming responses (SSE) reach the client\n // before the first body chunk.\n res.writeHead(response.status, headers);\n\n if (!response.body) {\n res.end();\n return;\n }\n\n const reader = response.body.getReader();\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n // Incremental piping — never buffer the full body (SSE streams forever).\n const ok = res.write(value);\n if (!ok) await new Promise<void>((resolve) => res.once(\"drain\", resolve));\n }\n res.end();\n } catch {\n // Client disconnected mid-stream; cancel the source.\n await reader.cancel().catch(() => {});\n res.destroy();\n }\n}\n\nexport const nodeAdapter: RuntimeAdapter = {\n name: \"node\",\n\n serve(fetch: FetchHandler, options: ServerOptions): Promise<ServerHandle> {\n const hostname = options.hostname ?? \"localhost\";\n\n const server = createServer((req, res) => {\n Promise.resolve()\n .then(() => fetch(toWebRequest(req, options.port, hostname)))\n .then((response) => writeResponse(response, res))\n .catch((err) => {\n console.error(err);\n if (!res.headersSent) {\n res.writeHead(500, { \"Content-Type\": \"text/plain\" });\n }\n res.end(\"Internal Server Error\");\n });\n });\n\n if (options.idleTimeout !== undefined) {\n server.timeout = options.idleTimeout * 1000;\n // keepAliveTimeout must not undercut idleTimeout or Node closes\n // long-lived SSE connections early.\n server.keepAliveTimeout = options.idleTimeout * 1000;\n }\n\n return new Promise((resolve, reject) => {\n server.once(\"error\", reject);\n server.listen(options.port, () => {\n const address = server.address();\n const port = typeof address === \"object\" && address ? address.port : options.port;\n resolve({\n port,\n hostname,\n stop: () =>\n new Promise<void>((res2, rej2) => {\n server.closeAllConnections?.();\n server.close((err) => (err ? rej2(err) : res2()));\n }),\n });\n });\n });\n },\n};\n"],"mappings":";;AAGA,SAAS,aAAa,KAAsB,MAAc,UAA2B;CAEnF,MAAM,MAAM,UADC,IAAI,QAAQ,QAAQ,GAAG,SAAS,GAAG,SACnB,IAAI,OAAO;CACxC,MAAM,UAAU,IAAI,QAAQ;CAC5B,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,IAAI,OAAO,GAAG;EACtD,IAAI,UAAU,KAAA,GAAW;EACzB,IAAI,MAAM,QAAQ,KAAK,GACrB,KAAK,MAAM,KAAK,OAAO,QAAQ,OAAO,KAAK,CAAC;OAE5C,QAAQ,IAAI,KAAK,KAAK;CAE1B;CACA,MAAM,SAAS,IAAI,UAAU;CAC7B,MAAM,UAAU,WAAW,SAAS,WAAW;CAC/C,OAAO,IAAI,QAAQ,KAAK;EACtB;EACA;EAGA,MAAM,UAAW,MAA8B,KAAA;EAE/C,QAAQ,UAAU,SAAS,KAAA;CAC7B,CAAC;AACH;AAEA,eAAe,cAAc,UAAoB,KAAoC;CACnF,MAAM,UAA6C,CAAC;CACpD,MAAM,YAAY,SAAS,QAAQ,eAAe,KAAK,CAAC;CACxD,SAAS,QAAQ,SAAS,OAAO,QAAQ;EACvC,IAAI,QAAQ,cAAc;EAC1B,QAAQ,OAAO;CACjB,CAAC;CACD,IAAI,UAAU,SAAS,GAAG,QAAQ,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MAChC,OAAO,sBAAsB;MAC7B,OAAO,OAAO,QAAS,MAAM,KAAK,GAAG,IAAI,KAAK,CAAE;KAClD,CAAC;IACL,CAAC;GACH,CAAC;EACH,CAAC;CACH;AACF"}
@@ -0,0 +1,52 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { join, resolve } from "node:path";
3
+ import { readdir, rm, unlink } from "node:fs/promises";
4
+ //#region .docu/node/paths.ts
5
+ /**
6
+ * FRAMEWORK_ROOT: Where the package code lives (.docu/components, .docu/pages, .docu/styles, .docu/node)
7
+ * PROJECT_ROOT: Where the user's project lives (docs/, docu.json)
8
+ */
9
+ var FRAMEWORK_ROOT = resolve(import.meta.dirname, "../..");
10
+ var PROJECT_ROOT = process.cwd();
11
+ join(FRAMEWORK_ROOT, ".docu/pages");
12
+ var STYLES_DIR = join(FRAMEWORK_ROOT, ".docu/styles");
13
+ var nodeDir = join(FRAMEWORK_ROOT, ".docu/node");
14
+ var libDir = join(FRAMEWORK_ROOT, ".docu/lib");
15
+ var LIB_DIR = existsSync(nodeDir) ? nodeDir : libDir;
16
+ var DIST_DIR = join(PROJECT_ROOT, ".docu/dist");
17
+ var ASSETS_DIR = join(DIST_DIR, "assets");
18
+ var CACHE_FILE = join(PROJECT_ROOT, ".docu/build-cache.json");
19
+ var DOCS_DIR = join(PROJECT_ROOT, "docs");
20
+ var DOCS_ASSETS_DIR = join(PROJECT_ROOT, "docs/assets");
21
+ var DOCU_CONFIG_PATH = join(PROJECT_ROOT, "docu.json");
22
+ var _config = null;
23
+ /** Clean stale client bundles from a previous build. */
24
+ async function cleanOldBundles(preserve) {
25
+ try {
26
+ const files = await readdir(ASSETS_DIR);
27
+ for (const file of files) {
28
+ if (preserve?.has(file)) continue;
29
+ if (file.startsWith("client.") || file.startsWith("client-")) await unlink(join(ASSETS_DIR, file));
30
+ }
31
+ } catch (err) {
32
+ if (err.code !== "ENOENT") console.error("Failed to clean old bundles:", err.message);
33
+ }
34
+ try {
35
+ await rm(join(ASSETS_DIR, "chunks"), {
36
+ recursive: true,
37
+ force: true
38
+ });
39
+ } catch (err) {
40
+ if (err.code !== "ENOENT") console.warn("[flame] Failed to clean chunks dir:", err.message);
41
+ }
42
+ }
43
+ function loadDocuConfig() {
44
+ if (_config) return _config;
45
+ if (!existsSync(DOCU_CONFIG_PATH)) throw new Error(`docu.json not found at ${DOCU_CONFIG_PATH}`);
46
+ _config = JSON.parse(readFileSync(DOCU_CONFIG_PATH, "utf-8"));
47
+ return _config;
48
+ }
49
+ //#endregion
50
+ export { DOCS_DIR as a, PROJECT_ROOT as c, loadDocuConfig as d, DOCS_ASSETS_DIR as i, STYLES_DIR as l, CACHE_FILE as n, FRAMEWORK_ROOT as o, DIST_DIR as r, LIB_DIR as s, ASSETS_DIR as t, cleanOldBundles as u };
51
+
52
+ //# sourceMappingURL=paths-BtOIPBQ9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths-BtOIPBQ9.js","names":[],"sources":["../node/paths.ts"],"sourcesContent":["import { resolve, join } from \"node:path\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { readdir, rm, unlink } from \"node:fs/promises\";\nimport type { DocuConfig } from \"./types\";\n\n/**\n * FRAMEWORK_ROOT: Where the package code lives (.docu/components, .docu/pages, .docu/styles, .docu/node)\n * PROJECT_ROOT: Where the user's project lives (docs/, docu.json)\n */\n\n// .docu/node/paths.ts → package root is 2 levels up\nexport const FRAMEWORK_ROOT = resolve(import.meta.dirname, \"../..\");\nexport const PROJECT_ROOT = process.cwd();\n\n// Framework paths (internal)\nexport const PAGES_DIR = join(FRAMEWORK_ROOT, \".docu/pages\");\nexport const STYLES_DIR = join(FRAMEWORK_ROOT, \".docu/styles\");\nconst nodeDir = join(FRAMEWORK_ROOT, \".docu/node\");\nconst libDir = join(FRAMEWORK_ROOT, \".docu/lib\");\nexport const LIB_DIR = existsSync(nodeDir) ? nodeDir : libDir;\n\n// Build output (user project)\nexport const DIST_DIR = join(PROJECT_ROOT, \".docu/dist\");\nexport const ASSETS_DIR = join(DIST_DIR, \"assets\");\nexport const CACHE_FILE = join(PROJECT_ROOT, \".docu/build-cache.json\");\n\n// Project paths (user content)\nexport const DOCS_DIR = join(PROJECT_ROOT, \"docs\");\nexport const DOCS_ASSETS_DIR = join(PROJECT_ROOT, \"docs/assets\");\nexport const DOCU_CONFIG_PATH = join(PROJECT_ROOT, \"docu.json\");\n\n// Config singleton\nlet _config: DocuConfig | null = null;\n\n/** Clean stale client bundles from a previous build. */\nexport async function cleanOldBundles(preserve?: Set<string>) {\n try {\n const files = await readdir(ASSETS_DIR);\n for (const file of files) {\n if (preserve?.has(file)) continue;\n if (file.startsWith(\"client.\") || file.startsWith(\"client-\")) {\n await unlink(join(ASSETS_DIR, file));\n }\n }\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") {\n console.error(\"Failed to clean old bundles:\", (err as Error).message);\n }\n }\n try {\n await rm(join(ASSETS_DIR, \"chunks\"), { recursive: true, force: true });\n } catch (err) {\n // chunks dir may not exist, or permission error — log to avoid silent failure\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") {\n console.warn(\"[flame] Failed to clean chunks dir:\", (err as Error).message);\n }\n }\n}\n\nexport function loadDocuConfig(): DocuConfig {\n if (_config) return _config;\n if (!existsSync(DOCU_CONFIG_PATH)) {\n throw new Error(`docu.json not found at ${DOCU_CONFIG_PATH}`);\n }\n _config = JSON.parse(readFileSync(DOCU_CONFIG_PATH, \"utf-8\"));\n return _config!;\n}\n"],"mappings":";;;;;;;;AAWA,IAAa,iBAAiB,QAAQ,YAAY,SAAS,OAAO;AAClE,IAAa,eAAe,QAAQ,IAAI;AAGf,KAAK,gBAAgB,aAAa;AAC3D,IAAa,aAAa,KAAK,gBAAgB,cAAc;AAC7D,IAAM,UAAU,KAAK,gBAAgB,YAAY;AACjD,IAAM,SAAS,KAAK,gBAAgB,WAAW;AAC/C,IAAa,UAAU,WAAW,OAAO,IAAI,UAAU;AAGvD,IAAa,WAAW,KAAK,cAAc,YAAY;AACvD,IAAa,aAAa,KAAK,UAAU,QAAQ;AACjD,IAAa,aAAa,KAAK,cAAc,wBAAwB;AAGrE,IAAa,WAAW,KAAK,cAAc,MAAM;AACjD,IAAa,kBAAkB,KAAK,cAAc,aAAa;AAC/D,IAAa,mBAAmB,KAAK,cAAc,WAAW;AAG9D,IAAI,UAA6B;;AAGjC,eAAsB,gBAAgB,UAAwB;CAC5D,IAAI;EACF,MAAM,QAAQ,MAAM,QAAQ,UAAU;EACtC,KAAK,MAAM,QAAQ,OAAO;GACxB,IAAI,UAAU,IAAI,IAAI,GAAG;GACzB,IAAI,KAAK,WAAW,SAAS,KAAK,KAAK,WAAW,SAAS,GACzD,MAAM,OAAO,KAAK,YAAY,IAAI,CAAC;EAEvC;CACF,SAAS,KAAK;EACZ,IAAK,IAA8B,SAAS,UAC1C,QAAQ,MAAM,gCAAiC,IAAc,OAAO;CAExE;CACA,IAAI;EACF,MAAM,GAAG,KAAK,YAAY,QAAQ,GAAG;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;CACvE,SAAS,KAAK;EAEZ,IAAK,IAA8B,SAAS,UAC1C,QAAQ,KAAK,uCAAwC,IAAc,OAAO;CAE9E;AACF;AAEA,SAAgB,iBAA6B;CAC3C,IAAI,SAAS,OAAO;CACpB,IAAI,CAAC,WAAW,gBAAgB,GAC9B,MAAM,IAAI,MAAM,0BAA0B,kBAAkB;CAE9D,UAAU,KAAK,MAAM,aAAa,kBAAkB,OAAO,CAAC;CAC5D,OAAO;AACT"}
@@ -1,12 +1,8 @@
1
- import {
2
- runPreview
3
- } from "./chunk-JMQI3FKV.js";
4
- import {
5
- denoAdapter
6
- } from "./chunk-UISOJ4RW.js";
7
- import "./chunk-EOK6KATZ.js";
8
- import "./chunk-IVM5UM44.js";
9
- import "./chunk-4IQXHHPF.js";
10
-
11
- // .docu/node/preview.deno.ts
1
+ import { t as denoAdapter } from "./deno-DmEaKggj.js";
2
+ import { t as runPreview } from "./preview.impl-CXJS2tQS.js";
3
+ //#region .docu/node/preview.deno.ts
12
4
  await runPreview(denoAdapter);
5
+ //#endregion
6
+ export {};
7
+
8
+ //# sourceMappingURL=preview.deno.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview.deno.js","names":[],"sources":["../node/preview.deno.ts"],"sourcesContent":["import { denoAdapter } from \"./runtime\";\nimport { runPreview } from \"./preview.impl\";\n\nawait runPreview(denoAdapter);\n"],"mappings":";;;AAGA,MAAM,WAAW,WAAW"}
@@ -0,0 +1,77 @@
1
+ import { r as DIST_DIR } from "./paths-BtOIPBQ9.js";
2
+ import { c as SECURITY_HEADERS, f as injectNonce, i as getContentType, l as cspHeader, u as generateNonce } from "./utils-DA17MyQG.js";
3
+ import { t as logger } from "./logger-CycvLCrQ.js";
4
+ import { existsSync, readFileSync, statSync } from "node:fs";
5
+ import { resolve } from "node:path";
6
+ import { readFile } from "node:fs/promises";
7
+ //#region .docu/node/preview.impl.ts
8
+ /**
9
+ * Runtime-neutral preview server — mirror of `preview.ts` (Bun-only,
10
+ * protected) driven by a `RuntimeAdapter` and `node:fs` file reads.
11
+ */
12
+ function resolveFile(pathname) {
13
+ const path = pathname.slice(1);
14
+ const isWithinDist = (p) => p === DIST_DIR || p.startsWith(DIST_DIR + "/");
15
+ if (!path.includes(".")) {
16
+ const withIndex = resolve(DIST_DIR, path, "index.html");
17
+ if (isWithinDist(withIndex) && existsSync(withIndex)) return withIndex;
18
+ const withHtml = resolve(DIST_DIR, path + ".html");
19
+ if (isWithinDist(withHtml) && existsSync(withHtml)) return withHtml;
20
+ }
21
+ const exact = resolve(DIST_DIR, path);
22
+ if (!isWithinDist(exact)) return null;
23
+ try {
24
+ if (statSync(exact).isFile()) return exact;
25
+ } catch (err) {
26
+ if (err.code !== "ENOENT") throw err;
27
+ }
28
+ return null;
29
+ }
30
+ async function runPreview(adapter) {
31
+ const PORT = parseInt(process.env.PORT || "4173", 10);
32
+ logger.buildStart();
33
+ if (!existsSync(DIST_DIR)) {
34
+ logger.spinner.start("Checking build output...");
35
+ logger.spinner.info("dist not found. Run \x1B[1mflame build\x1B[0m first.");
36
+ process.exit(0);
37
+ }
38
+ const notFoundPath = resolve(DIST_DIR, "404.html");
39
+ const handle = await adapter.serve(async (req) => {
40
+ const url = new URL(req.url);
41
+ const filePath = resolveFile(decodeURIComponent(url.pathname));
42
+ if (filePath) {
43
+ const contentType = getContentType(filePath);
44
+ if (contentType === "text/html") {
45
+ const nonce = generateNonce();
46
+ const html = await readFile(filePath, "utf-8");
47
+ const modified = injectNonce(html, nonce);
48
+ return new Response(modified, { headers: {
49
+ "Content-Type": "text/html",
50
+ ...SECURITY_HEADERS,
51
+ "Content-Security-Policy": cspHeader(nonce)
52
+ } });
53
+ }
54
+ return new Response(readFileSync(filePath), { headers: { "Content-Type": contentType } });
55
+ }
56
+ if (existsSync(notFoundPath)) {
57
+ const nonce = generateNonce();
58
+ const html = await readFile(notFoundPath, "utf-8");
59
+ const modified = injectNonce(html, nonce);
60
+ return new Response(modified, {
61
+ status: 404,
62
+ headers: {
63
+ "Content-Type": "text/html",
64
+ ...SECURITY_HEADERS,
65
+ "Content-Security-Policy": cspHeader(nonce)
66
+ }
67
+ });
68
+ }
69
+ return new Response("404 - Not Found", { status: 404 });
70
+ }, { port: PORT });
71
+ logger.ready(handle.port);
72
+ return handle;
73
+ }
74
+ //#endregion
75
+ export { runPreview as t };
76
+
77
+ //# sourceMappingURL=preview.impl-CXJS2tQS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview.impl-CXJS2tQS.js","names":[],"sources":["../node/preview.impl.ts"],"sourcesContent":["/**\n * Runtime-neutral preview server — mirror of `preview.ts` (Bun-only,\n * protected) driven by a `RuntimeAdapter` and `node:fs` file reads.\n */\n\nimport { existsSync, statSync, readFileSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport type { RuntimeAdapter, ServerHandle } from \"./runtime\";\nimport { logger } from \"./logger\";\nimport { DIST_DIR } from \"./paths\";\nimport { getContentType } from \"./utils\";\nimport { SECURITY_HEADERS, generateNonce, cspHeader, injectNonce } from \"./security\";\n\nfunction resolveFile(pathname: string): string | null {\n const path = pathname.slice(1);\n const isWithinDist = (p: string) => p === DIST_DIR || p.startsWith(DIST_DIR + \"/\");\n\n if (!path.includes(\".\")) {\n const withIndex = resolve(DIST_DIR, path, \"index.html\");\n if (isWithinDist(withIndex) && existsSync(withIndex)) return withIndex;\n const withHtml = resolve(DIST_DIR, path + \".html\");\n if (isWithinDist(withHtml) && existsSync(withHtml)) return withHtml;\n }\n\n const exact = resolve(DIST_DIR, path);\n if (!isWithinDist(exact)) return null;\n try {\n if (statSync(exact).isFile()) return exact;\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n return null;\n}\n\nexport async function runPreview(adapter: RuntimeAdapter): Promise<ServerHandle | null> {\n const PORT = parseInt(process.env.PORT || \"4173\", 10);\n\n logger.buildStart();\n\n if (!existsSync(DIST_DIR)) {\n logger.spinner.start(\"Checking build output...\");\n logger.spinner.info(\"dist not found. Run \\x1b[1mflame build\\x1b[0m first.\");\n process.exit(0);\n }\n\n const notFoundPath = resolve(DIST_DIR, \"404.html\");\n\n const handle = await adapter.serve(\n async (req) => {\n const url = new URL(req.url);\n const pathname = decodeURIComponent(url.pathname);\n\n const filePath = resolveFile(pathname);\n\n if (filePath) {\n const contentType = getContentType(filePath);\n if (contentType === \"text/html\") {\n const nonce = generateNonce();\n const html = await readFile(filePath, \"utf-8\");\n const modified = injectNonce(html, nonce);\n return new Response(modified, {\n headers: {\n \"Content-Type\": \"text/html\",\n ...SECURITY_HEADERS,\n \"Content-Security-Policy\": cspHeader(nonce),\n },\n });\n }\n return new Response(readFileSync(filePath), {\n headers: { \"Content-Type\": contentType },\n });\n }\n\n if (existsSync(notFoundPath)) {\n const nonce = generateNonce();\n const html = await readFile(notFoundPath, \"utf-8\");\n const modified = injectNonce(html, nonce);\n return new Response(modified, {\n status: 404,\n headers: {\n \"Content-Type\": \"text/html\",\n ...SECURITY_HEADERS,\n \"Content-Security-Policy\": cspHeader(nonce),\n },\n });\n }\n\n return new Response(\"404 - Not Found\", { status: 404 });\n },\n { port: PORT }\n );\n\n logger.ready(handle.port);\n return handle;\n}\n"],"mappings":";;;;;;;;;;;AAcA,SAAS,YAAY,UAAiC;CACpD,MAAM,OAAO,SAAS,MAAM,CAAC;CAC7B,MAAM,gBAAgB,MAAc,MAAM,YAAY,EAAE,WAAW,WAAW,GAAG;CAEjF,IAAI,CAAC,KAAK,SAAS,GAAG,GAAG;EACvB,MAAM,YAAY,QAAQ,UAAU,MAAM,YAAY;EACtD,IAAI,aAAa,SAAS,KAAK,WAAW,SAAS,GAAG,OAAO;EAC7D,MAAM,WAAW,QAAQ,UAAU,OAAO,OAAO;EACjD,IAAI,aAAa,QAAQ,KAAK,WAAW,QAAQ,GAAG,OAAO;CAC7D;CAEA,MAAM,QAAQ,QAAQ,UAAU,IAAI;CACpC,IAAI,CAAC,aAAa,KAAK,GAAG,OAAO;CACjC,IAAI;EACF,IAAI,SAAS,KAAK,CAAC,CAAC,OAAO,GAAG,OAAO;CACvC,SAAS,KAAK;EACZ,IAAK,IAA8B,SAAS,UAAU,MAAM;CAC9D;CACA,OAAO;AACT;AAEA,eAAsB,WAAW,SAAuD;CACtF,MAAM,OAAO,SAAS,QAAQ,IAAI,QAAQ,QAAQ,EAAE;CAEpD,OAAO,WAAW;CAElB,IAAI,CAAC,WAAW,QAAQ,GAAG;EACzB,OAAO,QAAQ,MAAM,0BAA0B;EAC/C,OAAO,QAAQ,KAAK,sDAAsD;EAC1E,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,eAAe,QAAQ,UAAU,UAAU;CAEjD,MAAM,SAAS,MAAM,QAAQ,MAC3B,OAAO,QAAQ;EACb,MAAM,MAAM,IAAI,IAAI,IAAI,GAAG;EAG3B,MAAM,WAAW,YAFA,mBAAmB,IAAI,QAEX,CAAQ;EAErC,IAAI,UAAU;GACZ,MAAM,cAAc,eAAe,QAAQ;GAC3C,IAAI,gBAAgB,aAAa;IAC/B,MAAM,QAAQ,cAAc;IAC5B,MAAM,OAAO,MAAM,SAAS,UAAU,OAAO;IAC7C,MAAM,WAAW,YAAY,MAAM,KAAK;IACxC,OAAO,IAAI,SAAS,UAAU,EAC5B,SAAS;KACP,gBAAgB;KAChB,GAAG;KACH,2BAA2B,UAAU,KAAK;IAC5C,EACF,CAAC;GACH;GACA,OAAO,IAAI,SAAS,aAAa,QAAQ,GAAG,EAC1C,SAAS,EAAE,gBAAgB,YAAY,EACzC,CAAC;EACH;EAEA,IAAI,WAAW,YAAY,GAAG;GAC5B,MAAM,QAAQ,cAAc;GAC5B,MAAM,OAAO,MAAM,SAAS,cAAc,OAAO;GACjD,MAAM,WAAW,YAAY,MAAM,KAAK;GACxC,OAAO,IAAI,SAAS,UAAU;IAC5B,QAAQ;IACR,SAAS;KACP,gBAAgB;KAChB,GAAG;KACH,2BAA2B,UAAU,KAAK;IAC5C;GACF,CAAC;EACH;EAEA,OAAO,IAAI,SAAS,mBAAmB,EAAE,QAAQ,IAAI,CAAC;CACxD,GACA,EAAE,MAAM,KAAK,CACf;CAEA,OAAO,MAAM,OAAO,IAAI;CACxB,OAAO;AACT"}
@@ -1,12 +1,8 @@
1
- import {
2
- runPreview
3
- } from "./chunk-JMQI3FKV.js";
4
- import {
5
- nodeAdapter
6
- } from "./chunk-UISOJ4RW.js";
7
- import "./chunk-EOK6KATZ.js";
8
- import "./chunk-IVM5UM44.js";
9
- import "./chunk-4IQXHHPF.js";
10
-
11
- // .docu/node/preview.node.ts
1
+ import { t as nodeAdapter } from "./node-DPTySdwG.js";
2
+ import { t as runPreview } from "./preview.impl-CXJS2tQS.js";
3
+ //#region .docu/node/preview.node.ts
12
4
  await runPreview(nodeAdapter);
5
+ //#endregion
6
+ export {};
7
+
8
+ //# sourceMappingURL=preview.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview.node.js","names":[],"sources":["../node/preview.node.ts"],"sourcesContent":["import { nodeAdapter } from \"./runtime\";\nimport { runPreview } from \"./preview.impl\";\n\nawait runPreview(nodeAdapter);\n"],"mappings":";;;AAGA,MAAM,WAAW,WAAW"}