@docubook/flame 2.0.0-beta.1 → 2.0.0-beta.3

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 (60) hide show
  1. package/.docu/lib/build.deno.js +6 -9
  2. package/.docu/lib/build.deno.js.map +1 -0
  3. package/.docu/lib/build.impl-Bz_p421t.js +424 -0
  4. package/.docu/lib/build.impl-Bz_p421t.js.map +1 -0
  5. package/.docu/lib/build.impl-CtPrlYAE.js +2 -0
  6. package/.docu/lib/build.node.js +6 -9
  7. package/.docu/lib/build.node.js.map +1 -0
  8. package/.docu/lib/clean.js +25 -25
  9. package/.docu/lib/clean.js.map +1 -0
  10. package/.docu/lib/deno-DmEaKggj.js +20 -0
  11. package/.docu/lib/deno-DmEaKggj.js.map +1 -0
  12. package/.docu/lib/deploy.deno.js +9 -9
  13. package/.docu/lib/deploy.deno.js.map +1 -0
  14. package/.docu/lib/deploy.node.js +8 -8
  15. package/.docu/lib/deploy.node.js.map +1 -0
  16. package/.docu/lib/deploy.shared-fk8eM-r4.js +295 -0
  17. package/.docu/lib/deploy.shared-fk8eM-r4.js.map +1 -0
  18. package/.docu/lib/html.shared-FwgbE1WG.js +2696 -0
  19. package/.docu/lib/html.shared-FwgbE1WG.js.map +1 -0
  20. package/.docu/lib/logger-CQyNTE6L.js +306 -0
  21. package/.docu/lib/logger-CQyNTE6L.js.map +1 -0
  22. package/.docu/lib/node-DPTySdwG.js +80 -0
  23. package/.docu/lib/node-DPTySdwG.js.map +1 -0
  24. package/.docu/lib/paths-Bl2cdp9E.js +76 -0
  25. package/.docu/lib/paths-Bl2cdp9E.js.map +1 -0
  26. package/.docu/lib/preview.deno.js +7 -11
  27. package/.docu/lib/preview.deno.js.map +1 -0
  28. package/.docu/lib/preview.impl-CnsbLmDA.js +77 -0
  29. package/.docu/lib/preview.impl-CnsbLmDA.js.map +1 -0
  30. package/.docu/lib/preview.node.js +7 -11
  31. package/.docu/lib/preview.node.js.map +1 -0
  32. package/.docu/lib/server.deno.js +7 -12
  33. package/.docu/lib/server.deno.js.map +1 -0
  34. package/.docu/lib/server.impl-CXTzYqbF.js +358 -0
  35. package/.docu/lib/server.impl-CXTzYqbF.js.map +1 -0
  36. package/.docu/lib/server.node.js +7 -12
  37. package/.docu/lib/server.node.js.map +1 -0
  38. package/.docu/lib/utils-DA17MyQG.js +167 -0
  39. package/.docu/lib/utils-DA17MyQG.js.map +1 -0
  40. package/.docu/node/build.impl.ts +76 -11
  41. package/.docu/node/build.ts +83 -9
  42. package/.docu/node/cache-key.ts +311 -0
  43. package/.docu/node/hydrate.node.ts +124 -177
  44. package/.docu/node/hydrate.ts +13 -14
  45. package/.docu/node/mdx.ts +14 -2
  46. package/.docu/node/paths.ts +27 -1
  47. package/.docu/node/types.ts +23 -5
  48. package/bin/cli.js +56 -18
  49. package/bin/compile-lib.mjs +30 -28
  50. package/package.json +10 -16
  51. package/.docu/lib/build.impl-3ZOQORN3.js +0 -12
  52. package/.docu/lib/chunk-4IQXHHPF.js +0 -62
  53. package/.docu/lib/chunk-6EOUQCRM.js +0 -301
  54. package/.docu/lib/chunk-6HFBJUMG.js +0 -434
  55. package/.docu/lib/chunk-EOK6KATZ.js +0 -191
  56. package/.docu/lib/chunk-FERG25YW.js +0 -470
  57. package/.docu/lib/chunk-MQRFIDS4.js +0 -92
  58. package/.docu/lib/chunk-U7M5SK76.js +0 -330
  59. package/.docu/lib/chunk-UISOJ4RW.js +0 -114
  60. package/.docu/lib/chunk-URBATJEC.js +0 -2720
