@marlinjai/clearify 1.5.1 → 1.5.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.
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-SCZZB7OE.js";
9
9
  import {
10
10
  clearifyPlugin
11
- } from "./chunk-NXQNNLGC.js";
11
+ } from "./chunk-UOVBAJMR.js";
12
12
  import {
13
13
  loadUserConfig,
14
14
  resolveConfig,
@@ -368,6 +368,23 @@ ${routeEntries.join(",\n")}
368
368
  server.ws.send({ type: "full-reload" });
369
369
  }
370
370
  });
371
+ return () => {
372
+ server.middlewares.use((req, _res, next) => {
373
+ if (req.method !== "GET" || !req.headers.accept?.includes("text/html")) {
374
+ return next();
375
+ }
376
+ const url = req.url?.split("?")[0] ?? "";
377
+ const sectionMatch = visibleSections.some(
378
+ (s) => s.basePath !== "/" && url.startsWith(s.basePath)
379
+ );
380
+ const apiBasePath = config.openapi?.basePath ?? "/api";
381
+ const apiMatch = config.openapi?.spec && url.startsWith(apiBasePath);
382
+ if (sectionMatch || apiMatch) {
383
+ req.url = "/index.html";
384
+ }
385
+ next();
386
+ });
387
+ };
371
388
  }
372
389
  };
373
390
  const headInjectionPlugin = {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  buildSite
3
- } from "../chunk-CQ4MNGBE.js";
3
+ } from "../chunk-NY3VVUQ3.js";
4
4
  import "../chunk-PRTER35L.js";
5
5
  import "../chunk-SCZZB7OE.js";
6
- import "../chunk-NXQNNLGC.js";
6
+ import "../chunk-UOVBAJMR.js";
7
7
  import "../chunk-B2Q23JW3.js";
8
8
  import "../chunk-IBK35HZR.js";
9
9
  import "../chunk-V7LLYIRO.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  buildSite
3
- } from "../chunk-CQ4MNGBE.js";
3
+ } from "../chunk-NY3VVUQ3.js";
4
4
  import {
5
5
  remarkMermaidToComponent
6
6
  } from "../chunk-PRTER35L.js";
7
7
  import "../chunk-SCZZB7OE.js";
8
8
  import {
9
9
  clearifyPlugin
10
- } from "../chunk-NXQNNLGC.js";
10
+ } from "../chunk-UOVBAJMR.js";
11
11
  import "../chunk-B2Q23JW3.js";
12
12
  import {
13
13
  init
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  clearifyPlugin
3
- } from "../chunk-NXQNNLGC.js";
3
+ } from "../chunk-UOVBAJMR.js";
4
4
  import "../chunk-B2Q23JW3.js";
5
5
  import "../chunk-IBK35HZR.js";
6
6
  import "../chunk-V7LLYIRO.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marlinjai/clearify",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "An open-source documentation site generator. Turn markdown into beautiful docs.",
5
5
  "type": "module",
6
6
  "bin": {