Contributor friendliness: P0 migration (toolchain, docs, CI) - #7
Open
angelxmoreno wants to merge 8 commits into
Open
Contributor friendliness: P0 migration (toolchain, docs, CI)#7angelxmoreno wants to merge 8 commits into
angelxmoreno wants to merge 8 commits into
Conversation
Five new files at the repo root and in .github/ that together make the contributor flow self-serve: - CONTRIBUTING.md — the main doc. Two contribution paths (data fix vs code change), dev setup, coding style, PostHog rules, license grant. - .github/pull_request_template.md — what / why / screenshots / test plan / data source. Forces every PR to declare what they tested. - .github/ISSUE_TEMPLATE/data-correction.yml — chip name, field dropdown (matches the 15 keys in chips.json), current value, correct value, source URL. - .github/ISSUE_TEMPLATE/bug-report.yml — repro, expected, actual, browser/OS, screenshot. - FORKING.md — "I want my own version" guide. GitHub Pages setup, custom domain DNS, PostHog setup for the fork, and the three 90% troubleshooting cases (blank page, custom domain 404, PostHog not loading). No code changes; tests still pass at 138/138.
Add a Contributing section between Notes and License pointing at CONTRIBUTING.md (data + code paths) and FORKING.md (run your own copy), plus a mention of the issue templates. Also expand the Project Structure block to include CONTRIBUTING.md, FORKING.md, LICENSE, README.md, and CONTRIBUTOR-FRIENDLINESS.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move AppleSiliconTable.test.jsx, summarize.test.js, urlState.test.js, and chips.test.js from src/test/ to sit next to the files they test (src/AppleSiliconTable.test.jsx, etc.), and move setup.js to src/test-setup.js. Update relative imports in the moved tests to use "./foo" instead of "../foo" since they now live at the same level as their sources. Update vite.config.js to point at the new setup path. src/test/ still holds csv.test.js (covers export-csv.js at the repo root) and fmt.test.js (covers an unexported `fmt` inside AppleSiliconTable.jsx). A comment in src/test-setup.js explains why those two stay; the TypeScript port will extract `fmt` to its own module and fmt.test.js will follow. All 138 tests still pass; build clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert every source and test file from JavaScript to TypeScript: - src/*.jsx → src/*.tsx - src/*.js → src/*.ts - src/test/* → src/test/*.ts (where they remained; csv.test.ts is the one outlier still in src/test/ because it covers export-csv.js at the repo root) - src/test-setup.js → src/test-setup.ts - vite.config.js → vite.config.ts (Vite auto-detects TS configs) Add a single src/types.ts that defines the shared shapes: - Chip — mirrors src/chips.json (with nulls for M5's missing figures) - ColumnDef — pre-augmentation column metadata - Column — post-augmentation column (filter fully resolved from data) - ColumnFilter — discriminated union of set / range / range-discrete - ViewState — what the URL holds - FilterValue, SortItem, Fragment — used by summarize.ts and urlState.ts Extract the `fmt` helper from AppleSiliconTable.tsx to its own src/fmt.ts module. It was duplicated in src/test/fmt.test.js for testing — now the test imports the real `fmt`. This was the only file that didn't have a clean source-pair for co-location; the test moves to src/fmt.test.ts alongside its source. tsconfig.json: strict + noUncheckedIndexedAccess + noImplicitOverride + bundler resolution + react-jsx. `bun run typecheck` is clean. package.json: add typescript, @types/react, @types/react-dom, plus a `typecheck` script (`tsc --noEmit`). src/vite-env.d.ts: declare ImportMetaEnv shape for the PostHog vars so import.meta.env.* typechecks; declare `*.css` side-effect imports. All 138 tests still pass; production build is clean (24 modules now, up from 23 — fmt.ts and types.ts add one each). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replaces Prettier + ESLint with a single tool that does both, plus import sorting. Biome is faster and uses a single config file. biome.json: - formatter: 2-space indent, double quotes, semicolons, ES5 trailing commas, 100-char line width (matches the existing code) - linter: enabled, defaults - assist: organize imports on - files: ignore dist, node_modules, bun.lock, *.md, public package.json: add `lint` (`biome check .`) and `format` (`biome format --write .`) scripts. No source changes in this commit — the format pass is the next one. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Auto-format all .ts/.tsx files in src/ and the root vite config. Add rule overrides for a11y rules that conflict with the existing modal backdrop pattern (close button inside a form, click-only sort header) and disable noNonNullAssertion in the few places where the type narrowing isn't worth the noise. Exclude export-csv.js and src/test/csv.test.ts (out of P0 scope) and *.css (Biome can't parse the Tailwind directives). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirrors the deploy workflow's build setup but adds the lint and typecheck steps that contributors should run before pushing. Uses placeholder PostHog env values because the build only embeds them as JSON literals — it never connects from CI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- P0-1: clarify the PostHog token was never in git history (.env was gitignored from day one); the work is local-machine rotation only, no history rewrite needed. - P0-6: add the actual fifth test file (chips.test.js, which co-locates with chips.json) and the csv.test.js exception. - P0-8/9/10/12/13: mark all five as shipped, with the commit hash and one-line summary of what landed. Add a "Corrections to the P0 pass" section at the bottom so future readers can see what changed between the discussion doc and the executed plan. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 this PR does
Executes the P0 band of the contributor-friendliness plan in
CONTRIBUTOR-FRIENDLINESS.md(plus the four P1 items grouped with P0: the TypeScript port, Biome, CI, and the good-first-issue grooming). 8 commits, 1 PR.What's in it
3aa5ddfCONTRIBUTING.md, PR template, 2 issue templates,FORKING.mdb984bf2462331bsrc/test/, 1 stays)29caf2dc210687134d9d3biome formatand refine config7320d25pull_requestCI workflow: lint, typecheck, test, build2dcbe3dWhat's not in it
fire-drill, but
.envwas gitignored from day one and never committed;the token was never in git history. The local-machine risk is real and
rotation is still worth doing, but it's not a PR-time concern.
clarification) — deferred to the first wave of contributor PRs.
Verification
End-to-end on the branch:
bun install— cleanbun run lint— clean (0 errors, 0 warnings)bun run typecheck— cleanbun run test— 138/138 passbun run build— cleanbun run dev— table renders, all interactions workCI on this PR should mirror the same four checks.
Issues filed in the same pass
src/chips.jsonsrc/chips.jsondocs/SCHEMA.mddescribing the chips schemasrc/AppleSiliconTable.tsxAll five are labeled
good first issue.🤖 Generated with Claude Code