mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
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
13 lines
444 B
JavaScript
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
|
|
}
|