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

docs: optimize Hey API logo size

Lubos 97fa5a06 328dd4b3

+99 -34
+1 -1
README.md
··· 1 1 <div align="center"> 2 - <img width="150" height="150" src="https://heyapi.dev/logo.png" alt="Logo"> 2 + <img alt="Hey API logo" height="150" src="https://heyapi.dev/images/logo-150w.png" width="150"> 3 3 <h1 align="center"><b>OpenAPI TypeScript</b></h1> 4 4 <p align="center">🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.</p> 5 5 </div>
+29 -3
docs/.vitepress/config/shared.ts
··· 3 3 export default defineConfig({ 4 4 cleanUrls: true, 5 5 head: [ 6 - ['link', { href: '/logo.png', rel: 'icon', type: 'image/png' }], 6 + [ 7 + 'link', 8 + { 9 + href: '/images/logo-16w.png', 10 + rel: 'icon', 11 + sizes: '16x16', 12 + type: 'image/png', 13 + }, 14 + ], 15 + [ 16 + 'link', 17 + { 18 + href: '/images/logo-32w.png', 19 + rel: 'icon', 20 + sizes: '32x32', 21 + type: 'image/png', 22 + }, 23 + ], 24 + [ 25 + 'link', 26 + { 27 + href: '/images/logo-48w.png', 28 + rel: 'icon', 29 + sizes: '48x48', 30 + type: 'image/png', 31 + }, 32 + ], 7 33 ['meta', { content: 'website', property: 'og:type' }], 8 34 ['meta', { content: 'en', property: 'og:locale' }], 9 35 [ ··· 15 41 }, 16 42 ], 17 43 ['meta', { content: 'OpenAPI TypeScript', property: 'og:site_name' }], 18 - ['meta', { content: '/logo.png', property: 'og:image' }], 44 + ['meta', { content: '/images/logo-640w.png', property: 'og:image' }], 19 45 ['meta', { content: 'https://heyapi.dev', property: 'og:url' }], 20 46 [ 21 47 'script', ··· 33 59 }, 34 60 themeConfig: { 35 61 externalLinkIcon: true, 36 - logo: '/logo.png', 62 + logo: '/images/logo-48w.png', 37 63 search: { 38 64 provider: 'local', 39 65 },
+8 -8
docs/index.md
··· 5 5 name: High-quality tools for interacting with APIs 6 6 tagline: Codegen for your TypeScript projects. Trusted more than 700k times each month to generate reliable API clients and SDKs. 7 7 actions: 8 - - theme: brand 8 + - link: /openapi-ts/get-started 9 9 text: Get Started 10 - link: /openapi-ts/get-started 11 - - theme: alt 10 + theme: brand 11 + - link: https://stackblitz.com/edit/hey-api-example?file=openapi-ts.config.ts,src%2Fclient%2Fschemas.gen.ts,src%2Fclient%2Fsdk.gen.ts,src%2Fclient%2Ftypes.gen.ts 12 12 text: View Demo 13 - link: https://stackblitz.com/edit/hey-api-example?file=openapi-ts.config.ts,src%2Fclient%2Fschemas.gen.ts,src%2Fclient%2Fsdk.gen.ts,src%2Fclient%2Ftypes.gen.ts 14 - - theme: alt 13 + theme: alt 14 + - link: https://github.com/orgs/hey-api/discussions/1495 15 15 text: Roadmap 16 - link: https://github.com/orgs/hey-api/discussions/1495 16 + theme: alt 17 17 image: 18 - src: /logo.png 19 - alt: logo 18 + alt: Hey API logo 19 + src: /images/logo-640w.png 20 20 21 21 features: 22 22 - icon: <svg class="icon-openapi" width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 32"><path d="M8.96 18.397H.515l.005.123.014.238.007.102.022.275.006.061.033.304.003.03.043.327c.098.677.243 1.343.437 1.999l.003.008.1.326.006.018.093.276.025.07.087.24.04.107.078.2.06.149.065.154.086.188.05.114.105.225.035.072.126.256.02.039.154.293.033.057 7.235-4.366a5.754 5.754 0 0 1-.528-1.885ZM.914 22.27l.002.007.273-.085-.275.078ZM11.034 22.275l-5.97 5.967.092.085.255.227.203.172.055.045.232.187.03.024.255.196a.066.066 0 0 1 .01.007l1.113.752.04.024.219.13.134.076.128.072.232.126.032.017.658.32 3.213-7.805a5.719 5.719 0 0 1-.934-.623l.003.001ZM10.415 21.683l-.186-.219-.154-.199-.165-.233-.154-.241-7.22 4.349.371.584.03.044.002.003.388.547.009.011.008.011.176.229.21.261.045.055.173.203.076.087.15.171.084.092.039.042.114.12.046.047.2.204 5.956-5.956-.195-.209-.003-.003ZM18.31 22.272l-.2.154.016.025 4.342 7.209.594-.41c.42-.31.827-.645 1.22-1.007l-5.949-5.947-.023-.024ZM21.92 30.003l.01-.006-.01.006Zm-.005.003ZM21.929 29.994l.057-.028-.001-.002-.056.033v-.003Zm-.01.009-.002.001.002-.001ZM21.916 30.006l-.011-.018.01.018Zm.004-.003.01-.005-.01.005Z" fill="#fff"></path><path d="m21.837 29.719-4.2-6.97-.25.139-.256.128a5.756 5.756 0 0 1-4.106.319l-.27-.095-.27-.095-3.207 7.788.024.009.024.009.007.003.615.235a14.262 14.262 0 0 0 3.007.708l.349.038.056.005.28.023.095.006.245.014.15.006.195.007.348.004c.788 0 1.575-.066 2.352-.196l.04-.006.246-.045.143-.027.145-.03.24-.053.044-.01a14.241 14.241 0 0 0 3.398-1.267l.209-.115.424-.238-.007-.02.01.018.014-.008.056-.034-.15-.25Zm-10.8-16.335.2-.155-.015-.024-4.343-7.206-.595.41c-.42.31-.827.645-1.218 1.006l5.948 5.945.024.024ZM4.654 7.808l-.395.413c-.44.476-.841.971-1.203 1.491l-.052.075-.121.178-.123.188-.045.068a14.135 14.135 0 0 0-2.2 7.035l-.007.286-.005.285h8.424l.013-.285.016-.286a5.716 5.716 0 0 1 1.27-3.068c.058-.073.128-.142.192-.212.065-.07.124-.144.192-.212L4.654 7.808Zm17.38-2.09L22 5.695l-.224-.132-.13-.075-.132-.073-.228-.123-.036-.019a14.74 14.74 0 0 0-1.52-.686l-.04-.015-.342-.124a14.216 14.216 0 0 0-2.839-.673l-.118-.016-.119-.013-.228-.025-.064-.006-.273-.023-.342-.02-.124-.006v8.444c.433.045.862.138 1.279.279l6.216-6.211a13.96 13.96 0 0 0-.703-.461h.002ZM7.363 5.692l.147.244-.147-.244Zm0 0L7.36 5.69l.004.002Z" fill="#fff"></path><path d="m14.388 3.664-.285.005a14.24 14.24 0 0 0-1.78.184l-.04.007-.247.044-.143.027-.145.03-.24.053-.043.01a14.252 14.252 0 0 0-3.4 1.268l-.705.398v.001l4.349 7.219.25-.14a5.727 5.727 0 0 1 2.141-.657l.285-.022s.19-.01.286-.01V3.658c-.095 0-.19.003-.285.005h.002ZM28.827 17.131l-.014-.227-.007-.113-.022-.267-.006-.07-.032-.297-.002-.024-.002-.012-.043-.32-.001-.01a14.164 14.164 0 0 0-.436-1.992l-.003-.013-.094-.304-.013-.04-.091-.272-.026-.074-.086-.235-.043-.111-.075-.194-.063-.153-.063-.15-.083-.191-.049-.108-.107-.228-.033-.069-.128-.259-.018-.035-.149-.286c-.002-.003-.003-.007-.006-.01a14.217 14.217 0 0 0-.806-1.308l-6.217 6.218c.14.415.233.844.278 1.279h8.444l-.004-.125ZM20.42 17.828l-.013.285-.016.286a5.709 5.709 0 0 1-1.27 3.068c-.057.073-.128.142-.192.212s-.123.144-.191.212l5.956 5.956c.067-.068.13-.138.197-.206l.197-.207c.44-.477.843-.977 1.206-1.496l.043-.06.13-.193.113-.173.057-.084a14.13 14.13 0 0 0 2.196-7.03l.007-.285.005-.286H20.42Z" fill="#fff"></path></svg>
docs/public/images/logo-150w.png

This is a binary file and will not be displayed.

docs/public/images/logo-16w.png

This is a binary file and will not be displayed.

docs/public/images/logo-32w.png

This is a binary file and will not be displayed.

docs/public/images/logo-48w.png

This is a binary file and will not be displayed.

docs/public/images/logo-640w.png

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-1200w.jpeg

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-1200w.png

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-1200w.webp

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-480w.jpeg

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-480w.png

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-480w.webp

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-768w.jpeg

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-768w.png

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-768w.webp

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-wordmark-1200w.jpeg

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-wordmark-480w.png

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-wordmark-768w.jpeg

This is a binary file and will not be displayed.

docs/public/images/stainless-logo-wordmark-768w.png

This is a binary file and will not be displayed.

docs/public/raw/stainless-logo-wordmark.png docs/public/stainless-logo-wordmark.png
docs/public/raw/stainless-logo.png docs/public/stainless-logo.png
+58 -19
docs/scripts/optimize-images.js
··· 3 3 4 4 import sharp from 'sharp'; 5 5 6 - const inputDir = 'public/raw'; 6 + const allowedImageExtensions = ['.png', '.jpg', '.jpeg', '.webp']; 7 + const images = [ 8 + { 9 + sizes: [ 10 + { 11 + formats: ['png'], 12 + width: 16, 13 + }, 14 + { 15 + formats: ['png'], 16 + width: 32, 17 + }, 18 + { 19 + formats: ['png'], 20 + width: 48, 21 + }, 22 + { 23 + formats: ['png'], 24 + width: 150, 25 + }, 26 + { 27 + formats: ['png'], 28 + width: 640, 29 + }, 30 + ], 31 + source: 'logo.png', 32 + }, 33 + { 34 + sizes: [ 35 + { 36 + formats: ['jpeg', 'webp'], 37 + width: 480, 38 + }, 39 + { 40 + formats: ['webp'], 41 + width: 768, 42 + }, 43 + { 44 + formats: ['png', 'webp'], 45 + width: 1200, 46 + }, 47 + ], 48 + source: 'stainless-logo-wordmark.png', 49 + }, 50 + ]; 51 + 7 52 const outputDir = 'public/images'; 8 53 9 - const supportedExtensions = ['.png', '.jpg', '.jpeg', '.webp']; 10 - const sizes = [480, 768, 1200]; 11 - const formats = ['png', 'webp', 'jpeg']; 12 - 13 54 if (fs.existsSync(outputDir)) { 14 55 fs.rmSync(outputDir, { force: true, recursive: true }); 15 56 } ··· 17 58 fs.mkdirSync(outputDir, { recursive: true }); 18 59 19 60 async function processImages() { 20 - const files = fs.readdirSync(inputDir); 21 - 22 - for (const file of files) { 23 - const inputPath = path.join(inputDir, file); 24 - const ext = path.extname(file).toLowerCase(); 25 - const baseName = path.basename(file, ext); 61 + for (const image of images) { 62 + const inputPath = path.join('public', image.source); 63 + const ext = path.extname(image.source).toLowerCase(); 64 + const name = path.basename(image.source, ext); 26 65 27 - if (!supportedExtensions.includes(ext)) { 66 + if (!allowedImageExtensions.includes(ext)) { 28 67 continue; 29 68 } 30 69 31 - console.log(`Processing ${file}...`); 32 - 33 - for (const size of sizes) { 70 + for (const imageSize of image.sizes) { 71 + const size = typeof imageSize === 'object' ? imageSize.width : imageSize; 72 + const formats = 73 + typeof imageSize === 'object' 74 + ? imageSize.formats || image.formats 75 + : image.formats; 34 76 for (const format of formats) { 35 - const outputFileName = `${baseName}-${size}w.${format}`; 77 + const outputFileName = `${name}-${size}w.${format}`; 36 78 const outputPath = path.join(outputDir, outputFileName); 37 79 38 80 let image = sharp(inputPath).resize(size).toFormat(format, { ··· 44 86 } 45 87 46 88 await image.toFile(outputPath); 47 - 48 - console.log(`Generated: ${outputFileName}`); 49 89 } 50 90 } 51 91 } 52 - console.log('✅ Image optimization complete!'); 53 92 } 54 93 55 94 processImages().catch((err) => {
+1 -1
packages/client-axios/README.md
··· 1 1 <div align="center"> 2 - <img width="150" height="150" src="https://heyapi.dev/logo.png" alt="Logo"> 2 + <img alt="Hey API logo" height="150" src="https://heyapi.dev/images/logo-150w.png" width="150"> 3 3 <h1 align="center"><b>Axios Client</b></h1> 4 4 <p align="center">🚀 Axios client for `@hey-api/openapi-ts` codegen.</p> 5 5 </div>
+1 -1
packages/client-fetch/README.md
··· 1 1 <div align="center"> 2 - <img width="150" height="150" src="https://heyapi.dev/logo.png" alt="Logo"> 2 + <img alt="Hey API logo" height="150" src="https://heyapi.dev/images/logo-150w.png" width="150"> 3 3 <h1 align="center"><b>Fetch API Client</b></h1> 4 4 <p align="center">🚀 Fetch API client for `@hey-api/openapi-ts` codegen.</p> 5 5 </div>
+1 -1
packages/openapi-ts/README.md
··· 1 1 <div align="center"> 2 - <img width="150" height="150" src="https://heyapi.dev/logo.png" alt="Logo"> 2 + <img alt="Hey API logo" height="150" src="https://heyapi.dev/images/logo-150w.png" width="150"> 3 3 <h1 align="center"><b>OpenAPI TypeScript</b></h1> 4 4 <p align="center">🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.</p> 5 5 </div>