// scripts/make-dist.mjs import fs from "node:fs"; import path from "node:path"; const distDir = path.resolve("dist"); if (!fs.existsSync(distDir)) fs.mkdirSync(distDir, { recursive: true }); const indexJs = `/* Auto-generated by scripts/make-dist.mjs */ export { default as Button } from "../src/components/Button.astro"; export { default as Form } from "../src/components/Form.astro"; export { default as Field } from "../src/components/Field.astro"; export { default as MultiSelect } from "../src/components/MultiSelect.astro"; export { default as Icon } from "../src/components/Icon.astro"; export { cn } from "../src/utils/cn.js"; `; const indexDts = `/* Auto-generated types (lightweight) */ /// export const Button: any; export const Form: any; export const Field: any; export const MultiSelect: any; export const Icon: any; export function cn(...classes: Array): string; `; fs.writeFileSync(path.join(distDir, "index.js"), indexJs, "utf8"); fs.writeFileSync(path.join(distDir, "index.d.ts"), indexDts, "utf8"); console.log("🧱 Wrote dist/index.js and dist/index.d.ts");