Export du dépôt interne d'Aleop, révision 0936ea1 (fichiers publiés identiques à e46bc12). Paquets construits depuis cette source : - Android : AAB 2026.10.0, code 4 - iPhone : archive 2026.10.0 (18) - Bureau : macOS universel build 13, Windows build 14, MSIX build 15 - Extensions Chrome, Edge et Firefox : 2026.10.0.3
23 lignes
1.3 KiB
JavaScript
23 lignes
1.3 KiB
JavaScript
// GPL-3.0-only. Réutilise sharp verrouillé dans brand/package-lock.json.
|
|
import sharp from '../brand/node_modules/sharp/lib/index.js';
|
|
import { readdir } from 'node:fs/promises';
|
|
import { readFileSync } from 'node:fs';
|
|
import { fileURLToPath } from 'node:url';
|
|
const root = fileURLToPath(new URL('.', import.meta.url));
|
|
const { tag } = JSON.parse(readFileSync(`${root}upstream.json`));
|
|
const dir = `${root}.cache/clients-${tag}/apps/browser/src/images`;
|
|
const source = `${root}../brand/loksi-icon.svg`;
|
|
for (const name of await readdir(dir)) {
|
|
const match = name.match(/^icon(\d+)(?:_gray|_locked)?(?:_beta)?\.png$/);
|
|
if (!match) continue;
|
|
const size = Number(match[1]);
|
|
let icon = sharp(source).resize(size, size);
|
|
if (name.includes('_gray')) icon = icon.greyscale();
|
|
if (name.includes('_locked')) {
|
|
// Pastille d'état des illustrations : disque cyan, contour et barre blancs. Ni jaune ni rouge dans la charte.
|
|
const badge = Buffer.from(`<svg width="${size}" height="${size}"><circle cx="${size * .78}" cy="${size * .78}" r="${size * .21}" fill="#009CDE" stroke="#FFFFFF"/><path d="M${size * .68} ${size * .78}h${size * .2}" stroke="#FFFFFF" stroke-width="${Math.max(1, size * .06)}"/></svg>`);
|
|
icon = icon.composite([{ input: badge }]);
|
|
}
|
|
await icon.png().toFile(`${dir}/${name}`);
|
|
}
|