docs: move assets to public#3876
Conversation
|
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
There was a problem hiding this comment.
Important
The generate-images Vite plugin still reads source images from web/src/assets/raw/, which this PR empties. Every web build will hit Error: Input file is missing from sharp for all 6 sources, the error is swallowed by the plugin's try/catch, and the resized outputs under web/public/assets/.gen/ will silently fail to regenerate.
TL;DR — Relocates 20 brand/raw image assets from web/src/assets/ to web/public/assets/ so the URLs referenced by the published READMEs (https://heyapi.dev/assets/<vendor>/..., https://heyapi.dev/assets/raw/logo.png) and the various example apps resolve to the literal files served from Astro's public/. Net intent is correct — files in src/assets/ are processed and hashed by Astro/Vite and are not reachable at their source path, while public/ is served verbatim.
Key changes
- Move 20 brand and raw assets into
public/— sponsor logos undercella/,fastapi/,kinde/,mintlify/,opencode/,scalar/, and theraw/images (hero.png,kinde-logo-wordmark{,-dark}.png,logo-astronaut.png,logo.png,logo.svg,openapi-ts-hero.png,stainless-logo-wordmark.png) now live underweb/public/assets/...so external links from READMEs and examples resolve correctly.
Summary | 20 files | 1 commit | base: main ← docs/pass-4
Image-pipeline source path is now stale
Before:
processImages()read each entry fromsrc/assets/raw/<source>where the files existed.
After: the files are atpublic/assets/raw/<source>, but the plugin still reads fromsrc/assets/raw/<source>.
web/plugins/generate-images.ts:123 builds the input path as path.join('src', 'assets', 'raw', image.source). After this PR none of hero.png, kinde-logo-wordmark.png, kinde-logo-wordmark-dark.png, logo-astronaut.png, openapi-ts-hero.png, or stainless-logo-wordmark.png exist at that path, so every sharp(inputPath)…toFile(...) call will throw. The try/catch in generateImagesPlugin.buildStart swallows the error after a single console.error, so the build continues but the resized outputs under web/public/assets/.gen/ are not regenerated. Suggested fix: change line 123 to path.join('public', 'assets', 'raw', image.source).
Why is this not caught by the build?
The plugin wraps `processImages()` in a `try/catch` that logs once and returns. `sharp` fails on the first missing input, the catch absorbs it, and Astro/Vite never see a non-zero exit. Whatever resized images were committed previously (or cached in `.gen/`) keep working until they go stale or are deleted.
web/plugins/generate-images.ts
Claude Opus | 𝕏

No description provided.