Files
pbakaus_impeccable/scripts/generate-extension-icons.js
T
Paul BakausandClaude Opus 4.6 e961d56252 Add Chrome DevTools extension for anti-pattern detection
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>
2026-04-06 15:18:36 -07:00

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();