Files
netto/scripts/check-ui-exports.mjs
T
Maofeng b3a7a2a8f5 feat: add Base UI Tailwind component library
Add composable wrappers for 37 Base UI component families.

Expose primitive and convenience APIs with shared styling utilities.

Add the registry manifest, installer CLI, generation and export checks.

Include a smoke example covering primitive and shadcn-style imports.
2026-07-25 06:04:19 +08:00

34 lines
959 B
JavaScript

import { readdir, readFile } from "node:fs/promises"
import path from "node:path"
const uiComponentsPath = path.join("src", "components", "ui")
const componentEntries = await readdir(uiComponentsPath, { withFileTypes: true })
const components = componentEntries
.filter((entry) => entry.isDirectory())
.map((entry) => entry.name)
.sort((a, b) => a.localeCompare(b))
const failures = []
for (const component of components) {
const indexPath = path.join(uiComponentsPath, component, "index.ts")
try {
const source = await readFile(indexPath, "utf8")
if (!source.includes("export default")) {
failures.push(`${indexPath}: missing default export`)
}
} catch (error) {
if (error.code !== "ENOENT") {
throw error
}
failures.push(`${indexPath}: missing file`)
}
}
if (failures.length > 0) {
console.error(failures.join("\n"))
process.exit(1)
}
console.log(`Checked ${components.length} component exports.`)