imrishabh18/pcbgolf

These code snippets define detailed PCB footprints for various SMD components, through-hole connectors, and chips, specifying pad locations, shapes, silkscreen outlines, and mechanical outlines for physical placement on a circuit board.

Version
1.4.3
License
unset
Stars
0

scripts/check-runtime-drc.ts

import { runAllRoutingChecks, runAllPlacementChecks } from '@tscircuit/checks'
const data = await Bun.file(new URL('../dist/route.circuit.json',import.meta.url)).json()
const stored = data.filter((e:any)=>e.type.endsWith('_error'))
const checked = (await Promise.all([runAllRoutingChecks(data),runAllPlacementChecks(data)])).flat()
const errors = checked.filter((e:any)=>e.type.endsWith('_error'))
const report = {passes:stored.length===0 && errors.length===0,storedErrorCount:stored.length,freshErrorCount:errors.length,errors,checker:'@tscircuit/checks@0.0.189 with checked-in geometry/connectivity patch'}
await Bun.write(new URL('../validation/tscircuit-drc.json',import.meta.url),JSON.stringify(report,null,2)+'\n')
console.log(JSON.stringify({passes:report.passes,storedErrorCount:stored.length,freshErrorCount:errors.length}))
if (!report.passes) process.exit(1)