mirror of
https://github.com/bitbaum/solon.git
synced 2026-12-04 12:47:33 +01:00
* feat(photos): serve photographs straight from R2, no image work on the box With NEXT_PUBLIC_MEDIA_BASE set at build time, the app box sends no photograph bytes and resizes nothing; unset, everything is as before. - src/lib/media: self-contained pipeline (no app imports, for a later move into @bitbaum/sitekit alongside Heidi's copy). media:render renders the bundled photographs at 640/960/1280/1920/2560 as AVIF and WebP with sharp and writes a committed manifest; media:upload (dry run by default, idempotent, immutable Cache-Control) sends them to the PHOTOS_S3_* bucket. A custom next/image loader, switched on only when the base is set, names the nearest variant; MediaImage draws AVIF with a WebP fallback and keeps the blur placeholder. ThemedPhoto, the menu feature and the ideas page use it. A test fails while the manifest lags an original. - Place photographs: with a base set, photoUrl points at the bucket object (place-photos/<file>@<width>) instead of /api/place-photo, which stays for the fallback and for PLACE_PHOTOS_VIA_APP=1 while the bucket fills. places:photos:to-r2 is now dry run by default; --apply copies what is only in place_photo_bytes and reads the rest of the shown widths from Commons straight into the bucket. Nothing is dropped. - places:photos:warm checks the bucket first and only falls back to the route for a miss. - .env.example and AGENTS.md document the variables and the order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * feat(photos): the box's build fills the bucket and switches it on itself Nobody runs manual steps on the box, so `pnpm run build` now starts with scripts/media-ensure.ts. On the box's build (SELF_HOST=1, or MEDIA_ENSURE=1) with PHOTOS_S3_* and MEDIA_PUBLIC_BASE set, it HEADs every manifest variant, renders (sharp, concurrency 1, no cache) and uploads only the missing ones, reads one back through the public base, and only on a 200 with the image's content type writes NEXT_PUBLIC_MEDIA_BASE into .env.production.local (gitignored) for next build. Anything missing or failing is one log line, takes back a base an earlier build wrote, and exits 0: the build never fails because of media. An explicit NEXT_PUBLIC_MEDIA_BASE still overrides. Place photographs stay on /api/place-photo by default (it copies DB-only photographs into the bucket on first request); PLACE_PHOTOS_DIRECT=1 is the later, explicit switch to direct addresses. The decision logic (src/lib/media/ensure.ts) is pure and tested; sharp's settings are shared by media:render and the build. AGENTS.md and .env.example: an operator only gives the bucket a public domain and puts the five variables in /opt/fleet/env. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T --------- Co-authored-by: Claude <noreply@anthropic.com>
136 lines
5.1 KiB
JSON
136 lines
5.1 KiB
JSON
{
|
|
"name": "solon",
|
|
"version": "0.1.0",
|
|
"packageManager": "pnpm@11.25.0",
|
|
"engines": {
|
|
"node": ">=20"
|
|
},
|
|
"private": true,
|
|
"license": "MIT",
|
|
"scripts": {
|
|
"dev": "next dev",
|
|
"build": "tsx scripts/media-ensure.ts; next build",
|
|
"start": "next start",
|
|
"lint": "eslint .",
|
|
"typecheck": "tsc --noEmit",
|
|
"design:check": "node scripts/design-system-check.js",
|
|
"verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run design:check && pnpm run check:places-literals && pnpm run places:world-countries --check && pnpm run check:cycles && pnpm run test:coverage",
|
|
"test": "vitest run",
|
|
"test:coverage": "vitest run --coverage",
|
|
"test:e2e": "playwright test",
|
|
"test:puppeteer": "BASE_URL=${BASE_URL:-http://localhost:3000} node tests/puppeteer/smoke.mjs",
|
|
"test:puppeteer:mega": "BASE_URL=${BASE_URL:-http://localhost:3000} node tests/puppeteer/mega-menu.mjs",
|
|
"format": "prettier --write .",
|
|
"format:check": "prettier --check .",
|
|
"db:generate": "drizzle-kit generate",
|
|
"db:migrate": "drizzle-kit migrate",
|
|
"db:push": "drizzle-kit push",
|
|
"check:vendored-drift": "node scripts/check-vendored-drift.mjs",
|
|
"places:sync-config": "tsx scripts/places-sync-config.ts",
|
|
"places:import": "tsx scripts/places-import.ts",
|
|
"snapshots:compress": "tsx scripts/snapshots-compress.ts",
|
|
"places:import-files": "tsx scripts/places-import-files.ts",
|
|
"places:fetch": "tsx scripts/places-fetch.ts",
|
|
"places:queue": "tsx scripts/places-queue.ts",
|
|
"data:refresh": "tsx scripts/data-refresh.ts",
|
|
"statistics:sync": "tsx scripts/statistics-sync.ts",
|
|
"statistics:quality": "tsx scripts/statistics-quality.ts",
|
|
"geography:world": "tsx scripts/build-world-geography.ts",
|
|
"check:cycles": "madge --circular --extensions ts,tsx --ts-config tsconfig.json src",
|
|
"places:world-countries": "tsx scripts/places-world-countries.ts",
|
|
"places:world-subdivisions": "tsx scripts/places-world-subdivisions.ts",
|
|
"statistics:verify": "tsx scripts/statistics-verify.ts",
|
|
"law:register": "tsx scripts/law-register.ts",
|
|
"law:text": "tsx scripts/law-text.ts",
|
|
"check:places-literals": "node --import tsx scripts/check-places-no-literals.ts",
|
|
"check:law-search": "tsx scripts/check-law-search.ts",
|
|
"brand": "tsx scripts/brand.mts",
|
|
"money:rates": "tsx scripts/money-rates.ts",
|
|
"law:translate": "tsx scripts/law-translate.ts",
|
|
"i18n:config": "tsx scripts/i18n-config.ts",
|
|
"law:plan": "tsx scripts/law-plan.ts",
|
|
"world:profiles": "tsx scripts/world-profiles.ts",
|
|
"places:photos": "tsx scripts/places-photos.ts",
|
|
"places:photos:warm": "tsx scripts/places-photos-warm.ts",
|
|
"places:photos:to-r2": "tsx scripts/places-photos-to-r2.ts",
|
|
"media:render": "tsx scripts/media-render.ts",
|
|
"media:upload": "tsx scripts/media-upload.ts",
|
|
"media:ensure": "MEDIA_ENSURE=1 tsx scripts/media-ensure.ts"
|
|
},
|
|
"dependencies": {
|
|
"@aws-sdk/client-s3": "^3.1172.0",
|
|
"@better-auth/passkey": "^1.7.14",
|
|
"@bitbaum/accountkit": "^0.32.1",
|
|
"@bitbaum/ai-kit": "^1.31.0",
|
|
"@bitbaum/bip-kit": "^0.10.0",
|
|
"@bitbaum/chartkit": "^0.8.0",
|
|
"@bitbaum/chatkit": "^0.45.0",
|
|
"@bitbaum/geo-kit": "^0.8.0",
|
|
"@bitbaum/limitkit": "^0.2.1",
|
|
"@bitbaum/mail-kit": "0.4.0",
|
|
"@bitbaum/searchkit": "^0.2.3",
|
|
"@fleet/design-tokens": "npm:@bitbaum/design-tokens@^1.7.1",
|
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
"@napi-rs/canvas": "^1.1.0",
|
|
"@noble/hashes": "2.4.0",
|
|
"@noble/secp256k1": "3.2.0",
|
|
"@scure/base": "^2.4.0",
|
|
"better-auth": "^1.7.14",
|
|
"bs58check": "^4.0.0",
|
|
"clsx": "2.1.1",
|
|
"d3-geo": "3.1.1",
|
|
"diff": "^8.0.4",
|
|
"drizzle-orm": "^0.45.4",
|
|
"fflate": "^0.8.3",
|
|
"lucide-react": "1.65.0",
|
|
"next": "16.4.6",
|
|
"next-intl": "^4.14.9",
|
|
"pdf-lib": "1.17.1",
|
|
"pdfjs-dist": "6.4.299",
|
|
"pg": "^8.23.1",
|
|
"proj4": "2.22.0",
|
|
"react": "19.3.1",
|
|
"react-dom": "19.3.1",
|
|
"tailwindcss": "4.3.3",
|
|
"tesseract.js": "^7.0.0",
|
|
"topojson-client": "3.1.0",
|
|
"topojson-server": "3.0.1",
|
|
"topojson-simplify": "3.0.3",
|
|
"unpdf": "^1.9.1",
|
|
"us-atlas": "^3.0.1",
|
|
"word-extractor": "^1.0.4",
|
|
"world-atlas": "^2.0.2",
|
|
"zod": "^4.6.7"
|
|
},
|
|
"devDependencies": {
|
|
"@electric-sql/pglite": "^0.5.13",
|
|
"@playwright/test": "1.64.1",
|
|
"@tailwindcss/postcss": "4.3.3",
|
|
"@types/d3-geo": "^3.1.1",
|
|
"@types/geojson": "^7946.0.16",
|
|
"@types/node": "26.6.6",
|
|
"@types/pg": "^8.23.1",
|
|
"@types/proj4": "^2.19.0",
|
|
"@types/react": "19.3.0",
|
|
"@types/react-dom": "19.3.0",
|
|
"@types/topojson-client": "^3.1.5",
|
|
"@types/topojson-server": "^3.0.4",
|
|
"@types/topojson-simplify": "^3.0.3",
|
|
"@types/topojson-specification": "^1.0.5",
|
|
"@vitest/coverage-v8": "^5.0.5",
|
|
"drizzle-kit": "^0.31.11",
|
|
"eslint": "10.14.0",
|
|
"eslint-config-next": "16.4.6",
|
|
"espree": "^11.2.0",
|
|
"madge": "^8.0.0",
|
|
"postcss": "8.5.32",
|
|
"prettier": "3.9.10",
|
|
"puppeteer": "25.16.0",
|
|
"sharp": "0.35.5",
|
|
"ts-node": "10.9.2",
|
|
"tsx": "^4.23.15",
|
|
"typescript": "^6.0.3",
|
|
"vitest": "^5.0.5"
|
|
}
|
|
}
|