@kubb/plugin-redoc 3.10.0 → 3.10.2
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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -17,9 +17,9 @@ var __esm = (fn, res) => function __init() {
|
|
|
17
17
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.
|
|
20
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.5_@types+node@20.17.31__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
|
|
21
21
|
var init_cjs_shims = __esm({
|
|
22
|
-
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.
|
|
22
|
+
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.5_@types+node@20.17.31__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.5_@types+node@20.17.31__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js","../src/index.ts","../src/plugin.ts","../../fs/src/index.ts","../src/redoc.tsx"],"names":["path","pkg","fs","createPlugin","pluginOasName","PluginMan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AC/B;AAAA,IACA,GAAA,EAAK,CAACC,uBAAa,CAAA;AAAA,IACnB,MAAM,UAAa,GAAA;AACjB,MAAM,MAAA,CAAC,aAAa,CAAyB,GAAAC,kBAAA,CAAc,mBAA8B,IAAK,CAAA,OAAA,EAAS,CAACD,uBAAa,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,GAAOJ,uBAAK,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,sBAAK,CAAA,OAAA,CAAQ,MAAM,MAAO,CAAA,IAAA,IAAQ,aAAa,CAAA,EAAG,QAAQ,CAAA;AAAA;AACzF,GACF;AACF,CAAC","file":"index.cjs","sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL(`file:${__filename}`).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","export { pluginRedoc, pluginRedocName } from './plugin.ts'\nexport type { PluginRedoc } from './types.ts'\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/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","export { clean } from './clean.ts'\nexport { getRelativePath, read, readSync } from './read.ts'\nexport { write } from './write.ts'\n\nexport function trimExtName(text: string): string {\n return text.replace(/\\.[^/.]+$/, '')\n}\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"]}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var __esm = (fn, res) => function __init() {
|
|
|
12
12
|
};
|
|
13
13
|
var getFilename, getDirname, __dirname;
|
|
14
14
|
var init_esm_shims = __esm({
|
|
15
|
-
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.
|
|
15
|
+
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.5_@types+node@20.17.31__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js"() {
|
|
16
16
|
getFilename = () => fileURLToPath(import.meta.url);
|
|
17
17
|
getDirname = () => path.dirname(getFilename());
|
|
18
18
|
__dirname = /* @__PURE__ */ getDirname();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.5_@types+node@20.17.31__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js","../src/index.ts","../src/plugin.ts","../../fs/src/index.ts","../src/redoc.tsx"],"names":["path"],"mappings":";;;;;;;;;;;;AAAA,IAIM,aACA,UAEO,EAAA,SAAA;AAPb,IAAA,cAAA,GAAA,KAAA,CAAA;AAAA,EAAA,sLAAA,GAAA;AAIA,IAAM,WAAc,GAAA,MAAM,aAAc,CAAA,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA;AACvD,IAAM,UAAa,GAAA,MAAM,IAAK,CAAA,OAAA,CAAQ,aAAa,CAAA;AAE5C,IAAM,4BAAuC,UAAA,EAAA;AAAA;AAAA,CAAA,CAAA;;;ACPpD,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAIO,SAAS,YAAY,IAAsB,EAAA;AAChD,EAAO,OAAA,IAAA,CAAK,OAAQ,CAAA,WAAA,EAAa,EAAE,CAAA;AACrC;;;ACNA,cAAA,EAAA;AAWA,eAAsB,WAAA,CAAY,KAA2B,EAAE,KAAA,EAAO,mBAAmB,eAAgB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AAA,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 { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","export { pluginRedoc, pluginRedocName } from './plugin.ts'\nexport type { PluginRedoc } from './types.ts'\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/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","export { clean } from './clean.ts'\nexport { getRelativePath, read, readSync } from './read.ts'\nexport { write } from './write.ts'\n\nexport function trimExtName(text: string): string {\n return text.replace(/\\.[^/.]+$/, '')\n}\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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-redoc",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.2",
|
|
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.2",
|
|
46
|
+
"@kubb/oas": "3.10.2",
|
|
47
|
+
"@kubb/plugin-oas": "3.10.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"tsup": "^8.4.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.2",
|
|
53
|
+
"@kubb/config-tsup": "3.10.2"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@kubb/react": "^3.0.0"
|