Keep YouTube fallbacks small enough to review

The first baseline committed the raw YouTube API dump, which fixed clean builds but carried unused API metadata. The route fallback only needs prebuilt listing objects, so this replaces the raw seed with slug-keyed listing fallbacks and adds a refresh script that fetches the latest source data before projecting it.

Constraint: helpers/site-listings.js must work in a fresh checkout before generated static/api output exists

Rejected: Commit the full raw YouTube JSON | unnecessarily large and mostly unused by the fallback path

Rejected: Drop descriptions only | smaller but would weaken app-link and tag matching semantics

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: Refresh static/api/youtube-video-listings.json via scripts/update-youtube-video-listing-fallbacks.js, not by committing static/api/youtube-videos.json

Tested: pnpm run with-env vite-node scripts/update-youtube-video-listing-fallbacks.js

Tested: pnpm run with-env vitest test/prebuild/site-listings.test.js

Tested: pnpm run netlify-prebuild:test-prebuild-functions

Tested: pnpm run netlify-prebuild
This commit is contained in:
ThatGuySam 2026-04-25 15:13:29 -05:00
parent eaeff51cc9
commit 3d19c60670
5 changed files with 57 additions and 28 deletions

View file

@ -1,3 +1,3 @@
*
!.gitignore
!youtube-videos.json
!youtube-video-listings.json

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long