@kubb/plugin-redoc 3.13.2 → 3.14.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Stijn Van Hulle
3
+ Copyright (c) 2025 Stijn Van Hulle
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { trimExtName } from '@kubb/core/fs';
6
6
  import fs from 'fs';
7
7
  import pkg from 'handlebars';
8
8
 
9
- // ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.19.4__jiti@2.4.2_postcss@8.5.6_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/esm_shims.js
9
+ // ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.19.6__jiti@2.4.2_postcss@8.5.6_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/esm_shims.js
10
10
  var getFilename = () => fileURLToPath(import.meta.url);
11
11
  var getDirname = () => path3.dirname(getFilename());
12
12
  var __dirname = /* @__PURE__ */ getDirname();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.19.4__jiti@2.4.2_postcss@8.5.6_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/esm_shims.js","../src/redoc.tsx","../src/plugin.ts"],"names":["path"],"mappings":";;;;;;;;;AAIA,IAAM,WAAc,GAAA,MAAM,aAAc,CAAA,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA;AACvD,IAAM,UAAa,GAAA,MAAMA,KAAK,CAAA,OAAA,CAAQ,aAAa,CAAA;AAE5C,IAAM,4BAAuC,UAAA,EAAA;ACIpD,eAAsB,W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AOA,MAAK,OAAQ,CAAA,IAAA,CAAK,OAAO,IAAM,EAAA,IAAA,CAAK,MAAO,CAAA,MAAA,CAAO,IAAI,CAAA;AACnE,MAAA,MAAM,QAAW,GAAA,MAAM,WAAY,CAAA,GAAA,CAAI,GAAG,CAAA;AAE1C,MAAM,MAAA,IAAA,CAAK,WAAY,CAAA,KAAA,CAAMA,KAAK,CAAA,OAAA,CAAQ,MAAM,MAAO,CAAA,IAAA,IAAQ,aAAa,CAAA,EAAG,QAAQ,CAAA;AAAA;AACzF,GACF;AACF,CAAC","file":"index.js","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 } 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 this.fileManager.write(path.resolve(root, output.path || './docs.html'), pageHTML)\n },\n }\n})\n"]}
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.19.6__jiti@2.4.2_postcss@8.5.6_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/esm_shims.js","../src/redoc.tsx","../src/plugin.ts"],"names":["path"],"mappings":";;;;;;;;;AAIA,IAAM,WAAc,GAAA,MAAM,aAAc,CAAA,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA;AACvD,IAAM,UAAa,GAAA,MAAMA,KAAK,CAAA,OAAA,CAAQ,aAAa,CAAA;AAE5C,IAAM,4BAAuC,UAAA,EAAA;ACIpD,eAAsB,WAAA,CAAY,KAA2B,EAAE,KAAA,EAAO,mBAAmB,eAAgB,EAAA,GAAsB,EAAI,EAAA;AACjI,EAAA,MAAM,gBAAmBA,GAAAA,KAAAA,CAAK,IAAK,CAAA,SAAA,EAAW,qBAAqB,CAAA;AACnE,EAAM,MAAA,QAAA,GAAW,IAAI,OAAQ,CAAA,EAAA,CAAG,aAAa,gBAAgB,CAAA,CAAE,UAAU,CAAA;AACzE,EAAA,OAAO,QAAS,CAAA;AAAA,IACd,KAAO,EAAA,KAAA,IAAS,GAA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ACF;AACF,CAAC","file":"index.js","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 } 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 this.fileManager.write(path.resolve(root, output.path || './docs.html'), pageHTML)\n },\n }\n})\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-redoc",
3
- "version": "3.13.2",
3
+ "version": "3.14.1",
4
4
  "description": "Beautiful docs with Redoc",
5
5
  "keywords": [
6
6
  "typescript",
@@ -42,15 +42,15 @@
42
42
  ],
43
43
  "dependencies": {
44
44
  "handlebars": "^4.7.8",
45
- "@kubb/core": "3.13.2",
46
- "@kubb/oas": "3.13.2",
47
- "@kubb/plugin-oas": "3.13.2"
45
+ "@kubb/core": "3.14.1",
46
+ "@kubb/oas": "3.14.1",
47
+ "@kubb/plugin-oas": "3.14.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "tsup": "^8.5.0",
51
51
  "typescript": "^5.8.3",
52
- "@kubb/config-ts": "3.13.2",
53
- "@kubb/config-tsup": "3.13.2"
52
+ "@kubb/config-ts": "3.14.1",
53
+ "@kubb/config-tsup": "3.14.1"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@kubb/react": "^3.0.0"