chore: add minimal validation — format, typecheck, CI - #17
Merged
Conversation
Minimal validation for the site — formatting and type checking / compilation. Two tools, four devDependencies: - prettier + prettier-plugin-astro, config matching the code style already in the repo (single quotes, semicolons, printWidth 100) - @astrojs/check + typescript, wired as `npm run typecheck`. astro build alone does not typecheck: it strips TS via esbuild, so a bad product tag or a malformed code token would compile fine and only surface as a broken card in the browser. astro check rejects it at the source. `npm run validate` chains format:check + typecheck + build. Deliberately not included, to keep the dependency footprint small: - eslint (+ eslint-plugin-astro, typescript-eslint) — 3 packages and a config to police ~30 lines of inline DOM wiring; astro check already covers the type-level errors that actually break this site. Worth ~55 npm packages; can be added later if the JS surface grows. - vitest — the tests I would write here (product has a recognized tag, code tokens use a known syntax class, required fields present) are the same invariants `Product`/`CodeToken` already encode as types and astro check already enforces. Runtime assertions restating the type system are upkeep without coverage. site.ts also gets a // prettier-ignore above each product's code: array. Each array packs several token tuples per line so the line mirrors the source line it renders as; prettier's default array breaking (one tuple per line) would expand each snippet to 20+ lines and lose that.
Mechanical `npm run format` output over the site source, plus a two-line var -> const in BaseLayout's pre-paint theme script. README.md and profile/ are in .prettierignore — they are org-facing content rather than site source, and reflowing their markdown tables would be churn in files this change has no reason to touch.
Nothing gated a PR before this: deploy.yml only builds and deploys on push to main, so a change that failed to typecheck would land and then break the deploy. Checkout, Node 22 (Astro 7 needs >=22.12.0, now pinned via engines), npm ci, then format:check / typecheck / build as separate steps so a red PR names the check that broke instead of one opaque validate blob.
jigarkhwar
force-pushed
the
chore/validation-tooling
branch
from
August 4, 2026 08:27
9e29649 to
e7f05bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Minimal validation for the site: formatting, type checking / compilation, and CI that enforces both on every PR.
Two tools, four devDependencies:
prettier-plugin-astro, config matching the code style already in the repo (single quotes, semicolons, printWidth 100).@astrojs/check+typescript, asnpm run typecheck.astro buildalone does not typecheck — it strips TS via esbuild, so a bad product tag or malformed code token compiles fine and only shows up as a broken card in the browser.astro checkrejects it at the source (verified: swapping one product's tag to an invalid value fails the check withType '"Bogus"' is not assignable to type '"Plugin" | "AI" | ...')..github/workflows/ci.yml) —pull_request+pushtomain: checkout, Node 22 (Astro 7 needs>=22.12.0, now pinned viaengines),npm ci, then format:check / typecheck / build as separate steps so a red PR names the check that broke. Nothing gated a PR before this —deploy.ymlonly builds and deploys on push tomain, so a change that failed to typecheck would land and then break the deploy.npm run validatechains all three locally.Deliberately left out
An earlier revision of this PR also added ESLint and Vitest. Both are dropped to keep the dependency footprint small — measured, not guessed:
mainastro checkalready covers the type-level errors that actually break this site. Easy to add later if the JS surface grows.Product/CodeTokenalready encode as types andastro checkalready enforces. Runtime assertions restating the type system are upkeep without coverage.@astrojs/checkis the expensive one at 74 packages, but it's what the officialnpm create astroscaffold ships for TypeScript projects, it's devDependencies-only (zero effect on the shipped site), and it's what makes the deleted tests unnecessary. Say the word if you'd rather drop it too and rely onastro buildalone — that would take this to +7 packages, at the cost of no type checking at all.Commits
// prettier-ignoreabove each product'scode:array insite.ts(each array packs several token tuples per line so the line mirrors the source line it renders as; prettier's default array-breaking would expand each snippet to 20+ lines).npm run formatover the site source, plus a two-linevar→constinBaseLayout's pre-paint theme script.README.mdandprofile/are in.prettierignore— org-facing content, not site source, and reflowing their markdown tables would be churn in files this change has no reason to touch.Verification
npm run validategreen end to end; lockfile confirmed in sync withpackage.jsonand free of the removed tools (CI installs withnpm ci). Site re-checked in the browser after the reformat — theme toggle, accordion and copy buttons all still work.🤖 Generated with Claude Code