@docubook/flame 1.6.5 → 1.6.6
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-VCWNBEBU.js → build.impl-EV3EJRZ3.js} +3 -3
- package/.docu/lib/build.node.js +3 -3
- package/.docu/lib/{chunk-P2P2NB3K.js → chunk-7IXQY2KM.js} +1 -2
- package/.docu/lib/{chunk-74AOEDLW.js → chunk-BWZFBPBP.js} +1 -1
- package/.docu/lib/{chunk-OUILOW2S.js → chunk-DXFKHOTN.js} +2 -2
- package/.docu/lib/{chunk-I7OBFORY.js → chunk-GHM253YH.js} +1 -1
- package/.docu/lib/{chunk-Y4PEPREZ.js → chunk-PIL6YLLW.js} +2 -2
- package/.docu/lib/{chunk-WSJC3PRH.js → chunk-VW7B64WE.js} +13 -4
- 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/deploy.shared.ts +0 -1
- package/.docu/node/git.ts +14 -0
- package/.docu/node/mdx.ts +2 -1
- package/bin/cli.js +2 -2
- package/package.json +3 -3
- package/template/docs/guide/deployment.mdx +13 -0
- package/template/package.json +2 -2
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-DXFKHOTN.js";
|
|
4
|
+
import "./chunk-VW7B64WE.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-GHM253YH.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-DXFKHOTN.js";
|
|
5
|
+
import "./chunk-VW7B64WE.js";
|
|
6
6
|
import "./chunk-EOK6KATZ.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-GHM253YH.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-DXFKHOTN.js";
|
|
4
|
+
import "./chunk-VW7B64WE.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-GHM253YH.js";
|
|
7
7
|
import "./chunk-4IQXHHPF.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/build.node.ts
|
|
@@ -54,7 +54,6 @@ var NGINX_CONF = `server {
|
|
|
54
54
|
}
|
|
55
55
|
`;
|
|
56
56
|
var DOCKERIGNORE = `node_modules
|
|
57
|
-
.git
|
|
58
57
|
*.DS_Store
|
|
59
58
|
.docu/dist
|
|
60
59
|
.docu/lib
|
|
@@ -133,7 +132,7 @@ async function runBuild() {
|
|
|
133
132
|
process.env.FLAME_BUILD_SILENT = "1";
|
|
134
133
|
process.env.LOG_LEVEL = "error";
|
|
135
134
|
}
|
|
136
|
-
const { runBuildCli } = await import("./build.impl-
|
|
135
|
+
const { runBuildCli } = await import("./build.impl-EV3EJRZ3.js");
|
|
137
136
|
await runBuildCli();
|
|
138
137
|
}
|
|
139
138
|
async function writeDockerFiles() {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
htmlShell,
|
|
14
14
|
initSentry,
|
|
15
15
|
loadPlugins
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VW7B64WE.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-GHM253YH.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-VW7B64WE.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-GHM253YH.js";
|
|
31
31
|
import {
|
|
32
32
|
DIST_DIR,
|
|
33
33
|
DOCS_DIR,
|
|
@@ -555,8 +555,8 @@ function scanDir(dirPath, docsRoot) {
|
|
|
555
555
|
if (entry.startsWith(".") || entry === "assets") continue;
|
|
556
556
|
const absPath = join(dirPath, entry);
|
|
557
557
|
try {
|
|
558
|
-
const
|
|
559
|
-
if (
|
|
558
|
+
const stat2 = statSync(absPath);
|
|
559
|
+
if (stat2.isDirectory()) {
|
|
560
560
|
const children = scanDir(absPath, docsRoot);
|
|
561
561
|
if (children.length > 0) {
|
|
562
562
|
nodes.push({
|
|
@@ -567,7 +567,7 @@ function scanDir(dirPath, docsRoot) {
|
|
|
567
567
|
children
|
|
568
568
|
});
|
|
569
569
|
}
|
|
570
|
-
} else if (
|
|
570
|
+
} else if (stat2.isFile() && isDocFile(entry)) {
|
|
571
571
|
nodes.push({
|
|
572
572
|
name: entry,
|
|
573
573
|
relPath: normalizePath(relative(docsRoot, absPath).replace(/\.(mdx|md)$/, "")),
|
|
@@ -1073,6 +1073,7 @@ function captureException(err, context) {
|
|
|
1073
1073
|
|
|
1074
1074
|
// .docu/node/git.ts
|
|
1075
1075
|
import { execFile as execFile2 } from "node:child_process";
|
|
1076
|
+
import { stat } from "node:fs/promises";
|
|
1076
1077
|
function runGit(args) {
|
|
1077
1078
|
return new Promise((resolve4, reject) => {
|
|
1078
1079
|
execFile2("git", args, { maxBuffer: 16 * 1024 * 1024 }, (err, stdout) => {
|
|
@@ -1098,6 +1099,14 @@ async function getGitLastModified(filePath) {
|
|
|
1098
1099
|
return null;
|
|
1099
1100
|
}
|
|
1100
1101
|
}
|
|
1102
|
+
async function getFilesystemMtime(filePath) {
|
|
1103
|
+
try {
|
|
1104
|
+
const stats = await stat(filePath);
|
|
1105
|
+
return stats.mtime.toISOString();
|
|
1106
|
+
} catch {
|
|
1107
|
+
return null;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1101
1110
|
async function getGitLastModifiedBatch(filePaths) {
|
|
1102
1111
|
const result = /* @__PURE__ */ new Map();
|
|
1103
1112
|
if (filePaths.length === 0) return result;
|
|
@@ -1208,7 +1217,7 @@ async function compileMdx(rawMdx, filePath, gitDates, remarkPlugins, rehypePlugi
|
|
|
1208
1217
|
frontmatter: {},
|
|
1209
1218
|
components
|
|
1210
1219
|
});
|
|
1211
|
-
const date = frontmatter.date || gitDates?.get(filePath) || await getGitLastModified(filePath) || void 0;
|
|
1220
|
+
const date = frontmatter.date || gitDates?.get(filePath) || await getGitLastModified(filePath) || await getFilesystemMtime(filePath) || void 0;
|
|
1212
1221
|
return {
|
|
1213
1222
|
content,
|
|
1214
1223
|
compiledSource: serialized.compiledSource,
|
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-PIL6YLLW.js";
|
|
4
|
+
import "./chunk-VW7B64WE.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-GHM253YH.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-PIL6YLLW.js";
|
|
4
|
+
import "./chunk-VW7B64WE.js";
|
|
5
5
|
import "./chunk-EOK6KATZ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-GHM253YH.js";
|
|
7
7
|
import "./chunk-4IQXHHPF.js";
|
|
8
8
|
|
|
9
9
|
// .docu/node/server.node.ts
|
package/.docu/node/git.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { execFile } from "node:child_process";
|
|
8
|
+
import { stat } from "node:fs/promises";
|
|
8
9
|
|
|
9
10
|
function runGit(args: string[]): Promise<string> {
|
|
10
11
|
return new Promise((resolve, reject) => {
|
|
@@ -35,6 +36,19 @@ export async function getGitLastModified(filePath: string): Promise<string | nul
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Fallback to filesystem mtime when git is unavailable (shallow clone, no .git, etc.).
|
|
41
|
+
* Returns ISO 8601 date string or null.
|
|
42
|
+
*/
|
|
43
|
+
export async function getFilesystemMtime(filePath: string): Promise<string | null> {
|
|
44
|
+
try {
|
|
45
|
+
const stats = await stat(filePath);
|
|
46
|
+
return stats.mtime.toISOString();
|
|
47
|
+
} catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
38
52
|
/** Batch git last modified dates for multiple files in a single spawn */
|
|
39
53
|
export async function getGitLastModifiedBatch(filePaths: string[]): Promise<Map<string, string>> {
|
|
40
54
|
const result = new Map<string, string>();
|
package/.docu/node/mdx.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
MDXRemote,
|
|
10
10
|
} from "@docubook/core";
|
|
11
11
|
import { createMdxComponents } from "@docubook/mdx-content";
|
|
12
|
-
import { getGitLastModified, getGitLastModifiedBatch } from "./git";
|
|
12
|
+
import { getGitLastModified, getGitLastModifiedBatch, getFilesystemMtime } from "./git";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Return the value with `.html` appended, or null if the value should be left
|
|
@@ -161,6 +161,7 @@ export async function compileMdx(
|
|
|
161
161
|
frontmatter.date ||
|
|
162
162
|
gitDates?.get(filePath) ||
|
|
163
163
|
(await getGitLastModified(filePath)) ||
|
|
164
|
+
(await getFilesystemMtime(filePath)) ||
|
|
164
165
|
undefined;
|
|
165
166
|
|
|
166
167
|
return {
|
package/bin/cli.js
CHANGED
|
@@ -127,8 +127,8 @@ if (command === "init") {
|
|
|
127
127
|
pkg.scripts = {
|
|
128
128
|
dev: `${flameCmd} dev`,
|
|
129
129
|
build: `NODE_ENV=production ${flameCmd} build`,
|
|
130
|
-
preview:
|
|
131
|
-
deploy:
|
|
130
|
+
preview: `${flameCmd} preview`,
|
|
131
|
+
deploy: `${flameCmd} deploy`,
|
|
132
132
|
};
|
|
133
133
|
|
|
134
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.6",
|
|
4
4
|
"description": "A blazing-fast React + MDX framework powered by Bun, built for modern documentation experiences.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"@docubook/core": "^1.8.2",
|
|
58
58
|
"@docubook/runt": "^1.0.0",
|
|
59
59
|
"@docubook/mdx-content": "^3.4.5",
|
|
60
|
-
"@docubook/
|
|
61
|
-
"@docubook/
|
|
60
|
+
"@docubook/ui-react": "^1.0.0",
|
|
61
|
+
"@docubook/themes-colors": "^1.0.2"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@sentry/bun": "^10.0.0"
|
|
@@ -13,6 +13,19 @@ npm run deploy # or: bun run deploy / deno task deploy
|
|
|
13
13
|
|
|
14
14
|
This builds the site, adds `.nojekyll`, and generates a GitHub Actions workflow on first run.
|
|
15
15
|
|
|
16
|
+
## Docker (self-hosted / VPS)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
flame deploy --docker
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Generates `Dockerfile` + `nginx.conf` + `.dockerignore`. Build and run:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
docker build -t my-docs .
|
|
26
|
+
docker run -p 80:80 my-docs
|
|
27
|
+
```
|
|
28
|
+
|
|
16
29
|
## Manual
|
|
17
30
|
|
|
18
31
|
```bash
|
package/template/package.json
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "flame dev",
|
|
7
7
|
"build": "NODE_ENV=production flame build",
|
|
8
|
-
"preview": "
|
|
9
|
-
"deploy": "
|
|
8
|
+
"preview": "flame preview",
|
|
9
|
+
"deploy": "flame deploy"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@docubook/flame": "latest"
|