feat(ui): export component prop types

This commit is contained in:
vince 2026-06-20 07:37:15 +02:00
parent 6a0c57e93c
commit 86e5f2de02
5 changed files with 51 additions and 31 deletions

View file

@ -1,8 +1,8 @@
export { Badge } from "./Badge"; export * from "./Badge";
export { Button } from "./Button"; export * from "./Button";
export { IconButton } from "./IconButton"; export * from "./IconButton";
export { IconGlyph } from "./IconGlyph"; export * from "./IconGlyph";
export { ProgressMeter } from "./ProgressMeter"; export * from "./ProgressMeter";
export { Separator } from "./Separator"; export * from "./Separator";
export { StatusBadge } from "./StatusBadge"; export * from "./StatusBadge";
export { ThemeToggle } from "./ThemeToggle"; export * from "./ThemeToggle";

View file

@ -1,10 +1,10 @@
export { CornerBracketFrame } from "./CornerBracketFrame"; export * from "./CornerBracketFrame";
export { DashboardFrame } from "./DashboardFrame"; export * from "./DashboardFrame";
export { DashboardHeader } from "./DashboardHeader"; export * from "./DashboardHeader";
export { DiagonalStripeField } from "./DiagonalStripeField"; export * from "./DiagonalStripeField";
export { FooterCell } from "./FooterCell"; export * from "./FooterCell";
export { FooterStatusCell } from "./FooterStatusCell"; export * from "./FooterStatusCell";
export { GridFrame } from "./GridFrame"; export * from "./GridFrame";
export { ModuleCard } from "./ModuleCard"; export * from "./ModuleCard";
export { Panel } from "./Panel"; export * from "./Panel";
export { ScanlineField } from "./ScanlineField"; export * from "./ScanlineField";

View file

@ -1,6 +1,6 @@
export { ServiceGroupPanel } from "./ServiceGroupPanel"; export * from "./ServiceGroupPanel";
export { ServicePanel } from "./ServicePanel"; export * from "./ServicePanel";
export { ServiceRow } from "./ServiceRow"; export * from "./ServiceRow";
export { StatusStrip } from "./StatusStrip"; export * from "./StatusStrip";
export { SystemState } from "./SystemState"; export * from "./SystemState";
export { WeatherModule } from "./WeatherModule"; export * from "./WeatherModule";

View file

@ -1,6 +1,6 @@
export { LineChart } from "./LineChart"; export * from "./LineChart";
export { SignalTrace } from "./SignalTrace"; export * from "./SignalTrace";
export { Sparkline } from "./Sparkline"; export * from "./Sparkline";
export { TelemetryCard } from "./TelemetryCard"; export * from "./TelemetryCard";
export { TelemetryGrid } from "./TelemetryGrid"; export * from "./TelemetryGrid";
export { TelemetryStrip } from "./TelemetryStrip"; export * from "./TelemetryStrip";

View file

@ -131,12 +131,32 @@ describe("Storybook inventory", () => {
for (const componentName of componentsByDomain.get(domain) ?? []) { for (const componentName of componentsByDomain.get(domain) ?? []) {
expect(domainIndexSource).toContain( expect(domainIndexSource).toContain(
`export { ${componentName} } from "./${componentName}";`, `export * from "./${componentName}";`,
); );
} }
} }
}); });
test("exports component prop interfaces through grouped package entrypoints", () => {
for (const component of componentInventory()) {
const source = readFileSync(component.path, "utf8");
const propTypeName = `${component.name}Props`;
if (!source.match(new RegExp(`export\\\\s+(interface|type)\\\\s+${propTypeName}\\\\b`))) {
continue;
}
const domainIndexSource = readFileSync(
join(componentsDir, component.domain, "index.ts"),
"utf8",
);
expect(domainIndexSource).toContain(
`export * from "./${component.name}";`,
);
}
});
test("keeps Storybook fixtures generic and content-free", () => { test("keeps Storybook fixtures generic and content-free", () => {
const storyText = readdirSync(storiesDir) const storyText = readdirSync(storiesDir)
.filter((filename) => filename.endsWith(".tsx") || filename.endsWith(".ts")) .filter((filename) => filename.endsWith(".tsx") || filename.endsWith(".ts"))