mirror of
https://github.com/hanzoai/site.git
synced 2026-11-20 21:14:28 +00:00
* Type scripts under strict Playwright's API the checks use is declared in host.ts (the package is the app repo's); caught errors read through why(). tabs-tree.test waits for the typed tabsTree. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Type the shared components under strict Window globals (__lenis, __hzHold, google) and the two react-dom calls are declared in components/*.d.ts, since @types/react-dom is not a dependency and the lockfile is frozen. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Type components/v2 under strict Props, state, refs and DOM events in the 93 v2 files. A2Motion's easing tuples are as const. Two real bugs: x-archimedes/MaskLines imported a NoJs that does not exist, and x-hypatia/PinChapters returned the element from a ref callback, which React 19 reads as a cleanup. AppSheet no longer sets aria-label to a JSX label. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Type components/home under strict The race, cost and frontier figures, the plan cards, the repository card and the product stories take Run, Models and Plan types from lib. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Type the hero devices and the app routes under strict HeroScene and its parts describe hero-scenes.json; the [slug] pages take params as a Promise, and metadata and viewport carry Next's types. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Give the integrations previews their Preview type Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Use the bench Card type for the closing cards Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk
24 lines
1.8 KiB
TypeScript
24 lines
1.8 KiB
TypeScript
// Dev issues: console errors and warnings plus the text of Next's dev issue overlay, per page. Usage: node scripts/issues.mjs /page ...
|
|
import puppeteer from 'puppeteer-core';
|
|
import { lock } from './lock.ts';
|
|
await lock();
|
|
const b = await puppeteer.launch({ executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', headless: true });
|
|
for (const p of process.argv.slice(2)) {
|
|
const page = await b.newPage(); await page.setViewport({ width: 1470, height: 900 });
|
|
const msgs: string[] = [];
|
|
page.on('console', (m) => { if (['error', 'warn', 'warning'].includes(m.type())) msgs.push(m.type() + ': ' + (process.env.FULL ? m.text().split('\n').filter((l) => /^\s*[+-] |^\s*</.test(l)).slice(0, 40).join('\n') : m.text().slice(0, 300))); });
|
|
page.on('pageerror', (e) => msgs.push('pageerror: ' + e.message.slice(0, 300)));
|
|
await page.goto('http://127.0.0.1:4180' + p, { waitUntil: 'domcontentloaded', timeout: 180000 }); await page.waitForSelector('header button', { timeout: 60000 });
|
|
await new Promise((r) => setTimeout(r, 2500));
|
|
const overlay = await page.evaluate(async () => {
|
|
const h = document.querySelector('nextjs-portal'); if (!h?.shadowRoot) return 'no overlay';
|
|
const R = h.shadowRoot, txt = () => [...R.querySelectorAll('*')].filter((e) => e.tagName !== 'STYLE' && !e.children.length).map((e) => e.textContent.trim()).filter(Boolean).join(' ยท ');
|
|
const badge = R.querySelector('[data-issues-open], [data-nextjs-dev-tools-button], button[aria-label*="ssue"]');
|
|
if (badge) { (badge as HTMLElement).click(); await new Promise((r) => setTimeout(r, 800)); }
|
|
return txt().slice(0, 700);
|
|
});
|
|
console.log(p, '\n ', [...new Set(msgs)].slice(0, 6).join('\n '), '\n overlay:', overlay);
|
|
await page.close();
|
|
}
|
|
await b.close();
|