imrishabh18/pedometer
This code defines and assembles a simple radio receiver hardware circuit using specific imported capacitors, inductors, RF connectors, and oscillator components with precise footprints and schematic attributes.
- Version
- 1.1.3
- License
- unset
- Stars
- 0
scripts/check-fabrication.ts
import fs from "node:fs";
import crypto from "node:crypto";
const report = JSON.parse(fs.readFileSync("review/fabrication-review.json", "utf8"));
const circuitHash = crypto.createHash("sha256").update(fs.readFileSync("dist/index/circuit.json")).digest("hex");
if (report.circuitSha256 !== circuitHash) {
console.error("FABRICATION HOLD: the review does not cover this Circuit JSON; rerun the fabrication review.");
process.exit(1);
}
const manufacturingHash = crypto.createHash("sha256").update(fs.readFileSync("review/manufacturing/circuit.json")).digest("hex");
if (report.manufacturingCircuitSha256 !== manufacturingHash) {
console.error("FABRICATION HOLD: manufacturing layers have changed since the review.");
process.exit(1);
}
const open = report.findings.filter((f: { status: string }) => f.status !== "resolved");
if (report.status !== "ready" || open.length) {
console.error(`FABRICATION HOLD: ${open.length} open findings. See docs/fabrication-review.md.`);
for (const f of open) console.error(`${f.id}: ${f.title}`);
process.exit(1);
}
console.log("Fabrication review clear for the recorded Circuit JSON.");