Files
020d79bb27 [examples] migrate cloudinary to vercel-blob (#93762)
## Summary

Replaces the Cloudinary-backed image gallery example with a Vercel
Blob–backed equivalent. The migration is driven by the broader move of
[`vercel/nextconf-image-gallery`](https://github.com/vercel/nextconf-image-gallery)
(the deployed companion to this example) off Cloudinary.

- Renamed `examples/with-cloudinary` → `examples/with-vercel-blob` via
`git mv` (history preserved).
- Images are discovered at build time via the `@vercel/blob` SDK's
`list()` API, then probed with
[`sharp`](https://github.com/lovell/sharp) for dimensions and to
pre-generate base64 blur placeholders. `next/image` (Vercel's image
optimizer) handles resizing — no Cloudinary `c_scale,w_*` transform
URLs.
- `ImageProps` is now `{ id, url, width, height, blurDataUrl }` (was `{
public_id, format, ... }`).
- `utils/cachedImages.ts` does the listing + dimension probe + blur
placeholder generation.
- Removed `utils/cloudinary.ts` and `utils/generateBlurPlaceholder.ts`.
- `next.config.js` `remotePatterns` now allows
`*.public.blob.vercel-storage.com`.
- Deps: dropped `cloudinary`, `imagemin`, `imagemin-jpegtran`; added
`@vercel/blob` and `sharp`.
- `.env.local.example` reduced to a single `BLOB_READ_WRITE_TOKEN`.
- README rewritten: blob description, deploy-button env, setup steps,
references.

## Test plan

- [x] `npx create-next-app --example with-vercel-blob ./blob-app` clones
cleanly
- [x] After populating a blob store and `.env.local`, `npm run dev`
renders the gallery with blur placeholders
- [x] `npm run build` succeeds (sharp probe + placeholder generation
runs at build time)
- [x] Vercel deploy button flow prompts only for `BLOB_READ_WRITE_TOKEN`

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: Joseph <[email protected]>
2026-05-12 11:01:10 +02:00

34 lines
817 B
JSON

{
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint ."
},
"dependencies": {
"@headlessui/react": "^1.7.4",
"@heroicons/react": "^2.0.13",
"@vercel/blob": "^1.0.0",
"eslint-config-next": "^13.0.1",
"framer-motion": "^7.6.4",
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hooks-global-state": "^2.0.0",
"react-swipeable": "^7.0.0",
"react-use-keypress": "^1.3.1",
"sharp": "^0.33.5"
},
"devDependencies": {
"@types/node": "18.11.9",
"@types/react": "18.2.8",
"autoprefixer": "^10.4.13",
"postcss": "^8.4.18",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"tailwindcss": "^3.2.1",
"typescript": "^5.1.0"
}
}