doesitarm/helpers/site-listings.js
Sam Carlton d1f49267c0 Keep device listings available in clean builds
The Netlify validation job imports site listings before generated static device JSON exists in a clean checkout, so keep the small device table in tracked source and use it as the route fallback.

Constraint: static/device-list.json is ignored generated output and is absent in GitHub-hosted clean runners
Rejected: Force-add static/device-list.json | keeps generated output under source control
Confidence: high
Scope-risk: narrow
Directive: Keep disabled device rows in the fallback source but filter them from routable listings
Tested: pnpm run with-env vitest ./test/prebuild/site-listings.test.js
Tested: pnpm netlify-build reached Astro build after passing prebuild tests
Not-tested: Full local netlify-build completion blocked by unrelated uncommitted scanner worker build failure
2026-04-25 15:46:39 -05:00

13 lines
444 B
JavaScript

import videoListingsText from '~/static/api/youtube-video-listings.json?raw'
import { deviceListingFallbacks } from './device-list-fallbacks.js'
const parsedVideoListings = JSON.parse( videoListingsText )
export function getDeviceListingBySlug ( slug ) {
return deviceListingFallbacks.find( device => device.slug === slug ) || null
}
export async function getVideoListingBySlug ( slug ) {
return parsedVideoListings[slug] || null
}