@kubb/plugin-redoc 5.2.3 → 5.2.5

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/dist/index.cjs CHANGED
@@ -29,11 +29,11 @@ let _kubb_adapter_oas = require("@kubb/adapter-oas");
29
29
  let _kubb_kit = require("@kubb/kit");
30
30
  // kubb-extension.json
31
31
  var compatibility = {
32
- "kubb": ">=5.18.4",
32
+ "kubb": ">=5.19.0",
33
33
  "node": ">=22.22"
34
34
  };
35
35
  // package.json
36
- var version = "5.2.3";
36
+ var version = "5.2.5";
37
37
  // src/redoc.ts
38
38
  const htmlEscapes = {
39
39
  "&": "&",
package/dist/index.js CHANGED
@@ -3,11 +3,11 @@ import { adapterOasName } from "@kubb/adapter-oas";
3
3
  import { Diagnostics, ast, defineExtension, injectFile, useConfig } from "@kubb/kit";
4
4
  // kubb-extension.json
5
5
  var compatibility = {
6
- "kubb": ">=5.18.4",
6
+ "kubb": ">=5.19.0",
7
7
  "node": ">=22.22"
8
8
  };
9
9
  // package.json
10
- var version = "5.2.3";
10
+ var version = "5.2.5";
11
11
  // src/redoc.ts
12
12
  const htmlEscapes = {
13
13
  "&": "&",
package/docs/options.md CHANGED
@@ -1,18 +1,19 @@
1
1
  # Options
2
2
 
3
- `pluginRedoc()` accepts a single option, the path of the HTML file it writes. It takes none of the [shared plugin options](https://kubb.dev/docs/5.x/reference/plugin-options).
3
+ `pluginRedoc()` takes one option, the path of the HTML file it writes. It takes none of the [shared plugin options](https://kubb.dev/docs/5.x/reference/plugin-options).
4
4
 
5
5
  ## Options overview
6
6
 
7
- | Option | Purpose | Default |
8
- | ------------------- | --------------------------------------- | ----------------------- |
9
- | [`output`](#output) | Where the HTML file is written: `path`. | `{ path: 'docs.html' }` |
7
+ | Option | Purpose | Default |
8
+ | ------------------------------ | ------------------------------- | ----------------------- |
9
+ | [`output`](#output) | Where the HTML file is written. | `{ path: 'docs.html' }` |
10
+ | ↳ [`output.path`](#outputpath) | File path of the HTML page. | `'docs.html'` |
10
11
 
11
12
  ## Option details
12
13
 
13
14
  ### output
14
15
 
15
- Where the generated Redoc HTML file is written.
16
+ Where the Redoc HTML file is written. Unlike the shared `output` option, it takes only `path`.
16
17
 
17
18
  | | |
18
19
  | -------- | ----------------------- |
@@ -22,7 +23,7 @@ Where the generated Redoc HTML file is written.
22
23
 
23
24
  #### output.path
24
25
 
25
- File path of the generated HTML, resolved against the global `output.path`. Unlike most plugins, this points at a single file, not a directory. End the path with `.html`. Without `.html`, Kubb writes the file at that exact path, with no extension.
26
+ File path of the HTML page, resolved against the root `output.path`. It names a file, not a folder.
26
27
 
27
28
  | | |
28
29
  | -------- | ------------- |
@@ -30,10 +31,8 @@ File path of the generated HTML, resolved against the global `output.path`. Unli
30
31
  | Required | `false` |
31
32
  | Default | `'docs.html'` |
32
33
 
33
- With `output.path` set to `'docs.html'` and the global `output.path` set to `'./src/gen'`, the plugin writes one file:
34
-
35
- ```text
36
- src/
37
- └── gen/
38
- └── docs.html
39
- ```
34
+ | `output.path` | Root `output.path` | Writes |
35
+ | ------------------ | ------------------ | ------------------------------------------- |
36
+ | `'docs.html'` | `'./src/gen'` | `src/gen/docs.html` |
37
+ | `'api/index.html'` | `'./src/gen'` | `src/gen/api/index.html` |
38
+ | `'docs'` | `'./src/gen'` | `src/gen/docs`, a file without an extension |
package/docs/overview.md CHANGED
@@ -1,22 +1,27 @@
1
1
  # Redoc
2
2
 
3
- The Redoc plugin generates a single HTML page that documents your OpenAPI spec with Redoc.
3
+ The Redoc plugin generates one Redoc HTML page with your OpenAPI spec embedded. Publish it to any static host without a build step.
4
4
 
5
- The whole spec is embedded in the page, so you can publish the page to any static host without a build step. Viewing the page needs network access, because it loads a pinned Redoc bundle from jsDelivr, checked with a Subresource Integrity hash, and its fonts from Google Fonts.
5
+ > [!NOTE]
6
+ > Viewing the page needs network access. It loads a pinned Redoc bundle from jsDelivr, checked with a Subresource Integrity hash, and its fonts from Google Fonts.
6
7
 
7
8
  ## Setup
8
9
 
9
- No other plugins or packages are needed. The plugin reads the spec through the default OpenAPI adapter, `adapterOas`, and fails with any other adapter.
10
+ No other plugins or packages are needed. The plugin needs the default OpenAPI adapter, `adapterOas`, and fails with `KUBB_ADAPTER_REQUIRED` for any other adapter.
10
11
 
11
12
  ## Options worth knowing
12
13
 
13
- - `output.path` sets the HTML file path, relative to the root `output.path`. The default is `docs.html`. End it with `.html`, because it names a file, not a folder.
14
+ | Option | Default | What it does |
15
+ | -------------------------------------------------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------- |
16
+ | [`output.path`](https://kubb.dev/extensions/kubb-labs/plugin-redoc/options#outputpath) | `'docs.html'` | Path of the HTML file, relative to the root `output.path`. End it with `.html`, because it names a file. |
14
17
 
15
- The plugin has no other options. See [Options](https://kubb.dev/extensions/kubb-labs/plugin-redoc/options) for its type and default.
18
+ The plugin has no other options.
16
19
 
17
20
  ## Example
18
21
 
19
- The config below writes the page to `src/gen/docs.html`.
22
+ This config writes the page to `src/gen/docs.html`, titled with the spec's `info.title`.
23
+
24
+ ::code-group
20
25
 
21
26
  ```typescript [kubb.config.ts]
22
27
  import { defineConfig } from 'kubb/config'
@@ -30,3 +35,11 @@ export default defineConfig({
30
35
  ],
31
36
  })
32
37
  ```
38
+
39
+ ```text [Output]
40
+ src/
41
+ └── gen/
42
+ └── docs.html
43
+ ```
44
+
45
+ ::
@@ -18,7 +18,7 @@
18
18
  }
19
19
  ],
20
20
  "compatibility": {
21
- "kubb": ">=5.18.4",
21
+ "kubb": ">=5.19.0",
22
22
  "node": ">=22.22"
23
23
  },
24
24
  "options": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-redoc",
3
- "version": "5.2.3",
3
+ "version": "5.2.5",
4
4
  "description": "Generate a ReDoc API reference page with Kubb. Produces a standalone HTML file you can host without a build step.",
5
5
  "keywords": [
6
6
  "api-docs",
@@ -70,13 +70,13 @@
70
70
  "registry": "https://registry.npmjs.org/"
71
71
  },
72
72
  "dependencies": {
73
- "@kubb/kit": "^5.19.0"
73
+ "@kubb/kit": "^5.20.1"
74
74
  },
75
75
  "devDependencies": {
76
- "@kubb/adapter-oas": "^5.19.0"
76
+ "@kubb/adapter-oas": "^5.20.1"
77
77
  },
78
78
  "peerDependencies": {
79
- "@kubb/adapter-oas": "^5.19.0"
79
+ "@kubb/adapter-oas": "^5.20.1"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=22.22"