astra/nema17-stepper-motor-controller-spring-clamp-rp2040
A 4-layer RP2040 controller board that negotiates USB‑C PD motor power and drives a NEMA17 stepper via a DRV8825, with current sensing, thermal shutdown, RGB status LED, buzzer alarm, optional AS5600 encoder, protection/filtering, and test points.
- Version
- 1.4.0
- License
- unset
- Stars
- 0
scripts/check-built.ts
import { mkdirSync, writeFileSync } from "node:fs";
// tsci check currently prints diagnostics without failing on embedded errors.
// Gate the reported count as well as the process exit status.
const file = process.argv[2] ?? "dist/index/circuit.json";
mkdirSync("reports", { recursive: true });
for (const [name, args] of [
["tsci-check", ["check", file]],
["shorts", ["check", "shorts", file, "--mode", "gerber", "--layer", "all"]],
] as const) {
const process = Bun.spawn(["bunx", "--no-install", "tsci", ...args], {
stdout: "pipe", stderr: "pipe",
});
const [stdout, stderr, code] = await Promise.all([
new Response(process.stdout).text(),
new Response(process.stderr).text(),
process.exited,
]);
const output = stdout + stderr;
writeFileSync(`reports/${name}.log`, output);
console.log(output);
if (code !== 0 || (name === "tsci-check" && !/^Errors: 0\s*$/m.test(output)) ||
(name === "shorts" && !output.includes("No shorts detected"))) {
throw new Error(`${name} failed; see reports/${name}.log`);
}
}