Files
Peter Meier e28230bcef
Deploy to Firebase Hosting / deploy (push) Failing after 2m4s
feat(images): responsive <picture> srcset for posts/blocks, drop AVIF for build speed
## Responsive sources

Wire `ensureResponsiveImage` (multi-width × multi-format srcset) into the three
remaining single-`<img>` components:

- ImageBlock (body): widths 600 + 1200, fit follows transform params
- ImageGalleryBlock (single-image branch): widths 600 + 1280, fit=contain
- PostCard (post-list cards): widths 400 + 800, fit=cover, ar=3:2

`resolveContentImages` now sets `block.resolvedResponsive` alongside the legacy
`resolvedImageSrc`, so every Svelte block component renders `<picture>` if
the responsive shape is present and falls back to a plain `<img>` otherwise.

Posts list pages (`/posts`, `/posts/page/N`, `/posts/tag/.../page/N`) call a
new `resolvePostCardResponsive` helper instead of one-shot `ensureTransformedImage`.

## Drop AVIF from defaults

Server-side AVIF encoding on the CMS is 5-10× slower than WebP. The bandwidth
win is marginal for this site and the build time hit is severe (multi-minute
hangs on each new variant). Default formats are now `["webp", "jpeg"]` for
`ensureResponsiveImage`, in `Layout.astro`'s TopBanner hero, and in the
post-card helper. Callers can still opt back into AVIF per-call.

## Module split for client-safe types

`ResponsiveImage` is now defined in a tiny `rusty-image-types.ts` and
duplicated in `rusty-image.ts` so Svelte components can `import type` the
shape without dragging `rusty-image.ts` (and its `node:crypto`/`node:fs`
imports) into the browser bundle.

`resolvePostCardResponsive` lives in a new `server-image.ts` for the same
reason — `blog-utils.ts` is imported by Svelte islands, so its server-only
helpers move out.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 18:41:22 +02:00

54 lines
1.8 KiB
JSON

{
"name": "rustyastro",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "yarn generate:api-types; astro dev",
"build": "yarn generate:api-types && astro build && pagefind --site dist && cp -r dist/pagefind public/",
"preview": "astro preview",
"cache:warm": "node scripts/warm-cache.mjs",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"astro": "astro",
"generate:api-types": "node scripts/generate-api-types.mjs",
"postinstall": "yarn generate:api-types || true",
"firebase-deploy": "yarn build && firebase deploy --only hosting",
"deploy": "yarn firebase-deploy",
"firebase-deploy:nocache": "yarn build && firebase deploy --only hosting"
},
"dependencies": {
"@astrojs/rss": "^4.0.18",
"@astrojs/sitemap": "^3.7.2",
"@astrojs/svelte": "^8.0.4",
"@fontsource-variable/lora": "^5.2.8",
"@fontsource-variable/rubik": "^5.2.8",
"@fontsource/inter": "^5.2.8",
"@iconify/svelte": "^5.2.1",
"@tailwindcss/vite": "^4.1.18",
"astro": "^6.1.1",
"blurhash": "^2.0.5",
"json5": "^2.2.3",
"marked": "^17.0.2",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-photo-album": "^3.5.1",
"svelte": "^5.51.2",
"tailwindcss": "^4.1.18"
},
"devDependencies": {
"@iconify-json/mdi": "^1.2.3",
"@storybook/svelte": "10",
"@storybook/svelte-vite": "10",
"@types/node": "^22.10.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"astro-icon": "^1.1.5",
"firebase": "^11.0.1",
"openapi-typescript": "^7.4.0",
"pagefind": "^1.4.0",
"storybook": "10",
"typescript": "^5.9.3"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}