@kubb/plugin-redoc 3.10.10 → 3.10.12
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.js +4 -5
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
+
import path3 from 'path';
|
|
1
2
|
import { fileURLToPath } from 'url';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import path3 from 'node:path';
|
|
4
3
|
import { createPlugin, PluginManager } from '@kubb/core';
|
|
5
4
|
import { pluginOasName } from '@kubb/plugin-oas';
|
|
6
5
|
import { trimExtName } from '@kubb/core/fs';
|
|
7
|
-
import fs from '
|
|
6
|
+
import fs from 'fs';
|
|
8
7
|
import pkg from 'handlebars';
|
|
9
8
|
|
|
10
|
-
// ../../node_modules/.pnpm/tsup@8.
|
|
9
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.17.47__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/esm_shims.js
|
|
11
10
|
var getFilename = () => fileURLToPath(import.meta.url);
|
|
12
|
-
var getDirname = () =>
|
|
11
|
+
var getDirname = () => path3.dirname(getFilename());
|
|
13
12
|
var __dirname = /* @__PURE__ */ getDirname();
|
|
14
13
|
async function getPageHTML(api, { title, disableGoogleFont, templateOptions } = {}) {
|
|
15
14
|
const templateFileName = path3.join(__dirname, "../static/redoc.hbs");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.8_@types+node@20.17.47__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.1/node_modules/tsup/assets/esm_shims.js","../src/redoc.tsx","../src/plugin.ts"],"names":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AyB,GAAA,aAAA,CAAc,mBAA8B,IAAK,CAAA,OAAA,EAAS,CAAC,aAAa,CAAC,CAAA;AACtH,MAAA,MAAM,GAAM,GAAA,MAAM,aAAc,CAAA,OAAA,CAAQ,MAAO,EAAA;AAE/C,MAAA,MAAM,IAAI,WAAY,EAAA;AAEtB,MAAM,MAAA,IAAA,GAAOA,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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-redoc",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.12",
|
|
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.10.
|
|
46
|
-
"@kubb/oas": "3.10.
|
|
47
|
-
"@kubb/plugin-oas": "3.10.
|
|
45
|
+
"@kubb/core": "3.10.12",
|
|
46
|
+
"@kubb/oas": "3.10.12",
|
|
47
|
+
"@kubb/plugin-oas": "3.10.12"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"tsup": "^8.
|
|
50
|
+
"tsup": "^8.5.0",
|
|
51
51
|
"typescript": "^5.8.3",
|
|
52
|
-
"@kubb/config-ts": "3.10.
|
|
53
|
-
"@kubb/config-tsup": "3.10.
|
|
52
|
+
"@kubb/config-ts": "3.10.12",
|
|
53
|
+
"@kubb/config-tsup": "3.10.12"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@kubb/react": "^3.0.0"
|