@kubb/plugin-redoc 4.1.3 → 4.1.4

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/README.md CHANGED
@@ -1,29 +1,29 @@
1
1
  <div align="center">
2
+ <h1>Plugin Redoc</h1>
3
+ <a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
4
+ <img width="180" src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/logo.png" alt="Kubb logo">
5
+ </a>
2
6
 
3
- <!-- <img src="assets/logo.png" alt="logo" width="200" height="auto" /> -->
4
- <h1>@kubb/plugin-redoc</h1>
5
-
6
- <p>
7
- Create beautiful docs with Redoc.
8
- </p>
9
- <img src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/banner.png" alt="logo" height="auto" />
10
7
 
11
8
  [![npm version][npm-version-src]][npm-version-href]
12
9
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
13
10
  [![Coverage][coverage-src]][coverage-href]
14
11
  [![License][license-src]][license-href]
15
-
12
+ [![Sponsors][sponsors-src]][sponsors-href]
16
13
  <h4>
17
- <a href="https://codesandbox.io/s/github/kubb-labs/kubb/tree/main//examples/typescript" target="_blank">View Demo</a>
18
- <span> · </span>
19
- <a href="https://kubb.dev/" target="_blank">Documentation</a>
20
- <span> · </span>
21
- <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
22
- <span> · </span>
23
- <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Request Feature</a>
24
- </h4>
14
+ <a href="https://codesandbox.io/s/github/kubb-labs/kubb/tree/main//examples/typescript" target="_blank">View Demo</a>
15
+ <span> · </span>
16
+ <a href="https://kubb.dev/" target="_blank">Documentation</a>
17
+ <span> · </span>
18
+ <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
19
+ <span> · </span>
20
+ <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Request Feature</a>
21
+ </h4>
25
22
  </div>
26
23
 
24
+ Create beautiful docs with Redoc.
25
+
26
+
27
27
  ## Supporting Kubb
28
28
 
29
29
  Kubb uses an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
@@ -51,3 +51,5 @@ Kubb uses an MIT-licensed open source project with its ongoing development made
51
51
  [minified-href]: https://www.npmjs.com/package/@kubb/plugin-redoc
52
52
  [coverage-src]: https://img.shields.io/codecov/c/github/kubb-labs/kubb?style=flat&colorA=18181B&colorB=f58517
53
53
  [coverage-href]: https://www.npmjs.com/package/@kubb/plugin-redoc
54
+ [sponsors-src]: https://img.shields.io/github/sponsors/stijnvanhulle?style=flat&colorA=18181B&colorB=f58517
55
+ [sponsors-href]: https://github.com/sponsors/stijnvanhulle/
package/dist/index.js CHANGED
@@ -13,9 +13,9 @@ var __esm = (fn, res) => function() {
13
13
  };
14
14
 
15
15
  //#endregion
16
- //#region ../../node_modules/.pnpm/tsdown@0.15.7_typescript@5.9.3/node_modules/tsdown/esm-shims.js
16
+ //#region ../../node_modules/.pnpm/tsdown@0.14.2_typescript@5.9.3/node_modules/tsdown/esm-shims.js
17
17
  var getFilename, getDirname, __dirname;
