// Checks the hosted deck on a live URL: hashed assets are immutable, the page inlines no images or // fonts, every slide and beat walks without errors, and after one visit the deck works fully offline // (see scripts/offline-audit.mjs). Usage: node scripts/check-live.mjs https://invisible-software-slides.kentcdodds.com/ import { chromium } from 'playwright' import { auditOffline } from './offline-audit.mjs' const base = new URL(process.argv[2] ?? 'https://invisible-software-slides.kentcdodds.com/').href.replace(/\/?$/, '/') const problems = [] const html = await (await fetch(base, { cache: 'no-store' })).text() const one = html.match(/c\/img\/[\w.-]+\.[0-9a-f]{8}\.\w+/)?.[0] const res = one && (await fetch(base + one)) if (!res?.ok || !/immutable/.test(res.headers.get('cache-control') ?? '')) problems.push(`hashed asset ${one} is not served immutable`) if (/data:image\/(?:png|jpeg|webp)|data:font\//.test(html.replace(/