@docubook/flame 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docu/lib/build.deno.js +4 -4
- package/.docu/lib/build.impl-FA57P3VC.js +12 -0
- package/.docu/lib/build.node.js +4 -4
- package/.docu/lib/{chunk-E4OIJWCU.js → chunk-7J3N2MCP.js} +3 -3
- package/.docu/lib/{chunk-RE4NGTMT.js → chunk-EOK6KATZ.js} +9 -3
- package/.docu/lib/{chunk-PTRZ2S2C.js → chunk-GLOJMRT4.js} +1 -1
- package/.docu/lib/{chunk-IR5TVJOV.js → chunk-NXO2BF64.js} +1 -1
- package/.docu/lib/{chunk-TE52TIEW.js → chunk-Q3AXTF2V.js} +2 -2
- package/.docu/lib/{chunk-AI7QAMMZ.js → chunk-QGEFJH47.js} +2 -1
- package/.docu/lib/{chunk-7ZEUL6PR.js → chunk-TEXSBNMR.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 +3 -3
- package/.docu/lib/preview.node.js +3 -3
- package/.docu/lib/server.deno.js +4 -4
- package/.docu/lib/server.node.js +4 -4
- package/.docu/node/security.ts +9 -3
- package/.docu/node/sentry.ts +1 -0
- package/package.json +2 -2
- package/.docu/lib/build.impl-7KJ4ZTAJ.js +0 -12
package/.docu/lib/build.deno.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuildCli
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7J3N2MCP.js";
|
|
4
|
+
import "./chunk-QGEFJH47.js";
|
|
5
|
+
import "./chunk-EOK6KATZ.js";
|
|
6
|
+
import "./chunk-GLOJMRT4.js";
|
|
7
7
|
import "./chunk-J5NMYSBJ.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/build.deno.ts
|
package/.docu/lib/build.node.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuildCli
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7J3N2MCP.js";
|
|
4
|
+
import "./chunk-QGEFJH47.js";
|
|
5
|
+
import "./chunk-EOK6KATZ.js";
|
|
6
|
+
import "./chunk-GLOJMRT4.js";
|
|
7
7
|
import "./chunk-J5NMYSBJ.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/build.node.ts
|
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
htmlShell,
|
|
14
14
|
initSentry,
|
|
15
15
|
loadPlugins
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QGEFJH47.js";
|
|
17
17
|
import {
|
|
18
18
|
generateNonce,
|
|
19
19
|
scanMdxFiles
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EOK6KATZ.js";
|
|
21
21
|
import {
|
|
22
22
|
logger
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GLOJMRT4.js";
|
|
24
24
|
import {
|
|
25
25
|
ASSETS_DIR,
|
|
26
26
|
CACHE_FILE,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// .docu/node/security.ts
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
2
3
|
import { resolve } from "node:path";
|
|
3
4
|
import { realpathSync } from "node:fs";
|
|
4
5
|
var SECURITY_HEADERS = {
|
|
@@ -9,7 +10,7 @@ var SECURITY_HEADERS = {
|
|
|
9
10
|
"Permissions-Policy": "camera=(), microphone=(), geolocation=()"
|
|
10
11
|
};
|
|
11
12
|
function generateNonce() {
|
|
12
|
-
return
|
|
13
|
+
return randomBytes(16).toString("base64");
|
|
13
14
|
}
|
|
14
15
|
function cspHeader(nonce, allowEval = false) {
|
|
15
16
|
const scriptSrc = allowEval ? `script-src 'self' 'nonce-${nonce}' 'unsafe-eval'` : `script-src 'self' 'nonce-${nonce}'`;
|
|
@@ -89,11 +90,16 @@ function wrapPluginResponse(pluginResponse, allowEval = false) {
|
|
|
89
90
|
securedHeaders.set(key, value);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
93
|
+
let body = pluginResponse.body;
|
|
92
94
|
const contentType = securedHeaders.get("Content-Type") || "";
|
|
93
95
|
if (contentType.includes("text/html") && !securedHeaders.has("Content-Security-Policy")) {
|
|
94
|
-
|
|
96
|
+
const nonce = generateNonce();
|
|
97
|
+
securedHeaders.set("Content-Security-Policy", cspHeader(nonce, allowEval));
|
|
98
|
+
if (typeof body === "string") {
|
|
99
|
+
body = injectNonce(body, nonce);
|
|
100
|
+
}
|
|
95
101
|
}
|
|
96
|
-
return new Response(
|
|
102
|
+
return new Response(body, {
|
|
97
103
|
status: pluginResponse.status,
|
|
98
104
|
statusText: pluginResponse.statusText,
|
|
99
105
|
headers: securedHeaders
|
|
@@ -12,7 +12,7 @@ var WORKFLOW_FILE = join(WORKFLOW_DIR, "deploy.yml");
|
|
|
12
12
|
async function runDeploy() {
|
|
13
13
|
console.log("\u{1F4E6} Building for production...\n");
|
|
14
14
|
process.env.NODE_ENV = "production";
|
|
15
|
-
const { runBuildCli } = await import("./build.impl-
|
|
15
|
+
const { runBuildCli } = await import("./build.impl-FA57P3VC.js");
|
|
16
16
|
await runBuildCli();
|
|
17
17
|
await writeFile(join(DIST_DIR, ".nojekyll"), "");
|
|
18
18
|
if (!existsSync(WORKFLOW_FILE)) {
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
generateNonce,
|
|
5
5
|
getContentType,
|
|
6
6
|
injectNonce
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EOK6KATZ.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GLOJMRT4.js";
|
|
11
11
|
import {
|
|
12
12
|
DIST_DIR
|
|
13
13
|
} from "./chunk-J5NMYSBJ.js";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
isExternalUrl,
|
|
6
6
|
normalizeImporterPath,
|
|
7
7
|
scanMdxFiles
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EOK6KATZ.js";
|
|
9
9
|
import {
|
|
10
10
|
ASSETS_DIR,
|
|
11
11
|
DOCS_DIR,
|
|
@@ -1031,6 +1031,7 @@ async function initSentry() {
|
|
|
1031
1031
|
initialized = true;
|
|
1032
1032
|
} catch {
|
|
1033
1033
|
sentry = null;
|
|
1034
|
+
initialized = false;
|
|
1034
1035
|
}
|
|
1035
1036
|
}
|
|
1036
1037
|
function captureException(err, context) {
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
htmlShell,
|
|
15
15
|
initSentry,
|
|
16
16
|
loadPlugins
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QGEFJH47.js";
|
|
18
18
|
import {
|
|
19
19
|
SECURITY_HEADERS,
|
|
20
20
|
generateNonce,
|
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
isSlugSafe,
|
|
25
25
|
stripDocsHtmlSuffix,
|
|
26
26
|
wrapPluginResponse
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-EOK6KATZ.js";
|
|
28
28
|
import {
|
|
29
29
|
logger
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GLOJMRT4.js";
|
|
31
31
|
import {
|
|
32
32
|
DIST_DIR,
|
|
33
33
|
DOCS_DIR,
|
package/.docu/lib/clean.js
CHANGED
package/.docu/lib/deploy.deno.js
CHANGED
package/.docu/lib/deploy.node.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPreview
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-Q3AXTF2V.js";
|
|
4
|
+
import "./chunk-EOK6KATZ.js";
|
|
5
|
+
import "./chunk-GLOJMRT4.js";
|
|
6
6
|
import "./chunk-J5NMYSBJ.js";
|
|
7
7
|
|
|
8
8
|
// .docu/node/preview.deno.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPreview
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-Q3AXTF2V.js";
|
|
4
|
+
import "./chunk-EOK6KATZ.js";
|
|
5
|
+
import "./chunk-GLOJMRT4.js";
|
|
6
6
|
import "./chunk-J5NMYSBJ.js";
|
|
7
7
|
|
|
8
8
|
// .docu/node/preview.node.ts
|
package/.docu/lib/server.deno.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runServer
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-TEXSBNMR.js";
|
|
4
|
+
import "./chunk-QGEFJH47.js";
|
|
5
|
+
import "./chunk-EOK6KATZ.js";
|
|
6
|
+
import "./chunk-GLOJMRT4.js";
|
|
7
7
|
import "./chunk-J5NMYSBJ.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-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-TEXSBNMR.js";
|
|
4
|
+
import "./chunk-QGEFJH47.js";
|
|
5
|
+
import "./chunk-EOK6KATZ.js";
|
|
6
|
+
import "./chunk-GLOJMRT4.js";
|
|
7
7
|
import "./chunk-J5NMYSBJ.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/server.node.ts
|
package/.docu/node/security.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
1
2
|
import { resolve } from "node:path";
|
|
2
3
|
import { realpathSync } from "node:fs";
|
|
3
4
|
|
|
@@ -10,7 +11,7 @@ export const SECURITY_HEADERS: Record<string, string> = {
|
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
export function generateNonce(): string {
|
|
13
|
-
return
|
|
14
|
+
return randomBytes(16).toString("base64");
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export function cspHeader(nonce: string, allowEval = false): string {
|
|
@@ -117,11 +118,16 @@ export function wrapPluginResponse(
|
|
|
117
118
|
securedHeaders.set(key, value);
|
|
118
119
|
}
|
|
119
120
|
}
|
|
121
|
+
let body = pluginResponse.body;
|
|
120
122
|
const contentType = securedHeaders.get("Content-Type") || "";
|
|
121
123
|
if (contentType.includes("text/html") && !securedHeaders.has("Content-Security-Policy")) {
|
|
122
|
-
|
|
124
|
+
const nonce = generateNonce();
|
|
125
|
+
securedHeaders.set("Content-Security-Policy", cspHeader(nonce, allowEval));
|
|
126
|
+
if (typeof body === "string") {
|
|
127
|
+
body = injectNonce(body, nonce);
|
|
128
|
+
}
|
|
123
129
|
}
|
|
124
|
-
return new Response(
|
|
130
|
+
return new Response(body, {
|
|
125
131
|
status: pluginResponse.status,
|
|
126
132
|
statusText: pluginResponse.statusText,
|
|
127
133
|
headers: securedHeaders,
|
package/.docu/node/sentry.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docubook/flame",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "A blazing-fast React + MDX framework powered by Bun, built for modern documentation experiences.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"unified": "^11.0.0",
|
|
57
57
|
"@docubook/core": "^1.8.2",
|
|
58
58
|
"@docubook/mdx-content": "^3.4.3",
|
|
59
|
+
"@docubook/themes-colors": "^1.0.1",
|
|
59
60
|
"@docubook/runt": "^1.0.0",
|
|
60
|
-
"@docubook/themes-colors": "^1.0.0",
|
|
61
61
|
"@docubook/ui-react": "^1.0.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|