@docubook/flame 1.6.3 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docu/lib/build.deno.js +2 -2
- package/.docu/lib/{build.impl-GH62P623.js → build.impl-VCWNBEBU.js} +2 -2
- package/.docu/lib/build.node.js +2 -2
- package/.docu/lib/{chunk-DSGJHYQX.js → chunk-74AOEDLW.js} +1 -1
- package/.docu/lib/{chunk-DJTS6D3J.js → chunk-I7OBFORY.js} +1 -1
- package/.docu/lib/{chunk-JM7HWEF6.js → chunk-OUILOW2S.js} +6 -4
- package/.docu/lib/{chunk-66756URY.js → chunk-P2P2NB3K.js} +3 -2
- package/.docu/lib/{chunk-KLB4S2KT.js → chunk-Y4PEPREZ.js} +3 -3
- package/.docu/lib/clean.js +1 -1
- package/.docu/lib/deploy.deno.js +1 -1
- package/.docu/lib/deploy.node.js +1 -1
- package/.docu/lib/preview.deno.js +2 -2
- package/.docu/lib/preview.node.js +2 -2
- package/.docu/lib/server.deno.js +2 -2
- package/.docu/lib/server.node.js +2 -2
- package/.docu/node/build.impl.ts +9 -3
- package/.docu/node/deploy.shared.ts +2 -1
- package/.docu/node/deploy.ts +2 -1
- package/.docu/node/server-routes.ts +4 -2
- package/bin/cli.js +13 -3
- package/package.json +2 -2
- package/template/.env.example +19 -3
- package/template/package.json +3 -3
package/.docu/lib/build.deno.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuildCli
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OUILOW2S.js";
|
|
4
4
|
import "./chunk-WSJC3PRH.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-I7OBFORY.js";
|
|
7
7
|
import "./chunk-4IQXHHPF.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/build.deno.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuild,
|
|
3
3
|
runBuildCli
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OUILOW2S.js";
|
|
5
5
|
import "./chunk-WSJC3PRH.js";
|
|
6
6
|
import "./chunk-EOK6KATZ.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-I7OBFORY.js";
|
|
8
8
|
import "./chunk-4IQXHHPF.js";
|
|
9
9
|
export {
|
|
10
10
|
runBuild,
|
package/.docu/lib/build.node.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuildCli
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OUILOW2S.js";
|
|
4
4
|
import "./chunk-WSJC3PRH.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-I7OBFORY.js";
|
|
7
7
|
import "./chunk-4IQXHHPF.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/build.node.ts
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-EOK6KATZ.js";
|
|
22
22
|
import {
|
|
23
23
|
logger
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-I7OBFORY.js";
|
|
25
25
|
import {
|
|
26
26
|
ASSETS_DIR,
|
|
27
27
|
CACHE_FILE,
|
|
@@ -146,7 +146,7 @@ ${msg}`, { cause: err });
|
|
|
146
146
|
const depth = slug ? slug.split("/").length : 1;
|
|
147
147
|
const favicon = docuConfig.meta?.favicon || "/docs/assets/images/favicon.ico";
|
|
148
148
|
const seo = buildSeoMeta(docuConfig, frontmatter, slug || "");
|
|
149
|
-
const csp = cspHeader(nonce,
|
|
149
|
+
const csp = cspHeader(nonce, true);
|
|
150
150
|
let html = htmlShell({
|
|
151
151
|
title,
|
|
152
152
|
description,
|
|
@@ -332,7 +332,8 @@ async function runBuild() {
|
|
|
332
332
|
body: renderToString(landingPage),
|
|
333
333
|
favicon: landingFavicon,
|
|
334
334
|
seo: landingSeo,
|
|
335
|
-
|
|
335
|
+
/** unsafe-eval required by mdx-remote hydration — see above. */
|
|
336
|
+
csp: cspHeader(landingNonce, true),
|
|
336
337
|
css: assetManifest.css,
|
|
337
338
|
js: assetManifest.js,
|
|
338
339
|
nonce: landingNonce,
|
|
@@ -352,7 +353,8 @@ async function runBuild() {
|
|
|
352
353
|
body: renderToString(notFoundPage),
|
|
353
354
|
favicon: notFoundFavicon,
|
|
354
355
|
headExtra: ['<meta name="robots" content="noindex,follow">'],
|
|
355
|
-
|
|
356
|
+
/** unsafe-eval required by mdx-remote hydration — see above. */
|
|
357
|
+
csp: cspHeader(notFoundNonce, true),
|
|
356
358
|
css: assetManifest.css,
|
|
357
359
|
js: assetManifest.js,
|
|
358
360
|
nonce: notFoundNonce,
|
|
@@ -67,7 +67,7 @@ function detectPkgManager(dir) {
|
|
|
67
67
|
const bunLockFile = existsSync(join(dir, "bun.lock")) ? "bun.lock" : existsSync(join(dir, "bun.lockb")) ? "bun.lockb" : null;
|
|
68
68
|
if (bunLockFile) {
|
|
69
69
|
return {
|
|
70
|
-
baseImage: "oven/bun:1",
|
|
70
|
+
baseImage: "oven/bun:1-debian",
|
|
71
71
|
lockFile: bunLockFile,
|
|
72
72
|
installCmd: "bun install --frozen-lockfile",
|
|
73
73
|
runCmd: "bun",
|
|
@@ -133,7 +133,7 @@ async function runBuild() {
|
|
|
133
133
|
process.env.FLAME_BUILD_SILENT = "1";
|
|
134
134
|
process.env.LOG_LEVEL = "error";
|
|
135
135
|
}
|
|
136
|
-
const { runBuildCli } = await import("./build.impl-
|
|
136
|
+
const { runBuildCli } = await import("./build.impl-VCWNBEBU.js");
|
|
137
137
|
await runBuildCli();
|
|
138
138
|
}
|
|
139
139
|
async function writeDockerFiles() {
|
|
@@ -143,6 +143,7 @@ async function writeDockerFiles() {
|
|
|
143
143
|
await writeFile(
|
|
144
144
|
join(dockerDir, "Dockerfile"),
|
|
145
145
|
`FROM ${pm.baseImage} AS builder
|
|
146
|
+
ENV NODE_ENV=production
|
|
146
147
|
WORKDIR /app
|
|
147
148
|
COPY package.json ${pm.lockFile} ./
|
|
148
149
|
RUN ${pm.installCmd}
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-EOK6KATZ.js";
|
|
28
28
|
import {
|
|
29
29
|
logger
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-I7OBFORY.js";
|
|
31
31
|
import {
|
|
32
32
|
DIST_DIR,
|
|
33
33
|
DOCS_DIR,
|
|
@@ -59,7 +59,7 @@ function createHtmlResponse(title, description, body, status, state, depth = 0)
|
|
|
59
59
|
themeCss: state.inlineThemeCss,
|
|
60
60
|
depth
|
|
61
61
|
});
|
|
62
|
-
return htmlResponse(html, nonce, status,
|
|
62
|
+
return htmlResponse(html, nonce, status, true);
|
|
63
63
|
}
|
|
64
64
|
async function getDocsForSlug(slug, state) {
|
|
65
65
|
if (!isSlugSafe(slug, DOCS_DIR)) return null;
|
|
@@ -161,7 +161,7 @@ async function renderDocsServerPage(doc, slug, pathname, state) {
|
|
|
161
161
|
depth
|
|
162
162
|
});
|
|
163
163
|
html = await state.builder.runTransformHtmlChain(html, ctx);
|
|
164
|
-
return htmlResponse(html, nonce, 200,
|
|
164
|
+
return htmlResponse(html, nonce, 200, true);
|
|
165
165
|
}
|
|
166
166
|
return createHtmlResponse(title, description, body, 200, state, depth);
|
|
167
167
|
}
|
package/.docu/lib/clean.js
CHANGED
package/.docu/lib/deploy.deno.js
CHANGED
package/.docu/lib/deploy.node.js
CHANGED
package/.docu/lib/server.deno.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y4PEPREZ.js";
|
|
4
4
|
import "./chunk-WSJC3PRH.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-I7OBFORY.js";
|
|
7
7
|
import "./chunk-4IQXHHPF.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/server.deno.ts
|
package/.docu/lib/server.node.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y4PEPREZ.js";
|
|
4
4
|
import "./chunk-WSJC3PRH.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-I7OBFORY.js";
|
|
7
7
|
import "./chunk-4IQXHHPF.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/server.node.ts
|
package/.docu/node/build.impl.ts
CHANGED
|
@@ -149,7 +149,11 @@ async function renderDocsPage(
|
|
|
149
149
|
const depth = slug ? slug.split("/").length : 1;
|
|
150
150
|
const favicon = docuConfig.meta?.favicon || "/docs/assets/images/favicon.ico";
|
|
151
151
|
const seo = buildSeoMeta(docuConfig, frontmatter, slug || "");
|
|
152
|
-
|
|
152
|
+
/**
|
|
153
|
+
* @docubook/mdx-remote uses new Function(compiledSource) for
|
|
154
|
+
* client-side MDX hydration. Keep allowEval=true until mdx-remote drops new Function.
|
|
155
|
+
*/
|
|
156
|
+
const csp = cspHeader(nonce, true);
|
|
153
157
|
let html = htmlShell({
|
|
154
158
|
title,
|
|
155
159
|
description,
|
|
@@ -358,7 +362,8 @@ export async function runBuild(): Promise<void> {
|
|
|
358
362
|
body: renderToString(landingPage),
|
|
359
363
|
favicon: landingFavicon,
|
|
360
364
|
seo: landingSeo,
|
|
361
|
-
|
|
365
|
+
/** unsafe-eval required by mdx-remote hydration — see above. */
|
|
366
|
+
csp: cspHeader(landingNonce, true),
|
|
362
367
|
css: assetManifest.css,
|
|
363
368
|
js: assetManifest.js,
|
|
364
369
|
nonce: landingNonce,
|
|
@@ -379,7 +384,8 @@ export async function runBuild(): Promise<void> {
|
|
|
379
384
|
body: renderToString(notFoundPage),
|
|
380
385
|
favicon: notFoundFavicon,
|
|
381
386
|
headExtra: ['<meta name="robots" content="noindex,follow">'],
|
|
382
|
-
|
|
387
|
+
/** unsafe-eval required by mdx-remote hydration — see above. */
|
|
388
|
+
csp: cspHeader(notFoundNonce, true),
|
|
383
389
|
css: assetManifest.css,
|
|
384
390
|
js: assetManifest.js,
|
|
385
391
|
nonce: notFoundNonce,
|
|
@@ -87,7 +87,7 @@ export function detectPkgManager(dir: string): {
|
|
|
87
87
|
: null;
|
|
88
88
|
if (bunLockFile) {
|
|
89
89
|
return {
|
|
90
|
-
baseImage: "oven/bun:1",
|
|
90
|
+
baseImage: "oven/bun:1-debian",
|
|
91
91
|
lockFile: bunLockFile,
|
|
92
92
|
installCmd: "bun install --frozen-lockfile",
|
|
93
93
|
runCmd: "bun",
|
|
@@ -169,6 +169,7 @@ async function writeDockerFiles() {
|
|
|
169
169
|
await writeFile(
|
|
170
170
|
join(dockerDir, "Dockerfile"),
|
|
171
171
|
`FROM ${pm.baseImage} AS builder
|
|
172
|
+
ENV NODE_ENV=production
|
|
172
173
|
WORKDIR /app
|
|
173
174
|
COPY package.json ${pm.lockFile} ./
|
|
174
175
|
RUN ${pm.installCmd}
|
package/.docu/node/deploy.ts
CHANGED
|
@@ -43,7 +43,8 @@ async function runBuild() {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export const DOCKERFILE_BUN = `FROM oven/bun:1 AS builder
|
|
46
|
+
export const DOCKERFILE_BUN = `FROM oven/bun:1-debian AS builder
|
|
47
|
+
ENV NODE_ENV=production
|
|
47
48
|
WORKDIR /app
|
|
48
49
|
COPY package.json bun.lock ./
|
|
49
50
|
RUN bun install --frozen-lockfile
|
|
@@ -45,7 +45,8 @@ function createHtmlResponse(
|
|
|
45
45
|
themeCss: state.inlineThemeCss,
|
|
46
46
|
depth,
|
|
47
47
|
});
|
|
48
|
-
|
|
48
|
+
/** unsafe-eval required by mdx-remote hydration — see build.impl.ts */
|
|
49
|
+
return htmlResponse(html, nonce, status, true);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
async function getDocsForSlug(
|
|
@@ -183,7 +184,8 @@ async function renderDocsServerPage(
|
|
|
183
184
|
depth,
|
|
184
185
|
});
|
|
185
186
|
html = await state.builder.runTransformHtmlChain(html, ctx);
|
|
186
|
-
|
|
187
|
+
/** unsafe-eval required by mdx-remote hydration — see build.impl.ts */
|
|
188
|
+
return htmlResponse(html, nonce, 200, true);
|
|
187
189
|
}
|
|
188
190
|
|
|
189
191
|
return createHtmlResponse(title, description, body, 200, state, depth);
|
package/bin/cli.js
CHANGED
|
@@ -61,6 +61,16 @@ const hasSilent = process.argv.includes("--silent");
|
|
|
61
61
|
if (hasDocker) process.env.FLAME_DEPLOY_DOCKER = "1";
|
|
62
62
|
if (hasSilent) process.env.FLAME_DEPLOY_SILENT = "1";
|
|
63
63
|
|
|
64
|
+
// Production mode for build/preview/deploy — ensures minified client bundle
|
|
65
|
+
// on all platforms (Coolify, Vercel, etc.) without requiring the user to
|
|
66
|
+
// set NODE_ENV manually.
|
|
67
|
+
if (
|
|
68
|
+
(command === "build" || command === "preview" || command === "deploy") &&
|
|
69
|
+
!process.env.NODE_ENV
|
|
70
|
+
) {
|
|
71
|
+
process.env.NODE_ENV = "production";
|
|
72
|
+
}
|
|
73
|
+
|
|
64
74
|
if (!command || command === "--help" || command === "-h") {
|
|
65
75
|
console.log(`
|
|
66
76
|
@docubook/flame — A blazing-fast React + MDX framework for modern documentation experiences. Runs on Bun, Node.js, and Deno.
|
|
@@ -116,9 +126,9 @@ if (command === "init") {
|
|
|
116
126
|
const flameCmd = "deno run -A npm:@docubook/flame";
|
|
117
127
|
pkg.scripts = {
|
|
118
128
|
dev: `${flameCmd} dev`,
|
|
119
|
-
build:
|
|
120
|
-
preview:
|
|
121
|
-
deploy:
|
|
129
|
+
build: `NODE_ENV=production ${flameCmd} build`,
|
|
130
|
+
preview: `NODE_ENV=production ${flameCmd} preview`,
|
|
131
|
+
deploy: `NODE_ENV=production ${flameCmd} deploy`,
|
|
122
132
|
};
|
|
123
133
|
|
|
124
134
|
// Generate deno.json with nodeModulesDir for npm compat.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docubook/flame",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.5",
|
|
4
4
|
"description": "A blazing-fast React + MDX framework powered by Bun, built for modern documentation experiences.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"react-dom": "^19.2.7",
|
|
56
56
|
"unified": "^11.0.0",
|
|
57
57
|
"@docubook/core": "^1.8.2",
|
|
58
|
-
"@docubook/mdx-content": "^3.4.5",
|
|
59
58
|
"@docubook/runt": "^1.0.0",
|
|
59
|
+
"@docubook/mdx-content": "^3.4.5",
|
|
60
60
|
"@docubook/themes-colors": "^1.0.2",
|
|
61
61
|
"@docubook/ui-react": "^1.0.0"
|
|
62
62
|
},
|
package/template/.env.example
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
# Server
|
|
1
|
+
# ── Server ──────────────────────────────────────────────
|
|
2
|
+
# Dev/preview server port.
|
|
2
3
|
PORT=3000
|
|
3
4
|
|
|
4
|
-
#
|
|
5
|
+
# ── Build ────────────────────────────────────────────────
|
|
6
|
+
# Max concurrent MDX pages to build (default: 4).
|
|
7
|
+
# Increase for faster builds on high-core machines.
|
|
8
|
+
# BUILD_CONCURRENCY=8
|
|
9
|
+
|
|
10
|
+
# ── Logging ──────────────────────────────────────────────
|
|
11
|
+
# Log level: debug | info | warn | error (default: info)
|
|
12
|
+
LOG_LEVEL=info
|
|
13
|
+
# Log format: pretty | json (default: pretty)
|
|
14
|
+
LOG_FORMAT=pretty
|
|
15
|
+
|
|
16
|
+
# ── Theme ────────────────────────────────────────────────
|
|
17
|
+
# Override docu.json themes.colors at runtime.
|
|
18
|
+
# Available presets: default, freshlime, coffee
|
|
5
19
|
# FLAME_THEME=default
|
|
6
20
|
# FLAME_THEME=freshlime
|
|
7
21
|
# FLAME_THEME=coffee
|
|
8
22
|
|
|
9
|
-
# Error Monitoring (optional)
|
|
23
|
+
# ── Error Monitoring (optional) ─────────────────────────
|
|
24
|
+
# Requires @sentry/bun installed (Bun) or @sentry/node (Node/Deno).
|
|
10
25
|
# SENTRY_DSN=https://your-dsn@sentry.io/project-id
|
|
26
|
+
# SENTRY_RELEASE=1.0.0
|
package/template/package.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "flame dev",
|
|
7
|
-
"build": "flame build",
|
|
8
|
-
"preview": "flame preview",
|
|
9
|
-
"deploy": "flame deploy"
|
|
7
|
+
"build": "NODE_ENV=production flame build",
|
|
8
|
+
"preview": "NODE_ENV=production flame preview",
|
|
9
|
+
"deploy": "NODE_ENV=production flame deploy"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@docubook/flame": "latest"
|