@docubook/flame 1.6.1 → 1.6.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.
- package/.docu/lib/build.deno.js +3 -3
- package/.docu/lib/{build.impl-5VMX2INF.js → build.impl-GH62P623.js} +3 -3
- package/.docu/lib/build.node.js +3 -3
- package/.docu/lib/{chunk-EINCC7ET.js → chunk-66756URY.js} +7 -2
- package/.docu/lib/{chunk-2VUUBIN3.js → chunk-DJTS6D3J.js} +1 -1
- package/.docu/lib/{chunk-P3ZT4S3D.js → chunk-DSGJHYQX.js} +1 -1
- package/.docu/lib/{chunk-XX2VVJMV.js → chunk-JM7HWEF6.js} +2 -2
- package/.docu/lib/{chunk-GC62TPBC.js → chunk-KLB4S2KT.js} +2 -2
- package/.docu/lib/{chunk-IJFMQFWW.js → chunk-WSJC3PRH.js} +31 -28
- 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 +3 -3
- package/.docu/lib/server.node.js +3 -3
- package/.docu/node/client-routes.ts +4 -2
- package/.docu/node/deploy.shared.ts +6 -1
- package/.docu/node/deploy.ts +0 -1
- package/.docu/node/hydrate.node.ts +14 -4
- package/.docu/node/hydrate.ts +14 -4
- package/bin/compile-lib.mjs +0 -24
- package/package.json +3 -3
package/.docu/lib/build.deno.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runBuildCli
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JM7HWEF6.js";
|
|
4
|
+
import "./chunk-WSJC3PRH.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-DJTS6D3J.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-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-JM7HWEF6.js";
|
|
5
|
+
import "./chunk-WSJC3PRH.js";
|
|
6
6
|
import "./chunk-EOK6KATZ.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-DJTS6D3J.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-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JM7HWEF6.js";
|
|
4
|
+
import "./chunk-WSJC3PRH.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-DJTS6D3J.js";
|
|
7
7
|
import "./chunk-4IQXHHPF.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/build.node.ts
|
|
@@ -24,6 +24,7 @@ var NGINX_CONF = `server {
|
|
|
24
24
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
|
|
25
25
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
26
26
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
|
27
|
+
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' https: data:; font-src 'self' data:; connect-src 'self' https:; frame-src https://www.youtube-nocookie.com; frame-ancestors 'none'" always;
|
|
27
28
|
|
|
28
29
|
location /assets/ {
|
|
29
30
|
expires 1y;
|
|
@@ -33,6 +34,7 @@ var NGINX_CONF = `server {
|
|
|
33
34
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
|
|
34
35
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
35
36
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
|
37
|
+
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' https: data:; font-src 'self' data:; connect-src 'self' https:; frame-src https://www.youtube-nocookie.com; frame-ancestors 'none'" always;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
location /docs/assets/ {
|
|
@@ -43,6 +45,7 @@ var NGINX_CONF = `server {
|
|
|
43
45
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
|
|
44
46
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
45
47
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
|
48
|
+
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' https: data:; font-src 'self' data:; connect-src 'self' https:; frame-src https://www.youtube-nocookie.com; frame-ancestors 'none'" always;
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
location / {
|
|
@@ -104,7 +107,10 @@ function detectPkgManager(dir) {
|
|
|
104
107
|
var HEADERS_FILE = `/*
|
|
105
108
|
X-Frame-Options: DENY
|
|
106
109
|
X-Content-Type-Options: nosniff
|
|
110
|
+
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
|
|
107
111
|
Referrer-Policy: strict-origin-when-cross-origin
|
|
112
|
+
Permissions-Policy: camera=(), microphone=(), geolocation=()
|
|
113
|
+
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' https: data:; font-src 'self' data:; connect-src 'self' https:; frame-src https://www.youtube-nocookie.com; frame-ancestors 'none'
|
|
108
114
|
|
|
109
115
|
/assets/*
|
|
110
116
|
Cache-Control: public, max-age=31536000, immutable
|
|
@@ -127,7 +133,7 @@ async function runBuild() {
|
|
|
127
133
|
process.env.FLAME_BUILD_SILENT = "1";
|
|
128
134
|
process.env.LOG_LEVEL = "error";
|
|
129
135
|
}
|
|
130
|
-
const { runBuildCli } = await import("./build.impl-
|
|
136
|
+
const { runBuildCli } = await import("./build.impl-GH62P623.js");
|
|
131
137
|
await runBuildCli();
|
|
132
138
|
}
|
|
133
139
|
async function writeDockerFiles() {
|
|
@@ -146,7 +152,6 @@ RUN ${pm.runCmd} run build
|
|
|
146
152
|
FROM nginx:alpine
|
|
147
153
|
COPY --from=builder /app/.docu/dist /usr/share/nginx/html
|
|
148
154
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
149
|
-
USER nginx
|
|
150
155
|
EXPOSE 80
|
|
151
156
|
CMD ["nginx", "-g", "daemon off;"]
|
|
152
157
|
`
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
htmlShell,
|
|
14
14
|
initSentry,
|
|
15
15
|
loadPlugins
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WSJC3PRH.js";
|
|
17
17
|
import {
|
|
18
18
|
cspHeader,
|
|
19
19
|
generateNonce,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from "./chunk-EOK6KATZ.js";
|
|
22
22
|
import {
|
|
23
23
|
logger
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-DJTS6D3J.js";
|
|
25
25
|
import {
|
|
26
26
|
ASSETS_DIR,
|
|
27
27
|
CACHE_FILE,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
htmlShell,
|
|
15
15
|
initSentry,
|
|
16
16
|
loadPlugins
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WSJC3PRH.js";
|
|
18
18
|
import {
|
|
19
19
|
SECURITY_HEADERS,
|
|
20
20
|
generateNonce,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-EOK6KATZ.js";
|
|
28
28
|
import {
|
|
29
29
|
logger
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-DJTS6D3J.js";
|
|
31
31
|
import {
|
|
32
32
|
DIST_DIR,
|
|
33
33
|
DOCS_DIR,
|
|
@@ -103,8 +103,8 @@ var BuildPluginBuilder = class {
|
|
|
103
103
|
_remarkPlugins = [];
|
|
104
104
|
_transformFrontmatter = [];
|
|
105
105
|
_transformHtml = [];
|
|
106
|
-
constructor(
|
|
107
|
-
this.config =
|
|
106
|
+
constructor(config2) {
|
|
107
|
+
this.config = config2;
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Collect and deduplicate all `<body>` injection snippets from registered plugins.
|
|
@@ -646,8 +646,8 @@ function getThemeConfig() {
|
|
|
646
646
|
if (process.env.FLAME_THEME) {
|
|
647
647
|
return process.env.FLAME_THEME;
|
|
648
648
|
}
|
|
649
|
-
const
|
|
650
|
-
return
|
|
649
|
+
const config2 = loadDocuConfig();
|
|
650
|
+
return config2.themes?.colors;
|
|
651
651
|
}
|
|
652
652
|
function buildThemeCss(baseCss, themeConfig) {
|
|
653
653
|
try {
|
|
@@ -683,19 +683,19 @@ import { existsSync, readFileSync, readdirSync as readdirSync2 } from "node:fs";
|
|
|
683
683
|
import { promisify } from "node:util";
|
|
684
684
|
import { mkdir, readFile, unlink, writeFile } from "node:fs/promises";
|
|
685
685
|
import { createHash } from "node:crypto";
|
|
686
|
-
function extractConfigIcons(
|
|
686
|
+
function extractConfigIcons(config2) {
|
|
687
687
|
const icons = [];
|
|
688
688
|
const pushIf = (s) => {
|
|
689
689
|
if (s) icons.push(s);
|
|
690
690
|
};
|
|
691
|
-
|
|
692
|
-
|
|
691
|
+
config2.home?.hero?.actions?.forEach((a) => pushIf(a.icon));
|
|
692
|
+
config2.home?.features?.forEach((f) => pushIf(f.icon));
|
|
693
693
|
(function walk(routes3) {
|
|
694
694
|
for (const r of routes3) {
|
|
695
695
|
pushIf(r.context?.icon);
|
|
696
696
|
if (r.items) walk(r.items);
|
|
697
697
|
}
|
|
698
|
-
})(
|
|
698
|
+
})(config2.routes ?? []);
|
|
699
699
|
return [...new Set(icons.filter((n) => /^[A-Z]/.test(n)))];
|
|
700
700
|
}
|
|
701
701
|
var execFileAsync = promisify(execFile);
|
|
@@ -874,17 +874,25 @@ async function buildClientBundle() {
|
|
|
874
874
|
{
|
|
875
875
|
name: "docu-config",
|
|
876
876
|
setup(build2) {
|
|
877
|
-
build2.onResolve({ filter: /
|
|
877
|
+
build2.onResolve({ filter: /client-routes$/ }, (args) => ({
|
|
878
878
|
path: args.path,
|
|
879
|
-
namespace: "
|
|
879
|
+
namespace: "client-routes"
|
|
880
880
|
}));
|
|
881
|
-
build2.onLoad({ filter: /.*/, namespace: "
|
|
882
|
-
const
|
|
881
|
+
build2.onLoad({ filter: /.*/, namespace: "client-routes" }, () => {
|
|
882
|
+
const config2 = loadDocuConfig();
|
|
883
883
|
const resolved = {
|
|
884
|
-
...
|
|
885
|
-
routes: resolveRoutes(
|
|
884
|
+
...config2,
|
|
885
|
+
routes: resolveRoutes(config2.routes)
|
|
886
|
+
};
|
|
887
|
+
return {
|
|
888
|
+
contents: [
|
|
889
|
+
`import type { DocuRoute, DocuConfig } from "./types";`,
|
|
890
|
+
`const docuConfig = ${JSON.stringify(resolved)};`,
|
|
891
|
+
`export const routes = docuConfig.routes || [];`,
|
|
892
|
+
`export const config = docuConfig;`
|
|
893
|
+
].join("\n"),
|
|
894
|
+
loader: "ts"
|
|
886
895
|
};
|
|
887
|
-
return { contents: JSON.stringify(resolved), loader: "json" };
|
|
888
896
|
});
|
|
889
897
|
}
|
|
890
898
|
}
|
|
@@ -2028,15 +2036,10 @@ function Anchor({
|
|
|
2028
2036
|
return /* @__PURE__ */ jsx15("a", { href, className: baseClasses, ...props, children });
|
|
2029
2037
|
}
|
|
2030
2038
|
|
|
2031
|
-
// docu-config-runtime:../../docu.json
|
|
2032
|
-
import { readFileSync as readFileSync2 } from "node:fs";
|
|
2033
|
-
import { join as join4 } from "node:path";
|
|
2034
|
-
var config = JSON.parse(readFileSync2(join4(process.cwd(), "docu.json"), "utf-8"));
|
|
2035
|
-
var docu_default = config;
|
|
2036
|
-
|
|
2037
2039
|
// .docu/node/client-routes.ts
|
|
2038
|
-
var
|
|
2039
|
-
var
|
|
2040
|
+
var docuConfig5 = loadDocuConfig();
|
|
2041
|
+
var routes2 = resolveRoutes(docuConfig5.routes || []);
|
|
2042
|
+
var config = docuConfig5;
|
|
2040
2043
|
|
|
2041
2044
|
// .docu/components/Sublink.tsx
|
|
2042
2045
|
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -2078,7 +2081,7 @@ function Sublink({
|
|
|
2078
2081
|
}
|
|
2079
2082
|
);
|
|
2080
2083
|
if (level >= 1) {
|
|
2081
|
-
if (
|
|
2084
|
+
if (config.sidebar?.context === "separator") {
|
|
2082
2085
|
const sectionOffsets = { 1: 16, 2: 32 };
|
|
2083
2086
|
let overlap = 14;
|
|
2084
2087
|
for (let l = 1; l < level; l++) {
|
|
@@ -2187,7 +2190,7 @@ function Menu({ onNavigate, className = "", pathname, routes: routes3 = [] }) {
|
|
|
2187
2190
|
() => pathname || (typeof window !== "undefined" ? window.location.pathname : "/docs")
|
|
2188
2191
|
);
|
|
2189
2192
|
if (!currentPath.startsWith("/docs")) return null;
|
|
2190
|
-
const mode =
|
|
2193
|
+
const mode = config.sidebar?.context || "dropdown";
|
|
2191
2194
|
const navProps = {
|
|
2192
2195
|
"aria-label": "Documentation navigation",
|
|
2193
2196
|
className: cn("transition-all duration-200", className)
|
|
@@ -2249,7 +2252,7 @@ function Menu({ onNavigate, className = "", pathname, routes: routes3 = [] }) {
|
|
|
2249
2252
|
}
|
|
2250
2253
|
|
|
2251
2254
|
// .docu/components/DocsLayout.tsx
|
|
2252
|
-
var
|
|
2255
|
+
var docuConfig6 = loadDocuConfig();
|
|
2253
2256
|
function DocsLayout({ children, repoUrl, pathname = "/docs" }) {
|
|
2254
2257
|
return React2.createElement(
|
|
2255
2258
|
"div",
|
|
@@ -2270,7 +2273,7 @@ function DocsLayout({ children, repoUrl, pathname = "/docs" }) {
|
|
|
2270
2273
|
React2.createElement(
|
|
2271
2274
|
"div",
|
|
2272
2275
|
{ className: "flex h-full flex-col overflow-y-auto px-4" },
|
|
2273
|
-
React2.createElement(Menu, { pathname, routes:
|
|
2276
|
+
React2.createElement(Menu, { pathname, routes: docuConfig6.routes || [] })
|
|
2274
2277
|
)
|
|
2275
2278
|
),
|
|
2276
2279
|
React2.createElement(
|
|
@@ -2282,7 +2285,7 @@ function DocsLayout({ children, repoUrl, pathname = "/docs" }) {
|
|
|
2282
2285
|
React2.createElement(
|
|
2283
2286
|
"nav",
|
|
2284
2287
|
{ className: "flex items-center gap-6 text-sm font-medium text-base-content/80" },
|
|
2285
|
-
...(
|
|
2288
|
+
...(docuConfig6.navbar?.menu || []).map((item) => {
|
|
2286
2289
|
const isExternal = /^https?:\/\//.test(item.href);
|
|
2287
2290
|
const isDocsActive = item.href === "/docs";
|
|
2288
2291
|
return React2.createElement(
|
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-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-KLB4S2KT.js";
|
|
4
|
+
import "./chunk-WSJC3PRH.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-DJTS6D3J.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-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-KLB4S2KT.js";
|
|
4
|
+
import "./chunk-WSJC3PRH.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-DJTS6D3J.js";
|
|
7
7
|
import "./chunk-4IQXHHPF.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/server.node.ts
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { DocuRoute, DocuConfig } from "./types";
|
|
2
|
-
import
|
|
2
|
+
import { loadDocuConfig } from "./paths";
|
|
3
|
+
import { resolveRoutes } from "./fs-scanner";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
const docuConfig = loadDocuConfig();
|
|
6
|
+
export const routes: DocuRoute[] = resolveRoutes(docuConfig.routes || []);
|
|
5
7
|
export const config = docuConfig as unknown as DocuConfig;
|
|
@@ -31,6 +31,7 @@ export const NGINX_CONF = `server {
|
|
|
31
31
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
|
|
32
32
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
33
33
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
|
34
|
+
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' https: data:; font-src 'self' data:; connect-src 'self' https:; frame-src https://www.youtube-nocookie.com; frame-ancestors 'none'" always;
|
|
34
35
|
|
|
35
36
|
location /assets/ {
|
|
36
37
|
expires 1y;
|
|
@@ -40,6 +41,7 @@ export const NGINX_CONF = `server {
|
|
|
40
41
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
|
|
41
42
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
42
43
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
|
44
|
+
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' https: data:; font-src 'self' data:; connect-src 'self' https:; frame-src https://www.youtube-nocookie.com; frame-ancestors 'none'" always;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
location /docs/assets/ {
|
|
@@ -50,6 +52,7 @@ export const NGINX_CONF = `server {
|
|
|
50
52
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
|
|
51
53
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
52
54
|
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
|
55
|
+
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' https: data:; font-src 'self' data:; connect-src 'self' https:; frame-src https://www.youtube-nocookie.com; frame-ancestors 'none'" always;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
location / {
|
|
@@ -126,7 +129,10 @@ export function detectPkgManager(dir: string): {
|
|
|
126
129
|
export const HEADERS_FILE = `/*
|
|
127
130
|
X-Frame-Options: DENY
|
|
128
131
|
X-Content-Type-Options: nosniff
|
|
132
|
+
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
|
|
129
133
|
Referrer-Policy: strict-origin-when-cross-origin
|
|
134
|
+
Permissions-Policy: camera=(), microphone=(), geolocation=()
|
|
135
|
+
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' https: data:; font-src 'self' data:; connect-src 'self' https:; frame-src https://www.youtube-nocookie.com; frame-ancestors 'none'
|
|
130
136
|
|
|
131
137
|
/assets/*
|
|
132
138
|
Cache-Control: public, max-age=31536000, immutable
|
|
@@ -172,7 +178,6 @@ RUN ${pm.runCmd} run build
|
|
|
172
178
|
FROM nginx:alpine
|
|
173
179
|
COPY --from=builder /app/.docu/dist /usr/share/nginx/html
|
|
174
180
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
175
|
-
USER nginx
|
|
176
181
|
EXPOSE 80
|
|
177
182
|
CMD ["nginx", "-g", "daemon off;"]
|
|
178
183
|
`
|
package/.docu/node/deploy.ts
CHANGED
|
@@ -270,17 +270,27 @@ export async function buildClientBundle(): Promise<{ js: string; css: string }>
|
|
|
270
270
|
{
|
|
271
271
|
name: "docu-config",
|
|
272
272
|
setup(build) {
|
|
273
|
-
|
|
273
|
+
// Components import as "../node/client-routes" (no .ts extension),
|
|
274
|
+
// so filter matches the path tail without requiring the extension.
|
|
275
|
+
build.onResolve({ filter: /client-routes$/ }, (args) => ({
|
|
274
276
|
path: args.path,
|
|
275
|
-
namespace: "
|
|
277
|
+
namespace: "client-routes",
|
|
276
278
|
}));
|
|
277
|
-
build.onLoad({ filter: /.*/, namespace: "
|
|
279
|
+
build.onLoad({ filter: /.*/, namespace: "client-routes" }, () => {
|
|
278
280
|
const config = loadDocuConfig();
|
|
279
281
|
const resolved = {
|
|
280
282
|
...config,
|
|
281
283
|
routes: resolveRoutes(config.routes as DocuRoute[] | undefined),
|
|
282
284
|
};
|
|
283
|
-
return {
|
|
285
|
+
return {
|
|
286
|
+
contents: [
|
|
287
|
+
`import type { DocuRoute, DocuConfig } from "./types";`,
|
|
288
|
+
`const docuConfig = ${JSON.stringify(resolved)};`,
|
|
289
|
+
`export const routes = docuConfig.routes || [];`,
|
|
290
|
+
`export const config = docuConfig;`,
|
|
291
|
+
].join("\n"),
|
|
292
|
+
loader: "ts",
|
|
293
|
+
};
|
|
284
294
|
});
|
|
285
295
|
},
|
|
286
296
|
},
|
package/.docu/node/hydrate.ts
CHANGED
|
@@ -142,17 +142,27 @@ export async function buildClientBundle(): Promise<{ js: string; css: string }>
|
|
|
142
142
|
{
|
|
143
143
|
name: "docu-config",
|
|
144
144
|
setup(build) {
|
|
145
|
-
|
|
145
|
+
// Components import as "../node/client-routes" (no .ts extension),
|
|
146
|
+
// so filter matches the path tail without requiring the extension.
|
|
147
|
+
build.onResolve({ filter: /client-routes$/ }, (args) => ({
|
|
146
148
|
path: args.path,
|
|
147
|
-
namespace: "
|
|
149
|
+
namespace: "client-routes",
|
|
148
150
|
}));
|
|
149
|
-
build.onLoad({ filter: /.*/, namespace: "
|
|
151
|
+
build.onLoad({ filter: /.*/, namespace: "client-routes" }, () => {
|
|
150
152
|
const config = loadDocuConfig();
|
|
151
153
|
const resolved = {
|
|
152
154
|
...config,
|
|
153
155
|
routes: resolveRoutes(config.routes as DocuRoute[] | undefined),
|
|
154
156
|
};
|
|
155
|
-
return {
|
|
157
|
+
return {
|
|
158
|
+
contents: [
|
|
159
|
+
`import type { DocuRoute, DocuConfig } from "./types";`,
|
|
160
|
+
`const docuConfig = ${JSON.stringify(resolved)};`,
|
|
161
|
+
`export const routes = docuConfig.routes || [];`,
|
|
162
|
+
`export const config = docuConfig;`,
|
|
163
|
+
].join("\n"),
|
|
164
|
+
loader: "ts",
|
|
165
|
+
};
|
|
156
166
|
});
|
|
157
167
|
},
|
|
158
168
|
},
|
package/bin/compile-lib.mjs
CHANGED
|
@@ -35,30 +35,6 @@ await build({
|
|
|
35
35
|
packages: "external",
|
|
36
36
|
jsx: "automatic",
|
|
37
37
|
logLevel: "info",
|
|
38
|
-
plugins: [
|
|
39
|
-
{
|
|
40
|
-
// The SSR component graph imports `docu.json` statically
|
|
41
|
-
// (client-routes.ts). At runtime that must be the USER's project
|
|
42
|
-
// config, so replace the import with a cwd-relative read instead of
|
|
43
|
-
// baking the monorepo's docu.json into the published bundle.
|
|
44
|
-
name: "docu-config-runtime",
|
|
45
|
-
setup(build) {
|
|
46
|
-
build.onResolve({ filter: /docu\.json$/ }, (args) => ({
|
|
47
|
-
path: args.path,
|
|
48
|
-
namespace: "docu-config-runtime",
|
|
49
|
-
}));
|
|
50
|
-
build.onLoad({ filter: /.*/, namespace: "docu-config-runtime" }, () => ({
|
|
51
|
-
contents: [
|
|
52
|
-
`import { readFileSync } from "node:fs";`,
|
|
53
|
-
`import { join } from "node:path";`,
|
|
54
|
-
`const config = JSON.parse(readFileSync(join(process.cwd(), "docu.json"), "utf-8"));`,
|
|
55
|
-
`export default config;`,
|
|
56
|
-
].join("\n"),
|
|
57
|
-
loader: "js",
|
|
58
|
-
}));
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
38
|
});
|
|
63
39
|
|
|
64
40
|
// esbuild's service process keeps Deno's event loop alive after one-shot
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docubook/flame",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
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,9 +56,9 @@
|
|
|
56
56
|
"unified": "^11.0.0",
|
|
57
57
|
"@docubook/core": "^1.8.2",
|
|
58
58
|
"@docubook/mdx-content": "^3.4.5",
|
|
59
|
+
"@docubook/runt": "^1.0.0",
|
|
59
60
|
"@docubook/themes-colors": "^1.0.2",
|
|
60
|
-
"@docubook/ui-react": "^1.0.0"
|
|
61
|
-
"@docubook/runt": "^1.0.0"
|
|
61
|
+
"@docubook/ui-react": "^1.0.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@sentry/bun": "^10.0.0"
|