@docubook/flame 2.0.0-beta.1 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docu/lib/build.deno.js +6 -9
- package/.docu/lib/build.deno.js.map +1 -0
- package/.docu/lib/build.impl-BJsi28mD.js +377 -0
- package/.docu/lib/build.impl-BJsi28mD.js.map +1 -0
- package/.docu/lib/build.impl-yVLaa1eQ.js +2 -0
- package/.docu/lib/build.node.js +6 -9
- package/.docu/lib/build.node.js.map +1 -0
- package/.docu/lib/clean.js +25 -25
- package/.docu/lib/clean.js.map +1 -0
- package/.docu/lib/deno-DmEaKggj.js +20 -0
- package/.docu/lib/deno-DmEaKggj.js.map +1 -0
- package/.docu/lib/deploy.deno.js +9 -9
- package/.docu/lib/deploy.deno.js.map +1 -0
- package/.docu/lib/deploy.node.js +8 -8
- package/.docu/lib/deploy.node.js.map +1 -0
- package/.docu/lib/deploy.shared-D3UWafa6.js +295 -0
- package/.docu/lib/deploy.shared-D3UWafa6.js.map +1 -0
- package/.docu/lib/html.shared-DSn-7_6t.js +2467 -0
- package/.docu/lib/html.shared-DSn-7_6t.js.map +1 -0
- package/.docu/lib/logger-CycvLCrQ.js +312 -0
- package/.docu/lib/logger-CycvLCrQ.js.map +1 -0
- package/.docu/lib/node-DPTySdwG.js +80 -0
- package/.docu/lib/node-DPTySdwG.js.map +1 -0
- package/.docu/lib/paths-BtOIPBQ9.js +52 -0
- package/.docu/lib/paths-BtOIPBQ9.js.map +1 -0
- package/.docu/lib/preview.deno.js +7 -11
- package/.docu/lib/preview.deno.js.map +1 -0
- package/.docu/lib/preview.impl-CXJS2tQS.js +77 -0
- package/.docu/lib/preview.impl-CXJS2tQS.js.map +1 -0
- package/.docu/lib/preview.node.js +7 -11
- package/.docu/lib/preview.node.js.map +1 -0
- package/.docu/lib/server.deno.js +7 -12
- package/.docu/lib/server.deno.js.map +1 -0
- package/.docu/lib/server.impl-CJuWimfN.js +358 -0
- package/.docu/lib/server.impl-CJuWimfN.js.map +1 -0
- package/.docu/lib/server.node.js +7 -12
- package/.docu/lib/server.node.js.map +1 -0
- package/.docu/lib/utils-DA17MyQG.js +167 -0
- package/.docu/lib/utils-DA17MyQG.js.map +1 -0
- package/.docu/node/hydrate.node.ts +116 -166
- package/bin/compile-lib.mjs +30 -28
- package/package.json +6 -6
- package/.docu/lib/build.impl-3ZOQORN3.js +0 -12
- package/.docu/lib/chunk-4IQXHHPF.js +0 -62
- package/.docu/lib/chunk-6EOUQCRM.js +0 -301
- package/.docu/lib/chunk-6HFBJUMG.js +0 -434
- package/.docu/lib/chunk-EOK6KATZ.js +0 -191
- package/.docu/lib/chunk-FERG25YW.js +0 -470
- package/.docu/lib/chunk-MQRFIDS4.js +0 -92
- package/.docu/lib/chunk-U7M5SK76.js +0 -330
- package/.docu/lib/chunk-UISOJ4RW.js +0 -114
- package/.docu/lib/chunk-URBATJEC.js +0 -2720
package/.docu/lib/build.deno.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-FERG25YW.js";
|
|
4
|
-
import "./chunk-URBATJEC.js";
|
|
5
|
-
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-6EOUQCRM.js";
|
|
7
|
-
import "./chunk-4IQXHHPF.js";
|
|
8
|
-
|
|
9
|
-
// .docu/node/build.deno.ts
|
|
1
|
+
import { n as runBuildCli } from "./build.impl-BJsi28mD.js";
|
|
2
|
+
//#region .docu/node/build.deno.ts
|
|
10
3
|
await runBuildCli();
|
|
11
4
|
process.exit(0);
|
|
5
|
+
//#endregion
|
|
6
|
+
export {};
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=build.deno.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.deno.js","names":[],"sources":["../node/build.deno.ts"],"sourcesContent":["import { runBuildCli } from \"./build.impl\";\n\nawait runBuildCli();\n// Deno resolves react-dom/server to server.browser.js (its `deno` export\n// condition), which opens a module-scope MessageChannel that keeps the event\n// loop alive after the build completes — force a clean exit.\nprocess.exit(0);\n"],"mappings":";;AAEA,MAAM,YAAY;AAIlB,QAAQ,KAAK,CAAC"}
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import { a as DOCS_DIR, c as PROJECT_ROOT, d as loadDocuConfig, i as DOCS_ASSETS_DIR, n as CACHE_FILE, r as DIST_DIR, t as ASSETS_DIR } from "./paths-BtOIPBQ9.js";
|
|
2
|
+
import { S as loadPlugins, _ as registerPageContent, a as IndexPage, b as computeInlineThemeCss, c as captureException, d as compileMdx, f as compileMdxModule, g as getPageStripped, h as getPageFrontmatter, i as DocsLayout, l as initSentry, m as getPageContent, o as NotFoundPage, p as frontmatterField, r as htmlShell, s as DocsPage, u as generateSearchIndex, v as getGitLastModifiedBatch, x as BuildPluginBuilder, y as buildClientBundle } from "./html.shared-DSn-7_6t.js";
|
|
3
|
+
import { l as cspHeader, o as scanMdxFiles, u as generateNonce } from "./utils-DA17MyQG.js";
|
|
4
|
+
import { t as logger } from "./logger-CycvLCrQ.js";
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
7
|
+
import { copyFile, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
8
|
+
import { createHash } from "node:crypto";
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { renderToString } from "react-dom/server";
|
|
11
|
+
//#region .docu/node/seo.ts
|
|
12
|
+
/**
|
|
13
|
+
* Build SEO metadata from config and per-page frontmatter.
|
|
14
|
+
* All fields are derived from existing data — no extra config required.
|
|
15
|
+
*/
|
|
16
|
+
function buildSeoMeta(config, frontmatter, slug) {
|
|
17
|
+
const baseURL = config.meta?.baseURL?.replace(/\/+$/, "") || "";
|
|
18
|
+
const result = {
|
|
19
|
+
url: slug ? `${baseURL}/docs/${slug}` : `${baseURL}/`,
|
|
20
|
+
siteName: config.meta?.title || ""
|
|
21
|
+
};
|
|
22
|
+
const image = frontmatterField(frontmatter, "image") || config.meta?.ogImage;
|
|
23
|
+
if (image) try {
|
|
24
|
+
result.image = new URL(image, image.startsWith("/") ? baseURL : `${baseURL}/docs/`).href;
|
|
25
|
+
} catch {
|
|
26
|
+
result.image = image;
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region .docu/node/build.impl.ts
|
|
32
|
+
/**
|
|
33
|
+
* Runtime-neutral static build — mirror of `build.ts` (Bun-only via its
|
|
34
|
+
* transitive imports, protected) with the Bun-coupled modules swapped for
|
|
35
|
+
* their neutral counterparts: `html.shared` (pure escaping) and
|
|
36
|
+
* `hydrate.node` (esbuild client bundling). Everything else is identical.
|
|
37
|
+
* The Node/Deno build entries call `runBuildCli()`.
|
|
38
|
+
*/
|
|
39
|
+
function parseArgs() {
|
|
40
|
+
const args = process.argv.slice(2);
|
|
41
|
+
return {
|
|
42
|
+
force: args.includes("--force") || args.includes("-f"),
|
|
43
|
+
clean: args.includes("--clean") || args.includes("-c")
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function hashContent(content) {
|
|
47
|
+
return createHash("sha256").update(content).digest("hex").slice(0, 16);
|
|
48
|
+
}
|
|
49
|
+
async function readCache() {
|
|
50
|
+
try {
|
|
51
|
+
if (existsSync(CACHE_FILE)) {
|
|
52
|
+
const data = await readFile(CACHE_FILE, "utf-8");
|
|
53
|
+
return JSON.parse(data);
|
|
54
|
+
}
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.error("Failed to load build cache:", err.message);
|
|
57
|
+
}
|
|
58
|
+
return {};
|
|
59
|
+
}
|
|
60
|
+
async function writeCache(cache) {
|
|
61
|
+
await writeFile(CACHE_FILE, JSON.stringify(cache, null, 2));
|
|
62
|
+
}
|
|
63
|
+
function parseConcurrency() {
|
|
64
|
+
return Math.max(1, parseInt(process.env.BUILD_CONCURRENCY || "4", 10) || 4);
|
|
65
|
+
}
|
|
66
|
+
function shouldRebuild(path, mtime, cache) {
|
|
67
|
+
const cached = cache[path];
|
|
68
|
+
if (!cached) return "yes";
|
|
69
|
+
if (mtime > cached.builtAt) return "hash_check";
|
|
70
|
+
return "no";
|
|
71
|
+
}
|
|
72
|
+
var assetManifest = {
|
|
73
|
+
js: "client.js",
|
|
74
|
+
css: "client.css"
|
|
75
|
+
};
|
|
76
|
+
var inlineThemeCss;
|
|
77
|
+
async function renderDocsPage(docuConfig, slug, rawMdx, filePath, gitDates, builder, nonce) {
|
|
78
|
+
let content = rawMdx;
|
|
79
|
+
if (builder) {
|
|
80
|
+
const transformed = await builder.runOnLoad(filePath, content);
|
|
81
|
+
if (transformed?.contents) content = transformed.contents;
|
|
82
|
+
}
|
|
83
|
+
let result;
|
|
84
|
+
try {
|
|
85
|
+
const remarkPlugins = builder?.collectRemarkPlugins();
|
|
86
|
+
const rehypePlugins = builder?.collectRehypePlugins();
|
|
87
|
+
const preFm = getPageFrontmatter(`/${slug}`);
|
|
88
|
+
const preStripped = getPageStripped(`/${slug}`);
|
|
89
|
+
result = await compileMdx(content, filePath, gitDates, remarkPlugins, rehypePlugins, void 0, preFm !== void 0 && preStripped !== void 0 ? {
|
|
90
|
+
frontmatter: preFm,
|
|
91
|
+
strippedContent: preStripped
|
|
92
|
+
} : void 0);
|
|
93
|
+
} catch (err) {
|
|
94
|
+
const msg = err instanceof Error ? err.message : "Unknown MDX error";
|
|
95
|
+
throw new Error(`MDX Error in: docs/${slug}.mdx\n${msg}`, { cause: err });
|
|
96
|
+
}
|
|
97
|
+
let frontmatter = result.frontmatter;
|
|
98
|
+
if (builder) frontmatter = await builder.runTransformFrontmatterChain(frontmatter, {
|
|
99
|
+
slug,
|
|
100
|
+
filePath,
|
|
101
|
+
content
|
|
102
|
+
});
|
|
103
|
+
const title = frontmatterField(frontmatter, "title") || slug || "Docs";
|
|
104
|
+
const description = frontmatterField(frontmatter, "description");
|
|
105
|
+
const slugParts = slug ? slug.split("/") : [];
|
|
106
|
+
const page = React.createElement(DocsLayout, { repoUrl: docuConfig.repo?.url }, React.createElement(DocsPage, {
|
|
107
|
+
slug: slugParts,
|
|
108
|
+
title,
|
|
109
|
+
description,
|
|
110
|
+
date: frontmatterField(frontmatter, "date") || void 0,
|
|
111
|
+
content: renderToString(result.content),
|
|
112
|
+
tocs: result.tocs,
|
|
113
|
+
filePath,
|
|
114
|
+
repoUrl: docuConfig.repo?.url,
|
|
115
|
+
mdxSlug: slug
|
|
116
|
+
}));
|
|
117
|
+
const body = renderToString(page);
|
|
118
|
+
const ctx = {
|
|
119
|
+
slug,
|
|
120
|
+
filePath,
|
|
121
|
+
frontmatter,
|
|
122
|
+
content,
|
|
123
|
+
config: docuConfig
|
|
124
|
+
};
|
|
125
|
+
const headExtra = builder?.collectHead(ctx);
|
|
126
|
+
const bodyExtra = builder?.collectBody(ctx);
|
|
127
|
+
const depth = slug ? slug.split("/").length : 1;
|
|
128
|
+
const favicon = docuConfig.meta?.favicon || "/docs/assets/images/favicon.ico";
|
|
129
|
+
const seo = buildSeoMeta(docuConfig, frontmatter, slug || "");
|
|
130
|
+
const csp = cspHeader(nonce);
|
|
131
|
+
let html = htmlShell({
|
|
132
|
+
title,
|
|
133
|
+
description,
|
|
134
|
+
body,
|
|
135
|
+
favicon,
|
|
136
|
+
seo,
|
|
137
|
+
csp,
|
|
138
|
+
css: assetManifest.css,
|
|
139
|
+
js: assetManifest.js,
|
|
140
|
+
nonce,
|
|
141
|
+
themeCss: inlineThemeCss,
|
|
142
|
+
depth,
|
|
143
|
+
headExtra,
|
|
144
|
+
bodyExtra
|
|
145
|
+
});
|
|
146
|
+
if (builder) html = await builder.runTransformHtmlChain(html, ctx);
|
|
147
|
+
return html;
|
|
148
|
+
}
|
|
149
|
+
async function copyDirectoryRecursive(src, dest) {
|
|
150
|
+
if (!existsSync(src)) return;
|
|
151
|
+
await mkdir(dest, { recursive: true });
|
|
152
|
+
const entries = await readdir(src, { withFileTypes: true });
|
|
153
|
+
for (const entry of entries) {
|
|
154
|
+
const srcPath = join(src, entry.name);
|
|
155
|
+
const destPath = join(dest, entry.name);
|
|
156
|
+
if (entry.isDirectory()) await copyDirectoryRecursive(srcPath, destPath);
|
|
157
|
+
else await copyFile(srcPath, destPath);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async function runBuild() {
|
|
161
|
+
const docuConfig = loadDocuConfig();
|
|
162
|
+
const args = parseArgs();
|
|
163
|
+
logger.buildStart();
|
|
164
|
+
if (args.clean) {
|
|
165
|
+
const { rm } = await import("node:fs/promises");
|
|
166
|
+
try {
|
|
167
|
+
await rm(DIST_DIR, {
|
|
168
|
+
recursive: true,
|
|
169
|
+
force: true
|
|
170
|
+
});
|
|
171
|
+
} catch (err) {
|
|
172
|
+
console.error("Failed to clean dist directory:", err.message);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
await mkdir(DIST_DIR, { recursive: true });
|
|
176
|
+
await mkdir(ASSETS_DIR, { recursive: true });
|
|
177
|
+
await copyDirectoryRecursive(DOCS_ASSETS_DIR, join(DIST_DIR, "docs", "assets"));
|
|
178
|
+
const mdxFiles = await scanMdxFiles(DOCS_DIR);
|
|
179
|
+
const cache = args.force ? {} : await readCache();
|
|
180
|
+
let built = 0;
|
|
181
|
+
let skipped = 0;
|
|
182
|
+
const pluginsConfig = docuConfig.plugins ?? [];
|
|
183
|
+
const builder = pluginsConfig.length > 0 ? new BuildPluginBuilder(docuConfig) : null;
|
|
184
|
+
if (builder) {
|
|
185
|
+
const plugins = await loadPlugins(pluginsConfig);
|
|
186
|
+
for (const plugin of plugins) await plugin.setup(builder);
|
|
187
|
+
await builder.runOnStart();
|
|
188
|
+
}
|
|
189
|
+
const mdxSources = {};
|
|
190
|
+
const prePassTasks = mdxFiles.map(async (file) => {
|
|
191
|
+
let raw;
|
|
192
|
+
try {
|
|
193
|
+
raw = await readFile(file.absPath, "utf-8");
|
|
194
|
+
} catch {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
registerPageContent(`/${file.path}`, raw);
|
|
198
|
+
let content = raw;
|
|
199
|
+
if (builder) {
|
|
200
|
+
const relPath = file.absPath.replace(PROJECT_ROOT + "/", "");
|
|
201
|
+
const transformed = await builder.runOnLoad(relPath, content);
|
|
202
|
+
if (transformed?.contents) content = transformed.contents;
|
|
203
|
+
}
|
|
204
|
+
const remarkPlugins = builder?.collectRemarkPlugins();
|
|
205
|
+
const rehypePlugins = builder?.collectRehypePlugins();
|
|
206
|
+
mdxSources[file.path] = await compileMdxModule(content, remarkPlugins, rehypePlugins, `/${file.path}`);
|
|
207
|
+
});
|
|
208
|
+
await Promise.all(prePassTasks);
|
|
209
|
+
const indexMdxPath = join(DOCS_DIR, "index.mdx");
|
|
210
|
+
if (existsSync(indexMdxPath)) try {
|
|
211
|
+
let indexContent = await readFile(indexMdxPath, "utf-8");
|
|
212
|
+
if (builder) {
|
|
213
|
+
const relPath = indexMdxPath.replace(PROJECT_ROOT + "/", "");
|
|
214
|
+
const transformed = await builder.runOnLoad(relPath, indexContent);
|
|
215
|
+
if (transformed?.contents) indexContent = transformed.contents;
|
|
216
|
+
}
|
|
217
|
+
mdxSources[""] = await compileMdxModule(indexContent, builder?.collectRemarkPlugins(), builder?.collectRehypePlugins());
|
|
218
|
+
} catch {}
|
|
219
|
+
logger.bundleStart();
|
|
220
|
+
let t = performance.now();
|
|
221
|
+
assetManifest = await buildClientBundle(mdxSources);
|
|
222
|
+
logger.bundleDone(Math.round(performance.now() - t));
|
|
223
|
+
inlineThemeCss = computeInlineThemeCss();
|
|
224
|
+
const lastManifest = cache["__assets__"];
|
|
225
|
+
const assetsChanged = !lastManifest || lastManifest.hash !== `${assetManifest.js}:${assetManifest.css}`;
|
|
226
|
+
if (assetsChanged) cache["__assets__"] = {
|
|
227
|
+
hash: `${assetManifest.js}:${assetManifest.css}`,
|
|
228
|
+
mtime: 0,
|
|
229
|
+
builtAt: Date.now()
|
|
230
|
+
};
|
|
231
|
+
logger.spinner.start("Building pages...");
|
|
232
|
+
t = performance.now();
|
|
233
|
+
const allRelPaths = mdxFiles.map((f) => f.absPath.replace(PROJECT_ROOT + "/", ""));
|
|
234
|
+
const indexMdxFull = join(DOCS_DIR, "index.mdx");
|
|
235
|
+
if (existsSync(indexMdxFull)) allRelPaths.push(indexMdxFull.replace(PROJECT_ROOT + "/", ""));
|
|
236
|
+
const gitDates = await getGitLastModifiedBatch(allRelPaths);
|
|
237
|
+
const CONCURRENCY = parseConcurrency();
|
|
238
|
+
const buildTasks = [];
|
|
239
|
+
const errors = [];
|
|
240
|
+
for (const file of mdxFiles) {
|
|
241
|
+
const rebuildDecision = shouldRebuild(file.path, file.mtime, cache);
|
|
242
|
+
if (rebuildDecision === "no") {
|
|
243
|
+
const outputPath = join(DIST_DIR, "docs", `${file.path}.html`);
|
|
244
|
+
if (existsSync(outputPath) && !assetsChanged) {
|
|
245
|
+
skipped++;
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
let rawMdx = getPageContent(`/${file.path}`);
|
|
250
|
+
if (rawMdx === void 0) try {
|
|
251
|
+
rawMdx = await readFile(file.absPath, "utf-8");
|
|
252
|
+
} catch (err) {
|
|
253
|
+
if (err.code !== "ENOENT") throw err;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
if (rebuildDecision === "hash_check") {
|
|
257
|
+
const contentHash = hashContent(rawMdx);
|
|
258
|
+
const cached = cache[file.path];
|
|
259
|
+
if (cached && cached.hash === contentHash) {
|
|
260
|
+
if (!assetsChanged) {
|
|
261
|
+
const outputPath = join(DIST_DIR, "docs", `${file.path}.html`);
|
|
262
|
+
if (existsSync(outputPath)) {
|
|
263
|
+
cache[file.path] = {
|
|
264
|
+
...cached,
|
|
265
|
+
mtime: file.mtime,
|
|
266
|
+
builtAt: Date.now()
|
|
267
|
+
};
|
|
268
|
+
skipped++;
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
const relPath = file.absPath.replace(PROJECT_ROOT + "/", "");
|
|
275
|
+
const capturedRawMdx = rawMdx;
|
|
276
|
+
const capturedFile = file;
|
|
277
|
+
buildTasks.push(async () => {
|
|
278
|
+
try {
|
|
279
|
+
const pageNonce = generateNonce();
|
|
280
|
+
const html = await renderDocsPage(docuConfig, capturedFile.path, capturedRawMdx, relPath, gitDates, builder, pageNonce);
|
|
281
|
+
const outputPath = join(DIST_DIR, "docs", `${capturedFile.path}.html`);
|
|
282
|
+
await mkdir(dirname(outputPath), { recursive: true });
|
|
283
|
+
await writeFile(outputPath, html);
|
|
284
|
+
cache[capturedFile.path] = {
|
|
285
|
+
hash: hashContent(capturedRawMdx),
|
|
286
|
+
mtime: capturedFile.mtime,
|
|
287
|
+
builtAt: Date.now()
|
|
288
|
+
};
|
|
289
|
+
built++;
|
|
290
|
+
} catch (err) {
|
|
291
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
292
|
+
errors.push(msg);
|
|
293
|
+
console.error(`\n\u274C ${msg}\n`);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
for (let i = 0; i < buildTasks.length; i += CONCURRENCY) await Promise.all(buildTasks.slice(i, i + CONCURRENCY).map((fn) => fn()));
|
|
298
|
+
try {
|
|
299
|
+
const indexMdxPath = join(DOCS_DIR, "index.mdx");
|
|
300
|
+
const indexHtml = await renderDocsPage(docuConfig, "", await readFile(indexMdxPath, "utf-8"), indexMdxPath.replace(PROJECT_ROOT + "/", ""), gitDates, builder, generateNonce());
|
|
301
|
+
await mkdir(join(DIST_DIR, "docs"), { recursive: true });
|
|
302
|
+
await writeFile(join(DIST_DIR, "docs", "index.html"), indexHtml);
|
|
303
|
+
} catch (err) {
|
|
304
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
305
|
+
errors.push(`index.mdx: ${msg}`);
|
|
306
|
+
console.error(`\n\u274C Failed to build index: ${msg}\n`);
|
|
307
|
+
}
|
|
308
|
+
const landingPage = React.createElement(IndexPage);
|
|
309
|
+
const landingFavicon = docuConfig.meta?.favicon || "/docs/assets/images/favicon.ico";
|
|
310
|
+
const landingSeo = buildSeoMeta(docuConfig, docuConfig.meta, "");
|
|
311
|
+
const landingNonce = generateNonce();
|
|
312
|
+
const landingHtml = htmlShell({
|
|
313
|
+
title: docuConfig.meta?.title || "DocuBook",
|
|
314
|
+
description: docuConfig.meta?.description || "",
|
|
315
|
+
body: renderToString(landingPage),
|
|
316
|
+
favicon: landingFavicon,
|
|
317
|
+
seo: landingSeo,
|
|
318
|
+
csp: cspHeader(landingNonce),
|
|
319
|
+
css: assetManifest.css,
|
|
320
|
+
js: assetManifest.js,
|
|
321
|
+
nonce: landingNonce,
|
|
322
|
+
themeCss: inlineThemeCss
|
|
323
|
+
});
|
|
324
|
+
await writeFile(join(DIST_DIR, "index.html"), landingHtml);
|
|
325
|
+
const notFoundPage = React.createElement(DocsLayout, { repoUrl: docuConfig.repo?.url }, React.createElement(NotFoundPage));
|
|
326
|
+
const notFoundFavicon = docuConfig.meta?.favicon || "/docs/assets/images/favicon.ico";
|
|
327
|
+
const notFoundNonce = generateNonce();
|
|
328
|
+
const notFoundHtml = htmlShell({
|
|
329
|
+
title: "404 - Not Found",
|
|
330
|
+
description: "",
|
|
331
|
+
body: renderToString(notFoundPage),
|
|
332
|
+
favicon: notFoundFavicon,
|
|
333
|
+
headExtra: ["<meta name=\"robots\" content=\"noindex,follow\">"],
|
|
334
|
+
csp: cspHeader(notFoundNonce),
|
|
335
|
+
css: assetManifest.css,
|
|
336
|
+
js: assetManifest.js,
|
|
337
|
+
nonce: notFoundNonce,
|
|
338
|
+
themeCss: inlineThemeCss,
|
|
339
|
+
absoluteAssets: true
|
|
340
|
+
});
|
|
341
|
+
await writeFile(join(DIST_DIR, "404.html"), notFoundHtml);
|
|
342
|
+
logger.spinner.stop(`Built ${built} pages (${skipped} cached) \x1b[90m(${Math.round(performance.now() - t)}ms)\x1b[0m`);
|
|
343
|
+
if (builder) {
|
|
344
|
+
const pages = mdxFiles.map((f) => ({
|
|
345
|
+
slug: f.path,
|
|
346
|
+
title: f.path.split("/").pop() || f.path,
|
|
347
|
+
filePath: join(DOCS_DIR, f.path),
|
|
348
|
+
outputPath: join(DIST_DIR, "docs", `${f.path}.html`)
|
|
349
|
+
}));
|
|
350
|
+
await builder.runOnEnd(pages);
|
|
351
|
+
}
|
|
352
|
+
logger.indexStart();
|
|
353
|
+
t = performance.now();
|
|
354
|
+
const indexSkipped = built === 0 && existsSync(join(ASSETS_DIR, "search-index.json"));
|
|
355
|
+
const indexCount = indexSkipped ? 0 : await generateSearchIndex();
|
|
356
|
+
logger.indexDone(indexCount, Math.round(performance.now() - t), indexSkipped);
|
|
357
|
+
logger.routes();
|
|
358
|
+
await writeCache(cache);
|
|
359
|
+
if (errors.length > 0) {
|
|
360
|
+
console.error(`\n\u274C Build completed with ${errors.length} error(s)\n`);
|
|
361
|
+
process.exit(1);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
async function runBuildCli() {
|
|
365
|
+
try {
|
|
366
|
+
await initSentry();
|
|
367
|
+
await runBuild();
|
|
368
|
+
} catch (err) {
|
|
369
|
+
captureException(err);
|
|
370
|
+
console.error("Build failed:", err);
|
|
371
|
+
process.exit(1);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
//#endregion
|
|
375
|
+
export { runBuildCli as n, runBuild as t };
|
|
376
|
+
|
|
377
|
+
//# sourceMappingURL=build.impl-BJsi28mD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.impl-BJsi28mD.js","names":[],"sources":["../node/seo.ts","../node/build.impl.ts"],"sourcesContent":["import type { DocuConfig } from \"./types\";\nimport { frontmatterField } from \"./mdx\";\n\nexport interface SeoMeta {\n /** Absolute canonical URL */\n url: string;\n /** Site name for og:site_name */\n siteName: string;\n /** Absolute OG image URL (from frontmatter.image, if set) */\n image?: string;\n}\n\n/**\n * Build SEO metadata from config and per-page frontmatter.\n * All fields are derived from existing data — no extra config required.\n */\nexport function buildSeoMeta(\n config: DocuConfig,\n frontmatter: Record<string, unknown>,\n slug: string\n): SeoMeta {\n const baseURL = config.meta?.baseURL?.replace(/\\/+$/, \"\") || \"\";\n const url = slug ? `${baseURL}/docs/${slug}` : `${baseURL}/`;\n\n const result: SeoMeta = {\n url,\n siteName: config.meta?.title || \"\",\n };\n\n // Per-page image from frontmatter, fallback to global default from config\n const image = frontmatterField(frontmatter, \"image\") || config.meta?.ogImage;\n if (image) {\n // Resolve using URL constructor — handles absolute, root-relative, and relative paths\n try {\n result.image = new URL(image, image.startsWith(\"/\") ? baseURL : `${baseURL}/docs/`).href;\n } catch {\n result.image = image;\n }\n }\n\n return result;\n}\n","/**\n * Runtime-neutral static build — mirror of `build.ts` (Bun-only via its\n * transitive imports, protected) with the Bun-coupled modules swapped for\n * their neutral counterparts: `html.shared` (pure escaping) and\n * `hydrate.node` (esbuild client bundling). Everything else is identical.\n * The Node/Deno build entries call `runBuildCli()`.\n */\n\nimport { readFile, writeFile, mkdir, readdir, copyFile } from \"node:fs/promises\";\nimport { existsSync } from \"node:fs\";\nimport { createHash } from \"node:crypto\";\nimport { join, dirname } from \"node:path\";\nimport React from \"react\";\nimport { renderToString } from \"react-dom/server\";\nimport {\n compileMdx,\n compileMdxModule,\n frontmatterField,\n getGitLastModifiedBatch,\n getPageContent,\n getPageFrontmatter,\n getPageStripped,\n registerPageContent,\n} from \"./mdx\";\nimport {\n DOCS_DIR,\n DIST_DIR,\n ASSETS_DIR,\n CACHE_FILE,\n DOCS_ASSETS_DIR,\n PROJECT_ROOT,\n loadDocuConfig,\n} from \"./paths\";\nimport { htmlShell } from \"./html.shared\";\nimport { generateSearchIndex } from \"./search-indexer\";\nimport { buildClientBundle, computeInlineThemeCss } from \"./hydrate.node\";\nimport { logger } from \"./logger\";\nimport { initSentry, captureException } from \"./sentry\";\nimport { loadPlugins } from \"./plugin-loader\";\nimport { BuildPluginBuilder } from \"./plugin-builder\";\nimport { scanMdxFiles } from \"./utils\";\nimport type { BuildCache, CliArgs } from \"./types\";\nimport { generateNonce, cspHeader } from \"./security\";\nimport type { PageMeta, PageContext } from \"./plugin\";\nimport { buildSeoMeta } from \"./seo\";\nimport DocsPage from \"../pages/docs/[[...slug]]\";\nimport IndexPage from \"../pages/index\";\nimport NotFoundPage from \"../pages/404\";\nimport { DocsLayout } from \"../components/DocsLayout\";\n\nfunction parseArgs(): CliArgs {\n const args = process.argv.slice(2);\n return {\n force: args.includes(\"--force\") || args.includes(\"-f\"),\n clean: args.includes(\"--clean\") || args.includes(\"-c\"),\n };\n}\n\nfunction hashContent(content: string): string {\n return createHash(\"sha256\").update(content).digest(\"hex\").slice(0, 16);\n}\n\nasync function readCache(): Promise<BuildCache> {\n try {\n if (existsSync(CACHE_FILE)) {\n const data = await readFile(CACHE_FILE, \"utf-8\");\n return JSON.parse(data);\n }\n } catch (err) {\n console.error(\"Failed to load build cache:\", (err as Error).message);\n }\n return {};\n}\n\nasync function writeCache(cache: BuildCache): Promise<void> {\n await writeFile(CACHE_FILE, JSON.stringify(cache, null, 2));\n}\n\nfunction parseConcurrency(): number {\n return Math.max(1, parseInt(process.env.BUILD_CONCURRENCY || \"4\", 10) || 4);\n}\n\ntype RebuildDecision = \"yes\" | \"hash_check\" | \"no\";\n\nfunction shouldRebuild(path: string, mtime: number, cache: BuildCache): RebuildDecision {\n const cached = cache[path];\n if (!cached) return \"yes\";\n if (mtime > cached.builtAt) return \"hash_check\";\n return \"no\";\n}\n\nlet assetManifest = { js: \"client.js\", css: \"client.css\" };\n\nlet inlineThemeCss: string | undefined;\n\nasync function renderDocsPage(\n docuConfig: ReturnType<typeof loadDocuConfig>,\n slug: string,\n rawMdx: string,\n filePath: string,\n gitDates?: Map<string, string>,\n builder?: BuildPluginBuilder | null,\n nonce?: string\n): Promise<string> {\n let content = rawMdx;\n if (builder) {\n const transformed = await builder.runOnLoad(filePath, content);\n if (transformed?.contents) {\n content = transformed.contents;\n }\n }\n\n let result;\n try {\n const remarkPlugins = builder?.collectRemarkPlugins();\n const rehypePlugins = builder?.collectRehypePlugins();\n // Parse-once: reuse the prePass frontmatter + stripped content so the\n // SSR phase does not re-extract them. Only when the prePass actually\n // registered them — otherwise compileMdx does its own extraction.\n const preFm = getPageFrontmatter(`/${slug}`);\n const preStripped = getPageStripped(`/${slug}`);\n const pre =\n preFm !== undefined && preStripped !== undefined\n ? { frontmatter: preFm, strippedContent: preStripped }\n : undefined;\n result = await compileMdx(\n content,\n filePath,\n gitDates,\n remarkPlugins,\n rehypePlugins,\n undefined,\n pre\n );\n } catch (err) {\n const msg = err instanceof Error ? err.message : \"Unknown MDX error\";\n throw new Error(`MDX Error in: docs/${slug}.mdx\\n${msg}`, { cause: err });\n }\n\n let frontmatter = result.frontmatter as Record<string, unknown>;\n if (builder) {\n frontmatter = await builder.runTransformFrontmatterChain(frontmatter, {\n slug,\n filePath,\n content,\n });\n }\n\n const title = frontmatterField(frontmatter, \"title\") || slug || \"Docs\";\n const description = frontmatterField(frontmatter, \"description\");\n const slugParts = slug ? slug.split(\"/\") : [];\n\n const page = React.createElement(\n DocsLayout,\n { repoUrl: docuConfig.repo?.url },\n React.createElement(DocsPage, {\n slug: slugParts,\n title,\n description,\n date: frontmatterField(frontmatter, \"date\") || undefined,\n // Render MDX content as its own root: client hydrates the island as a\n // separate root, so SSR must be root-relative too or useId-based ids\n // (mdx-compiler components) mismatch during hydration.\n content: renderToString(result.content),\n tocs: result.tocs,\n filePath,\n repoUrl: docuConfig.repo?.url,\n mdxSlug: slug,\n })\n );\n\n const body = renderToString(page);\n\n const ctx: PageContext = { slug, filePath, frontmatter, content, config: docuConfig };\n const headExtra = builder?.collectHead(ctx);\n const bodyExtra = builder?.collectBody(ctx);\n\n const depth = slug ? slug.split(\"/\").length : 1;\n const favicon = docuConfig.meta?.favicon || \"/docs/assets/images/favicon.ico\";\n const seo = buildSeoMeta(docuConfig, frontmatter, slug || \"\");\n // MDX content hydrates from the bundled ESM module (mdx-hydrate), not\n // new Function — no 'unsafe-eval' needed in the CSP.\n const csp = cspHeader(nonce);\n let html = htmlShell({\n title,\n description,\n body,\n favicon,\n seo,\n csp,\n css: assetManifest.css,\n js: assetManifest.js,\n nonce,\n themeCss: inlineThemeCss,\n depth,\n headExtra,\n bodyExtra,\n });\n\n if (builder) {\n html = await builder.runTransformHtmlChain(html, ctx);\n }\n\n return html;\n}\n\nasync function copyDirectoryRecursive(src: string, dest: string): Promise<void> {\n if (!existsSync(src)) return;\n await mkdir(dest, { recursive: true });\n const entries = await readdir(src, { withFileTypes: true });\n for (const entry of entries) {\n const srcPath = join(src, entry.name);\n const destPath = join(dest, entry.name);\n if (entry.isDirectory()) {\n await copyDirectoryRecursive(srcPath, destPath);\n } else {\n await copyFile(srcPath, destPath);\n }\n }\n}\n\nexport async function runBuild(): Promise<void> {\n const docuConfig = loadDocuConfig();\n const args = parseArgs();\n\n logger.buildStart();\n\n if (args.clean) {\n const { rm } = await import(\"node:fs/promises\");\n try {\n await rm(DIST_DIR, { recursive: true, force: true });\n } catch (err) {\n console.error(\"Failed to clean dist directory:\", (err as Error).message);\n }\n }\n\n await mkdir(DIST_DIR, { recursive: true });\n await mkdir(ASSETS_DIR, { recursive: true });\n\n await copyDirectoryRecursive(DOCS_ASSETS_DIR, join(DIST_DIR, \"docs\", \"assets\"));\n\n const mdxFiles = await scanMdxFiles(DOCS_DIR);\n const cache = args.force ? {} : await readCache();\n let built = 0;\n let skipped = 0;\n\n const pluginsConfig = docuConfig.plugins ?? [];\n const builder = pluginsConfig.length > 0 ? new BuildPluginBuilder(docuConfig) : null;\n if (builder) {\n const plugins = await loadPlugins(pluginsConfig);\n for (const plugin of plugins) {\n await plugin.setup(builder);\n }\n await builder.runOnStart();\n }\n\n // Pre-compile every page's MDX to an ESM module (program format) so the\n // client bundle can hydrate the content island statically — no new Function.\n // Mirrors the page loop's transform + plugin chain so SSR and client trees\n // match. Runs for all files regardless of cache; the bundle is shared by\n // every page, so a content change invalidates the page cache anyway.\n const mdxSources: Record<string, string> = {};\n const prePassTasks = mdxFiles.map(async (file) => {\n let raw: string;\n try {\n raw = await readFile(file.absPath, \"utf-8\");\n } catch {\n return;\n }\n // Cache the original content so the page loop does not re-read the file\n // (one disk read per file — the frontmatter is parsed once here too).\n registerPageContent(`/${file.path}`, raw);\n let content = raw;\n if (builder) {\n const relPath = file.absPath.replace(PROJECT_ROOT + \"/\", \"\");\n const transformed = await builder.runOnLoad(relPath, content);\n if (transformed?.contents) content = transformed.contents;\n }\n const remarkPlugins = builder?.collectRemarkPlugins();\n const rehypePlugins = builder?.collectRehypePlugins();\n mdxSources[file.path] = await compileMdxModule(\n content,\n remarkPlugins,\n rehypePlugins,\n `/${file.path}`\n );\n });\n await Promise.all(prePassTasks);\n\n // The docs root (index.mdx) renders with slug \"\" — mirror that key so the\n // index page hydrates too. Its render has its own try/catch; skip on error.\n const indexMdxPath = join(DOCS_DIR, \"index.mdx\");\n if (existsSync(indexMdxPath)) {\n try {\n const indexRaw = await readFile(indexMdxPath, \"utf-8\");\n let indexContent = indexRaw;\n if (builder) {\n const relPath = indexMdxPath.replace(PROJECT_ROOT + \"/\", \"\");\n const transformed = await builder.runOnLoad(relPath, indexContent);\n if (transformed?.contents) indexContent = transformed.contents;\n }\n mdxSources[\"\"] = await compileMdxModule(\n indexContent,\n builder?.collectRemarkPlugins(),\n builder?.collectRehypePlugins()\n );\n } catch {\n // ignore — the index render reports its own error\n }\n }\n\n logger.bundleStart();\n let t = performance.now();\n assetManifest = await buildClientBundle(mdxSources);\n logger.bundleDone(Math.round(performance.now() - t));\n\n inlineThemeCss = computeInlineThemeCss();\n\n const lastManifest = cache[\"__assets__\"];\n const assetsChanged =\n !lastManifest || lastManifest.hash !== `${assetManifest.js}:${assetManifest.css}`;\n if (assetsChanged) {\n cache[\"__assets__\"] = {\n hash: `${assetManifest.js}:${assetManifest.css}`,\n mtime: 0,\n builtAt: Date.now(),\n };\n }\n\n logger.spinner.start(\"Building pages...\");\n t = performance.now();\n\n const allRelPaths = mdxFiles.map((f) => f.absPath.replace(PROJECT_ROOT + \"/\", \"\"));\n\n const indexMdxFull = join(DOCS_DIR, \"index.mdx\");\n if (existsSync(indexMdxFull)) {\n allRelPaths.push(indexMdxFull.replace(PROJECT_ROOT + \"/\", \"\"));\n }\n const gitDates = await getGitLastModifiedBatch(allRelPaths);\n\n const CONCURRENCY = parseConcurrency();\n const buildTasks = [];\n const errors: string[] = [];\n\n for (const file of mdxFiles) {\n const rebuildDecision = shouldRebuild(file.path, file.mtime, cache);\n\n if (rebuildDecision === \"no\") {\n const outputPath = join(DIST_DIR, \"docs\", `${file.path}.html`);\n if (existsSync(outputPath) && !assetsChanged) {\n skipped++;\n continue;\n }\n }\n\n let rawMdx = getPageContent(`/${file.path}`);\n if (rawMdx === undefined) {\n try {\n rawMdx = await readFile(file.absPath, \"utf-8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n continue;\n }\n }\n\n if (rebuildDecision === \"hash_check\") {\n const contentHash = hashContent(rawMdx);\n const cached = cache[file.path];\n if (cached && cached.hash === contentHash) {\n if (!assetsChanged) {\n const outputPath = join(DIST_DIR, \"docs\", `${file.path}.html`);\n if (existsSync(outputPath)) {\n cache[file.path] = { ...cached, mtime: file.mtime, builtAt: Date.now() };\n skipped++;\n continue;\n }\n }\n }\n }\n\n const relPath = file.absPath.replace(PROJECT_ROOT + \"/\", \"\");\n const capturedRawMdx = rawMdx;\n const capturedFile = file;\n\n buildTasks.push(async () => {\n try {\n const pageNonce = generateNonce();\n const html = await renderDocsPage(\n docuConfig,\n capturedFile.path,\n capturedRawMdx,\n relPath,\n gitDates,\n builder,\n pageNonce\n );\n const outputPath = join(DIST_DIR, \"docs\", `${capturedFile.path}.html`);\n await mkdir(dirname(outputPath), { recursive: true });\n await writeFile(outputPath, html);\n cache[capturedFile.path] = {\n hash: hashContent(capturedRawMdx),\n mtime: capturedFile.mtime,\n builtAt: Date.now(),\n };\n built++;\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n errors.push(msg);\n console.error(`\\n\\u274C ${msg}\\n`);\n }\n });\n }\n\n for (let i = 0; i < buildTasks.length; i += CONCURRENCY) {\n await Promise.all(buildTasks.slice(i, i + CONCURRENCY).map((fn) => fn()));\n }\n\n try {\n const indexMdxPath = join(DOCS_DIR, \"index.mdx\");\n const indexRaw = await readFile(indexMdxPath, \"utf-8\");\n const indexRelPath = indexMdxPath.replace(PROJECT_ROOT + \"/\", \"\");\n const indexHtml = await renderDocsPage(\n docuConfig,\n \"\",\n indexRaw,\n indexRelPath,\n gitDates,\n builder,\n generateNonce()\n );\n await mkdir(join(DIST_DIR, \"docs\"), { recursive: true });\n await writeFile(join(DIST_DIR, \"docs\", \"index.html\"), indexHtml);\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n errors.push(`index.mdx: ${msg}`);\n console.error(`\\n\\u274C Failed to build index: ${msg}\\n`);\n }\n\n const landingPage = React.createElement(IndexPage);\n const landingFavicon = docuConfig.meta?.favicon || \"/docs/assets/images/favicon.ico\";\n const landingSeo = buildSeoMeta(docuConfig, docuConfig.meta as Record<string, unknown>, \"\");\n const landingNonce = generateNonce();\n const landingHtml = htmlShell({\n title: docuConfig.meta?.title || \"DocuBook\",\n description: docuConfig.meta?.description || \"\",\n body: renderToString(landingPage),\n favicon: landingFavicon,\n seo: landingSeo,\n csp: cspHeader(landingNonce),\n css: assetManifest.css,\n js: assetManifest.js,\n nonce: landingNonce,\n themeCss: inlineThemeCss,\n });\n await writeFile(join(DIST_DIR, \"index.html\"), landingHtml);\n\n const notFoundPage = React.createElement(\n DocsLayout,\n { repoUrl: docuConfig.repo?.url },\n React.createElement(NotFoundPage)\n );\n const notFoundFavicon = docuConfig.meta?.favicon || \"/docs/assets/images/favicon.ico\";\n const notFoundNonce = generateNonce();\n const notFoundHtml = htmlShell({\n title: \"404 - Not Found\",\n description: \"\",\n body: renderToString(notFoundPage),\n favicon: notFoundFavicon,\n headExtra: ['<meta name=\"robots\" content=\"noindex,follow\">'],\n csp: cspHeader(notFoundNonce),\n css: assetManifest.css,\n js: assetManifest.js,\n nonce: notFoundNonce,\n themeCss: inlineThemeCss,\n // Served as the static-host fallback at ANY requested path — relative\n // depth can never be right there, so use root-absolute asset URLs.\n absoluteAssets: true,\n });\n await writeFile(join(DIST_DIR, \"404.html\"), notFoundHtml);\n\n logger.spinner.stop(\n `Built ${built} pages (${skipped} cached) \\x1b[90m(${Math.round(performance.now() - t)}ms)\\x1b[0m`\n );\n\n if (builder) {\n const pages: PageMeta[] = mdxFiles.map((f) => ({\n slug: f.path,\n title: f.path.split(\"/\").pop() || f.path,\n filePath: join(DOCS_DIR, f.path),\n outputPath: join(DIST_DIR, \"docs\", `${f.path}.html`),\n }));\n await builder.runOnEnd(pages);\n }\n\n logger.indexStart();\n t = performance.now();\n // No content changed (all pages cached) → the aggregated index is\n // unchanged too; reuse the existing file instead of regenerating it.\n const indexSkipped = built === 0 && existsSync(join(ASSETS_DIR, \"search-index.json\"));\n const indexCount = indexSkipped ? 0 : await generateSearchIndex();\n logger.indexDone(indexCount, Math.round(performance.now() - t), indexSkipped);\n\n logger.routes();\n\n await writeCache(cache);\n\n if (errors.length > 0) {\n console.error(`\\n\\u274C Build completed with ${errors.length} error(s)\\n`);\n process.exit(1);\n }\n}\n\nexport async function runBuildCli(): Promise<void> {\n try {\n await initSentry();\n await runBuild();\n } catch (err) {\n captureException(err);\n console.error(\"Build failed:\", err);\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,SAAgB,aACd,QACA,aACA,MACS;CACT,MAAM,UAAU,OAAO,MAAM,SAAS,QAAQ,QAAQ,EAAE,KAAK;CAG7D,MAAM,SAAkB;EACtB,KAHU,OAAO,GAAG,QAAQ,QAAQ,SAAS,GAAG,QAAQ;EAIxD,UAAU,OAAO,MAAM,SAAS;CAClC;CAGA,MAAM,QAAQ,iBAAiB,aAAa,OAAO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QXHHPF.js";
|
|
8
|
-
|
|
9
|
-
// .docu/node/build.node.ts
|
|
1
|
+
import { n as runBuildCli } from "./build.impl-BJsi28mD.js";
|
|
2
|
+
//#region .docu/node/build.node.ts
|
|
10
3
|
await runBuildCli();
|
|
4
|
+
//#endregion
|
|
5
|
+
export {};
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=build.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.node.js","names":[],"sources":["../node/build.node.ts"],"sourcesContent":["import { runBuildCli } from \"./build.impl\";\n\nawait runBuildCli();\n"],"mappings":";;AAEA,MAAM,YAAY"}
|
package/.docu/lib/clean.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
logger
|
|
3
|
-
} from "./chunk-6EOUQCRM.js";
|
|
4
|
-
import "./chunk-4IQXHHPF.js";
|
|
5
|
-
|
|
6
|
-
// .docu/node/clean.ts
|
|
7
|
-
import { rm } from "node:fs/promises";
|
|
1
|
+
import { t as logger } from "./logger-CycvLCrQ.js";
|
|
8
2
|
import { existsSync } from "node:fs";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
4
|
+
//#region .docu/node/clean.ts
|
|
9
5
|
var DIST = ".docu/dist";
|
|
10
6
|
var CACHE = ".docu/build-cache.json";
|
|
11
7
|
async function clean() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
logger.buildStart();
|
|
9
|
+
logger.spinner.start("Cleaning build artifacts...");
|
|
10
|
+
let removed = 0;
|
|
11
|
+
if (existsSync(DIST)) {
|
|
12
|
+
await rm(DIST, {
|
|
13
|
+
recursive: true,
|
|
14
|
+
force: true
|
|
15
|
+
});
|
|
16
|
+
removed++;
|
|
17
|
+
}
|
|
18
|
+
if (existsSync(CACHE)) {
|
|
19
|
+
await rm(CACHE, { force: true });
|
|
20
|
+
removed++;
|
|
21
|
+
}
|
|
22
|
+
if (removed === 0) logger.spinner.info("Nothing to clean");
|
|
23
|
+
else logger.spinner.stop(`Cleaned ${removed} item(s)`);
|
|
28
24
|
}
|
|
29
25
|
clean().catch((err) => {
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
console.error("Clean failed:", err);
|
|
27
|
+
process.exit(1);
|
|
32
28
|
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export {};
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=clean.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean.js","names":[],"sources":["../node/clean.ts"],"sourcesContent":["import { rm } from \"node:fs/promises\";\nimport { existsSync } from \"node:fs\";\nimport { logger } from \"./logger\";\n\nconst DIST = \".docu/dist\";\nconst CACHE = \".docu/build-cache.json\";\n\nasync function clean() {\n logger.buildStart();\n logger.spinner.start(\"Cleaning build artifacts...\");\n\n let removed = 0;\n\n if (existsSync(DIST)) {\n await rm(DIST, { recursive: true, force: true });\n removed++;\n }\n\n if (existsSync(CACHE)) {\n await rm(CACHE, { force: true });\n removed++;\n }\n\n if (removed === 0) {\n logger.spinner.info(\"Nothing to clean\");\n } else {\n logger.spinner.stop(`Cleaned ${removed} item(s)`);\n }\n}\n\nclean().catch((err) => {\n console.error(\"Clean failed:\", err);\n process.exit(1);\n});\n"],"mappings":";;;;AAIA,IAAM,OAAO;AACb,IAAM,QAAQ;AAEd,eAAe,QAAQ;CACrB,OAAO,WAAW;CAClB,OAAO,QAAQ,MAAM,6BAA6B;CAElD,IAAI,UAAU;CAEd,IAAI,WAAW,IAAI,GAAG;EACpB,MAAM,GAAG,MAAM;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EAC/C;CACF;CAEA,IAAI,WAAW,KAAK,GAAG;EACrB,MAAM,GAAG,OAAO,EAAE,OAAO,KAAK,CAAC;EAC/B;CACF;CAEA,IAAI,YAAY,GACd,OAAO,QAAQ,KAAK,kBAAkB;MAEtC,OAAO,QAAQ,KAAK,WAAW,QAAQ,SAAS;AAEpD;AAEA,MAAM,CAAC,CAAC,OAAO,QAAQ;CACrB,QAAQ,MAAM,iBAAiB,GAAG;CAClC,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region .docu/node/runtime/deno.ts
|
|
2
|
+
var denoAdapter = {
|
|
3
|
+
name: "deno",
|
|
4
|
+
serve(fetch, options) {
|
|
5
|
+
const server = Deno.serve({
|
|
6
|
+
port: options.port,
|
|
7
|
+
hostname: options.hostname,
|
|
8
|
+
onListen: () => {}
|
|
9
|
+
}, fetch);
|
|
10
|
+
return {
|
|
11
|
+
port: server.addr.port,
|
|
12
|
+
hostname: server.addr.hostname,
|
|
13
|
+
stop: () => server.shutdown()
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { denoAdapter as t };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=deno-DmEaKggj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deno-DmEaKggj.js","names":[],"sources":["../node/runtime/deno.ts"],"sourcesContent":["import type { FetchHandler, RuntimeAdapter, ServerOptions } from \"./types\";\n\n/** Minimal ambient view of the Deno global — only what the adapter touches. */\ndeclare const Deno: {\n serve(\n options: { port?: number; hostname?: string; onListen?: (addr: unknown) => void },\n handler: (req: Request) => Response | Promise<Response>\n ): {\n addr: { port: number; hostname: string };\n shutdown(): Promise<void>;\n };\n};\n\nexport const denoAdapter: RuntimeAdapter = {\n name: \"deno\",\n\n serve(fetch: FetchHandler, options: ServerOptions) {\n const server = Deno.serve(\n {\n port: options.port,\n hostname: options.hostname,\n onListen: () => {\n // Suppress Deno's default \"Listening on ...\" log; callers print their own.\n },\n },\n fetch\n );\n return {\n port: server.addr.port,\n hostname: server.addr.hostname,\n stop: () => server.shutdown(),\n };\n },\n};\n"],"mappings":";AAaA,IAAa,cAA8B;CACzC,MAAM;CAEN,MAAM,OAAqB,SAAwB;EACjD,MAAM,SAAS,KAAK,MAClB;GACE,MAAM,QAAQ;GACd,UAAU,QAAQ;GAClB,gBAAgB,CAEhB;EACF,GACA,KACF;EACA,OAAO;GACL,MAAM,OAAO,KAAK;GAClB,UAAU,OAAO,KAAK;GACtB,YAAY,OAAO,SAAS;EAC9B;CACF;AACF"}
|
package/.docu/lib/deploy.deno.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-U7M5SK76.js";
|
|
4
|
-
import "./chunk-4IQXHHPF.js";
|
|
5
|
-
|
|
6
|
-
// .docu/node/deploy.deno.ts
|
|
1
|
+
import { t as runDeploy } from "./deploy.shared-D3UWafa6.js";
|
|
2
|
+
//#region .docu/node/deploy.deno.ts
|
|
7
3
|
try {
|
|
8
|
-
|
|
4
|
+
await runDeploy();
|
|
9
5
|
} catch (err) {
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
console.error("Deploy failed:", err);
|
|
7
|
+
process.exit(1);
|
|
12
8
|
}
|
|
13
9
|
process.exit(0);
|
|
10
|
+
//#endregion
|
|
11
|
+
export {};
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=deploy.deno.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.deno.js","names":[],"sources":["../node/deploy.deno.ts"],"sourcesContent":["import { runDeploy } from \"./deploy.shared\";\n\ntry {\n await runDeploy();\n} catch (err) {\n console.error(\"Deploy failed:\", err);\n process.exit(1);\n}\n// See build.deno.ts — react-dom/server's browser build keeps Deno's event\n// loop alive after the in-process build; force a clean exit.\nprocess.exit(0);\n"],"mappings":";;AAEA,IAAI;CACF,MAAM,UAAU;AAClB,SAAS,KAAK;CACZ,QAAQ,MAAM,kBAAkB,GAAG;CACnC,QAAQ,KAAK,CAAC;AAChB;AAGA,QAAQ,KAAK,CAAC"}
|
package/.docu/lib/deploy.node.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-U7M5SK76.js";
|
|
4
|
-
import "./chunk-4IQXHHPF.js";
|
|
5
|
-
|
|
6
|
-
// .docu/node/deploy.node.ts
|
|
1
|
+
import { t as runDeploy } from "./deploy.shared-D3UWafa6.js";
|
|
2
|
+
//#region .docu/node/deploy.node.ts
|
|
7
3
|
runDeploy().catch((err) => {
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
console.error("Deploy failed:", err);
|
|
5
|
+
process.exit(1);
|
|
10
6
|
});
|
|
7
|
+
//#endregion
|
|
8
|
+
export {};
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=deploy.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.node.js","names":[],"sources":["../node/deploy.node.ts"],"sourcesContent":["import { runDeploy } from \"./deploy.shared\";\n\nrunDeploy().catch((err) => {\n console.error(\"Deploy failed:\", err);\n process.exit(1);\n});\n"],"mappings":";;AAEA,UAAU,CAAC,CAAC,OAAO,QAAQ;CACzB,QAAQ,MAAM,kBAAkB,GAAG;CACnC,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|