// Regenerates src/logo.ts from the PNG assets. // The assets are downscaled copies of // apps/site/docs/public/images/brand/midscene-icon.png (96px wide). import { readFileSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); const toDataUri = (file) => `data:image/png;base64,${readFileSync(path.join(root, 'assets', file)).toString('base64')}`; const content = `// Generated by scripts/generate-logo.mjs. Do not edit by hand. export const LOGO_96 = '${toDataUri('logo-96.png')}'; // Height / width of the brand icon. export const LOGO_RATIO = 60 / 64; `; writeFileSync(path.join(root, 'src', 'logo.ts'), content); console.log('src/logo.ts generated');