@marlinjai/clearify 1.5.0 → 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.
@@ -175,7 +175,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
175
175
  if (options.noInternal) {
176
176
  writeFileSync(
177
177
  configPath,
178
- `import { defineConfig } from 'clearify';
178
+ `import { defineConfig } from '@marlinjai/clearify';
179
179
 
180
180
  export default defineConfig({
181
181
  name: 'My Documentation',
@@ -190,7 +190,7 @@ export default defineConfig({
190
190
  } else {
191
191
  writeFileSync(
192
192
  configPath,
193
- `import { defineConfig } from 'clearify';
193
+ `import { defineConfig } from '@marlinjai/clearify';
194
194
 
195
195
  export default defineConfig({
196
196
  name: 'My Documentation',
@@ -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 = {
@@ -37,5 +37,5 @@ cli.command("openapi:generate", "Generate OpenAPI spec from NestJS app").option(
37
37
  });
38
38
  });
39
39
  cli.help();
40
- cli.version("1.5.0");
40
+ cli.version("1.5.1");
41
41
  cli.parse();
@@ -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,17 +1,17 @@
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
14
- } from "../chunk-GFD54GNO.js";
14
+ } from "../chunk-MWUXPDQK.js";
15
15
  import {
16
16
  checkLinks
17
17
  } from "../chunk-WT5W333R.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init
3
- } from "../chunk-GFD54GNO.js";
3
+ } from "../chunk-MWUXPDQK.js";
4
4
  export {
5
5
  init
6
6
  };
@@ -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.0",
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": {