18
- var init_esm_shims = __esm({ "../../node_modules/.pnpm/tsdown@0.15.7_typescript@5.9.3/node_modules/tsdown/esm-shims.js": (() => {
18
+ var init_esm_shims = __esm({ "../../node_modules/.pnpm/tsdown@0.14.2_typescript@5.9.3/node_modules/tsdown/esm-shims.js": (() => {
19
19
  getFilename = () => fileURLToPath(import.meta.url);
20
20
  getDirname = () => path.dirname(getFilename());
21
21
  __dirname = /* @__PURE__ */ getDirname();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../node_modules/.pnpm/tsdown@0.15.7_typescript@5.9.3/node_modules/tsdown/esm-shims.js","../src/redoc.tsx","../src/plugin.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","import fs from 'node:fs'\nimport path from 'node:path'\nimport type { OasTypes } from '@kubb/oas'\nimport pkg from 'handlebars'\n\ntype BuildDocsOptions = {\n title?: string\n disableGoogleFont?: boolean\n templateOptions?: any\n}\n\nexport async function getPageHTML(api: OasTypes.OASDocument, { 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'\n\nimport { PluginManager, createPlugin } from '@kubb/core'\nimport { pluginOasName } from '@kubb/plugin-oas'\n\nimport type { Plugin } from '@kubb/core'\nimport { trimExtName, write } from '@kubb/core/fs'\nimport type { PluginOas } from '@kubb/plugin-oas'\nimport { getPageHTML } from './redoc.tsx'\nimport type { PluginRedoc } from './types.ts'\n\nexport const pluginRedocName = 'plugin-redoc' satisfies PluginRedoc['name']\n\nexport const pluginRedoc = createPlugin<PluginRedoc>((options) => {\n const { output = { path: 'docs.html' } } = options\n\n return {\n name: pluginRedocName,\n options: {\n output,\n name: trimExtName(output.path),\n },\n pre: [pluginOasName],\n async buildStart() {\n const [swaggerPlugin]: [Plugin<PluginOas>] = PluginManager.getDependedPlugins<PluginOas>(this.plugins, [pluginOasName])\n const oas = await swaggerPlugin.context.getOas()\n\n await oas.dereference()\n\n const root = path.resolve(this.config.root, this.config.output.path)\n const pageHTML = await getPageHTML(oas.api)\n\n await write(path.resolve(root, output.path || './docs.html'), pageHTML)\n },\n }\n})\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;CAIM,oBAAoB,cAAc,OAAO,KAAK,IAAI;CAClD,mBAAmB,KAAK,QAAQ,aAAa,CAAC;CAEvC,YAA4B,4BAAY;;;;;;ACIrD,eAAsB,YAAY,KAA2B,EAAE,OAAO,mBAAmB,oBAAsC,EAAE,EAAE;CACjI,MAAM,mBAAmB,KAAK,KAAK,WAAW,sBAAsB;AAEpE,QADiB,IAAI,QAAQ,GAAG,aAAa,iBAAiB,CAAC,UAAU,CAAC,CAC1D;EACd,OAAO,SAAS,IAAI,KAAK,SAAS;EAClC,WAAW;;;;kBAIG,KAAK,UAAU,KAAK,MAAM,EAAE,CAAC;;;;;;EAM3C;EACA;EACD,CAAC;;;;;ACjBJ,MAAa,kBAAkB;AAE/B,MAAa,cAAc,cAA2B,YAAY;CAChE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,KAAK;AAE3C,QAAO;EACL,MAAM;EACN,SAAS;GACP;GACA,MAAM,YAAY,OAAO,KAAK;GAC/B;EACD,KAAK,CAAC,cAAc;EACpB,MAAM,aAAa;GACjB,MAAM,CAAC,iBAAsC,cAAc,mBAA8B,KAAK,SAAS,CAAC,cAAc,CAAC;GACvH,MAAM,MAAM,MAAM,cAAc,QAAQ,QAAQ;AAEhD,SAAM,IAAI,aAAa;GAEvB,MAAM,OAAO,KAAK,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,OAAO,KAAK;GACpE,MAAM,WAAW,MAAM,YAAY,IAAI,IAAI;AAE3C,SAAM,MAAM,KAAK,QAAQ,MAAM,OAAO,QAAQ,cAAc,EAAE,SAAS;;EAE1E;EACD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../node_modules/.pnpm/tsdown@0.14.2_typescript@5.9.3/node_modules/tsdown/esm-shims.js","../src/redoc.tsx","../src/plugin.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","import fs from 'node:fs'\nimport path from 'node:path'\nimport type { OasTypes } from '@kubb/oas'\nimport pkg from 'handlebars'\n\ntype BuildDocsOptions = {\n title?: string\n disableGoogleFont?: boolean\n templateOptions?: any\n}\n\nexport async function getPageHTML(api: OasTypes.OASDocument, { 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'\n\nimport { PluginManager, createPlugin } from '@kubb/core'\nimport { pluginOasName } from '@kubb/plugin-oas'\n\nimport type { Plugin } from '@kubb/core'\nimport { trimExtName, write } from '@kubb/core/fs'\nimport type { PluginOas } from '@kubb/plugin-oas'\nimport { getPageHTML } from './redoc.tsx'\nimport type { PluginRedoc } from './types.ts'\n\nexport const pluginRedocName = 'plugin-redoc' satisfies PluginRedoc['name']\n\nexport const pluginRedoc = createPlugin<PluginRedoc>((options) => {\n const { output = { path: 'docs.html' } } = options\n\n return {\n name: pluginRedocName,\n options: {\n output,\n name: trimExtName(output.path),\n },\n pre: [pluginOasName],\n async buildStart() {\n const [swaggerPlugin]: [Plugin<PluginOas>] = PluginManager.getDependedPlugins<PluginOas>(this.plugins, [pluginOasName])\n const oas = await swaggerPlugin.context.getOas()\n\n await oas.dereference()\n\n const root = path.resolve(this.config.root, this.config.output.path)\n const pageHTML = await getPageHTML(oas.api)\n\n await write(path.resolve(root, output.path || './docs.html'), pageHTML)\n },\n }\n})\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;CAIM,oBAAoB,cAAc,OAAO,KAAK,IAAI;CAClD,mBAAmB,KAAK,QAAQ,aAAa,CAAC;CAEvC,YAA4B,4BAAY;;;;;;ACIrD,eAAsB,YAAY,KAA2B,EAAE,OAAO,mBAAmB,oBAAsC,EAAE,EAAE;CACjI,MAAM,mBAAmB,KAAK,KAAK,WAAW,sBAAsB;AAEpE,QADiB,IAAI,QAAQ,GAAG,aAAa,iBAAiB,CAAC,UAAU,CAAC,CAC1D;EACd,OAAO,SAAS,IAAI,KAAK,SAAS;EAClC,WAAW;;;;kBAIG,KAAK,UAAU,KAAK,MAAM,EAAE,CAAC;;;;;;EAM3C;EACA;EACD,CAAC;;;;;ACjBJ,MAAa,kBAAkB;AAE/B,MAAa,cAAc,cAA2B,YAAY;CAChE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,KAAK;AAE3C,QAAO;EACL,MAAM;EACN,SAAS;GACP;GACA,MAAM,YAAY,OAAO,KAAK;GAC/B;EACD,KAAK,CAAC,cAAc;EACpB,MAAM,aAAa;GACjB,MAAM,CAAC,iBAAsC,cAAc,mBAA8B,KAAK,SAAS,CAAC,cAAc,CAAC;GACvH,MAAM,MAAM,MAAM,cAAc,QAAQ,QAAQ;AAEhD,SAAM,IAAI,aAAa;GAEvB,MAAM,OAAO,KAAK,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,OAAO,KAAK;GACpE,MAAM,WAAW,MAAM,YAAY,IAAI,IAAI;AAE3C,SAAM,MAAM,KAAK,QAAQ,MAAM,OAAO,QAAQ,cAAc,EAAE,SAAS;;EAE1E;EACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-redoc",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "description": "Beautiful docs with Redoc",
5
5
  "keywords": [
6
6
  "typescript",
@@ -40,12 +40,12 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "handlebars": "^4.7.8",
43
- "@kubb/core": "4.1.3",
44
- "@kubb/oas": "4.1.3",
45
- "@kubb/plugin-oas": "4.1.3"
43
+ "@kubb/core": "4.1.4",
44
+ "@kubb/oas": "4.1.4",
45
+ "@kubb/plugin-oas": "4.1.4"
46
46
  },
47
47
  "devDependencies": {
48
- "tsdown": "^0.15.7",
48
+ "tsdown": "^0.14.2",
49
49
  "typescript": "^5.9.3"
50
50
  },
51
51
  "peerDependencies": {