$ show harlan-zw/unlighthouse
Unlighthouse is a CLI tool and web dashboard that scans entire websites using Google Lighthouse, aggregating results across all pages and presenting them in a real-time, filterable dashboard. The architecture is a monorepo with separate packages for core scanning logic, CLI, CI integration, a Vue 3 client, and a small h3 server for serving reports and WebSocket updates. Key entry points include the `unlighthouse` CLI (via `cac`), the `unlighthouse-ci` CI command, and the `createUnlighthouse` function from `@unlighthouse/core`. Primary data flows: URL discovery (sitemap, robots.txt, crawling), parallel Lighthouse runs via `puppeteer-cluster`, streaming results to the client, and exporting reports (HTML, JSON, CSV, LHCI). External dependencies include Puppeteer (Chrome), Lighthouse, and optionally the CrUX API for historical field data. The codebase is well-structured, uses ESM, and has a modern build pipeline with Vite and Vitest. Some integrations (Nuxt, Vite, Webpack) are deprecated, but the core functionality remains actively maintained. The client UI is feature-rich, with dark mode, search, pagination, and detailed audit result views.
The LLM identified 4 files worth highlighting for reuse:
A self-contained utility that parses robots.txt content into a structured object (allow/disallow rules, sitemaps, crawl delay, host). It handles edge cases (wildcards, comments, HTTP/HTTPS protocols) and is fully testable. Could be extracted into a standalone npm package or reused in any project needing robots.txt parsing. Demonstrates careful edge-case handling and clear separation of concerns.
A fully featured Vue 3 pagination component with first/prev/next/last buttons, ellipsis, page number buttons, and slot-based customization. It handles edge cases like single page, boundary conditions, and keyboard navigation. The component is self-contained, uses only reactive props and emits, and can be easily extracted to any Vue 3 project. Demonstrates non-obvious skill in handling pagination logic and accessibility.
A generic popover component with a trigger button, smooth transition animations, and a slot for arbitrary content. It manages open/close state, handles click outside to close, and supports keyboard navigation. The component is isolated with no internal dependencies beyond Vue 3, making it reusable across any Vue 3 application. Demonstrates clean encapsulation of interactive UI patterns.
An SVG-based circular gauge component for displaying scores (e.g., Lighthouse scores). It supports both a full gauge and a stripped mode, animates smoothly, and color-codes scores based on thresholds. The component is self-contained, uses only props and computed properties, and can be reused in any Vue 3 project needing a gauge visualization. Demonstrates clean SVG manipulation and animation logic.