forked from
npmx.dev/npmx.dev
[READ-ONLY]
a fast, modern browser for the npm registry
1#!/bin/bash
2# Run Lighthouse CI audits.
3#
4# Modes:
5# - Accessibility (default): requires LIGHTHOUSE_COLOR_MODE (dark/light)
6# - Performance: set LH_PERF=1 (no color mode needed)
7#
8# The LIGHTHOUSE_COLOR_MODE env var is read by lighthouse-setup.cjs
9# to set the appropriate theme before each audit.
10
11set -e
12
13if [ -n "${LH_PERF}" ]; then
14 echo "⚡ Running Lighthouse performance audit (CLS)..."
15 pnpx @lhci/cli autorun --upload.githubStatusContextSuffix="/perf"
16 echo ""
17 echo "✅ Performance audit completed"
18 exit 0
19fi
20
21case "${LIGHTHOUSE_COLOR_MODE}" in
22 dark)
23 echo "🌙 Running Lighthouse accessibility audit (dark mode)..."
24 pnpx @lhci/cli autorun --upload.githubStatusContextSuffix="/dark"
25 ;;
26 light)
27 echo "☀️ Running Lighthouse accessibility audit (light mode)..."
28 pnpx @lhci/cli autorun --upload.githubStatusContextSuffix="/light"
29 ;;
30 *)
31 echo "⚠️ Missing or invalid LIGHTHOUSE_COLOR_MODE. Use 'dark' or 'light'."
32 exit 1
33 ;;
34esac
35
36echo ""
37echo "✅ Accessibility audit completed"