Skip to content

Draw the 30 home parks from built-in fence distances - #20

Merged
VaalRL merged 2 commits into
mainfrom
claude/exciting-brown-osrche
Oct 19, 2026
Merged

VaalRL merged 2 commits into
mainfrom
claude/exciting-brown-osrche

Conversation

@VaalRL

@VaalRL VaalRL commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • New script scripts/update-venues.mjs: writes src/data/venues.json.
    • It takes each club's park from /teams?sportId=1&season=…, then fetches all 30 at once with /venues?venueIds=…&hydrate=fieldInfo, trimmed with fields=.
    • It stores the fence distances plus turf, roof and capacity.
    • It refuses to write if there are fewer than 30 clubs, fewer than 28 parks, or any park lacks a center field distance.
  • Weekly data job (update-player-data.yml):
    • now also runs the venues script and commits both data files;
    • branch renamed from data/taiwan-players to data/weekly-update;
    • title renamed to "Update player and ballpark data".
  • Game page (src/utils/venues.ts): the alignment chart reads the built-in park first. It calls /venues/{id} only for parks outside the 30 clubs' homes, such as London or Tokyo games.
  • ADR 0003: gets an update note. Its alternative Add a transactions section (轉隊記錄) to the player page #3, "bake into a static file once the data can be verified", is now adopted, and the extra /venues request it listed as a cost is gone.
  • Version 1.13.1, with changelog and TODO Phase 47.

Where the data came from

  • The first venues.json was produced by the updated workflow itself, run via workflow_dispatch on this branch against the live API. It was taken from the data/weekly-update branch the run pushed; nothing was typed by hand.
  • It has 30 parks for 2026. Fenway is 310/390/420/380/302. PNC's left-center (410) is deeper than its center (399). Dodger Stadium publishes only five angles, with no left/right.

Test plan

  • npm test: 426 pass (4 new).
    • Every club has a park with line-to-line distances.
    • Parks are looked up by id.
    • A home park draws its fences with no /venues request.
    • A park that isn't built in, like London, still gets requested and drawn.
  • build, lint (0 errors)

Note

The old data/taiwan-players branch is no longer written to and can be deleted.


Generated by Claude Code

src/data/venues.json, produced by the weekly data job on the live API,
holds each club's park; the game page asks /venues only for others.
Version 1.13.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016uCcPyXxqRPqY3P5CNeNXF
@VaalRL
VaalRL merged commit 7001fb5 into main Oct 19, 2026
1 check passed
@VaalRL VaalRL mentioned this pull request Oct 20, 2026
3 tasks done
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.

2 participants