@kubb/plugin-redoc 5.0.0-beta.15 → 5.0.0-beta.25

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
@@ -52,11 +52,16 @@ function trimExtName(text) {
52
52
  }
53
53
  //#endregion
54
54
  //#region package.json
55
- var version = "5.0.0-beta.15";
55
+ var version = "5.0.0-beta.25";
56
56
  //#endregion
57
57
  //#region src/redoc.tsx
58
58
  const __filename$1 = (0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
59
59
  const __dirname$1 = node_path.default.dirname(__filename$1);
60
+ /**
61
+ * Renders a self-contained Redoc HTML page for an OpenAPI document. The page
62
+ * embeds the spec inline and pulls Redoc's bundle from a CDN at runtime, so
63
+ * the generated file works without further build steps.
64
+ */
60
65
  async function getPageHTML(api, { title, disableGoogleFont, templateOptions } = {}) {
61
66
  const templateFileName = node_path.default.join(__dirname$1, "../static/redoc.hbs");
62
67
  return handlebars.default.compile(node_fs.default.readFileSync(templateFileName).toString())({
@@ -77,7 +82,30 @@ async function getPageHTML(api, { title, disableGoogleFont, templateOptions } =
77
82
  }
78
83
  //#endregion
79
84
  //#region src/plugin.ts
85
+ /**
86
+ * Canonical plugin name for `@kubb/plugin-redoc`. Used for driver lookups and
87
+ * cross-plugin dependency references.
88
+ */
80
89
  const pluginRedocName = "plugin-redoc";
90
+ /**
91
+ * Generates a self-contained static HTML documentation page from your OpenAPI
92
+ * spec using Redoc. The file is regenerated on every Kubb build, so the docs
93
+ * stay in lockstep with the spec the rest of your code is generated from.
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * import { defineConfig } from 'kubb'
98
+ * import { pluginRedoc } from '@kubb/plugin-redoc'
99
+ *
100
+ * export default defineConfig({
101
+ * input: { path: './petStore.yaml' },
102
+ * output: { path: './src/gen' },
103
+ * plugins: [
104
+ * pluginRedoc({ output: { path: 'docs.html' } }),
105
+ * ],
106
+ * })
107
+ * ```
108
+ */
81
109
  const pluginRedoc = (0, _kubb_core.definePlugin)((options) => {
82
110
  const { output = { path: "docs.html" } } = options;
83
111
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["__filename","__dirname","path","pkg","fs","adapterOasName","path","ast"],"sources":["../../../internals/utils/src/string.ts","../package.json","../src/redoc.tsx","../src/plugin.ts"],"sourcesContent":["/**\n * Strips a single matching pair of `\"...\"`, `'...'`, or `` `...` `` from both ends of `text`.\n * Returns the string unchanged when no balanced quote pair is found.\n *\n * @example\n * trimQuotes('\"hello\"') // 'hello'\n * trimQuotes('hello') // 'hello'\n */\nexport function trimQuotes(text: string): string {\n if (text.length >= 2) {\n const first = text[0]\n const last = text[text.length - 1]\n if ((first === '\"' && last === '\"') || (first === \"'\" && last === \"'\") || (first === '`' && last === '`')) {\n return text.slice(1, -1)\n }\n }\n return text\n}\n\n/**\n * Escapes characters that are not allowed inside JS string literals.\n * Handles quotes, backslashes, and Unicode line terminators (U+2028 / U+2029).\n *\n * @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4\n *\n * @example\n * ```ts\n * jsStringEscape('say \"hi\"\\nbye') // 'say \\\\\"hi\\\\\"\\\\nbye'\n * ```\n */\nexport function jsStringEscape(input: unknown): string {\n return `${input}`.replace(/[\"'\\\\\\n\\r\\u2028\\u2029]/g, (character) => {\n switch (character) {\n case '\"':\n case \"'\":\n case '\\\\':\n return `\\\\${character}`\n case '\\n':\n return '\\\\n'\n case '\\r':\n return '\\\\r'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return ''\n }\n })\n}\n\n/**\n * Strips the file extension from a path or file name.\n * Only removes the last `.ext` segment when the dot is not part of a directory name.\n *\n * @example\n * trimExtName('petStore.ts') // 'petStore'\n * trimExtName('/src/models/pet.ts') // '/src/models/pet'\n * trimExtName('/project.v2/gen/pet.ts') // '/project.v2/gen/pet'\n * trimExtName('noExtension') // 'noExtension'\n */\nexport function trimExtName(text: string): string {\n const dotIndex = text.lastIndexOf('.')\n if (dotIndex > 0 && !text.includes('/', dotIndex)) {\n return text.slice(0, dotIndex)\n }\n return text\n}\n","","import fs from 'node:fs'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { AdapterOas } from '@kubb/adapter-oas'\nimport pkg from 'handlebars'\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\ntype BuildDocsOptions = {\n title?: string\n disableGoogleFont?: boolean\n templateOptions?: any\n}\n\nexport async function getPageHTML(api: AdapterOas['document'], { title, disableGoogleFont, templateOptions }: BuildDocsOptions = {}) {\n const templateFileName = path.join(__dirname, '../static/redoc.hbs')\n const template = pkg.compile(fs.readFileSync(templateFileName).toString())\n return template({\n title: title || api.info.title || 'ReDoc documentation',\n redocHTML: `\n <script src=\"https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js\"> </script>\n <div id=\"redoc-container\"></div>\n <script>\n const data = ${JSON.stringify(api, null, 2)};\n Redoc.init(data, {\n \"expandResponses\": \"200,400\"\n }, document.getElementById('redoc-container'))\n </script>\n `,\n disableGoogleFont,\n templateOptions,\n })\n}\n","import path from 'node:path'\nimport { trimExtName } from '@internals/utils'\nimport type { AdapterOas } from '@kubb/adapter-oas'\nimport { adapterOasName } from '@kubb/adapter-oas'\n\nimport { type Adapter, ast, definePlugin } from '@kubb/core'\nimport { version } from '../package.json'\nimport { getPageHTML } from './redoc.tsx'\nimport type { PluginRedoc } from './types.ts'\n\nexport const pluginRedocName = 'plugin-redoc' satisfies PluginRedoc['name']\n\nexport const pluginRedoc = definePlugin<PluginRedoc>((options) => {\n const { output = { path: 'docs.html' } } = options\n\n return {\n name: pluginRedocName,\n version,\n options,\n hooks: {\n async 'kubb:plugin:setup'(ctx) {\n ctx.setOptions({\n output,\n name: trimExtName(output.path),\n exclude: [],\n override: [],\n })\n\n const adapter = ctx.config.adapter\n\n if (adapter?.name !== adapterOasName) {\n throw new Error(\n `[${pluginRedocName}] plugin-redoc requires the OpenAPI adapter. Make sure you are using adapterOas (e.g. \\`adapter: adapterOas()\\`) in your Kubb config.`,\n )\n }\n\n const document = (adapter as Adapter<AdapterOas>).document\n\n if (!document) {\n throw new Error(\n `[${pluginRedocName}] No OpenAPI document found. The adapterOas did not produce a document — ensure the adapter has run before this plugin.`,\n )\n }\n\n const root = path.resolve(ctx.config.root, ctx.config.output.path)\n const pageHTML = await getPageHTML(document)\n\n ctx.injectFile({\n baseName: 'docs.html',\n path: path.resolve(root, output.path || './docs.html'),\n sources: [\n ast.createSource({\n name: 'docs.html',\n nodes: [ast.createText(pageHTML)],\n }),\n ],\n })\n },\n },\n }\n})\n\nexport default pluginRedoc\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,SAAgB,YAAY,MAAsB;CAChD,MAAM,WAAW,KAAK,YAAY,IAAI;CACtC,IAAI,WAAW,KAAK,CAAC,KAAK,SAAS,KAAK,SAAS,EAC/C,OAAO,KAAK,MAAM,GAAG,SAAS;CAEhC,OAAO;;;;;;;AE5DT,MAAMA,gBAAAA,GAAAA,SAAAA,eAAAA,QAAAA,MAAAA,CAAAA,cAAAA,WAAAA,CAAAA,KAA2C;AACjD,MAAMC,cAAYC,UAAAA,QAAK,QAAQF,aAAW;AAQ1C,eAAsB,YAAY,KAA6B,EAAE,OAAO,mBAAmB,oBAAsC,EAAE,EAAE;CACnI,MAAM,mBAAmBE,UAAAA,QAAK,KAAKD,aAAW,sBAAsB;CAEpE,OADiBE,WAAAA,QAAI,QAAQC,QAAAA,QAAG,aAAa,iBAAiB,CAAC,UAAU,CAC1D,CAAC;EACd,OAAO,SAAS,IAAI,KAAK,SAAS;EAClC,WAAW;;;;kBAIG,KAAK,UAAU,KAAK,MAAM,EAAE,CAAC;;;;;;EAM3C;EACA;EACD,CAAC;;;;ACtBJ,MAAa,kBAAkB;AAE/B,MAAa,eAAA,GAAA,WAAA,eAAyC,YAAY;CAChE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,KAAK;CAE3C,OAAO;EACL,MAAM;EACN;EACA;EACA,OAAO,EACL,MAAM,oBAAoB,KAAK;GAC7B,IAAI,WAAW;IACb;IACA,MAAM,YAAY,OAAO,KAAK;IAC9B,SAAS,EAAE;IACX,UAAU,EAAE;IACb,CAAC;GAEF,MAAM,UAAU,IAAI,OAAO;GAE3B,IAAI,SAAS,SAASC,kBAAAA,gBACpB,MAAM,IAAI,MACR,IAAI,gBAAgB,uIACrB;GAGH,MAAM,WAAY,QAAgC;GAElD,IAAI,CAAC,UACH,MAAM,IAAI,MACR,IAAI,gBAAgB,yHACrB;GAGH,MAAM,OAAOC,YAAAA,QAAK,QAAQ,IAAI,OAAO,MAAM,IAAI,OAAO,OAAO,KAAK;GAClE,MAAM,WAAW,MAAM,YAAY,SAAS;GAE5C,IAAI,WAAW;IACb,UAAU;IACV,MAAMA,YAAAA,QAAK,QAAQ,MAAM,OAAO,QAAQ,cAAc;IACtD,SAAS,CACPC,WAAAA,IAAI,aAAa;KACf,MAAM;KACN,OAAO,CAACA,WAAAA,IAAI,WAAW,SAAS,CAAC;KAClC,CAAC,CACH;IACF,CAAC;KAEL;EACF;EACD"}
1
+ {"version":3,"file":"index.cjs","names":["__filename","__dirname","path","pkg","fs","adapterOasName","path","ast"],"sources":["../../../internals/utils/src/string.ts","../package.json","../src/redoc.tsx","../src/plugin.ts"],"sourcesContent":["/**\n * Strips a single matching pair of `\"...\"`, `'...'`, or `` `...` `` from both ends of `text`.\n * Returns the string unchanged when no balanced quote pair is found.\n *\n * @example\n * trimQuotes('\"hello\"') // 'hello'\n * trimQuotes('hello') // 'hello'\n */\nexport function trimQuotes(text: string): string {\n if (text.length >= 2) {\n const first = text[0]\n const last = text[text.length - 1]\n if ((first === '\"' && last === '\"') || (first === \"'\" && last === \"'\") || (first === '`' && last === '`')) {\n return text.slice(1, -1)\n }\n }\n return text\n}\n\n/**\n * Escapes characters that are not allowed inside JS string literals.\n * Handles quotes, backslashes, and Unicode line terminators (U+2028 / U+2029).\n *\n * @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4\n *\n * @example\n * ```ts\n * jsStringEscape('say \"hi\"\\nbye') // 'say \\\\\"hi\\\\\"\\\\nbye'\n * ```\n */\nexport function jsStringEscape(input: unknown): string {\n return `${input}`.replace(/[\"'\\\\\\n\\r\\u2028\\u2029]/g, (character) => {\n switch (character) {\n case '\"':\n case \"'\":\n case '\\\\':\n return `\\\\${character}`\n case '\\n':\n return '\\\\n'\n case '\\r':\n return '\\\\r'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return ''\n }\n })\n}\n\n/**\n * Strips the file extension from a path or file name.\n * Only removes the last `.ext` segment when the dot is not part of a directory name.\n *\n * @example\n * trimExtName('petStore.ts') // 'petStore'\n * trimExtName('/src/models/pet.ts') // '/src/models/pet'\n * trimExtName('/project.v2/gen/pet.ts') // '/project.v2/gen/pet'\n * trimExtName('noExtension') // 'noExtension'\n */\nexport function trimExtName(text: string): string {\n const dotIndex = text.lastIndexOf('.')\n if (dotIndex > 0 && !text.includes('/', dotIndex)) {\n return text.slice(0, dotIndex)\n }\n return text\n}\n","","import fs from 'node:fs'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { AdapterOas } from '@kubb/adapter-oas'\nimport pkg from 'handlebars'\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\ntype BuildDocsOptions = {\n title?: string\n disableGoogleFont?: boolean\n templateOptions?: any\n}\n\n/**\n * Renders a self-contained Redoc HTML page for an OpenAPI document. The page\n * embeds the spec inline and pulls Redoc's bundle from a CDN at runtime, so\n * the generated file works without further build steps.\n */\nexport async function getPageHTML(api: AdapterOas['document'], { title, disableGoogleFont, templateOptions }: BuildDocsOptions = {}) {\n const templateFileName = path.join(__dirname, '../static/redoc.hbs')\n const template = pkg.compile(fs.readFileSync(templateFileName).toString())\n return template({\n title: title || api.info.title || 'ReDoc documentation',\n redocHTML: `\n <script src=\"https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js\"> </script>\n <div id=\"redoc-container\"></div>\n <script>\n const data = ${JSON.stringify(api, null, 2)};\n Redoc.init(data, {\n \"expandResponses\": \"200,400\"\n }, document.getElementById('redoc-container'))\n </script>\n `,\n disableGoogleFont,\n templateOptions,\n })\n}\n","import path from 'node:path'\nimport { trimExtName } from '@internals/utils'\nimport type { AdapterOas } from '@kubb/adapter-oas'\nimport { adapterOasName } from '@kubb/adapter-oas'\n\nimport { type Adapter, ast, definePlugin } from '@kubb/core'\nimport { version } from '../package.json'\nimport { getPageHTML } from './redoc.tsx'\nimport type { PluginRedoc } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-redoc`. Used for driver lookups and\n * cross-plugin dependency references.\n */\nexport const pluginRedocName = 'plugin-redoc' satisfies PluginRedoc['name']\n\n/**\n * Generates a self-contained static HTML documentation page from your OpenAPI\n * spec using Redoc. The file is regenerated on every Kubb build, so the docs\n * stay in lockstep with the spec the rest of your code is generated from.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginRedoc } from '@kubb/plugin-redoc'\n *\n * export default defineConfig({\n * input: { path: './petStore.yaml' },\n * output: { path: './src/gen' },\n * plugins: [\n * pluginRedoc({ output: { path: 'docs.html' } }),\n * ],\n * })\n * ```\n */\nexport const pluginRedoc = definePlugin<PluginRedoc>((options) => {\n const { output = { path: 'docs.html' } } = options\n\n return {\n name: pluginRedocName,\n version,\n options,\n hooks: {\n async 'kubb:plugin:setup'(ctx) {\n ctx.setOptions({\n output,\n name: trimExtName(output.path),\n exclude: [],\n override: [],\n })\n\n const adapter = ctx.config.adapter\n\n if (adapter?.name !== adapterOasName) {\n throw new Error(\n `[${pluginRedocName}] plugin-redoc requires the OpenAPI adapter. Make sure you are using adapterOas (e.g. \\`adapter: adapterOas()\\`) in your Kubb config.`,\n )\n }\n\n const document = (adapter as Adapter<AdapterOas>).document\n\n if (!document) {\n throw new Error(\n `[${pluginRedocName}] No OpenAPI document found. The adapterOas did not produce a document — ensure the adapter has run before this plugin.`,\n )\n }\n\n const root = path.resolve(ctx.config.root, ctx.config.output.path)\n const pageHTML = await getPageHTML(document)\n\n ctx.injectFile({\n baseName: 'docs.html',\n path: path.resolve(root, output.path || './docs.html'),\n sources: [\n ast.createSource({\n name: 'docs.html',\n nodes: [ast.createText(pageHTML)],\n }),\n ],\n })\n },\n },\n }\n})\n\nexport default pluginRedoc\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,SAAgB,YAAY,MAAsB;CAChD,MAAM,WAAW,KAAK,YAAY,IAAI;CACtC,IAAI,WAAW,KAAK,CAAC,KAAK,SAAS,KAAK,SAAS,EAC/C,OAAO,KAAK,MAAM,GAAG,SAAS;CAEhC,OAAO;;;;;;;AE5DT,MAAMA,gBAAAA,GAAAA,SAAAA,eAAAA,QAAAA,MAAAA,CAAAA,cAAAA,WAAAA,CAAAA,KAA2C;AACjD,MAAMC,cAAYC,UAAAA,QAAK,QAAQF,aAAW;;;;;;AAa1C,eAAsB,YAAY,KAA6B,EAAE,OAAO,mBAAmB,oBAAsC,EAAE,EAAE;CACnI,MAAM,mBAAmBE,UAAAA,QAAK,KAAKD,aAAW,sBAAsB;CAEpE,OADiBE,WAAAA,QAAI,QAAQC,QAAAA,QAAG,aAAa,iBAAiB,CAAC,UAAU,CAC1D,CAAC;EACd,OAAO,SAAS,IAAI,KAAK,SAAS;EAClC,WAAW;;;;kBAIG,KAAK,UAAU,KAAK,MAAM,EAAE,CAAC;;;;;;EAM3C;EACA;EACD,CAAC;;;;;;;;ACvBJ,MAAa,kBAAkB;;;;;;;;;;;;;;;;;;;;AAqB/B,MAAa,eAAA,GAAA,WAAA,eAAyC,YAAY;CAChE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,KAAK;CAE3C,OAAO;EACL,MAAM;EACN;EACA;EACA,OAAO,EACL,MAAM,oBAAoB,KAAK;GAC7B,IAAI,WAAW;IACb;IACA,MAAM,YAAY,OAAO,KAAK;IAC9B,SAAS,EAAE;IACX,UAAU,EAAE;IACb,CAAC;GAEF,MAAM,UAAU,IAAI,OAAO;GAE3B,IAAI,SAAS,SAASC,kBAAAA,gBACpB,MAAM,IAAI,MACR,IAAI,gBAAgB,uIACrB;GAGH,MAAM,WAAY,QAAgC;GAElD,IAAI,CAAC,UACH,MAAM,IAAI,MACR,IAAI,gBAAgB,yHACrB;GAGH,MAAM,OAAOC,YAAAA,QAAK,QAAQ,IAAI,OAAO,MAAM,IAAI,OAAO,OAAO,KAAK;GAClE,MAAM,WAAW,MAAM,YAAY,SAAS;GAE5C,IAAI,WAAW;IACb,UAAU;IACV,MAAMA,YAAAA,QAAK,QAAQ,MAAM,OAAO,QAAQ,cAAc;IACtD,SAAS,CACPC,WAAAA,IAAI,aAAa;KACf,MAAM;KACN,OAAO,CAACA,WAAAA,IAAI,WAAW,SAAS,CAAC;KAClC,CAAC,CACH;IACF,CAAC;KAEL;EACF;EACD"}
package/dist/index.d.ts CHANGED
@@ -4,9 +4,14 @@ import { Exclude, Include, Output, Override, PluginFactoryOptions } from "@kubb/
4
4
 
5
5
  //#region src/types.d.ts
6
6
  type Options = {
7
+ /**
8
+ * Output location of the generated Redoc HTML file. The path is resolved
9
+ * against the global `output.path` set on `defineConfig`.
10
+ */
7
11
  output?: {
8
12
  /**
9
- * Output path for the generated HTML documentation.
13
+ * File path of the generated HTML, relative to the global `output.path`.
14
+ * Unlike most plugins, this points at a single file rather than a directory.
10
15
  *
11
16
  * @default 'docs.html'
12
17
  */
@@ -30,7 +35,30 @@ declare global {
30
35
  }
31
36
  //#endregion
32
37
  //#region src/plugin.d.ts
38
+ /**
39
+ * Canonical plugin name for `@kubb/plugin-redoc`. Used for driver lookups and
40
+ * cross-plugin dependency references.
41
+ */
33
42
  declare const pluginRedocName = "plugin-redoc";
43
+ /**
44
+ * Generates a self-contained static HTML documentation page from your OpenAPI
45
+ * spec using Redoc. The file is regenerated on every Kubb build, so the docs
46
+ * stay in lockstep with the spec the rest of your code is generated from.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * import { defineConfig } from 'kubb'
51
+ * import { pluginRedoc } from '@kubb/plugin-redoc'
52
+ *
53
+ * export default defineConfig({
54
+ * input: { path: './petStore.yaml' },
55
+ * output: { path: './src/gen' },
56
+ * plugins: [
57
+ * pluginRedoc({ output: { path: 'docs.html' } }),
58
+ * ],
59
+ * })
60
+ * ```
61
+ */
34
62
  declare const pluginRedoc: (options?: Options | undefined) => _$_kubb_core0.Plugin<PluginRedoc>;
35
63
  //#endregion
36
64
  export { type PluginRedoc, pluginRedoc as default, pluginRedoc, pluginRedocName };
package/dist/index.js CHANGED
@@ -23,11 +23,16 @@ function trimExtName(text) {
23
23
  }
24
24
  //#endregion
25
25
  //#region package.json
26
- var version = "5.0.0-beta.15";
26
+ var version = "5.0.0-beta.25";
27
27
  //#endregion
28
28
  //#region src/redoc.tsx
29
29
  const __filename = fileURLToPath(import.meta.url);
30
30
  const __dirname = path.dirname(__filename);
31
+ /**
32
+ * Renders a self-contained Redoc HTML page for an OpenAPI document. The page
33
+ * embeds the spec inline and pulls Redoc's bundle from a CDN at runtime, so
34
+ * the generated file works without further build steps.
35
+ */
31
36
  async function getPageHTML(api, { title, disableGoogleFont, templateOptions } = {}) {
32
37
  const templateFileName = path.join(__dirname, "../static/redoc.hbs");
33
38
  return pkg.compile(fs.readFileSync(templateFileName).toString())({
@@ -48,7 +53,30 @@ async function getPageHTML(api, { title, disableGoogleFont, templateOptions } =
48
53
  }
49
54
  //#endregion
50
55
  //#region src/plugin.ts
56
+ /**
57
+ * Canonical plugin name for `@kubb/plugin-redoc`. Used for driver lookups and
58
+ * cross-plugin dependency references.
59
+ */
51
60
  const pluginRedocName = "plugin-redoc";
61
+ /**
62
+ * Generates a self-contained static HTML documentation page from your OpenAPI
63
+ * spec using Redoc. The file is regenerated on every Kubb build, so the docs
64
+ * stay in lockstep with the spec the rest of your code is generated from.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * import { defineConfig } from 'kubb'
69
+ * import { pluginRedoc } from '@kubb/plugin-redoc'
70
+ *
71
+ * export default defineConfig({
72
+ * input: { path: './petStore.yaml' },
73
+ * output: { path: './src/gen' },
74
+ * plugins: [
75
+ * pluginRedoc({ output: { path: 'docs.html' } }),
76
+ * ],
77
+ * })
78
+ * ```
79
+ */
52
80
  const pluginRedoc = definePlugin((options) => {
53
81
  const { output = { path: "docs.html" } } = options;
54
82
  return {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../internals/utils/src/string.ts","../package.json","../src/redoc.tsx","../src/plugin.ts"],"sourcesContent":["/**\n * Strips a single matching pair of `\"...\"`, `'...'`, or `` `...` `` from both ends of `text`.\n * Returns the string unchanged when no balanced quote pair is found.\n *\n * @example\n * trimQuotes('\"hello\"') // 'hello'\n * trimQuotes('hello') // 'hello'\n */\nexport function trimQuotes(text: string): string {\n if (text.length >= 2) {\n const first = text[0]\n const last = text[text.length - 1]\n if ((first === '\"' && last === '\"') || (first === \"'\" && last === \"'\") || (first === '`' && last === '`')) {\n return text.slice(1, -1)\n }\n }\n return text\n}\n\n/**\n * Escapes characters that are not allowed inside JS string literals.\n * Handles quotes, backslashes, and Unicode line terminators (U+2028 / U+2029).\n *\n * @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4\n *\n * @example\n * ```ts\n * jsStringEscape('say \"hi\"\\nbye') // 'say \\\\\"hi\\\\\"\\\\nbye'\n * ```\n */\nexport function jsStringEscape(input: unknown): string {\n return `${input}`.replace(/[\"'\\\\\\n\\r\\u2028\\u2029]/g, (character) => {\n switch (character) {\n case '\"':\n case \"'\":\n case '\\\\':\n return `\\\\${character}`\n case '\\n':\n return '\\\\n'\n case '\\r':\n return '\\\\r'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return ''\n }\n })\n}\n\n/**\n * Strips the file extension from a path or file name.\n * Only removes the last `.ext` segment when the dot is not part of a directory name.\n *\n * @example\n * trimExtName('petStore.ts') // 'petStore'\n * trimExtName('/src/models/pet.ts') // '/src/models/pet'\n * trimExtName('/project.v2/gen/pet.ts') // '/project.v2/gen/pet'\n * trimExtName('noExtension') // 'noExtension'\n */\nexport function trimExtName(text: string): string {\n const dotIndex = text.lastIndexOf('.')\n if (dotIndex > 0 && !text.includes('/', dotIndex)) {\n return text.slice(0, dotIndex)\n }\n return text\n}\n","","import fs from 'node:fs'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { AdapterOas } from '@kubb/adapter-oas'\nimport pkg from 'handlebars'\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\ntype BuildDocsOptions = {\n title?: string\n disableGoogleFont?: boolean\n templateOptions?: any\n}\n\nexport async function getPageHTML(api: AdapterOas['document'], { title, disableGoogleFont, templateOptions }: BuildDocsOptions = {}) {\n const templateFileName = path.join(__dirname, '../static/redoc.hbs')\n const template = pkg.compile(fs.readFileSync(templateFileName).toString())\n return template({\n title: title || api.info.title || 'ReDoc documentation',\n redocHTML: `\n <script src=\"https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js\"> </script>\n <div id=\"redoc-container\"></div>\n <script>\n const data = ${JSON.stringify(api, null, 2)};\n Redoc.init(data, {\n \"expandResponses\": \"200,400\"\n }, document.getElementById('redoc-container'))\n </script>\n `,\n disableGoogleFont,\n templateOptions,\n })\n}\n","import path from 'node:path'\nimport { trimExtName } from '@internals/utils'\nimport type { AdapterOas } from '@kubb/adapter-oas'\nimport { adapterOasName } from '@kubb/adapter-oas'\n\nimport { type Adapter, ast, definePlugin } from '@kubb/core'\nimport { version } from '../package.json'\nimport { getPageHTML } from './redoc.tsx'\nimport type { PluginRedoc } from './types.ts'\n\nexport const pluginRedocName = 'plugin-redoc' satisfies PluginRedoc['name']\n\nexport const pluginRedoc = definePlugin<PluginRedoc>((options) => {\n const { output = { path: 'docs.html' } } = options\n\n return {\n name: pluginRedocName,\n version,\n options,\n hooks: {\n async 'kubb:plugin:setup'(ctx) {\n ctx.setOptions({\n output,\n name: trimExtName(output.path),\n exclude: [],\n override: [],\n })\n\n const adapter = ctx.config.adapter\n\n if (adapter?.name !== adapterOasName) {\n throw new Error(\n `[${pluginRedocName}] plugin-redoc requires the OpenAPI adapter. Make sure you are using adapterOas (e.g. \\`adapter: adapterOas()\\`) in your Kubb config.`,\n )\n }\n\n const document = (adapter as Adapter<AdapterOas>).document\n\n if (!document) {\n throw new Error(\n `[${pluginRedocName}] No OpenAPI document found. The adapterOas did not produce a document — ensure the adapter has run before this plugin.`,\n )\n }\n\n const root = path.resolve(ctx.config.root, ctx.config.output.path)\n const pageHTML = await getPageHTML(document)\n\n ctx.injectFile({\n baseName: 'docs.html',\n path: path.resolve(root, output.path || './docs.html'),\n sources: [\n ast.createSource({\n name: 'docs.html',\n nodes: [ast.createText(pageHTML)],\n }),\n ],\n })\n },\n },\n }\n})\n\nexport default pluginRedoc\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6DA,SAAgB,YAAY,MAAsB;CAChD,MAAM,WAAW,KAAK,YAAY,IAAI;CACtC,IAAI,WAAW,KAAK,CAAC,KAAK,SAAS,KAAK,SAAS,EAC/C,OAAO,KAAK,MAAM,GAAG,SAAS;CAEhC,OAAO;;;;;;;AE5DT,MAAM,aAAa,cAAc,OAAO,KAAK,IAAI;AACjD,MAAM,YAAY,KAAK,QAAQ,WAAW;AAQ1C,eAAsB,YAAY,KAA6B,EAAE,OAAO,mBAAmB,oBAAsC,EAAE,EAAE;CACnI,MAAM,mBAAmB,KAAK,KAAK,WAAW,sBAAsB;CAEpE,OADiB,IAAI,QAAQ,GAAG,aAAa,iBAAiB,CAAC,UAAU,CAC1D,CAAC;EACd,OAAO,SAAS,IAAI,KAAK,SAAS;EAClC,WAAW;;;;kBAIG,KAAK,UAAU,KAAK,MAAM,EAAE,CAAC;;;;;;EAM3C;EACA;EACD,CAAC;;;;ACtBJ,MAAa,kBAAkB;AAE/B,MAAa,cAAc,cAA2B,YAAY;CAChE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,KAAK;CAE3C,OAAO;EACL,MAAM;EACN;EACA;EACA,OAAO,EACL,MAAM,oBAAoB,KAAK;GAC7B,IAAI,WAAW;IACb;IACA,MAAM,YAAY,OAAO,KAAK;IAC9B,SAAS,EAAE;IACX,UAAU,EAAE;IACb,CAAC;GAEF,MAAM,UAAU,IAAI,OAAO;GAE3B,IAAI,SAAS,SAAS,gBACpB,MAAM,IAAI,MACR,IAAI,gBAAgB,uIACrB;GAGH,MAAM,WAAY,QAAgC;GAElD,IAAI,CAAC,UACH,MAAM,IAAI,MACR,IAAI,gBAAgB,yHACrB;GAGH,MAAM,OAAO,KAAK,QAAQ,IAAI,OAAO,MAAM,IAAI,OAAO,OAAO,KAAK;GAClE,MAAM,WAAW,MAAM,YAAY,SAAS;GAE5C,IAAI,WAAW;IACb,UAAU;IACV,MAAM,KAAK,QAAQ,MAAM,OAAO,QAAQ,cAAc;IACtD,SAAS,CACP,IAAI,aAAa;KACf,MAAM;KACN,OAAO,CAAC,IAAI,WAAW,SAAS,CAAC;KAClC,CAAC,CACH;IACF,CAAC;KAEL;EACF;EACD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../internals/utils/src/string.ts","../package.json","../src/redoc.tsx","../src/plugin.ts"],"sourcesContent":["/**\n * Strips a single matching pair of `\"...\"`, `'...'`, or `` `...` `` from both ends of `text`.\n * Returns the string unchanged when no balanced quote pair is found.\n *\n * @example\n * trimQuotes('\"hello\"') // 'hello'\n * trimQuotes('hello') // 'hello'\n */\nexport function trimQuotes(text: string): string {\n if (text.length >= 2) {\n const first = text[0]\n const last = text[text.length - 1]\n if ((first === '\"' && last === '\"') || (first === \"'\" && last === \"'\") || (first === '`' && last === '`')) {\n return text.slice(1, -1)\n }\n }\n return text\n}\n\n/**\n * Escapes characters that are not allowed inside JS string literals.\n * Handles quotes, backslashes, and Unicode line terminators (U+2028 / U+2029).\n *\n * @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4\n *\n * @example\n * ```ts\n * jsStringEscape('say \"hi\"\\nbye') // 'say \\\\\"hi\\\\\"\\\\nbye'\n * ```\n */\nexport function jsStringEscape(input: unknown): string {\n return `${input}`.replace(/[\"'\\\\\\n\\r\\u2028\\u2029]/g, (character) => {\n switch (character) {\n case '\"':\n case \"'\":\n case '\\\\':\n return `\\\\${character}`\n case '\\n':\n return '\\\\n'\n case '\\r':\n return '\\\\r'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return ''\n }\n })\n}\n\n/**\n * Strips the file extension from a path or file name.\n * Only removes the last `.ext` segment when the dot is not part of a directory name.\n *\n * @example\n * trimExtName('petStore.ts') // 'petStore'\n * trimExtName('/src/models/pet.ts') // '/src/models/pet'\n * trimExtName('/project.v2/gen/pet.ts') // '/project.v2/gen/pet'\n * trimExtName('noExtension') // 'noExtension'\n */\nexport function trimExtName(text: string): string {\n const dotIndex = text.lastIndexOf('.')\n if (dotIndex > 0 && !text.includes('/', dotIndex)) {\n return text.slice(0, dotIndex)\n }\n return text\n}\n","","import fs from 'node:fs'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport type { AdapterOas } from '@kubb/adapter-oas'\nimport pkg from 'handlebars'\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\ntype BuildDocsOptions = {\n title?: string\n disableGoogleFont?: boolean\n templateOptions?: any\n}\n\n/**\n * Renders a self-contained Redoc HTML page for an OpenAPI document. The page\n * embeds the spec inline and pulls Redoc's bundle from a CDN at runtime, so\n * the generated file works without further build steps.\n */\nexport async function getPageHTML(api: AdapterOas['document'], { title, disableGoogleFont, templateOptions }: BuildDocsOptions = {}) {\n const templateFileName = path.join(__dirname, '../static/redoc.hbs')\n const template = pkg.compile(fs.readFileSync(templateFileName).toString())\n return template({\n title: title || api.info.title || 'ReDoc documentation',\n redocHTML: `\n <script src=\"https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js\"> </script>\n <div id=\"redoc-container\"></div>\n <script>\n const data = ${JSON.stringify(api, null, 2)};\n Redoc.init(data, {\n \"expandResponses\": \"200,400\"\n }, document.getElementById('redoc-container'))\n </script>\n `,\n disableGoogleFont,\n templateOptions,\n })\n}\n","import path from 'node:path'\nimport { trimExtName } from '@internals/utils'\nimport type { AdapterOas } from '@kubb/adapter-oas'\nimport { adapterOasName } from '@kubb/adapter-oas'\n\nimport { type Adapter, ast, definePlugin } from '@kubb/core'\nimport { version } from '../package.json'\nimport { getPageHTML } from './redoc.tsx'\nimport type { PluginRedoc } from './types.ts'\n\n/**\n * Canonical plugin name for `@kubb/plugin-redoc`. Used for driver lookups and\n * cross-plugin dependency references.\n */\nexport const pluginRedocName = 'plugin-redoc' satisfies PluginRedoc['name']\n\n/**\n * Generates a self-contained static HTML documentation page from your OpenAPI\n * spec using Redoc. The file is regenerated on every Kubb build, so the docs\n * stay in lockstep with the spec the rest of your code is generated from.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginRedoc } from '@kubb/plugin-redoc'\n *\n * export default defineConfig({\n * input: { path: './petStore.yaml' },\n * output: { path: './src/gen' },\n * plugins: [\n * pluginRedoc({ output: { path: 'docs.html' } }),\n * ],\n * })\n * ```\n */\nexport const pluginRedoc = definePlugin<PluginRedoc>((options) => {\n const { output = { path: 'docs.html' } } = options\n\n return {\n name: pluginRedocName,\n version,\n options,\n hooks: {\n async 'kubb:plugin:setup'(ctx) {\n ctx.setOptions({\n output,\n name: trimExtName(output.path),\n exclude: [],\n override: [],\n })\n\n const adapter = ctx.config.adapter\n\n if (adapter?.name !== adapterOasName) {\n throw new Error(\n `[${pluginRedocName}] plugin-redoc requires the OpenAPI adapter. Make sure you are using adapterOas (e.g. \\`adapter: adapterOas()\\`) in your Kubb config.`,\n )\n }\n\n const document = (adapter as Adapter<AdapterOas>).document\n\n if (!document) {\n throw new Error(\n `[${pluginRedocName}] No OpenAPI document found. The adapterOas did not produce a document — ensure the adapter has run before this plugin.`,\n )\n }\n\n const root = path.resolve(ctx.config.root, ctx.config.output.path)\n const pageHTML = await getPageHTML(document)\n\n ctx.injectFile({\n baseName: 'docs.html',\n path: path.resolve(root, output.path || './docs.html'),\n sources: [\n ast.createSource({\n name: 'docs.html',\n nodes: [ast.createText(pageHTML)],\n }),\n ],\n })\n },\n },\n }\n})\n\nexport default pluginRedoc\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6DA,SAAgB,YAAY,MAAsB;CAChD,MAAM,WAAW,KAAK,YAAY,IAAI;CACtC,IAAI,WAAW,KAAK,CAAC,KAAK,SAAS,KAAK,SAAS,EAC/C,OAAO,KAAK,MAAM,GAAG,SAAS;CAEhC,OAAO;;;;;;;AE5DT,MAAM,aAAa,cAAc,OAAO,KAAK,IAAI;AACjD,MAAM,YAAY,KAAK,QAAQ,WAAW;;;;;;AAa1C,eAAsB,YAAY,KAA6B,EAAE,OAAO,mBAAmB,oBAAsC,EAAE,EAAE;CACnI,MAAM,mBAAmB,KAAK,KAAK,WAAW,sBAAsB;CAEpE,OADiB,IAAI,QAAQ,GAAG,aAAa,iBAAiB,CAAC,UAAU,CAC1D,CAAC;EACd,OAAO,SAAS,IAAI,KAAK,SAAS;EAClC,WAAW;;;;kBAIG,KAAK,UAAU,KAAK,MAAM,EAAE,CAAC;;;;;;EAM3C;EACA;EACD,CAAC;;;;;;;;ACvBJ,MAAa,kBAAkB;;;;;;;;;;;;;;;;;;;;AAqB/B,MAAa,cAAc,cAA2B,YAAY;CAChE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,KAAK;CAE3C,OAAO;EACL,MAAM;EACN;EACA;EACA,OAAO,EACL,MAAM,oBAAoB,KAAK;GAC7B,IAAI,WAAW;IACb;IACA,MAAM,YAAY,OAAO,KAAK;IAC9B,SAAS,EAAE;IACX,UAAU,EAAE;IACb,CAAC;GAEF,MAAM,UAAU,IAAI,OAAO;GAE3B,IAAI,SAAS,SAAS,gBACpB,MAAM,IAAI,MACR,IAAI,gBAAgB,uIACrB;GAGH,MAAM,WAAY,QAAgC;GAElD,IAAI,CAAC,UACH,MAAM,IAAI,MACR,IAAI,gBAAgB,yHACrB;GAGH,MAAM,OAAO,KAAK,QAAQ,IAAI,OAAO,MAAM,IAAI,OAAO,OAAO,KAAK;GAClE,MAAM,WAAW,MAAM,YAAY,SAAS;GAE5C,IAAI,WAAW;IACb,UAAU;IACV,MAAM,KAAK,QAAQ,MAAM,OAAO,QAAQ,cAAc;IACtD,SAAS,CACP,IAAI,aAAa;KACf,MAAM;KACN,OAAO,CAAC,IAAI,WAAW,SAAS,CAAC;KAClC,CAAC,CACH;IACF,CAAC;KAEL;EACF;EACD"}
package/extension.yaml CHANGED
@@ -2,7 +2,7 @@ $schema: https://kubb.dev/schemas/extension.json
2
2
  kind: plugin
3
3
  id: plugin-redoc
4
4
  name: Redoc
5
- description: Generate API documentation with Redoc from OpenAPI specifications.
5
+ description: Render your OpenAPI spec as a single-file HTML page using Redoc, regenerated as part of the Kubb build.
6
6
  category: documentation
7
7
  type: official
8
8
  npmPackage: '@kubb/plugin-redoc'
@@ -32,25 +32,60 @@ featured: false
32
32
  icon:
33
33
  light: https://kubb.dev/feature/openapi.svg
34
34
  intro: |
35
- Generate interactive API documentation from your OpenAPI schema using [Redoc](https://redocly.com/).
35
+ # @kubb/plugin-redoc
36
+
37
+ Generate a static HTML documentation page for your OpenAPI spec using [Redoc](https://redocly.com/). The page is self-contained — drop it on any static host or open it locally.
38
+
39
+ Because the file is regenerated on every Kubb build, your docs stay in lockstep with the spec your code was generated from.
36
40
  options:
37
41
  - name: output
38
42
  type: '{ path: string }'
39
43
  required: false
40
- description: Specify the output path for the generated documentation HTML file.
44
+ description: Output location of the generated HTML file.
41
45
  properties:
42
46
  - name: path
43
47
  type: string
44
48
  required: true
45
49
  description: |
46
- The output file path for the generated documentation HTML.
50
+ File path of the generated HTML, relative to the global `output.path`.
51
+
52
+ Use a `.html` extension. Unlike most plugins, this option points at a single file rather than a directory.
47
53
  tip: |
48
- if `output.path` is a file, `group` cannot be used.
54
+ When `output.path` points to a single file, the `group` option cannot be used because every operation ends up in the same file.
55
+ examples:
56
+ - name: kubb.config.ts
57
+ files:
58
+ - lang: typescript
59
+ twoslash: false
60
+ code: |
61
+ import { defineConfig } from 'kubb'
62
+ import { pluginTs } from '@kubb/plugin-ts'
63
+
64
+ export default defineConfig({
65
+ input: { path: './petStore.yaml' },
66
+ output: { path: './src/gen' },
67
+ plugins: [
68
+ pluginTs({
69
+ output: { path: './types' },
70
+ }),
71
+ ],
72
+ })
73
+ - name: Resulting tree
74
+ files:
75
+ - lang: text
76
+ twoslash: false
77
+ code: |
78
+ src/
79
+ └── gen/
80
+ └── types/
81
+ ├── Pet.ts
82
+ └── Store.ts
49
83
  default: "'docs.html'"
50
84
  examples:
51
85
  - name: kubb.config.ts
52
86
  files:
53
87
  - lang: typescript
88
+ twoslash: false
54
89
  code: |
55
90
  import { defineConfig } from 'kubb'
56
91
  import { pluginRedoc } from '@kubb/plugin-redoc'
@@ -64,4 +99,3 @@ examples:
64
99
  }),
65
100
  ],
66
101
  })
67
- twoslash: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-redoc",
3
- "version": "5.0.0-beta.15",
3
+ "version": "5.0.0-beta.25",
4
4
  "description": "Generate a beautiful, interactive ReDoc API reference page from your OpenAPI specification. Produces a standalone HTML file with a responsive, developer-friendly UI.",
5
5
  "keywords": [
6
6
  "api-docs",
@@ -50,8 +50,8 @@
50
50
  "registry": "https://registry.npmjs.org/"
51
51
  },
52
52
  "dependencies": {
53
- "@kubb/adapter-oas": "5.0.0-beta.19",
54
- "@kubb/core": "5.0.0-beta.19",
53
+ "@kubb/adapter-oas": "5.0.0-beta.25",
54
+ "@kubb/core": "5.0.0-beta.25",
55
55
  "handlebars": "^4.7.9"
56
56
  },
57
57
  "devDependencies": {
package/src/plugin.ts CHANGED
@@ -8,8 +8,31 @@ import { version } from '../package.json'
8
8
  import { getPageHTML } from './redoc.tsx'
9
9
  import type { PluginRedoc } from './types.ts'
10
10
 
11
+ /**
12
+ * Canonical plugin name for `@kubb/plugin-redoc`. Used for driver lookups and
13
+ * cross-plugin dependency references.
14
+ */
11
15
  export const pluginRedocName = 'plugin-redoc' satisfies PluginRedoc['name']
12
16
 
17
+ /**
18
+ * Generates a self-contained static HTML documentation page from your OpenAPI
19
+ * spec using Redoc. The file is regenerated on every Kubb build, so the docs
20
+ * stay in lockstep with the spec the rest of your code is generated from.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * import { defineConfig } from 'kubb'
25
+ * import { pluginRedoc } from '@kubb/plugin-redoc'
26
+ *
27
+ * export default defineConfig({
28
+ * input: { path: './petStore.yaml' },
29
+ * output: { path: './src/gen' },
30
+ * plugins: [
31
+ * pluginRedoc({ output: { path: 'docs.html' } }),
32
+ * ],
33
+ * })
34
+ * ```
35
+ */
13
36
  export const pluginRedoc = definePlugin<PluginRedoc>((options) => {
14
37
  const { output = { path: 'docs.html' } } = options
15
38
 
package/src/redoc.tsx CHANGED
@@ -13,6 +13,11 @@ type BuildDocsOptions = {
13
13
  templateOptions?: any
14
14
  }
15
15
 
16
+ /**
17
+ * Renders a self-contained Redoc HTML page for an OpenAPI document. The page
18
+ * embeds the spec inline and pulls Redoc's bundle from a CDN at runtime, so
19
+ * the generated file works without further build steps.
20
+ */
16
21
  export async function getPageHTML(api: AdapterOas['document'], { title, disableGoogleFont, templateOptions }: BuildDocsOptions = {}) {
17
22
  const templateFileName = path.join(__dirname, '../static/redoc.hbs')
18
23
  const template = pkg.compile(fs.readFileSync(templateFileName).toString())
package/src/types.ts CHANGED
@@ -1,9 +1,14 @@
1
1
  import type { Exclude, Include, Output, Override, PluginFactoryOptions } from '@kubb/core'
2
2
 
3
3
  export type Options = {
4
+ /**
5
+ * Output location of the generated Redoc HTML file. The path is resolved
6
+ * against the global `output.path` set on `defineConfig`.
7
+ */
4
8
  output?: {
5
9
  /**
6
- * Output path for the generated HTML documentation.
10
+ * File path of the generated HTML, relative to the global `output.path`.
11
+ * Unlike most plugins, this points at a single file rather than a directory.
7
12
  *
8
13
  * @default 'docs.html'
9
14
  */