Skip to content

Contributor friendliness: P0 migration (toolchain, docs, CI) - #7

Open
angelxmoreno wants to merge 8 commits into
mainfrom
feat/p0-migration
Open

Contributor friendliness: P0 migration (toolchain, docs, CI)#7
angelxmoreno wants to merge 8 commits into
mainfrom
feat/p0-migration

Conversation

@angelxmoreno

Copy link
Copy Markdown
Owner

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

# Commit What
1 3aa5ddf CONTRIBUTING.md, PR template, 2 issue templates, FORKING.md
2 b984bf2 README links to the new docs
3 462331b Co-located tests (4 clean ones moved out of src/test/, 1 stays)
4 29caf2d Port to TypeScript with strict mode (the biggest commit)
5 c210687 Add Biome for formatting + linting
6 134d9d3 Apply biome format and refine config
7 7320d25 pull_request CI workflow: lint, typecheck, test, build
8 2dcbe3d Correct CONTRIBUTOR-FRIENDLINESS.md based on execution

What's not in it

  • P0-1 (PostHog token rotation) — the discussion doc framed this as a
    fire-drill, but .env was 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.
  • P2 items (CHANGELOG, Renovate, preview deploys, CoC contact, license
    clarification) — deferred to the first wave of contributor PRs.

Verification

End-to-end on the branch:

  • bun install — clean
  • bun run lint — clean (0 errors, 0 warnings)
  • bun run typecheck — clean
  • bun run test — 138/138 pass
  • bun run build — clean
  • bun run dev — table renders, all interactions work

CI on this PR should mirror the same four checks.

Issues filed in the same pass

All five are labeled good first issue.

🤖 Generated with Claude Code

angelxmoreno and others added 8 commits June 7, 2026 10:01
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant