pcbjam/CLAUDE.md
Viktor Vaczi fdc4583288 chore(deploy/site): retire the migration scaffolding, keep the health check
The Vercel -> Cloudflare Pages move is done and the Vercel project is
deleted, so the one-shot scripts have no remaining purpose. Nothing in CI
ever called them — deploy-site.yml runs npm ci / test / build / pages
deploy inline — so this removes 10 files and orphans nothing.

Deleted: 00-baseline (refused to run without x-vercel-id, so permanently
unrunnable), 01-preflight (proved Vercel state and API-token scopes),
07-dns-cutover (the phased cutover; in the end the records were attached
through the dashboard, and the rules/apex phases went unused once we chose
APEX_MODE=serve), 09-detach-vercel (its target project is gone), plus
03-ensure-project, 04-set-secrets, 05-deploy, 06-verify-deploy,
02-verify-local and 99-rollback, all either spent or duplicating CI. Their
lib/cf-api.sh went with them: the survivors use wrangler, so the whole
remaining path needs only `wrangler login` and no zone scopes.

What is kept is the part with ongoing value: lib/parity.sh, the assertion
set that caught five real defects during the migration — the live COOP/COEP
bug on the post's canonical URL, the soft-404 Pages would have introduced,
the cross-site form-POST guard Vercel had been providing for free, the
missing immutable header, and HSTS max-age=0. "Does the page return 200"
catches none of those.

08-verify-prod.sh becomes verify.sh, since the numbered sequence it
belonged to no longer exists. It drops the stamp machinery, the dry-run
plumbing and the Vercel-fallback messaging (there is no fallback now:
recovery is promoting a previous Pages deployment), and gains --skip-dns /
--skip-domains so it can be pointed at a single deployment via PROD_BASE
before promoting it.

The README is rewritten around the four invariants that fail SILENTLY —
never widen _headers to /*, keep both URL forms of the Gerber post, never
delete 404.astro, keep the cross-site form-POST guard — each with the
reason, since the reason is the only thing that stops someone simplifying
them back out.

Verified after: 21 probes, 20 pass, 1 warn (HSTS max-age is 6 months vs
Vercel's 2 years — on, just shorter), 0 fail.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LAmkjM7okPdScp9XLW1JVr
2026-07-27 15:08:56 +02:00

3.5 KiB

The goal is to build kicad with wasm and run it in a browser README.md details how to run the project

A lot of native module have to be compiled to wasm, the most complex is wxwidgets /kicad and /wxwidgets are git submodules from our own forks The e2e tests are in /tests, with a README and WHATWORKS md files Test determinism rules (no blind sleeps/ifs, stableShot screenshots, retries:0) are in tests/TESTING.md, enforced by npm run lint:determinism. The e2e tests are separated per feature Wxwidgets wasm port has hooks for finding positions of UI elements, tests use that The test screenshots are tracked with git, per engine (tests/baseline-screenshots/{chromium,firefox}/); CI's Linux render is the source of truth (tooling: tests/tools/screenshots/, see its README). To update baselines, promote a CI run's render (churn-free — only meaningfully-changed images restage): cd tests && npm run screenshots:promote -- --run <ci-run-id>, then commit. npm run screenshots:check is the local gate; on each main push CI posts a screenshot-diff + runtime-perf report to Discord. The tests have log files in tests/logs/{wxwidgets/kicad}/{test-name} after each run where the js console and cpp logs are visible Always check screenshots for validating tests Run e2e tests from /tests folder: npm run test:e2e (full CI project set, one merged playwright.config.ts) or npm run test:kicad (firefox shortcut) — not playwright directly. One spec/engine: npx playwright test --project=kicad-firefox kicad/pcbnew.spec.ts. Web-app suite: npm run test:web.

Build kicad with docker/build.sh (includes wxwidgets build, runs in docker) Build wxwidgets standalone with scripts/build-wx-wasm.sh (runs on machine, for wxwidgets-only changes) Build CPP wxwidgets tests with scripts/builds-wasm-test.sh The build scripts pipe their outputs into log files so that they won't clog the LLM context. Don't pipe outputs, just run the scripts. Maybe with flex if you need that.

Don't change the wxwidgets core unless absolutely necessary, try to fix things in the wasm layer. Don't change kicad unless absolutely necessary - keep our fork as close to upstream as possible. Run scripts/kicad-diff-stats.sh to see how far our KiCad fork has diverged from upstream. It's okay to add temporary logging that will be removed for debugging.

Don't try to guess what's broken , use debug tools / symbols, supported by the build scripts

Feature docs/patches are in features//. Run scripts/create-feature-patches.sh to save patches for root, kicad, wxwidgets submodules.

The landing page / website is in /site (Astro, static, deployed to Cloudflare Pages by .github/workflows/deploy-site.yml on every push to main touching site/**). It has no Astro adapter; the one dynamic route (/api/waitlist) is a Cloudflare Pages Function in site/functions/. Prod response headers come from site/public/_headers (COOP/COEP for the embedded Gerber viewer — never widen them to /*, the landing page must stay un-isolated for the YouTube embed). The footer shows a build SHA that links to the pcbjam commit the site was built from; because it pins the kicad + wxwidgets submodule revisions implicitly, it is our GPLv3 corresponding-source pointer (see /licenses). It resolves automatically at build time in site/src/components/Footer.astro (CF_PAGES_COMMIT_SHA / GITHUB_SHA in CI, git rev-parse locally) — no manual bump needed. Cloudflare setup, the invariants that fail silently, and the health check (deploy/site/verify.sh) are documented in pcbjam/deploy/site/README.md.