imrishabh18/nema-23-stepper-controller

A 57 mm four-layer RP2040 NEMA23 stepper-controller PCB with USB‑C/USB‑PD power input, protected motor rail, DRV8452 dual-winding driver, bidirectional current sensing, temperature/enable interlock, optional magnetic encoder, RGB LED and buzzer status indicators, and motor/test connectors.

Version
1.2.3
License
unset
Stars
0

scripts/check-drc.mjs

import {spawnSync} from 'node:child_process'
import {readFileSync,writeFileSync,mkdirSync} from 'node:fs'
import {runAllChecks} from '@tscircuit/checks'

// Core may log asynchronous checker exceptions without returning a nonzero exit.
// Treat these as failures and independently invoke all DRC checks as well.
const result=spawnSync('bun',['run','build'],{encoding:'utf8',maxBuffer:32*1024*1024})
process.stdout.write(result.stdout??'');process.stderr.write(result.stderr??'')
if(result.error)throw result.error
if(result.status!==0||/Async effect error|Unresolved boundary conflict/.test((result.stdout??'')+(result.stderr??'')))throw Error('Build or asynchronous DRC failed')
const json=JSON.parse(readFileSync('dist/index/circuit.json'))
const results=await runAllChecks(json)
mkdirSync('checks',{recursive:true})
writeFileSync('checks/drc.json',JSON.stringify(results,null,2))
const errors=results.filter(e=>e.type.endsWith('_error')||e.type==='error')
if(errors.length)throw Error(JSON.stringify(errors,null,2))
const verify=spawnSync('bun',['run','verify:built'],{stdio:'inherit'})
if(verify.error||verify.status!==0)throw verify.error??Error('Built assertions failed')
console.log(`PASS: independent full DRC, zero errors (${results.length} non-error diagnostic records).`)