From 48e1d4085a5a5a4db168cc5255a4129a0052fed4 Mon Sep 17 00:00:00 2001 From: a-dev Date: Sat, 27 Jun 2026 17:19:26 +0400 Subject: [PATCH] article: validation + demo form chores: claude config --- CLAUDE.md | 45 + README.md | 4 +- astro.config.mjs | 7 +- bun.lock | 6609 +++-------------- package.json | 16 +- .../{_article.md => _overscroll-article.md} | 0 .../validation/_components/input-field.tsx | 59 + .../validation/_components/login-demo.tsx | 31 + .../validation/_components/login-form.tsx | 62 + .../validation/_components/login-schema.ts | 45 + src/pages/validation/_components/mock-auth.ts | 50 + .../_components/naive-login-form.tsx | 132 + .../_components/reward-early-validation.ts | 29 + .../_components/use-field-display-errors.ts | 33 + src/pages/validation/_components/use-login.ts | 43 + src/pages/validation/_validation-article.md | 232 + src/pages/validation/index.astro | 34 + src/pages/validation/validation.css | 132 + tsconfig.json | 5 +- 19 files changed, 2188 insertions(+), 5380 deletions(-) create mode 100644 CLAUDE.md rename src/pages/overscroll/{_article.md => _overscroll-article.md} (100%) create mode 100644 src/pages/validation/_components/input-field.tsx create mode 100644 src/pages/validation/_components/login-demo.tsx create mode 100644 src/pages/validation/_components/login-form.tsx create mode 100644 src/pages/validation/_components/login-schema.ts create mode 100644 src/pages/validation/_components/mock-auth.ts create mode 100644 src/pages/validation/_components/naive-login-form.tsx create mode 100644 src/pages/validation/_components/reward-early-validation.ts create mode 100644 src/pages/validation/_components/use-field-display-errors.ts create mode 100644 src/pages/validation/_components/use-login.ts create mode 100644 src/pages/validation/_validation-article.md create mode 100644 src/pages/validation/index.astro create mode 100644 src/pages/validation/validation.css diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..9831838 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,45 @@ +## Project Overview + +Self-contained web-dev "probes" — each explores one concept (overscroll, validation timing) with a +live demo and an article. Static Astro site deployed to GitHub Pages. Package manager is **Bun**; +Node `>=22.12.0`. + +## Commands + +- `bun run dev` — dev server (`--host`, on LAN) +- `bun run build` / `bun run preview` — build to `dist/` / serve it +- `GITHUB_PAGES=true bun run build` — build with the `/probes` base path (what CI deploys) +- `bun run lint` / `bun run lint:fix` — oxlint + stylelint +- `bun run format` / `bun run format:check` — oxfmt (not Prettier) +- `bun run typecheck` — `oxlint --type-aware` + +## Architecture + +**One probe = one route folder** under `src/pages//`, owning everything it needs: + +- `index.astro` — full `` page (probes are standalone, no shared layout) +- `.css` — page styles, imported into the `.astro` file +- `_article.md` — the explainer (`_` prefix keeps it out of routing) +- `_components/` — React island(s) + logic, only if interactive + +`src/pages/index.astro` is an intentionally empty landing page; the probe list lives in `README.md`. + +**React islands:** `output: "static"`. Pages are SSR'd HTML; interactivity is opt-in per component. +`validation` mounts one island (``); `overscroll` uses no React, just an +inline `