@@ -0,0 +1,306 @@
1
+ import { d as loadDocuConfig } from "./paths-Bl2cdp9E.js";
2
+ var package_default = {
3
+ name: "@docubook/flame",
4
+ version: "2.0.0-beta.3",
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.4.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": "oxlint .",
36
+ "prepublishOnly": "bun .docu/node/clean.ts && oxlint . && 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
+ "lucide-react": "^1.14.0",
68
+ "react": "^19.2.7",
69
+ "react-dom": "^19.2.7",
70
+ "unified": "^11.0.0",
71
+ "vite": "^8.2.1",
72
+ "zod": "^4.4.3"
73
+ },
74
+ peerDependencies: { "@sentry/bun": "^10.0.0" },
75
+ peerDependenciesMeta: { "@sentry/bun": { "optional": true } },
76
+ devDependencies: {
77
+ "@types/node": "^22.0.0",
78
+ "@types/react": "^19.0.0",
79
+ "@types/react-dom": "^19.0.0",
80
+ "bun-types": "^1.4.0",
81
+ "tailwindcss": "^4.3.0",
82
+ "typescript": "^7.0.2"
83
+ }
84
+ };
85
+ //#endregion
86
+ //#region .docu/node/logger.ts
87
+ /**
88
+ * Interactive CLI logger with spinner and tree-style route display.
89
+ * Inspired by Next.js/Turbopack build output.
90
+ *
91
+ * Supports structured logging via environment variables:
92
+ * - LOG_LEVEL: debug | info | warn | error (default: info)
93
+ * - LOG_FORMAT: json | pretty (default: pretty)
94
+ */
95
+ var docuConfig = loadDocuConfig();
96
+ var isCI = !!(process.env.CI || process.env.NO_COLOR || !process.stdout.isTTY);
97
+ var isJSON = (process.env.LOG_FORMAT || "pretty") === "json";
98
+ var LEVELS = {
99
+ debug: 0,
100
+ info: 1,
101
+ warn: 2,
102
+ error: 3
103
+ };
104
+ var currentLevel = LEVELS[process.env.LOG_LEVEL || "info"] ?? LEVELS.info;
105
+ function shouldLog(level) {
106
+ return LEVELS[level] >= currentLevel;
107
+ }
108
+ function jsonLog(level, msg, meta) {
109
+ if (!shouldLog(level)) return;
110
+ const entry = {
111
+ ts: (/* @__PURE__ */ new Date()).toISOString(),
112
+ ...meta,
113
+ level,
114
+ msg
115
+ };
116
+ (level === "error" ? console.error : level === "warn" ? console.warn : console.log)(JSON.stringify(entry));
117
+ }
118
+ /** Returns true if the caller should skip (already handled or filtered). */
119
+ function guard(level, msg, meta) {
120
+ if (isJSON) {
121
+ jsonLog(level, msg, meta);
122
+ return true;
123
+ }
124
+ return !shouldLog(level);
125
+ }
126
+ var c = isCI || isJSON ? {
127
+ reset: "",
128
+ bold: "",
129
+ dim: "",
130
+ green: "",
131
+ cyan: "",
132
+ magenta: "",
133
+ yellow: "",
134
+ red: "",
135
+ white: "",
136
+ gray: ""
137
+ } : {
138
+ reset: "\x1B[0m",
139
+ bold: "\x1B[1m",
140
+ dim: "\x1B[2m",
141
+ green: "\x1B[32m",
142
+ cyan: "\x1B[36m",
143
+ magenta: "\x1B[35m",
144
+ yellow: "\x1B[33m",
145
+ red: "\x1B[31m",
146
+ white: "\x1B[37m",
147
+ gray: "\x1B[90m"
148
+ };
149
+ var SPINNER_FRAMES = [
150
+ "⠋",
151
+ "⠙",
152
+ "⠹",
153
+ "⠸",
154
+ "⠼",
155
+ "⠴",
156
+ "⠦",
157
+ "⠧",
158
+ "⠇",
159
+ "⠏"
160
+ ];
161
+ var Spinner = class {
162
+ frame = 0;
163
+ message = "";
164
+ timer = null;
165
+ info(finalMsg) {
166
+ if (this.timer) clearInterval(this.timer);
167
+ this.timer = null;
168
+ if (isCI) console.log(`ℹ ${finalMsg}`);
169
+ else {
170
+ process.stdout.write(`\r\x1b[K${c.cyan}ℹ${c.reset} ${finalMsg}\n`);
171
+ process.stdout.write("\x1B[?25h");
172
+ }
173
+ }
174
+ start(msg) {
175
+ this.message = msg;
176
+ if (isCI) {
177
+ console.log(`… ${msg}`);
178
+ return;
179
+ }
180
+ this.frame = 0;
181
+ process.stdout.write("\x1B[?25l");
182
+ this.render();
183
+ this.timer = setInterval(() => this.render(), 80);
184
+ }
185
+ stop(finalMsg) {
186
+ if (this.timer) clearInterval(this.timer);
187
+ this.timer = null;
188
+ if (isCI) {
189
+ console.log(`✓ ${finalMsg}`);
190
+ return;
191
+ }
192
+ process.stdout.write(`\r\x1b[K${c.green}✓${c.reset} ${finalMsg}\n`);
193
+ process.stdout.write("\x1B[?25h");
194
+ }
195
+ render() {
196
+ const f = SPINNER_FRAMES[this.frame % SPINNER_FRAMES.length];
197
+ process.stdout.write(`\r${c.cyan}${f}${c.reset} ${this.message}`);
198
+ this.frame++;
199
+ }
200
+ };
201
+ var MAX_ROUTE_LINES = 5;
202
+ var routeLineCount = 0;
203
+ var routeTruncated = false;
204
+ function printRouteTree(routes, prefix = "", isRoot = true) {
205
+ for (let i = 0; i < routes.length; i++) {
206
+ if (routeTruncated) return;
207
+ if (routeLineCount >= MAX_ROUTE_LINES) {
208
+ routeTruncated = true;
209
+ process.stdout.write(`${prefix}${c.dim}...${c.reset}\n`);
210
+ return;
211
+ }
212
+ const route = routes[i];
213
+ const last = i === routes.length - 1;
214
+ const connector = isRoot ? "" : last ? "└── " : "├── ";
215
+ const childPrefix = isRoot ? "" : last ? " " : "│ ";
216
+ const path = route.noLink ? `${c.dim}${route.href}${c.reset}` : `${c.white}${route.href}${c.reset}`;
217
+ const label = route.noLink ? `${c.gray}(group)${c.reset}` : "";
218
+ process.stdout.write(`${prefix}${connector}${path} ${label}\n`);
219
+ routeLineCount++;
220
+ if (route.items?.length) printRouteTree(route.items, prefix + childPrefix, false);
221
+ }
222
+ }
223
+ var logger = {
224
+ spinner: new Spinner(),
225
+ buildStart() {
226
+ if (guard("info", "build_start", {
227
+ package: "@docubook/flame",
228
+ version: package_default.version
229
+ })) return;
230
+ console.log(`\n${c.bold}${c.cyan} 🔥 DocuBook Flame${c.reset} ${c.dim}v${package_default.version}${c.reset}\n`);
231
+ },
232
+ bundleStart() {
233
+ if (guard("info", "bundle_start")) return;
234
+ this.spinner.start("Building client bundle...");
235
+ },
236
+ bundleDone(ms) {
237
+ if (guard("info", "bundle_done", { duration_ms: ms })) return;
238
+ this.spinner.stop(`Client bundle compiled ${c.dim}(${ms}ms)${c.reset}`);
239
+ },
240
+ indexStart() {
241
+ if (guard("info", "index_start")) return;
242
+ this.spinner.start("Generating search index...");
243
+ },
244
+ indexDone(records, ms, skipped = false) {
245
+ if (guard("info", "index_done", {
246
+ records,
247
+ duration_ms: ms,
248
+ skipped
249
+ })) return;
250
+ this.spinner.stop(skipped ? `Search index cached ${c.dim}(${ms}ms)${c.reset}` : `Search index generated ${c.dim}(${records} records, ${ms}ms)${c.reset}`);
251
+ },
252
+ routes() {
253
+ if (guard("debug", "routes")) return;
254
+ const routes = docuConfig.routes;
255
+ if (!routes?.length) return;
256
+ console.log(`\n${c.bold} Routes${c.reset} ${c.dim}(${countRoutes(routes)} pages)${c.reset}\n`);
257
+ routeLineCount = 0;
258
+ routeTruncated = false;
259
+ printRouteTree(routes, " ");
260
+ },
261
+ ready(port, hmr = false) {
262
+ if (guard("info", "server_ready", {
263
+ port,
264
+ hmr
265
+ })) return;
266
+ console.log(`\n${c.green}${c.bold} ✓ Ready${c.reset} in ${c.bold}http://localhost:${port}/docs/${c.reset}`);
267
+ if (hmr) console.log(`${c.dim} HMR enabled — watching docs/ for changes${c.reset}`);
268
+ console.log("");
269
+ },
270
+ request(method, pathname, status, duration_ms) {
271
+ if (guard("info", "http_request", {
272
+ method,
273
+ path: pathname,
274
+ status,
275
+ duration_ms
276
+ })) return;
277
+ const color = status >= 500 ? c.red : status >= 400 ? c.gray : c.green;
278
+ const ts = (/* @__PURE__ */ new Date()).toLocaleTimeString();
279
+ const dur = duration_ms != null ? ` ${c.dim}${duration_ms}ms${c.reset}` : "";
280
+ console.log(`${c.dim} ${ts}${c.reset} ${method} ${pathname} ${color}${status}${c.reset}${dur}`);
281
+ },
282
+ debug(msg, meta) {
283
+ if (guard("debug", msg, meta)) return;
284
+ console.log(`${c.gray} [debug] ${msg}${c.reset}`);
285
+ },
286
+ warn(msg, meta) {
287
+ if (guard("warn", msg, meta)) return;
288
+ console.warn(`${c.yellow} ⚠ ${msg}${c.reset}`);
289
+ },
290
+ error(msg, meta) {
291
+ if (guard("error", msg, meta)) return;
292
+ console.error(`${c.red} ✖ ${msg}${c.reset}`);
293
+ }
294
+ };
295
+ function countRoutes(routes) {
296
+ let count = 0;
297
+ for (const r of routes) {
298
+ if (!r.noLink) count++;
299
+ if (r.items) count += countRoutes(r.items);
300
+ }
301
+ return count;
302
+ }
303
+ //#endregion
304
+ export { logger as t };
305
+
306
+ //# sourceMappingURL=logger-CQyNTE6L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger-CQyNTE6L.js","names":[],"sources":["../../package.json","../node/logger.ts"],"sourcesContent":["{\n \"name\": \"@docubook/flame\",\n \"version\": \"2.0.0-beta.3\",\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.4.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\": \"oxlint .\",\n \"prepublishOnly\": \"bun .docu/node/clean.ts && oxlint . && 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 \"lucide-react\": \"^1.14.0\",\n \"react\": \"^19.2.7\",\n \"react-dom\": \"^19.2.7\",\n \"unified\": \"^11.0.0\",\n \"vite\": \"^8.2.1\",\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 \"@types/node\": \"^22.0.0\",\n \"@types/react\": \"^19.0.0\",\n \"@types/react-dom\": \"^19.0.0\",\n \"bun-types\": \"^1.4.0\",\n \"tailwindcss\": \"^4.3.0\",\n \"typescript\": \"^7.0.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AI,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,gBAAgB;CAIlD,IAAI,UAAU,SAAS,QAAQ,OAAO;CAEtC,IAAI,CAAC,SAAS,MAAM;EAClB,IAAI,IAAI;EACR;CACF;CAEA,MAAM,SAAS,SAAS,KAAK,UAAU;CACvC,IAAI;EACF,SAAS;GACP,MAAM,EAAE,MAAM,UAAU,MA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, 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
+ /**
11
+ * Find the project root by walking up from cwd until docu.json is found.
12
+ * Falls back to cwd when not found (tests, ad-hoc scripts). Bun 1.4
13
+ * `run --parallel --filter` may change cwd per workspace task, so a bare
14
+ * process.cwd() can point at the wrong package.
15
+ */
16
+ function findProjectRoot() {
17
+ let dir = process.cwd();
18
+ for (let i = 0; i < 6; i++) {
19
+ try {
20
+ if (existsSync(join(dir, "docu.json"))) return dir;
21
+ } catch {
22
+ break;
23
+ }
24
+ const parent = resolve(dir, "..");
25
+ if (parent === dir) break;
26
+ dir = parent;
27
+ }
28
+ return process.cwd();
29
+ }
30
+ var PROJECT_ROOT = findProjectRoot();
31
+ join(FRAMEWORK_ROOT, ".docu/pages");
32
+ var STYLES_DIR = join(FRAMEWORK_ROOT, ".docu/styles");
33
+ var nodeDir = join(FRAMEWORK_ROOT, ".docu/node");
34
+ var libDir = join(FRAMEWORK_ROOT, ".docu/lib");
35
+ var LIB_DIR = existsSync(nodeDir) ? nodeDir : libDir;
36
+ var DIST_DIR = join(PROJECT_ROOT, ".docu/dist");
37
+ var ASSETS_DIR = join(DIST_DIR, "assets");
38
+ var CACHE_FILE = join(PROJECT_ROOT, ".docu/build-cache.json");
39
+ var DOCS_DIR = join(PROJECT_ROOT, "docs");
40
+ var DOCS_ASSETS_DIR = join(PROJECT_ROOT, "docs/assets");
41
+ var DOCU_CONFIG_PATH = join(PROJECT_ROOT, "docu.json");
42
+ /** Resolve a project-relative file against the discovered PROJECT_ROOT. */
43
+ function resolveProjectFile(...segments) {
44
+ return join(PROJECT_ROOT, ...segments);
45
+ }
46
+ var _config = null;
47
+ /** Clean stale client bundles from a previous build. */
48
+ async function cleanOldBundles(preserve) {
49
+ try {
50
+ const files = await readdir(ASSETS_DIR);
51
+ for (const file of files) {
52
+ if (preserve?.has(file)) continue;
53
+ if (file.startsWith("client.") || file.startsWith("client-")) await unlink(join(ASSETS_DIR, file));
54
+ }
55
+ } catch (err) {
56
+ if (err.code !== "ENOENT") console.error("Failed to clean old bundles:", err.message);
57
+ }
58
+ try {
59
+ await rm(join(ASSETS_DIR, "chunks"), {
60
+ recursive: true,
61
+ force: true
62
+ });
63
+ } catch (err) {
64
+ if (err.code !== "ENOENT") console.warn("[flame] Failed to clean chunks dir:", err.message);
65
+ }
66
+ }
67
+ function loadDocuConfig() {
68
+ if (_config) return _config;
69
+ if (!existsSync(DOCU_CONFIG_PATH)) throw new Error(`docu.json not found at ${DOCU_CONFIG_PATH}`);
70
+ _config = JSON.parse(readFileSync(DOCU_CONFIG_PATH, "utf-8"));
71
+ return _config;
72
+ }
73
+ //#endregion
74
+ export { DOCS_DIR as a, PROJECT_ROOT as c, loadDocuConfig as d, resolveProjectFile as f, 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 };
75
+
76
+ //# sourceMappingURL=paths-Bl2cdp9E.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths-Bl2cdp9E.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, \"../..\");\n\n/**\n * Find the project root by walking up from cwd until docu.json is found.\n * Falls back to cwd when not found (tests, ad-hoc scripts). Bun 1.4\n * `run --parallel --filter` may change cwd per workspace task, so a bare\n * process.cwd() can point at the wrong package.\n */\nfunction findProjectRoot(): string {\n let dir = process.cwd();\n for (let i = 0; i < 6; i++) {\n try {\n if (existsSync(join(dir, \"docu.json\"))) return dir;\n } catch {\n break;\n }\n const parent = resolve(dir, \"..\");\n if (parent === dir) break;\n dir = parent;\n }\n return process.cwd();\n}\nexport const PROJECT_ROOT = findProjectRoot();\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/** Resolve a project-relative file against the discovered PROJECT_ROOT. */\nexport function resolveProjectFile(...segments: string[]): string {\n return join(PROJECT_ROOT, ...segments);\n}\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;;;;;;;AAQlE,SAAS,kBAA0B;CACjC,IAAI,MAAM,QAAQ,IAAI;CACtB,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK;EAC1B,IAAI;GACF,IAAI,WAAW,KAAK,KAAK,WAAW,CAAC,GAAG,OAAO;EACjD,QAAQ;GACN;EACF;EACA,MAAM,SAAS,QAAQ,KAAK,IAAI;EAChC,IAAI,WAAW,KAAK;EACpB,MAAM;CACR;CACA,OAAO,QAAQ,IAAI;AACrB;AACA,IAAa,eAAe,gBAAgB;AAGnB,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,SAAgB,mBAAmB,GAAG,UAA4B;CAChE,OAAO,KAAK,cAAc,GAAG,QAAQ;AACvC;AAGA,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-MQRFIDS4.js";
4
- import {
5
- denoAdapter
6
- } from "./chunk-UISOJ4RW.js";
7
- import "./chunk-EOK6KATZ.js";
8
- import "./chunk-6EOUQCRM.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-CnsbLmDA.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-Bl2cdp9E.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-CQyNTE6L.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-CnsbLmDA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview.impl-CnsbLmDA.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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7C,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-MQRFIDS4.js";
4
- import {
5
- nodeAdapter
6
- } from "./chunk-UISOJ4RW.js";
7
- import "./chunk-EOK6KATZ.js";
8
- import "./chunk-6EOUQCRM.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-CnsbLmDA.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"}