Files
lunch/scripts/app-icons.mjs
T
Kai BöhmandClaude Opus 5.5 fa83e560b2
ci / olares chart · sanity (pull_request) Successful in 5s
ci / app · types + tests + build (pull_request) Successful in 3m54s
release / which version (pull_request) Successful in 1s
release / olares chart · sanity (pull_request) Successful in 3s
release / app (pull_request) Successful in 1m25s
release / tag and release (pull_request) Skipped
Scaffold the app, chart, CI and release (26.11.1)
Next.js 15 with next-intl (de, en, fr, es; locale per person, no URL
prefix), Tailwind v4 tokens for the warm palette with dark mode, a
shadcn/ui button, Serwist service worker and PWA manifest with icons.
One Postgres pool with withHousehold() setting app.household_id per
transaction; the first migration creates households with FORCE ROW
LEVEL SECURITY, and a two-household test checks the isolation as the
table owner. scripts/migrate.mjs applies db/migrations once each with a
checksum and retries until the database is reachable.

Olares chart with one deployment (init: chown, migrate from the same
image), ClusterIP service, entrance internal until the own sign-in
exists, image path fixed in the template and tag from appVersion.
scripts/check-chart.sh carries the rules from Rocket; CI runs it, type
check, tests against Postgres and the build; release builds
lunch-app, tags and attaches the chart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUc2nv7rJVU2gp3Bgtha3q
2026-11-06 19:08:21 +00:00

32 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Erzeugt die Symbole der PWA aus docs/icon/lunch.svg (Chromium über
// Playwright, nur lokal nötig): public/icon.svg, apple-touch-icon.png,
// icon-192.png, icon-512.png, icon-512-maskable.png und olares/icon.png (512 × 512, geht als lunch/icon.png nach aimighty/bilder).
// Ändert sich das Symbol, alle neu erzeugen und mit committen.
import { copyFile, readFile } from "node:fs/promises";
import { createRequire } from "node:module";
// Playwright ist keine Abhängigkeit des Projekts; global installiert reicht.
const { chromium } = createRequire(import.meta.url)("playwright");
const svg = await readFile("docs/icon/lunch.svg", "utf8");
const browser = await chromium.launch();
const page = await browser.newPage();
async function render(file, size, { maskable = false } = {}) {
// Maskierbar: Motiv auf 80 % in sicherer Zone, Rand in Terrakotta.
const inner = maskable ? Math.round(size * 0.8) : size;
await page.setViewportSize({ width: size, height: size });
await page.setContent(`<html><body style="margin:0;background:${maskable ? "#b8573a" : "transparent"};display:grid;place-items:center;width:${size}px;height:${size}px">
<div style="width:${inner}px;height:${inner}px">${svg.replace("<svg ", `<svg width="${inner}" height="${inner}" `)}</div></body></html>`);
await page.screenshot({ path: file, omitBackground: !maskable });
}
await copyFile("docs/icon/lunch.svg", "public/icon.svg");
await render("public/apple-touch-icon.png", 180, { maskable: true });
await render("public/icon-192.png", 192);
await render("public/icon-512.png", 512);
await render("public/icon-512-maskable.png", 512, { maskable: true });
await render("olares/icon.png", 512);
await browser.close();
console.log("icons written");