These notes align contributors on how to work in this project.
src/holds all TypeScript sources;index.tswires the user-script entry,browser-scraper.tshosts runtime helpers, andscrapers/contains site-specific scrapers with paired.e2e.tssnapshots.docs/contains the publishedscraper.user.js*payload served via GitHub Pages; regenerate only through the release flow.dist/is throwaway build output; never edit by hand, and git-ignore any experimental artifacts.types/stores generated declaration files shipped to consumers; refresh withnpm run build:typingsbefore publishing.screenshots/captures UX references; keep filenames descriptive and update when UI changes.
npm run build(orjust build) bundles the userscript intodist/usingbuild.ts.npm run prod:buildcreates the production userscript; run before tagging releases.npm run check-typesperforms a stricttsc --noEmit.npm run lintandnpm run check-fmtenforce ESLint and Prettier;npm run fmtapplies formatting fixes.just e2eexecutes Chromium-backed E2E tests viatsx; usejust e2e-onlywhile iterating andjust e2e-update-snapshotswhen intentional DOM changes affect snapshots.
- Follow TypeScript ES modules, 2-space indentation, and trailing commas where Prettier emits them.
- Prefer standalone pure functions over classes; keep scraper logic per site under
src/scrapers/<site>.ts. - Use
camelCasefor variables and functions,PascalCasefor types, andkebab-casefilenames for new modules. - Keep side effects inside
index.tsor dedicated UI glue; utility modules should be deterministic and dependency free. - Run
npm run lintbefore pushing to catch unused exports or implicitany.
- Yakaboo: the product attributes accordion now renders through
[data-testid="char-toggler"]; fall back to the legacy.main__chars button.ui-btn-navselector and treataria-expanded/aria-pressedorПриховатиas the expanded signal.
- Tests live beside implementations as
*.e2e.ts; pair each with a.snapshotfile checked in. - Ensure Chromium is available on PATH; override with
CHROMIUM_PATH=/path/to/chromium just e2e. - Name tests after the user journey they assert and prefer
testContexthelpers fromsrc/test-utils.ts. - Update snapshots only when output changes are intentional and reviewed; keep failures reproducible by seeding data or mocking network calls.
- Use present-tense, imperative commit subjects (
add imdb scraper metadata,bump to 2.11.0) and keep body text focused on rationale. - Group related changes into single commits; avoid mixing feature work with formatting churn.
- PRs must describe the change, list verification steps (
just e2eoutputs, manual browser checks), and attach fresh UI screenshots when visuals shift. - Link relevant issues or release tickets, note breaking changes explicitly, and confirm types/lint/test commands have been run.