You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Field | — | disabled, position | Field.Label, Field.Description, Field.HelperMessage | — | active |
27
28
| Icon | Icon component for EDS 2.0 | color, data, size, title | — | — | active |
@@ -41,7 +42,7 @@ This file is the canonical "what already exists" reference for AI coding assista
41
42
## Field reference
42
43
43
44
-**Description** — first paragraph of the JSDoc above the component's `forwardRef` declaration (also tries `<Name>Component` / `<Name>Root` for compound components), with the `<Name>Props` type alias as fallback. `—` means no JSDoc is present yet; consider adding one.
44
-
-**Props** — EDS-defined props only, from the `<Name>Props` type literal. Intersected HTML attributes (`HTMLAttributes<...>`, `InputHTMLAttributes<...>`, etc.) and React-conventional props (`children`, `className`, `style`, `ref`, `key`) are NOT listed — assume the standard DOM props for the underlying element are available.
45
+
-**Props** — EDS-defined props only, from the `<Name>Props` type literal. Intersected HTML attributes (`HTMLAttributes<...>`, `InputHTMLAttributes<...>`, etc.) and React-conventional props (`children`, `className`, `style`, `ref`, `key`) are NOT listed — assume the standard DOM props for the underlying element are available. Known limitation: only inline type literals and intersections are walked — props coming from a referenced local type alias (`type FooProps = SharedBase & {...}`) or a union type are not expanded.
45
46
-**Sub-components** — compound sub-components attached via the `Compound<Name>` type pattern (e.g. `Field.Label`, `Banner.Icon`). Standalone components exported from the same directory (e.g. `MenuItem` from `./Menu`) appear as their own rows.
46
47
-**asChild** — `✓` if the component supports the `asChild` polymorphism pattern (see `Slot/README.md`).
47
48
-**Status** — `active` unless the props type carries an `@deprecated` JSDoc tag.
Copy file name to clipboardExpand all lines: scripts/generate-component-index.js
+82-7Lines changed: 82 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,13 @@
9
9
* (the top-level barrel — what consumers can actually import).
10
10
*
11
11
* Re-run via `pnpm run generate:component-index`. Also runs as part of
12
-
* `prebuild`, so any `pnpm run build` keeps the file fresh.
12
+
* `prebuild`, so a root `pnpm run build` keeps the file fresh (note:
13
+
* `pnpm run build:core-react` does NOT — pre-hooks only fire for the exact
14
+
* script name `build`).
15
+
*
16
+
* `--check` regenerates in memory and exits 1 if the committed file is
17
+
* stale, naming the affected components. Wired into the Checks workflow so
18
+
* a PR that changes the /next API surface without regenerating fails CI.
13
19
*/
14
20
15
21
constfs=require('fs')
@@ -272,7 +278,7 @@ function renderTable(rows) {
272
278
return[header,sep, ...body].join('\n')
273
279
}
274
280
275
-
functiongenerate(){
281
+
functionbuildContent(){
276
282
constpublicComponents=discoverPublicComponents()
277
283
constrows=publicComponents
278
284
.map(extractComponentData)
@@ -301,7 +307,7 @@ ${renderTable(rows)}
301
307
## Field reference
302
308
303
309
- **Description** — first paragraph of the JSDoc above the component's \`forwardRef\` declaration (also tries \`<Name>Component\` / \`<Name>Root\` for compound components), with the \`<Name>Props\` type alias as fallback. \`—\` means no JSDoc is present yet; consider adding one.
304
-
- **Props** — EDS-defined props only, from the \`<Name>Props\` type literal. Intersected HTML attributes (\`HTMLAttributes<...>\`, \`InputHTMLAttributes<...>\`, etc.) and React-conventional props (\`children\`, \`className\`, \`style\`, \`ref\`, \`key\`) are NOT listed — assume the standard DOM props for the underlying element are available.
310
+
- **Props** — EDS-defined props only, from the \`<Name>Props\` type literal. Intersected HTML attributes (\`HTMLAttributes<...>\`, \`InputHTMLAttributes<...>\`, etc.) and React-conventional props (\`children\`, \`className\`, \`style\`, \`ref\`, \`key\`) are NOT listed — assume the standard DOM props for the underlying element are available. Known limitation: only inline type literals and intersections are walked — props coming from a referenced local type alias (\`type FooProps = SharedBase & {...}\`) or a union type are not expanded.
305
311
- **Sub-components** — compound sub-components attached via the \`Compound<Name>\` type pattern (e.g. \`Field.Label\`, \`Banner.Icon\`). Standalone components exported from the same directory (e.g. \`MenuItem\` from \`./Menu\`) appear as their own rows.
306
312
- **asChild** — \`✓\` if the component supports the \`asChild\` polymorphism pattern (see \`Slot/README.md\`).
307
313
- **Status** — \`active\` unless the props type carries an \`@deprecated\` JSDoc tag.
@@ -314,12 +320,81 @@ ${renderTable(rows)}
314
320
- Storybook links
315
321
`
316
322
323
+
return{ content, rows }
324
+
}
325
+
326
+
/**
327
+
* Extract `componentName -> full table row` from generated markdown, so a
328
+
* failed --check can say which components are affected instead of just
0 commit comments