fork of hey-api/openapi-ts because I need some additional things

Merge pull request #2461 from hey-api/docs/fix-version

docs: fix versioned clients and plugins

authored by

Lubos and committed by
GitHub
f77783f1 ebce298d

+331 -30
+2 -17
docs/.vitepress/config/index.ts
··· 1 - import path from 'node:path'; 2 - 3 1 import { defineConfig } from 'vitepress'; 4 2 5 - import en from './en'; 6 - import shared from './shared'; 3 + import en from './en.js'; 4 + import shared from './shared.js'; 7 5 8 6 export default defineConfig({ 9 7 ...shared, 10 8 locales: { 11 9 ...shared.locales, 12 10 root: { label: 'English', ...en }, 13 - }, 14 - vite: { 15 - ...shared.vite, 16 - resolve: { 17 - ...shared.vite?.resolve, 18 - alias: { 19 - ...shared.vite?.resolve?.alias, 20 - '@components': path.resolve(__dirname, '..', 'theme', 'components'), 21 - '@data': path.resolve(__dirname, '..', '..', 'data'), 22 - '@versions': path.resolve(__dirname, '..', 'theme', 'versions'), 23 - }, 24 - preserveSymlinks: true, 25 - }, 26 11 }, 27 12 });
+19
docs/.vitepress/config/shared.ts
··· 1 + import path from 'node:path'; 2 + 1 3 import { defineConfig, type HeadConfig } from 'vitepress'; 2 4 import llmstxt from 'vitepress-plugin-llms'; 3 5 ··· 115 117 }, 116 118 }), 117 119 ], 120 + resolve: { 121 + alias: [ 122 + { 123 + find: '@components', 124 + replacement: path.resolve(__dirname, '..', 'theme', 'components'), 125 + }, 126 + { 127 + find: '@data', 128 + replacement: path.resolve(__dirname, '..', '..', 'data'), 129 + }, 130 + { 131 + find: '@versions', 132 + replacement: path.resolve(__dirname, '..', 'theme', 'versions'), 133 + }, 134 + ], 135 + preserveSymlinks: true, 136 + }, 118 137 }, 119 138 });
docs/.vitepress/theme/Layout.vue docs/.vitepress/theme/components/Layout.vue
+8
docs/.vitepress/theme/custom.css
··· 415 415 /* don't render last updated date */ 416 416 display: none; 417 417 } 418 + 419 + .DocSearch-Modal { 420 + display: flex; 421 + } 422 + 423 + .DocSearch-Footer { 424 + position: initial; 425 + }
+1 -1
docs/.vitepress/theme/index.ts
··· 5 5 // custom CSS must be imported after default theme to correctly apply styles 6 6 import './custom.css'; 7 7 8 - import Layout from './Layout.vue'; 8 + import Layout from './components/Layout.vue'; 9 9 10 10 export default { 11 11 Layout,
+1
docs/tsconfig.json
··· 2 2 "compilerOptions": { 3 3 "baseUrl": ".", 4 4 "esModuleInterop": true, 5 + "module": "nodenext", 5 6 "paths": { 6 7 "@components/*": ["./.vitepress/theme/components/*"], 7 8 "@data": ["./data/*"],
+288
patches/vitepress.patch
··· 1 + diff --git a/dist/client/shared.js b/dist/client/shared.js 2 + index f65eb22fe2b0dfeb9bd823c00c737f5035f2c891..16a45edcf11b71881b31f1203add291a2c447d22 100644 3 + --- a/dist/client/shared.js 4 + +++ b/dist/client/shared.js 5 + @@ -16,6 +16,7 @@ export const notFoundPageData = { 6 + lastUpdated: 0, 7 + isNotFound: true 8 + }; 9 + +const versionedPaths = ['clients', 'plugins']; 10 + export function isActive(currentPath, matchPath, asRegex = false) { 11 + if (matchPath === undefined) { 12 + return false; 13 + @@ -24,8 +25,19 @@ export function isActive(currentPath, matchPath, asRegex = false) { 14 + if (asRegex) { 15 + return new RegExp(matchPath).test(currentPath); 16 + } 17 + - if (normalize(matchPath) !== currentPath) { 18 + - return false; 19 + + const normalizedMatchPath = normalize(matchPath); 20 + + if (normalizedMatchPath !== currentPath) { 21 + + const currentPathParts = currentPath.split('/'); 22 + + if (currentPathParts.length > 3 && 23 + + versionedPaths.some((entry) => entry === currentPathParts[2])) { 24 + + currentPath = currentPathParts.slice(0, 4).join('/'); 25 + + if (normalizedMatchPath !== currentPath) { 26 + + return false; 27 + + } 28 + + } 29 + + else { 30 + + return false; 31 + + } 32 + } 33 + const hashMatch = matchPath.match(HASH_RE); 34 + if (hashMatch) { 35 + diff --git a/dist/node/chunk-CwUP9ZhX.js b/dist/node/chunk-CwUP9ZhX.js 36 + index e8b4954d00f247fb852096bb1f8f077fcfc1f93f..8db594d1bdaac76359656a95ac96cd98161b1062 100644 37 + --- a/dist/node/chunk-CwUP9ZhX.js 38 + +++ b/dist/node/chunk-CwUP9ZhX.js 39 + @@ -2053,7 +2053,7 @@ function requireBrowser () { 40 + } catch (error) { 41 + return '[UnexpectedJSONParseError]: ' + error.message; 42 + } 43 + - }; 44 + + }; 45 + } (browser, browser.exports)); 46 + return browser.exports; 47 + } 48 + @@ -2328,7 +2328,7 @@ function requireNode () { 49 + formatters.O = function (v) { 50 + this.inspectOpts.colors = this.useColors; 51 + return util.inspect(v, this.inspectOpts); 52 + - }; 53 + + }; 54 + } (node, node.exports)); 55 + return node.exports; 56 + } 57 + @@ -3522,7 +3522,7 @@ function requireFs () { 58 + 'fs.realpath.native is not a function. Is fs being monkey-patched?', 59 + 'Warning', 'fs-extra-WARN0003' 60 + ); 61 + - } 62 + + } 63 + } (fs$1)); 64 + return fs$1; 65 + } 66 + @@ -6185,7 +6185,7 @@ class AST { 67 + const aps = addPatternStart; 68 + // check if we have a possibility of matching . or .., 69 + // and prevent that. 70 + - const needNoTrav = 71 + + const needNoTrav = 72 + // dots are allowed, and the pattern starts with [ or . 73 + (dot && aps.has(src.charAt(0))) || 74 + // the pattern starts with \., and then [ or . 75 + @@ -8616,11 +8616,11 @@ class LRUCache { 76 + b.__abortController instanceof AC); 77 + } 78 + async fetch(k, fetchOptions = {}) { 79 + - const { 80 + + const { 81 + // get options 82 + - allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, 83 + + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, 84 + // set options 85 + - ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, 86 + + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, 87 + // fetch exclusive options 88 + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; 89 + if (!this.#hasFetchMethod) { 90 + @@ -14468,7 +14468,7 @@ function requireUtils$4 () { 91 + } 92 + 93 + return last; 94 + - }; 95 + + }; 96 + } (utils$5)); 97 + return utils$5; 98 + } 99 + @@ -17226,7 +17226,7 @@ function requireDist$1 () { 100 + exports.fdir = void 0; 101 + const builder_1 = requireBuilder(); 102 + Object.defineProperty(exports, "fdir", { enumerable: true, get: function () { return builder_1.Builder; } }); 103 + - __exportStar(requireTypes$1(), exports); 104 + + __exportStar(requireTypes$1(), exports); 105 + } (dist$1)); 106 + return dist$1; 107 + } 108 + @@ -18267,6 +18267,7 @@ const notFoundPageData = { 109 + lastUpdated: 0, 110 + isNotFound: true 111 + }; 112 + +const versionedPaths = ["clients", "plugins"]; 113 + function isActive(currentPath, matchPath, asRegex = false) { 114 + if (matchPath === void 0) { 115 + return false; 116 + @@ -18275,8 +18276,17 @@ function isActive(currentPath, matchPath, asRegex = false) { 117 + if (asRegex) { 118 + return new RegExp(matchPath).test(currentPath); 119 + } 120 + - if (normalize$1(matchPath) !== currentPath) { 121 + - return false; 122 + + const normalizedMatchPath = normalize$1(matchPath); 123 + + if (normalizedMatchPath !== currentPath) { 124 + + const currentPathParts = currentPath.split("/"); 125 + + if (currentPathParts.length > 3 && versionedPaths.some((entry) => entry === currentPathParts[2])) { 126 + + currentPath = currentPathParts.slice(0, 4).join("/"); 127 + + if (normalizedMatchPath !== currentPath) { 128 + + return false; 129 + + } 130 + + } else { 131 + + return false; 132 + + } 133 + } 134 + const hashMatch = matchPath.match(HASH_RE); 135 + if (hashMatch) { 136 + @@ -23631,7 +23641,7 @@ function requireEngines () { 137 + stringify: function() { 138 + throw new Error('stringifying JavaScript is not supported'); 139 + } 140 + - }; 141 + + }; 142 + } (engines)); 143 + return engines.exports; 144 + } 145 + @@ -23731,7 +23741,7 @@ function requireUtils$2 () { 146 + exports.startsWith = function(str, substr, len) { 147 + if (typeof len !== 'number') len = substr.length; 148 + return str.slice(0, len) === substr; 149 + - }; 150 + + }; 151 + } (utils$3)); 152 + return utils$3; 153 + } 154 + @@ -25043,7 +25053,7 @@ const decodeMap = new Map([ 155 + /** 156 + * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. 157 + */ 158 + -const fromCodePoint$1 = 159 + +const fromCodePoint$1 = 160 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins 161 + (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) { 162 + let output = ""; 163 + @@ -25135,7 +25145,7 @@ var DecodingMode; 164 + class EntityDecoder { 165 + constructor( 166 + /** The tree used to decode entities. */ 167 + - decodeTree, 168 + + decodeTree, 169 + /** 170 + * The function that is called when a codepoint is decoded. 171 + * 172 + @@ -25145,7 +25155,7 @@ class EntityDecoder { 173 + * @param codepoint The decoded codepoint. 174 + * @param consumed The number of bytes consumed by the decoder. 175 + */ 176 + - emitCodePoint, 177 + + emitCodePoint, 178 + /** An object that is used to produce errors. */ 179 + errors) { 180 + this.decodeTree = decodeTree; 181 + @@ -25458,7 +25468,7 @@ function getDecoder(decodeTree) { 182 + while ((offset = str.indexOf("&", offset)) >= 0) { 183 + ret += str.slice(lastIndex, offset); 184 + decoder.startEntity(decodeMode); 185 + - const len = decoder.write(str, 186 + + const len = decoder.write(str, 187 + // Skip the "&" 188 + offset + 1); 189 + if (len < 0) { 190 + @@ -38931,7 +38941,7 @@ class SignalExit extends SignalExitBase { 191 + const process$1 = globalThis.process; 192 + // wrap so that we call the method on the actual handler, without 193 + // exporting it directly. 194 + -const { 195 + +const { 196 + /** 197 + * Called when the process is exiting, whether via signal, explicit 198 + * exit, or running out of stuff to do. 199 + @@ -41070,7 +41080,7 @@ function requireEastasianwidth () { 200 + eawLen += charLen; 201 + } 202 + return result; 203 + - }; 204 + + }; 205 + } (eastasianwidth)); 206 + return eastasianwidth.exports; 207 + } 208 + @@ -42826,7 +42836,7 @@ function requireTypes () { 209 + IndexTagNames["sitemapindex"] = "sitemapindex"; 210 + IndexTagNames["loc"] = "loc"; 211 + IndexTagNames["lastmod"] = "lastmod"; 212 + - })(exports.IndexTagNames || (exports.IndexTagNames = {})); 213 + + })(exports.IndexTagNames || (exports.IndexTagNames = {})); 214 + } (types)); 215 + return types; 216 + } 217 + @@ -42840,7 +42850,7 @@ function requireSitemapXml () { 218 + hasRequiredSitemapXml = 1; 219 + Object.defineProperty(sitemapXml, "__esModule", { value: true }); 220 + sitemapXml.element = sitemapXml.ctag = sitemapXml.otag = sitemapXml.text = void 0; 221 + - const invalidXMLUnicodeRegex = 222 + + const invalidXMLUnicodeRegex = 223 + // eslint-disable-next-line no-control-regex 224 + /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u0084\u0086-\u009F\uD800-\uDFFF\uFDD0-\uFDDF\u{1FFFE}-\u{1FFFF}\u{2FFFE}-\u{2FFFF}\u{3FFFE}-\u{3FFFF}\u{4FFFE}-\u{4FFFF}\u{5FFFE}-\u{5FFFF}\u{6FFFE}-\u{6FFFF}\u{7FFFE}-\u{7FFFF}\u{8FFFE}-\u{8FFFF}\u{9FFFE}-\u{9FFFF}\u{AFFFE}-\u{AFFFF}\u{BFFFE}-\u{BFFFF}\u{CFFFE}-\u{CFFFF}\u{DFFFE}-\u{DFFFF}\u{EFFFE}-\u{EFFFF}\u{FFFFE}-\u{FFFFF}\u{10FFFE}-\u{10FFFF}]/gu; 225 + const amp = /&/g; 226 + @@ -43586,7 +43596,7 @@ function requireSitemapStream () { 227 + }); 228 + }); 229 + } 230 + - exports.streamToPromise = streamToPromise; 231 + + exports.streamToPromise = streamToPromise; 232 + } (sitemapStream)); 233 + return sitemapStream; 234 + } 235 + @@ -43809,7 +43819,7 @@ function requireSitemapIndexStream () { 236 + }); 237 + } 238 + } 239 + - exports.SitemapAndIndexStream = SitemapAndIndexStream; 240 + + exports.SitemapAndIndexStream = SitemapAndIndexStream; 241 + } (sitemapIndexStream)); 242 + return sitemapIndexStream; 243 + } 244 + @@ -45470,7 +45480,7 @@ function requireSax () { 245 + } 246 + }()); 247 + } 248 + - })(exports); 249 + + })(exports); 250 + } (sax)); 251 + return sax; 252 + } 253 + @@ -46277,7 +46287,7 @@ function requireSitemapSimple () { 254 + } 255 + }; 256 + exports.simpleSitemapAndIndex = simpleSitemapAndIndex; 257 + - exports.default = exports.simpleSitemapAndIndex; 258 + + exports.default = exports.simpleSitemapAndIndex; 259 + } (sitemapSimple)); 260 + return sitemapSimple; 261 + } 262 + @@ -46333,7 +46343,7 @@ function requireDist () { 263 + Object.defineProperty(exports, "XMLToSitemapIndexStream", { enumerable: true, get: function () { return sitemap_index_parser_1.XMLToSitemapIndexStream; } }); 264 + Object.defineProperty(exports, "IndexObjectStreamToJSON", { enumerable: true, get: function () { return sitemap_index_parser_1.IndexObjectStreamToJSON; } }); 265 + var sitemap_simple_1 = requireSitemapSimple(); 266 + - Object.defineProperty(exports, "simpleSitemapAndIndex", { enumerable: true, get: function () { return sitemap_simple_1.simpleSitemapAndIndex; } }); 267 + + Object.defineProperty(exports, "simpleSitemapAndIndex", { enumerable: true, get: function () { return sitemap_simple_1.simpleSitemapAndIndex; } }); 268 + } (dist)); 269 + return dist; 270 + } 271 + @@ -48930,7 +48940,7 @@ function requireLodash_template () { 272 + return false; 273 + } 274 + 275 + - module.exports = template; 276 + + module.exports = template; 277 + } (lodash_template, lodash_template.exports)); 278 + return lodash_template.exports; 279 + } 280 + @@ -49165,7 +49175,7 @@ function requirePostcssPrefixSelector () { 281 + 282 + return { 283 + postcssPlugin: 'postcss-prefix-selector', 284 + - prepare(result) { 285 + + prepare(result) { 286 + const root = result.root; 287 + const file = root.source.input.file; 288 +
+12 -12
pnpm-lock.yaml
··· 17817 17817 17818 17818 '@vue-macros/common@1.16.1(vue@3.5.13(typescript@5.8.3))': 17819 17819 dependencies: 17820 - '@vue/compiler-sfc': 3.5.13 17820 + '@vue/compiler-sfc': 3.5.18 17821 17821 ast-kit: 1.4.2 17822 17822 local-pkg: 1.1.1 17823 17823 magic-string-ast: 0.7.1 ··· 17838 17838 '@babel/types': 7.26.10 17839 17839 '@vue/babel-helper-vue-transform-on': 1.4.0 17840 17840 '@vue/babel-plugin-resolve-type': 1.4.0(@babel/core@7.26.10) 17841 - '@vue/shared': 3.5.13 17841 + '@vue/shared': 3.5.18 17842 17842 optionalDependencies: 17843 17843 '@babel/core': 7.26.10 17844 17844 transitivePeerDependencies: ··· 17851 17851 '@babel/helper-module-imports': 7.25.9 17852 17852 '@babel/helper-plugin-utils': 7.26.5 17853 17853 '@babel/parser': 7.26.10 17854 - '@vue/compiler-sfc': 3.5.13 17854 + '@vue/compiler-sfc': 3.5.18 17855 17855 transitivePeerDependencies: 17856 17856 - supports-color 17857 17857 17858 17858 '@vue/compiler-core@3.5.13': 17859 17859 dependencies: 17860 - '@babel/parser': 7.26.10 17860 + '@babel/parser': 7.28.3 17861 17861 '@vue/shared': 3.5.13 17862 17862 entities: 4.5.0 17863 17863 estree-walker: 2.0.2 ··· 17883 17883 17884 17884 '@vue/compiler-sfc@3.5.13': 17885 17885 dependencies: 17886 - '@babel/parser': 7.26.10 17886 + '@babel/parser': 7.28.3 17887 17887 '@vue/compiler-core': 3.5.13 17888 17888 '@vue/compiler-dom': 3.5.13 17889 17889 '@vue/compiler-ssr': 3.5.13 17890 17890 '@vue/shared': 3.5.13 17891 17891 estree-walker: 2.0.2 17892 17892 magic-string: 0.30.17 17893 - postcss: 8.5.4 17893 + postcss: 8.5.6 17894 17894 source-map-js: 1.2.1 17895 17895 17896 17896 '@vue/compiler-sfc@3.5.18': ··· 18012 18012 '@vue/language-core@2.2.0(typescript@5.8.3)': 18013 18013 dependencies: 18014 18014 '@volar/language-core': 2.4.12 18015 - '@vue/compiler-dom': 3.5.13 18015 + '@vue/compiler-dom': 3.5.18 18016 18016 '@vue/compiler-vue2': 2.7.16 18017 - '@vue/shared': 3.5.13 18017 + '@vue/shared': 3.5.18 18018 18018 alien-signals: 0.4.14 18019 18019 minimatch: 9.0.5 18020 18020 muggle-string: 0.4.1 ··· 18403 18403 18404 18404 ast-kit@1.4.2: 18405 18405 dependencies: 18406 - '@babel/parser': 7.26.10 18406 + '@babel/parser': 7.28.3 18407 18407 pathe: 2.0.3 18408 18408 18409 18409 ast-types-flow@0.0.8: {} ··· 22576 22576 '@unhead/shared': 1.11.20 22577 22577 '@unhead/ssr': 1.11.20 22578 22578 '@unhead/vue': 1.11.20(vue@3.5.13(typescript@5.8.3)) 22579 - '@vue/shared': 3.5.13 22579 + '@vue/shared': 3.5.18 22580 22580 acorn: 8.14.0 22581 22581 c12: 2.0.1(magicast@0.3.5) 22582 22582 chokidar: 4.0.3 ··· 22696 22696 '@unhead/shared': 1.11.20 22697 22697 '@unhead/ssr': 1.11.20 22698 22698 '@unhead/vue': 1.11.20(vue@3.5.13(typescript@5.8.3)) 22699 - '@vue/shared': 3.5.13 22699 + '@vue/shared': 3.5.18 22700 22700 acorn: 8.14.0 22701 22701 c12: 2.0.1(magicast@0.3.5) 22702 22702 chokidar: 4.0.3 ··· 25894 25894 '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.26.10) 25895 25895 '@babel/plugin-transform-typescript': 7.26.8(@babel/core@7.26.10) 25896 25896 '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.26.10) 25897 - '@vue/compiler-dom': 3.5.13 25897 + '@vue/compiler-dom': 3.5.18 25898 25898 kolorist: 1.8.0 25899 25899 magic-string: 0.30.17 25900 25900 vite: 7.1.2(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.8.0)