SPB Git

Repository Public

build-brand.ts 971 B 14 lines typescript

1/**2 * pnpm brand:build — derives the raster icons from the vector mark (brand/atlas-mark.svg).3 * Outputs are committed: src/app/apple-icon.png, public/icon-192.png, public/icon-512.png.4 */5import { readFile } from "node:fs/promises";6import sharp from "sharp";78const mark = (await readFile("brand/atlas-mark.svg", "utf8")).replace(/<svg[^>]*>/, "").replace("</svg>", "");9const tile = (size: number, pad: number) => Buffer.from(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${48 + pad * 2} ${48 + pad * 2}" width="${size}" height="${size}"><rect width="100%" height="100%" fill="#0B1426"/><g transform="translate(${pad} ${pad})" fill="none">${mark}</g></svg>`);10await sharp(tile(180, 9)).png().toFile("src/app/apple-icon.png");11await sharp(tile(192, 9)).png().toFile("public/icon-192.png");12await sharp(tile(512, 9)).png().toFile("public/icon-512.png");13console.log("Icônes générées : src/app/apple-icon.png, public/icon-192.png, public/icon-512.png");14
Files main
Menu

Theme