@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 +2 -2
- package/dist/index.js +2 -2
- package/docs/options.md +12 -13
- package/docs/overview.md +19 -6
- package/kubb-extension.json +1 -1
- package/package.json +4 -4
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.
|
|
32
|
+
"kubb": ">=5.19.0",
|
|
33
33
|
"node": ">=22.22"
|
|
34
34
|
};
|
|
35
35
|
// package.json
|
|
36
|
-
var version = "5.2.
|
|
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.
|
|
6
|
+
"kubb": ">=5.19.0",
|
|
7
7
|
"node": ">=22.22"
|
|
8
8
|
};
|
|
9
9
|
// package.json
|
|
10
|
-
var version = "5.2.
|
|
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()`
|
|
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
|
|
8
|
-
|
|
|
9
|
-
| [`output`](#output)
|
|
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
|
|
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
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
src/
|
|
37
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
18
|
+
The plugin has no other options.
|
|
16
19
|
|
|
17
20
|
## Example
|
|
18
21
|
|
|
19
|
-
|
|
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
|
+
::
|
package/kubb-extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-redoc",
|
|
3
|
-
"version": "5.2.
|
|
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.
|
|
73
|
+
"@kubb/kit": "^5.20.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@kubb/adapter-oas": "^5.
|
|
76
|
+
"@kubb/adapter-oas": "^5.20.1"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@kubb/adapter-oas": "^5.
|
|
79
|
+
"@kubb/adapter-oas": "^5.20.1"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": ">=22.22"
|