@kubb/plugin-redoc 3.16.4 → 3.17.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["api: OasTypes.OASDocument","path","pkg","fs","pluginOasName","PluginManager","path"],"sources":["../src/redoc.tsx","../src/plugin.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,eAAsB,YAAYA,KAA2B,EAAE,OAAO,mBAAmB,iBAAmC,GAAG,CAAE,GAAE;CACjI,MAAM,mBAAmBC,kBAAK,KAAK,WAAW,sBAAsB;CACpE,MAAM,WAAWC,mBAAI,QAAQC,gBAAG,aAAa,iBAAiB,CAAC,UAAU,CAAC;AAC1E,QAAO,SAAS;EACd,OAAO,SAAS,IAAI,KAAK,SAAS;EAClC,WAAW,CAAC;;;;gBAIA,EAAE,KAAK,UAAU,KAAK,MAAM,EAAE,CAAC;;;;;IAK3C,CAAC;EACD;EACA;CACD,EAAC;AACH;;;;AClBD,MAAa,kBAAkB;AAE/B,MAAa,4CAAwC,CAAC,YAAY;CAChE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAa,GAAE,GAAG;AAE3C,QAAO;EACL,MAAM;EACN,SAAS;GACP;GACA,sCAAkB,OAAO,KAAK;EAC/B;EACD,KAAK,CAACC,+BAAc;EACpB,MAAM,aAAa;GACjB,MAAM,CAAC,cAAmC,GAAGC,0BAAc,mBAA8B,KAAK,SAAS,CAACD,+BAAc,EAAC;GACvH,MAAM,MAAM,MAAM,cAAc,QAAQ,QAAQ;GAEhD,MAAM,IAAI,aAAa;GAEvB,MAAM,OAAOE,kBAAK,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,OAAO,KAAK;GACpE,MAAM,WAAW,MAAM,YAAY,IAAI,IAAI;GAE3C,gCAAYA,kBAAK,QAAQ,MAAM,OAAO,QAAQ,cAAc,EAAE,SAAS;EACxE;CACF;AACF,EAAC"}
1
+ {"version":3,"file":"index.cjs","names":["path","pkg","fs","pluginOasName","PluginManager","path"],"sources":["../src/redoc.tsx","../src/plugin.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,eAAsB,YAAY,KAA2B,EAAE,OAAO,mBAAmB,iBAAmC,GAAG,EAAE,EAAE;CACjI,MAAM,mBAAmBA,kBAAK,KAAK,WAAW;CAC9C,MAAM,WAAWC,mBAAI,QAAQC,gBAAG,aAAa,kBAAkB;AAC/D,QAAO,SAAS;EACd,OAAO,SAAS,IAAI,KAAK,SAAS;EAClC,WAAW;;;;kBAIG,KAAK,UAAU,KAAK,MAAM,GAAG;;;;;;EAM3C;EACA;EACD;AACF;;;;AClBD,MAAa,kBAAkB;AAE/B,MAAa,6CAAyC,YAAY;CAChE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,EAAE,GAAG;AAE3C,QAAO;EACL,MAAM;EACN,SAAS;GACP;GACA,sCAAkB,OAAO;GAC1B;EACD,KAAK,CAACC,gCAAc;EACpB,MAAM,aAAa;GACjB,MAAM,CAAC,cAAmC,GAAGC,0BAAc,mBAA8B,KAAK,SAAS,CAACD,gCAAc;GACtH,MAAM,MAAM,MAAM,cAAc,QAAQ;AAExC,SAAM,IAAI;GAEV,MAAM,OAAOE,kBAAK,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,OAAO;GAC/D,MAAM,WAAW,MAAM,YAAY,IAAI;AAEvC,mCAAYA,kBAAK,QAAQ,MAAM,OAAO,QAAQ,gBAAgB;EAC/D;EACF;AACF"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["api: OasTypes.OASDocument"],"sources":["../../../node_modules/.pnpm/tsdown@0.14.1_typescript@5.9.2/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,cAAc,MAAM,cAAc,OAAO,KAAK,IAAI;CAClD,aAAa,MAAM,KAAK,QAAQ,aAAa,CAAC;CAEvC,4BAA4B,YAAY;;;;;;ACIrD,eAAsB,YAAYA,KAA2B,EAAE,OAAO,mBAAmB,iBAAmC,GAAG,CAAE,GAAE;CACjI,MAAM,mBAAmB,KAAK,KAAK,WAAW,sBAAsB;CACpE,MAAM,WAAW,IAAI,QAAQ,GAAG,aAAa,iBAAiB,CAAC,UAAU,CAAC;AAC1E,QAAO,SAAS;EACd,OAAO,SAAS,IAAI,KAAK,SAAS;EAClC,WAAW,CAAC;;;;gBAIA,EAAE,KAAK,UAAU,KAAK,MAAM,EAAE,CAAC;;;;;IAK3C,CAAC;EACD;EACA;CACD,EAAC;AACH;;;;AClBD,MAAa,kBAAkB;AAE/B,MAAa,cAAc,aAA0B,CAAC,YAAY;CAChE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAa,GAAE,GAAG;AAE3C,QAAO;EACL,MAAM;EACN,SAAS;GACP;GACA,MAAM,YAAY,OAAO,KAAK;EAC/B;EACD,KAAK,CAAC,aAAc;EACpB,MAAM,aAAa;GACjB,MAAM,CAAC,cAAmC,GAAG,cAAc,mBAA8B,KAAK,SAAS,CAAC,aAAc,EAAC;GACvH,MAAM,MAAM,MAAM,cAAc,QAAQ,QAAQ;GAEhD,MAAM,IAAI,aAAa;GAEvB,MAAM,OAAO,KAAK,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,OAAO,KAAK;GACpE,MAAM,WAAW,MAAM,YAAY,IAAI,IAAI;GAE3C,MAAM,MAAM,KAAK,QAAQ,MAAM,OAAO,QAAQ,cAAc,EAAE,SAAS;EACxE;CACF;AACF,EAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../node_modules/.pnpm/tsdown@0.14.1_typescript@5.9.2/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;CAC9C,mBAAmB,KAAK,QAAQ;CAEzB,YAA4B;;;;;;ACIzC,eAAsB,YAAY,KAA2B,EAAE,OAAO,mBAAmB,iBAAmC,GAAG,EAAE,EAAE;CACjI,MAAM,mBAAmB,KAAK,KAAK,WAAW;CAC9C,MAAM,WAAW,IAAI,QAAQ,GAAG,aAAa,kBAAkB;AAC/D,QAAO,SAAS;EACd,OAAO,SAAS,IAAI,KAAK,SAAS;EAClC,WAAW;;;;kBAIG,KAAK,UAAU,KAAK,MAAM,GAAG;;;;;;EAM3C;EACA;EACD;AACF;;;;AClBD,MAAa,kBAAkB;AAE/B,MAAa,cAAc,cAA2B,YAAY;CAChE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,EAAE,GAAG;AAE3C,QAAO;EACL,MAAM;EACN,SAAS;GACP;GACA,MAAM,YAAY,OAAO;GAC1B;EACD,KAAK,CAAC,cAAc;EACpB,MAAM,aAAa;GACjB,MAAM,CAAC,cAAmC,GAAG,cAAc,mBAA8B,KAAK,SAAS,CAAC,cAAc;GACtH,MAAM,MAAM,MAAM,cAAc,QAAQ;AAExC,SAAM,IAAI;GAEV,MAAM,OAAO,KAAK,QAAQ,KAAK,OAAO,MAAM,KAAK,OAAO,OAAO;GAC/D,MAAM,WAAW,MAAM,YAAY,IAAI;AAEvC,SAAM,MAAM,KAAK,QAAQ,MAAM,OAAO,QAAQ,gBAAgB;EAC/D;EACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-redoc",
3
- "version": "3.16.4",
3
+ "version": "3.17.1",
4
4
  "description": "Beautiful docs with Redoc",
5
5
  "keywords": [
6
6
  "typescript",
@@ -40,14 +40,14 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "handlebars": "^4.7.8",
43
- "@kubb/core": "3.16.4",
44
- "@kubb/oas": "3.16.4",
45
- "@kubb/plugin-oas": "3.16.4"
43
+ "@kubb/core": "3.17.1",
44
+ "@kubb/oas": "3.17.1",
45
+ "@kubb/plugin-oas": "3.17.1"
46
46
  },
47
47
  "devDependencies": {
48
48
  "tsdown": "^0.14.1",
49
49
  "typescript": "^5.9.2",
50
- "@kubb/config-ts": "3.16.4"
50
+ "@kubb/config-ts": "3.17.1"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@kubb/react": "^3.0.0"