import { cpSync, existsSync } from "node:fs";
import { execSync } from "node:child_process";
import { join } from "node:path";
const variants = ["st", "mt"].filter((v) => existsSync(join("dist", v)));
if (variants.length === 0) {
console.error(
"[build-types] No dist/{st,mt}/ subdir found — did the rollup build run?"
);
process.exit(1);
}
for (const v of variants) {
console.log(`[build-types] Copying js/types → dist/${v}`);
cpSync("js/types", `dist/${v}`, { recursive: true });
}
console.log("[build-types] Running clean.js");
execSync("node clean.js", { stdio: "inherit" });