@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.
@@ -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 hasPlugins = !!docuConfig.plugins?.length;
222
- const builder = hasPlugins ? new BuildPluginBuilder(docuConfig) : null;
221
+ const pluginsConfig = docuConfig.plugins ?? [];
222
+ const builder = pluginsConfig.length > 0 ? new BuildPluginBuilder(docuConfig) : null;
223
223
  if (builder) {
224
- const plugins = await loadPlugins(docuConfig.plugins!);
224
+ const plugins = await loadPlugins(pluginsConfig);
225
225
  for (const plugin of plugins) {
226
226
  await plugin.setup(builder);
227
227
  }
@@ -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 = Number.isInteger(parsedPort) && parsedPort > 0 && parsedPort <= 65535 ? parsedPort : 3000;
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 hasPlugins = !!docuConfig.plugins?.length;
45
- const builder = hasPlugins ? new BuildPluginBuilder(docuConfig) : null;
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(docuConfig.plugins!);
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!, true);
200
+ logger.ready(server.port ?? PORT, true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docubook/flame",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "A blazing-fast React + MDX framework powered by Bun, built for modern documentation experiences.",
5
5
  "type": "module",
6
6
  "bin": {