mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-11 21:57:14 +03:00
Adds a Manifest V3 Chrome extension that injects the detector when DevTools opens, with a dedicated panel for browsing findings, a toolbar popup for quick scan/toggle, and per-rule settings synced via chrome.storage. Categorizes anti-patterns into AI slop vs quality issues with visual differentiation (sparkle prefix, panel grouping). Overlay labels are polished with flush positioning, cycling for multi-finding elements, and synchronized hover darkening. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Generates PNG extension icons from SVG using Puppeteer.
|
|
*
|
|
* Run: node scripts/generate-extension-icons.js
|
|
*/
|
|
|
|
import puppeteer from 'puppeteer';
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const ROOT = path.resolve(__dirname, '..');
|
|
const ICONS_DIR = path.join(ROOT, 'extension/icons');
|
|
|
|
const SIZES = [16, 32, 48, 128];
|
|
|
|
const svgContent = fs.readFileSync(path.join(ICONS_DIR, 'icon.svg'), 'utf-8');
|
|
|
|
const browser = await puppeteer.launch({ headless: true });
|
|
const page = await browser.newPage();
|
|
|
|
for (const size of SIZES) {
|
|
await page.setViewport({ width: size, height: size, deviceScaleFactor: 1 });
|
|
await page.setContent(`
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head><style>* { margin: 0; padding: 0; } body { width: ${size}px; height: ${size}px; overflow: hidden; }</style></head>
|
|
<body>${svgContent.replace('viewBox="0 0 128 128"', `viewBox="0 0 128 128" width="${size}" height="${size}"`)}</body>
|
|
</html>
|
|
`);
|
|
await page.screenshot({ path: path.join(ICONS_DIR, `icon-${size}.png`), omitBackground: true });
|
|
console.log(`Generated icon-${size}.png`);
|
|
}
|
|
|
|
await browser.close();
|