@docubook/flame 1.3.7 → 1.3.8
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/node/build.ts +4 -4
- package/.docu/node/server.ts +8 -5
- package/package.json +1 -1
package/.docu/node/build.ts
CHANGED
|
@@ -82,7 +82,7 @@ async function renderDocsPage(
|
|
|
82
82
|
rawMdx: string,
|
|
83
83
|
filePath: string,
|
|
84
84
|
gitDates?: Map<string, string>,
|
|
85
|
-
builder?: BuildPluginBuilder,
|
|
85
|
+
builder?: BuildPluginBuilder | null,
|
|
86
86
|
nonce?: string
|
|
87
87
|
): Promise<string> {
|
|
88
88
|
let content = rawMdx;
|
|
@@ -218,10 +218,10 @@ async function build() {
|
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
const
|
|
222
|
-
const builder =
|
|
221
|
+
const pluginsConfig = docuConfig.plugins ?? [];
|
|
222
|
+
const builder = pluginsConfig.length > 0 ? new BuildPluginBuilder(docuConfig) : null;
|
|
223
223
|
if (builder) {
|
|
224
|
-
const plugins = await loadPlugins(
|
|
224
|
+
const plugins = await loadPlugins(pluginsConfig);
|
|
225
225
|
for (const plugin of plugins) {
|
|
226
226
|
await plugin.setup(builder);
|
|
227
227
|
}
|
package/.docu/node/server.ts
CHANGED
|
@@ -20,7 +20,8 @@ import { wrapPluginResponse } from "./security";
|
|
|
20
20
|
const docuConfig = loadDocuConfig();
|
|
21
21
|
|
|
22
22
|
const parsedPort = parseInt(process.env.PORT ?? "3000", 10);
|
|
23
|
-
const PORT =
|
|
23
|
+
const PORT =
|
|
24
|
+
Number.isInteger(parsedPort) && parsedPort > 0 && parsedPort <= 65535 ? parsedPort : 3000;
|
|
24
25
|
|
|
25
26
|
logger.buildStart();
|
|
26
27
|
|
|
@@ -41,10 +42,12 @@ logger.indexDone(records, Math.round(performance.now() - t));
|
|
|
41
42
|
logger.routes();
|
|
42
43
|
|
|
43
44
|
// Plugin setup — all hooks active (onLoad, remark/rehype, frontmatter, head/body, html transform, handleRequest)
|
|
44
|
-
const
|
|
45
|
-
const builder =
|
|
45
|
+
const pluginsConfig = docuConfig.plugins ?? [];
|
|
46
|
+
const builder = pluginsConfig.length > 0 ? new BuildPluginBuilder(docuConfig) : null;
|
|
47
|
+
|
|
46
48
|
if (builder) {
|
|
47
|
-
const plugins = await loadPlugins(
|
|
49
|
+
const plugins = await loadPlugins(pluginsConfig);
|
|
50
|
+
|
|
48
51
|
for (const plugin of plugins) {
|
|
49
52
|
await plugin.setup(builder);
|
|
50
53
|
}
|
|
@@ -194,4 +197,4 @@ const server = Bun.serve({
|
|
|
194
197
|
},
|
|
195
198
|
});
|
|
196
199
|
|
|
197
|
-
logger.ready(server.port
|
|
200
|
+
logger.ready(server.port ?? PORT, true);
|