AnasSarkiz/magnetic-shutter-remote-r8
A USB‑C rechargeable battery-powered ESP32‑C3 wireless controller with Li‑ion charging, protected 3.3‑V buck‑boost regulation, thermal/safety monitoring, status LEDs, buttons, programming UART, crystal clock, and 2.4‑GHz antenna matching network.
- Version
- 0.4.0-prototype
- License
- unset
- Stars
- 0
scripts/export-gerbers.ts
import { any_circuit_element } from "circuit-json";
import { convertCircuitJsonToGerberFiles } from "circuit-json-to-gerber";
import { z } from "zod";
const [inputPath, outputDirectory] = z
.tuple([z.string().min(1), z.string().min(1)])
.parse(Bun.argv.slice(2));
const circuit = any_circuit_element
.array()
.parse(await Bun.file(inputPath).json());
const files = convertCircuitJsonToGerberFiles(circuit);
for (const [filename, contents] of Object.entries(files)) {
await Bun.write(`${outputDirectory}/${filename}`, contents);
}
console.log(
`${Object.keys(files).length} original Gerber/Excellon outputs from ${inputPath}`,
);