feat(ui): export component prop types
This commit is contained in:
parent
7b96a7cb76
commit
2535dccff2
5 changed files with 51 additions and 31 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -131,12 +131,32 @@ 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", () => {
|
||||
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", () => {
|
||||
const storyText = readdirSync(storiesDir)
|
||||
.filter((filename) => filename.endsWith(".tsx") || filename.endsWith(".ts"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue