Compare commits

..

3 commits

Author SHA1 Message Date
3ff41e771b Merge pull request #39 from codex/ui-prop-type-exports
feat(ui): export component prop types
2026-06-20 07:41:51 +02:00
vince
5dccd70e0b test(ui): assert public prop exports are detected 2026-06-20 07:40:52 +02:00
vince
2535dccff2 feat(ui): export component prop types 2026-06-20 07:37:15 +02:00
5 changed files with 59 additions and 31 deletions

View file

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

View file

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

View file

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

View file

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

View file

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