// 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 ColorSwitcher } from "../src/components/ColorSwitcher.astro"; export { default as DatePicker } from "../src/components/DatePicker.astro"; export { default as DateTimePicker } from "../src/components/DateTimePicker.astro"; export { default as Dropdown } from "../src/components/Dropdown.astro"; export { default as Field } from "../src/components/Field.astro"; export { default as FieldRow } from "../src/components/FieldRow.astro"; export { default as FileUploader } from "../src/components/FileUploader.astro"; export { default as Form } from "../src/components/Form.astro"; export { default as MultiSelect } from "../src/components/MultiSelect.astro"; export { default as OtpField } from "../src/components/OtpField.astro"; export { default as PasswordField } from "../src/components/PasswordField.astro"; export { default as ThemeSwitcher } from "../src/components/ThemeSwitcher.astro"; export { default as TimePicker } from "../src/components/TimePicker.astro"; export { cn } from "../src/utils/cn.js"; `; const indexDts = `/* Auto-generated types (lightweight) */ /// export const Button: any; export const ColorSwitcher: any; export const DatePicker: any; export const DateTimePicker: any; export const Dropdown: any; export const Field: any; export const FieldRow: any; export const FileUploader: any; export const Form: any; export const MultiSelect: any; export const OtpField: any; export const PasswordField: any; export const ThemeSwitcher: any; export const TimePicker: 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");