@estiva-app/ui 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/AppShell.d.ts.map +1 -1
- package/dist/AttachmentCard.d.ts.map +1 -1
- package/dist/Banner.d.ts +20 -2
- package/dist/Banner.d.ts.map +1 -1
- package/dist/ContainerHeader.d.ts +25 -0
- package/dist/ContainerHeader.d.ts.map +1 -0
- package/dist/EmptyState.d.ts +10 -1
- package/dist/EmptyState.d.ts.map +1 -1
- package/dist/Form.d.ts.map +1 -1
- package/dist/IconButton.d.ts +9 -1
- package/dist/IconButton.d.ts.map +1 -1
- package/dist/PreviewCard.d.ts +9 -2
- package/dist/PreviewCard.d.ts.map +1 -1
- package/dist/SectionHeader.d.ts +7 -1
- package/dist/SectionHeader.d.ts.map +1 -1
- package/dist/Select.d.ts +11 -3
- package/dist/Select.d.ts.map +1 -1
- package/dist/Tooltip.d.ts +13 -1
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/eslint/index.js +2 -1
- package/dist/eslint/index.js.map +2 -2
- package/dist/eslint/no-restyled-part.d.ts.map +1 -1
- package/dist/gates/app-checks.d.ts.map +1 -1
- package/dist/gates/{chunk-ZGJ2J5NU.js → chunk-EA33NP5B.js} +275 -11
- package/dist/gates/chunk-EA33NP5B.js.map +7 -0
- package/dist/gates/{chunk-AUXD4GCY.js → chunk-GTQZEHPC.js} +15 -1
- package/dist/gates/chunk-GTQZEHPC.js.map +7 -0
- package/dist/gates/cli.js +1 -1
- package/dist/gates/create-app.d.ts +2 -0
- package/dist/gates/create-app.d.ts.map +1 -1
- package/dist/gates/create-app.js +1 -1
- package/dist/gates/index.js +25 -3
- package/dist/gates/index.js.map +2 -2
- package/dist/gates/status.d.ts +2 -0
- package/dist/gates/status.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +196 -156
- package/dist/index.js.map +4 -4
- package/dist/registry/app-DQI6WLHR.js +10 -0
- package/dist/registry/app.d.ts +21 -0
- package/dist/registry/app.d.ts.map +1 -0
- package/dist/registry/build-LGFCCOLR.js +27 -0
- package/dist/registry/build-LGFCCOLR.js.map +7 -0
- package/dist/registry/build.d.ts +68 -2
- package/dist/registry/build.d.ts.map +1 -1
- package/dist/registry/{chunk-MRSBS5OP.js → chunk-E4JNV7PC.js} +68 -12
- package/dist/registry/chunk-E4JNV7PC.js.map +7 -0
- package/dist/registry/{chunk-QDYGB3QN.js → chunk-NJN4MQAM.js} +60 -15
- package/dist/registry/chunk-NJN4MQAM.js.map +7 -0
- package/dist/registry/{chunk-IJNCYVH4.js → chunk-W2B2G7OE.js} +34 -9
- package/dist/registry/chunk-W2B2G7OE.js.map +7 -0
- package/dist/registry/chunk-WMFF3MPP.js +648 -0
- package/dist/registry/chunk-WMFF3MPP.js.map +7 -0
- package/dist/registry/cli.js +81 -26
- package/dist/registry/cli.js.map +3 -3
- package/dist/registry/find.d.ts +12 -1
- package/dist/registry/find.d.ts.map +1 -1
- package/dist/registry/index.d.ts +5 -2
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +11 -3
- package/dist/registry/schema.d.ts +83 -6
- package/dist/registry/schema.d.ts.map +1 -1
- package/package.json +2 -2
- package/registry.json +283 -95
- package/src/AppShell.mdx +10 -0
- package/src/AppShell.test.tsx +16 -0
- package/src/AppShell.tsx +4 -1
- package/src/AttachmentCard.mdx +9 -0
- package/src/AttachmentCard.test.tsx +10 -0
- package/src/AttachmentCard.tsx +8 -5
- package/src/Avatar.mdx +13 -3
- package/src/AvatarGroup.mdx +4 -0
- package/src/Banner.mdx +30 -7
- package/src/Banner.stories.tsx +22 -0
- package/src/Banner.test.tsx +35 -0
- package/src/Banner.tsx +34 -9
- package/src/Breadcrumb.mdx +10 -0
- package/src/Button.mdx +14 -3
- package/src/Card.mdx +9 -0
- package/src/Checkbox.mdx +10 -0
- package/src/Chip.mdx +4 -0
- package/src/ChipInput.mdx +12 -0
- package/src/CollapsibleSection.mdx +9 -0
- package/src/CommandPalette.mdx +14 -2
- package/src/ConfirmDialog.mdx +11 -0
- package/src/ContainerHeader.mdx +60 -0
- package/src/ContainerHeader.stories.tsx +62 -0
- package/src/ContainerHeader.test.tsx +47 -0
- package/src/ContainerHeader.tsx +45 -0
- package/src/DialogShell.mdx +14 -0
- package/src/Divider.mdx +9 -1
- package/src/EditableText.mdx +11 -0
- package/src/EmptyState.mdx +27 -4
- package/src/EmptyState.stories.tsx +6 -1
- package/src/EmptyState.test.tsx +18 -1
- package/src/EmptyState.tsx +14 -1
- package/src/Field.mdx +10 -1
- package/src/FieldLine.mdx +9 -1
- package/src/FilePicker.mdx +8 -0
- package/src/Form.mdx +10 -0
- package/src/Form.test.tsx +26 -0
- package/src/Form.tsx +7 -0
- package/src/IconButton.mdx +16 -2
- package/src/IconButton.stories.tsx +3 -0
- package/src/IconButton.test.tsx +25 -0
- package/src/IconButton.tsx +61 -46
- package/src/IdentityMenu.mdx +9 -0
- package/src/InlineChip.mdx +8 -0
- package/src/Kbd.mdx +4 -0
- package/src/Link.mdx +10 -0
- package/src/Menu.mdx +16 -1
- package/src/MenuItem.mdx +12 -2
- package/src/NavItem.mdx +8 -0
- package/src/Person.mdx +4 -0
- package/src/PersonTrigger.mdx +9 -0
- package/src/Popover.mdx +21 -0
- package/src/PreviewCard.mdx +19 -4
- package/src/PreviewCard.tsx +11 -4
- package/src/ProgressBar.mdx +8 -0
- package/src/Property.mdx +4 -0
- package/src/Rail.mdx +9 -1
- package/src/RailItem.mdx +8 -0
- package/src/Reaction.mdx +9 -0
- package/src/ReactionPicker.mdx +8 -0
- package/src/ScrollArea.mdx +13 -2
- package/src/SearchInput.mdx +9 -0
- package/src/SectionHeader.mdx +13 -0
- package/src/SectionHeader.stories.tsx +9 -0
- package/src/SectionHeader.test.tsx +9 -0
- package/src/SectionHeader.tsx +8 -2
- package/src/SectionLabel.mdx +4 -0
- package/src/Select.mdx +21 -2
- package/src/Select.stories.tsx +4 -1
- package/src/Select.test.tsx +17 -0
- package/src/Select.tsx +34 -13
- package/src/Sidebar.mdx +8 -0
- package/src/Skeleton.mdx +4 -0
- package/src/Tabs.mdx +12 -1
- package/src/TextInput.mdx +8 -0
- package/src/Textarea.mdx +8 -0
- package/src/Toast.mdx +12 -1
- package/src/Toolbar.mdx +11 -0
- package/src/Tooltip.mdx +26 -2
- package/src/Tooltip.stories.tsx +26 -0
- package/src/Tooltip.test.tsx +29 -0
- package/src/Tooltip.tsx +17 -4
- package/src/TopBar.mdx +4 -0
- package/src/eslint/no-rebuilt-behaviour.ts +1 -1
- package/src/eslint/no-restyled-part.ts +1 -0
- package/src/gates/app-checks.ts +23 -1
- package/src/gates/create-app.test.ts +77 -6
- package/src/gates/create-app.ts +288 -15
- package/src/gates/status.ts +16 -0
- package/src/index.ts +1 -0
- package/src/pages.test.ts +142 -0
- package/src/registry/app.test.ts +562 -0
- package/src/registry/app.ts +854 -0
- package/src/registry/build.ts +114 -25
- package/src/registry/cli.ts +105 -42
- package/src/registry/find.ts +45 -8
- package/src/registry/index.ts +8 -1
- package/src/registry/registry.test.ts +5 -5
- package/src/registry/schema.ts +163 -12
- package/tailwind-preset.js +22 -1
- package/dist/gates/chunk-AUXD4GCY.js.map +0 -7
- package/dist/gates/chunk-ZGJ2J5NU.js.map +0 -7
- package/dist/registry/build-GOVLABI6.js +0 -13
- package/dist/registry/chunk-IJNCYVH4.js.map +0 -7
- package/dist/registry/chunk-MRSBS5OP.js.map +0 -7
- package/dist/registry/chunk-QDYGB3QN.js.map +0 -7
- /package/dist/registry/{build-GOVLABI6.js.map → app-DQI6WLHR.js.map} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/registry/find.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * The catalogue's reader (UIG-12): `ui:find <words>`.\n *\n * It exists to prove the format. A schema nobody consumes is a schema nobody\n * has tested, and the questions it has to answer are regression tests, not the\n * scope: \"floating panel\" must find `Popover`, \"scrolling\" `ScrollArea`,\n * \"empty\" `EmptyState`.\n *\n * It is also the answer to \"what do we have for this?\", which is the question\n * the wall cannot answer: a lint rule refuses the wrong thing, and this is\n * where the right one is named (UIG-20 makes a session ask it first).\n */\nimport type { Registry, RegistryEntry } from './schema'\n\nexport interface Finding {\n entry: RegistryEntry\n /** How many of the query's words matched anywhere. Ranked on this first. */\n matched: number\n score: number\n /** Which fields matched, for the reader to say why. */\n where: string[]\n /**\n * The props the query named **by name**, so the answer shows those rather\n * than all of them. A prop whose note merely carries one of the words counts\n * towards the score and is not shown: on \"floating panel\", six of `Popover`'s\n * notes say \"panel\", and printing all six buries the answer.\n */\n props: string[]\n}\n\n/**\n * Words that are in nearly every sentence, and so tell a search nothing.\n *\n * Measured: `ui:find \"truncate a long link\"` printed `Link`'s `external` prop,\n * because its note says \"in **a** new tab\" and the one-letter word matched\n * itself exactly. The minimum length in `alike` only guards a *prefix* match;\n * an exact match short-circuits it, which is right for `tab` and useless for `a`.\n */\nconst STOP = new Set([\n 'a', 'an', 'and', 'are', 'as', 'at', 'be', 'but', 'by', 'can', 'do', 'for', 'from', 'how', 'i', 'if', 'in', 'is', 'it', 'its', 'me', 'my', 'no', 'not', 'of',\n 'on', 'or', 'our', 'so', 'that', 'the', 'their', 'them', 'then', 'there', 'they', 'this', 'to', 'up', 'was', 'we', 'what', 'when', 'which', 'with', 'you', 'your',\n])\n\n/**\n * The words of a piece of text, with names taken apart.\n *\n * `CommandPalette` is kept whole *and* split, so \"palette\" reaches it and\n * \"commandpalette\" still does. Prose is already words; this costs it nothing.\n */\nfunction words(text: string): string[] {\n const found: string[] = []\n for (const token of text.match(/[A-Za-z0-9]+/g) ?? []) {\n found.push(token.toLowerCase())\n const parts = token.split(/(?<=[a-z0-9])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/)\n if (parts.length > 1) found.push(...parts.map((part) => part.toLowerCase()))\n }\n return found\n}\n\n/**\n * Whether a word of the query means a word of the text.\n *\n * Either being a prefix of the other covers \"scroll\" against \"scrolling\"; the\n * five-letter key covers \"scrolls\" against \"scrolling\", where neither is. Crude\n * on purpose \u2014 a stemmer is a dependency and a surprise, and the failure here\n * is an extra row in a list of five, not a wrong answer.\n *\n * **Three letters at least**, or a prefix match is no match at all: `person's`\n * puts the word \"s\" in the text, and every query on earth starts with some\n * letter. Measured \u2014 before this, \"scrolling\" found `Avatar`.\n */\nfunction alike(query: string, text: string): boolean {\n if (query === text) return true\n if (Math.min(query.length, text.length) < 3) return false\n if (text.startsWith(query) || query.startsWith(text)) return true\n return query.slice(0, 5) === text.slice(0, 5)\n}\n\nconst hit = (query: string, text: string) => words(text).some((word) => alike(query, word))\n\n/**\n * Search name, purpose, behaviours and variants.\n *\n * A row that answers more of the question comes first, whatever it scored:\n * \"floating panel\" has to reach `Popover`, whose purpose carries both words,\n * over `MenuPanel`, whose name carries one of them loudly.\n */\nexport function findInRegistry(registry: Registry, query: string, { limit = 5 }: { limit?: number } = {}): Finding[] {\n const all = words(query)\n // Drop the words that mean nothing. If the question was only those, keep them\n // rather than answer nothing at all.\n const carrying = all.filter((word) => word.length >= 3 && !STOP.has(word))\n const asked = carrying.length ? carrying : all\n if (asked.length === 0) return []\n\n const findings: Finding[] = []\n for (const entry of registry.entries) {\n let score = 0\n let matched = 0\n const where = new Set<string>()\n const byName = new Set<string>()\n const byNote = new Set<string>()\n for (const word of asked) {\n let best = 0\n if (entry.name.toLowerCase() === word) {\n best = 100\n where.add('name')\n } else if (hit(word, entry.name)) {\n best = 40\n where.add('name')\n }\n if (hit(word, entry.purpose)) {\n best = Math.max(best, 20)\n where.add('purpose')\n }\n for (const owned of entry.ownsBehaviours) {\n if (hit(word, owned.behaviour) || hit(word, owned.id)) {\n best = Math.max(best, 15)\n where.add('behaviour')\n }\n }\n for (const variant of entry.variants) {\n if (variant.values.some((value) => hit(word, value)) || hit(word, variant.prop)) {\n best = Math.max(best, 8)\n where.add('variant')\n byName.add(variant.prop)\n }\n }\n // What it can do. \"does Link already truncate?\" is the question this\n // answers, and answering it is what stops the thing being built twice.\n for (const prop of entry.props) {\n // A prop the question named by name is the answer; one whose note\n // happens to carry the word is a hint. Named ones go first, so a short\n // answer shows the right lines.\n if (hit(word, prop.name)) {\n best = Math.max(best, 14)\n where.add('prop')\n byName.add(prop.name)\n } else if (prop.note !== null && hit(word, prop.note)) {\n best = Math.max(best, 10)\n where.add('prop')\n byNote.add(prop.name)\n }\n }\n if (best > 0) matched += 1\n score += best\n }\n if (matched > 0) findings.push({ entry, matched, score, where: [...where], props: [...byName] })\n }\n\n findings.sort((a, b) => b.matched - a.matched || b.score - a.score || a.entry.name.localeCompare(b.entry.name))\n return findings.slice(0, limit)\n}\n\n/** `http://localhost:6008/?path=/docs/overlays-popover--docs`, or `null` where the entry has no page. */\nexport function docsLink(registry: Registry, entry: RegistryEntry): string | null {\n if (!entry.docsId) return null\n return registry.storybook.devUrl + registry.storybook.docsPath.replace('{docsId}', entry.docsId)\n}\n\n/** What the command prints: the import line first, because that is what the reader came for. */\nexport function formatFindings(registry: Registry, findings: Finding[], query: string): string {\n if (findings.length === 0) {\n return [\n `Nothing in ${registry.builtFrom.repo} matches \"${query}\".`,\n 'If nothing here does what you need, say so and ask \u2014 do not invent a component.',\n ].join('\\n')\n }\n\n const blocks = findings.map((finding) => {\n const { entry } = finding\n const lines = [\n `${entry.name} \u00B7 ${entry.kind} \u00B7 ${entry.repo} (matched ${finding.where.join(', ')})`,\n ` ${entry.purpose}`,\n ` import { ${entry.name} } from '${entry.importPath}'`,\n ]\n if (entry.ownsBehaviours.length) lines.push(` owns: ${entry.ownsBehaviours.map((owned) => owned.behaviour).join(' \u00B7 ')}`)\n if (entry.variants.length) lines.push(` ${entry.variants.map((variant) => `${variant.prop}: ${variant.values.join(' | ')}`).join(' ')}`)\n // The props the question named, with their own line \u2014 not all of them. A\n // component with twenty props would bury its own answer.\n const shown = finding.props\n .filter((name) => !entry.variants.some((variant) => variant.prop === name))\n .slice(0, 3)\n .map((name) => entry.props.find((prop) => prop.name === name))\n for (const prop of shown) {\n if (prop) lines.push(` ${prop.name}: ${prop.takes}${prop.note ? ` \u2014 ${prop.note}` : ''}`)\n }\n if (entry.props.length) lines.push(` ${entry.props.length} props in all; see the page for the rest`)\n const link = docsLink(registry, entry)\n if (link) lines.push(` ${link}`)\n return lines.join('\\n')\n })\n\n return blocks.join('\\n\\n')\n}\n"],
|
|
5
|
-
"mappings": ";;;AAsCA,IAAM,OAAO,oBAAI,IAAI;AAAA,EACnB;AAAA,EAAK;AAAA,EAAM;AAAA,EAAO;AAAA,EAAO;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAO;AAAA,EAAM;AAAA,EAAO;AAAA,EAAM;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAO;AAAA,EAAK;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAO;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAO;AAAA,EACxJ;AAAA,EAAM;AAAA,EAAM;AAAA,EAAO;AAAA,EAAM;AAAA,EAAQ;AAAA,EAAO;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAM;AAAA,EAAM;AAAA,EAAO;AAAA,EAAM;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAS;AAAA,EAAQ;AAAA,EAAO;AAC7J,CAAC;AAQD,SAAS,MAAM,MAAwB;AACrC,QAAM,QAAkB,CAAC;AACzB,aAAW,SAAS,KAAK,MAAM,eAAe,KAAK,CAAC,GAAG;AACrD,UAAM,KAAK,MAAM,YAAY,CAAC;AAC9B,UAAM,QAAQ,MAAM,MAAM,iDAAiD;AAC3E,QAAI,MAAM,SAAS,EAAG,OAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC;AAAA,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AM,0CAA0C;AACpG,UAAM,OAAO,SAAS,UAAU,KAAK;AACrC,QAAI,KAAM,OAAM,KAAK,KAAK,IAAI,EAAE;AAChC,WAAO,MAAM,KAAK,IAAI;AAAA,EACxB,CAAC;AAED,SAAO,OAAO,KAAK,MAAM;AAC3B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/registry/schema.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * The catalogue's shape (UIG-12, seam S2 in docs/GATES.md \u00A716).\n *\n * A **data source read by machines first** and rendered second \u2014 not a\n * documentation generator. The skill (UIG-20), the copy detector (UIG-25) and\n * the merged search (UIG-19) all read this and nothing else, so the field\n * names are the contract and `schemaVersion` is what makes a change to them\n * detectable.\n *\n * Names are plain and ours. Open-sourcing is far off; when it comes, a\n * renaming pass is one version bump, and guessing at a public vocabulary now\n * would cost every reader between here and there.\n */\n\n/**\n * Raise this whenever a field is added, removed or given a new meaning. A\n * reader that knows version N and is handed N+1 must be able to say so rather\n * than silently read a field that moved.\n */\nexport const SCHEMA_VERSION = 1\n\n/** What a name is, which decides how a reader offers it. */\nexport type EntryKind =\n /** Draws something. Used in JSX. */\n | 'component'\n /** A React hook: `use\u2026`, callable only inside a component. */\n | 'hook'\n /** A function or a constant. Neither of the above. */\n | 'helper'\n\n/** Where an entry's one-line purpose was read from. */\nexport type PurposeSource =\n /** The `.mdx` page's opening paragraph \u2014 the name has a page of its own. */\n | 'page'\n /** The doc comment above the export \u2014 the name is documented on a sibling's page. */\n | 'comment'\n\nexport type EntryStatus = 'stable' | 'migrating' | 'deprecated'\n\n/** A prop that takes one of a known set of words, and the set. */\nexport interface EntryVariant {\n prop: string\n values: string[]\n}\n\n/**\n * One prop a component declares itself.\n *\n * **Itself**, not what it inherits: a component that extends\n * `ComponentPropsWithRef<'div'>` would otherwise drag in every DOM attribute,\n * which is noise in a catalogue whose whole point is a short answer.\n */\nexport interface EntryProp {\n name: string\n /**\n * What it takes, in a word a person reads: `true/false`, `number`, `text`,\n * `anything`, `a handler`, the words themselves for a set (`left | right`),\n * or the type as written where none of those fit.\n */\n takes: string\n required: boolean\n /** The first sentence of the prop's own comment, where it has one. */\n note: string | null\n}\n\n/** A behaviour this component owns, from UIG-8's enumeration. */\nexport interface EntryBehaviour {\n /** `OwnedBehaviour.id` \u2014 `portal`, `walking`, `scroll`\u2026 */\n id: string\n /** What a person notices it doing, in words. */\n behaviour: string\n}\n\nexport interface RegistryEntry {\n /** The exported name, exactly as `index.ts` exports it. */\n name: string\n /** Which library it came from. One repo per registry until UIG-13 merges them. */\n repo: string\n kind: EntryKind\n /** What a caller actually types. */\n importPath: string\n /** The file the name is declared in, relative to the repo. Several names share one file. */\n sourceFile: string\n /** One line: what it is for. Never empty \u2014 the build fails instead. */\n purpose: string\n purposeFrom: PurposeSource\n /**\n * Every prop it declares itself \u2014 what it can do. This is the field a reader\n * asks \"does it already do X?\" of, before writing X by hand.\n */\n props: EntryProp[]\n /**\n * The subset of `props` that takes one of a known set of words, structured.\n * Kept beside `props` because it is what a search ranks well on, and what a\n * caller most often needs named back at them.\n */\n variants: EntryVariant[]\n /** What it owns, so a caller never rebuilds it (UIG-8). Empty for most. */\n ownsBehaviours: EntryBehaviour[]\n status: EntryStatus\n /**\n * Which migration stage plans to change it.\n *\n * Always `null` here. The migration's plan lives in `K:/Estiva/migration\n * docs`, which is not in this repo and is not in CI \u2014 and a copy kept here by\n * hand is the drifting list this whole project exists to remove. The field\n * stays in the schema because a later ticket may have a source a build can\n * read; until then a reader gets an honest `null` rather than a stale number.\n */\n migrationStage: number | null\n /** The `.mdx` page's Storybook id, or `null` where the name has no page of its own. */\n docsId: string | null\n /** A story that shows it, by Storybook id. `null` where nothing renders it alone. */\n storyId: string | null\n /** The `.mdx` path, relative to the repo, or `null`. */\n docPage: string | null\n}\n\n/** A name that is exported and deliberately not an entry. Empty today; the count still has to reconcile. */\nexport interface RegistryExclusion {\n name: string\n reason: string\n}\n\nexport interface Registry {\n schemaVersion: number\n builtFrom: {\n repo: string\n /** The npm package the entries are imported from. */\n package: string\n packageVersion: string\n /** Value exports counted in `index.ts`. `entries + excluded` must equal it. */\n exports: number\n /** Type-only exports, which are not entries. Recorded so the count reconciles. */\n typeExports: number\n }\n /**\n * How to turn an id into a link. There is no Storybook on the internet yet\n * (UIG-19), so an absolute URL committed here would resolve nowhere: the\n * reader joins its own base to these.\n */\n storybook: {\n docsPath: string\n storyPath: string\n devUrl: string\n }\n entries: RegistryEntry[]\n excluded: RegistryExclusion[]\n}\n\nconst KINDS: EntryKind[] = ['component', 'hook', 'helper']\nconst STATUSES: EntryStatus[] = ['stable', 'migrating', 'deprecated']\nconst SOURCES: PurposeSource[] = ['page', 'comment']\n\nconst isString = (v: unknown): v is string => typeof v === 'string'\nconst isFilledString = (v: unknown): v is string => isString(v) && v.trim().length > 0\n\n/**\n * Check a registry against this schema. Returns every problem, not the first:\n * a build that reports one missing purpose per run costs one run per entry.\n *\n * An empty list is the only pass. CI runs this on the committed file.\n */\nexport function validateRegistry(value: unknown): string[] {\n const problems: string[] = []\n const fail = (message: string) => problems.push(message)\n\n if (typeof value !== 'object' || value === null) return ['the registry is not an object']\n const registry = value as Partial<Registry>\n\n if (registry.schemaVersion !== SCHEMA_VERSION) fail(`schemaVersion is ${String(registry.schemaVersion)}, expected ${SCHEMA_VERSION}`)\n\n const built = registry.builtFrom\n if (typeof built !== 'object' || built === null) fail('builtFrom is missing')\n else {\n if (!isFilledString(built.repo)) fail('builtFrom.repo is missing')\n if (!isFilledString(built.package)) fail('builtFrom.package is missing')\n if (!isFilledString(built.packageVersion)) fail('builtFrom.packageVersion is missing')\n if (typeof built.exports !== 'number') fail('builtFrom.exports is not a number')\n if (typeof built.typeExports !== 'number') fail('builtFrom.typeExports is not a number')\n }\n\n const book = registry.storybook\n if (typeof book !== 'object' || book === null) fail('storybook is missing')\n else {\n for (const key of ['docsPath', 'storyPath', 'devUrl'] as const) {\n if (!isFilledString(book[key])) fail(`storybook.${key} is missing`)\n }\n if (isString(book.docsPath) && !book.docsPath.includes('{docsId}')) fail('storybook.docsPath does not carry {docsId}')\n if (isString(book.storyPath) && !book.storyPath.includes('{storyId}')) fail('storybook.storyPath does not carry {storyId}')\n }\n\n const entries = registry.entries\n const excluded = registry.excluded\n if (!Array.isArray(entries)) return [...problems, 'entries is not an array']\n if (!Array.isArray(excluded)) return [...problems, 'excluded is not an array']\n if (entries.length === 0) fail('entries is empty')\n\n const seen = new Set<string>()\n for (const [i, raw] of entries.entries()) {\n const at = (field: string) => `entries[${i}] (${isString((raw as RegistryEntry)?.name) ? (raw as RegistryEntry).name : '?'}).${field}`\n if (typeof raw !== 'object' || raw === null) {\n fail(`entries[${i}] is not an object`)\n continue\n }\n const entry = raw as Partial<RegistryEntry>\n if (!isFilledString(entry.name)) fail(at('name') + ' is missing')\n else if (seen.has(entry.name)) fail(`${entry.name} appears twice`)\n else seen.add(entry.name)\n\n if (!isFilledString(entry.repo)) fail(at('repo') + ' is missing')\n if (!isFilledString(entry.importPath)) fail(at('importPath') + ' is missing')\n if (!isFilledString(entry.sourceFile)) fail(at('sourceFile') + ' is missing')\n // The reason this schema exists: an entry with no purpose is an entry the\n // search cannot find and the skill cannot quote.\n if (!isFilledString(entry.purpose)) fail(at('purpose') + ' is empty')\n if (!KINDS.includes(entry.kind as EntryKind)) fail(at('kind') + ` is ${String(entry.kind)}`)\n if (!SOURCES.includes(entry.purposeFrom as PurposeSource)) fail(at('purposeFrom') + ` is ${String(entry.purposeFrom)}`)\n if (!STATUSES.includes(entry.status as EntryStatus)) fail(at('status') + ` is ${String(entry.status)}`)\n if (!(entry.migrationStage === null || typeof entry.migrationStage === 'number')) fail(at('migrationStage') + ' is neither a number nor null')\n if (!Array.isArray(entry.props)) fail(at('props') + ' is not an array')\n else\n for (const prop of entry.props) {\n if (!isFilledString(prop?.name) || !isFilledString(prop?.takes) || typeof prop?.required !== 'boolean') fail(at('props') + ' has a malformed entry')\n else if (!(prop.note === null || isFilledString(prop.note))) fail(at('props') + `.${prop.name}.note is neither a string nor null`)\n }\n if (!Array.isArray(entry.variants)) fail(at('variants') + ' is not an array')\n else\n for (const variant of entry.variants) {\n if (!isFilledString(variant?.prop) || !Array.isArray(variant?.values) || variant.values.length === 0) fail(at('variants') + ' has a malformed entry')\n // variants is a view of props, never a second source that can disagree.\n else if (Array.isArray(entry.props) && !entry.props.some((prop) => prop?.name === variant.prop)) fail(at('variants') + `.${variant.prop} is not one of its props`)\n }\n if (!Array.isArray(entry.ownsBehaviours)) fail(at('ownsBehaviours') + ' is not an array')\n else for (const behaviour of entry.ownsBehaviours) {\n if (!isFilledString(behaviour?.id) || !isFilledString(behaviour?.behaviour)) fail(at('ownsBehaviours') + ' has a malformed entry')\n }\n for (const key of ['docsId', 'storyId', 'docPage'] as const) {\n const held = entry[key]\n if (!(held === null || isFilledString(held))) fail(at(key) + ' is neither a string nor null')\n }\n // \"Every storyUrl resolves, or is recorded as absent with a reason\" \u2014 the\n // reason is enforced rather than written down: only something that draws\n // nothing may have nowhere to be looked at. A component with no story is\n // already an error of UIG-5's component-has-a-story; this stops the\n // catalogue quietly carrying one.\n if (entry.kind === 'component' && (entry.docsId === null || entry.storyId === null)) {\n fail(at('docsId') + ' is null, and only a helper or a hook may have no page or story')\n }\n }\n\n for (const [i, raw] of excluded.entries()) {\n const gap = raw as Partial<RegistryExclusion>\n if (!isFilledString(gap?.name)) fail(`excluded[${i}].name is missing`)\n if (!isFilledString(gap?.reason)) fail(`excluded[${i}].reason is missing`)\n if (isString(gap?.name) && seen.has(gap.name)) fail(`${gap.name} is both an entry and excluded`)\n }\n\n // Completeness (the ticket's acceptance): every value export is either an\n // entry or an exclusion with a reason. Averaging the difference away is the\n // failure this check exists to make impossible.\n const counted = entries.length + excluded.length\n if (typeof built === 'object' && built !== null && typeof built.exports === 'number' && counted !== built.exports) {\n fail(`${entries.length} entries + ${excluded.length} excluded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registry/build.ts"],
|
|
4
|
-
"sourcesContent": ["/// <reference types=\"node\" />\n/**\n * The catalogue's builder (UIG-12): it reads the code and writes\n * `registry.json`. Nothing here is kept by hand, and CI rebuilds it and fails\n * on a difference, so the file cannot drift from what it describes.\n *\n * **Why a parser and not a regex.** This package's components are flat in\n * `src/`, with `.tsx`, `.mdx`, `.stories.tsx` and sometimes `.test.tsx` side by\n * side, and **a file is not a component**: eleven files export more than one\n * name \u2014 `Menu.tsx` alone exports seven \u2014 and `Skeleton.tsx` exports no\n * `Skeleton` at all. Pairing by filename gets `FieldLine`, `MenuItem` and every\n * one of those wrong. The target set is what `src/index.ts` exports, read with\n * TypeScript's own parser, and everything else is looked up from there.\n *\n * TypeScript is the app's own install, as it is for the gate pieces\n * (`build.mjs`): every package this names stays external.\n */\nimport { existsSync, readFileSync, readdirSync } from 'node:fs'\nimport { join } from 'node:path'\nimport ts from 'typescript'\nimport { OWNED_BEHAVIOURS } from '../eslint/index'\nimport { SCHEMA_VERSION, type EntryBehaviour, type EntryKind, type EntryProp, type EntryVariant, type Registry, type RegistryEntry } from './schema'\n\nexport interface BuildOptions {\n /** The repository's top folder. */\n root?: string\n /** The name this registry's entries are recorded under. One repo per registry until UIG-13. */\n repo?: string\n}\n\n/** One name as `index.ts` exports it. */\ninterface RawExport {\n name: string\n /** The sibling it comes from, without `./`. */\n module: string\n isType: boolean\n}\n\n/** What the parser found above and about one exported declaration. */\ninterface Declared {\n /** The doc comment, cleaned, or `''`. */\n doc: string\n deprecated: boolean\n /**\n * Its first parameter's type, as written. Kept as the node and resolved after\n * the whole file is walked: a props interface is often declared *below* the\n * component that takes it.\n */\n propsType?: ts.TypeNode\n}\n\nconst PACKAGE_IMPORT = '@estiva-app/ui'\n\n/**\n * Storybook's own `sanitize`, which is what turns a title and a story's export\n * name into the id in the URL. Copied rather than imported: `storybook` is a\n * dev dependency of this repo and must not become a runtime dependency of the\n * builder, which apps run. A test holds this to the ids a real Storybook build\n * produces.\n */\nfunction sanitize(name: string): string {\n return name\n .toLowerCase()\n .replace(/[ \u2019\u2013\u2014\u2015\u2032\u00BF'`~!@#$%^&*()_|+\\-=?;:'\",.<>{}[\\]\\\\/]/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-+/, '')\n .replace(/-+$/, '')\n}\n\n/**\n * Storybook's `storyNameFromExport`, which is lodash's `startCase`: an export\n * called `WithCounts` is the story \"With Counts\", and its id is\n * `navigation-tabs--with-counts`, not `--withcounts`.\n *\n * Measured against a real `storybook build` (2026-09-18): without this, 11 of\n * the 81 ids resolved nowhere \u2014 every export whose name is more than one word.\n * Written out rather than pulled from lodash or `@storybook/csf`, neither of\n * which may become a runtime dependency of a builder that apps run.\n */\nfunction storyNameFromExport(key: string): string {\n return key\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/([a-zA-Z])([0-9])/g, '$1 $2')\n .replace(/([0-9])([a-zA-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .trim()\n}\n\nconst toId = (title: string, name: string) => `${sanitize(title)}--${sanitize(storyNameFromExport(name))}`\n\n/** Read `src/index.ts`. Its `export { \u2026 } from './Sibling'` statements are the target set. */\nexport function readIndexExports(source: string): RawExport[] {\n const file = ts.createSourceFile('index.ts', source, ts.ScriptTarget.Latest, true)\n const found: RawExport[] = []\n for (const statement of file.statements) {\n if (!ts.isExportDeclaration(statement)) continue\n const from = statement.moduleSpecifier\n const clause = statement.exportClause\n if (!from || !ts.isStringLiteral(from) || !clause || !ts.isNamedExports(clause)) continue\n for (const element of clause.elements) {\n found.push({ name: element.name.text, module: from.text.replace(/^\\.\\//, ''), isType: statement.isTypeOnly || element.isTypeOnly })\n }\n }\n return found\n}\n\n/**\n * The doc comment immediately above a declaration, cleaned of its markers.\n * `''` when there is none.\n *\n * `headerPos` is where the **file's** own header comment starts, and a\n * declaration never gets to claim it. Measured: `Skeleton.tsx` opens with a\n * paragraph about the whole family and `export function SkeletonBar` follows it\n * directly, so the bar was given the family's description \u2014 right-looking, and\n * wrong. Refusing it turns that into a build failure with the export's name in\n * it, which is a line somebody then writes.\n */\nfunction docAbove(source: string, node: ts.Node, headerPos: number | null = null): string {\n const ranges = ts.getLeadingCommentRanges(source, node.getFullStart()) ?? []\n const jsdoc = ranges.filter((range) => source.slice(range.pos, range.pos + 3) === '/**').pop()\n if (!jsdoc) return ''\n if (headerPos !== null && jsdoc.pos === headerPos) return ''\n // Only a comment that sits against the declaration describes it: anything\n // with a blank line or another statement between them is about something else.\n const between = source.slice(jsdoc.end, node.getStart())\n if (between.trim() !== '') return ''\n return source\n .slice(jsdoc.pos, jsdoc.end)\n .split(/\\r?\\n/)\n .map((line) => line.trim().replace(/^\\/\\*\\*/, '').replace(/\\*\\/$/, '').replace(/^\\*/, '').trim())\n .join('\\n')\n .trim()\n}\n\n/**\n * The first sentence of a block of prose, which is the purpose.\n *\n * A sentence ends at `.`, `!` or `?` followed by a space and something that\n * starts a new one. A very short first sentence takes the next as well \u2014\n * \"A list of actions from a trigger.\" is a purpose; \"One row, two parts.\" is\n * not, on its own.\n */\nfunction firstSentence(prose: string): string {\n const flat = prose\n .split(/\\n\\s*\\n/)[0]\n .split('\\n')\n .filter((line) => !line.trim().startsWith('@'))\n .join(' ')\n .replace(/\\*\\*/g, '')\n .replace(/\\s+/g, ' ')\n .trim()\n const parts = flat.split(/(?<=[.!?])\\s+(?=[A-Z`'\"\u2018\u201C])/)\n let line = parts[0] ?? ''\n if (line.length < 40 && parts[1]) line = `${line} ${parts[1]}`\n return line.trim()\n}\n\n/** A page's opening paragraph: everything between its `# Heading` and the first blank line. */\nfunction pageOpening(mdx: string): string {\n const lines = mdx.split(/\\r?\\n/)\n const heading = lines.findIndex((line) => /^#\\s+\\S/.test(line))\n if (heading < 0) return ''\n const paragraph: string[] = []\n for (const line of lines.slice(heading + 1)) {\n const text = line.trim()\n if (text === '') {\n if (paragraph.length) break\n continue\n }\n // A canvas, an import or the next heading: the opening paragraph is over,\n // or there never was one.\n if (text.startsWith('<') || text.startsWith('#')) break\n paragraph.push(text)\n }\n return paragraph.join(' ')\n}\n\n/**\n * A property's name, however it is written.\n *\n * **A quoted name is a name.** `'aria-label'?: string` cannot be written as an\n * identifier, so a reader that takes identifiers only drops it \u2014 and with it\n * every accessible name this package declares. Found by comparing against\n * `react-docgen`, a parser with none of this one's assumptions: 13 props over\n * 10 files, two of them required (`Reaction`, `Toolbar`).\n */\nfunction propName(member: ts.TypeElement): string | null {\n if (!member.name) return null\n if (ts.isIdentifier(member.name) || ts.isStringLiteral(member.name)) return member.name.text\n return null\n}\n\n/** A union of string literals, following one local type alias if the property points at one. */\nfunction literalUnion(type: ts.TypeNode | undefined, aliases: Map<string, ts.TypeNode>, seen = new Set<string>()): string[] | null {\n if (!type) return null\n if (ts.isTypeReferenceNode(type) && ts.isIdentifier(type.typeName)) {\n const name = type.typeName.text\n if (seen.has(name)) return null\n seen.add(name)\n const alias = aliases.get(name)\n return alias ? literalUnion(alias, aliases, seen) : null\n }\n if (ts.isLiteralTypeNode(type) && ts.isStringLiteral(type.literal)) return [type.literal.text]\n if (!ts.isUnionTypeNode(type)) return null\n const values: string[] = []\n for (const member of type.types) {\n // `'small' | 'default' | undefined` is still a set of two words.\n if (member.kind === ts.SyntaxKind.UndefinedKeyword || member.kind === ts.SyntaxKind.NullKeyword) continue\n const inner = literalUnion(member, aliases, seen)\n if (!inner) return null\n values.push(...inner)\n }\n return values.length > 1 ? values : null\n}\n\n/** Everything one sibling file says about the names it exports. */\n/** A type\u2019s finished props and word-choices, read by the module that declares them. */\ninterface Resolved {\n props: EntryProp[]\n variants: EntryVariant[]\n}\n\n/** Ask another file of this package for a type it declares, already resolved. */\ntype Sibling = (module: string, typeName: string) => Resolved | undefined\n\nfunction readModule(source: string, sibling: Sibling = () => undefined) {\n const file = ts.createSourceFile('module.tsx', source, ts.ScriptTarget.Latest, true)\n const declarations = new Map<string, Declared>()\n const aliases = new Map<string, ts.TypeNode>()\n const shapes = new Map<string, ts.TypeElement[]>()\n /** What each interface extends, as written \u2014 `Omit<IdentityMenuProps, 'compact'>` and all. */\n const bases = new Map<string, ts.ExpressionWithTypeArguments[]>()\n /** Which module each imported name came from. */\n const importedFrom = new Map<string, string>()\n\n const propsTypeOf = (parameters: readonly ts.ParameterDeclaration[]): ts.TypeNode | undefined => parameters[0]?.type\n\n /**\n * The props type of `const X = \u2026`.\n *\n * A plain function expression carries it on its first parameter. `forwardRef`\n * carries it as its **second type argument** and leaves the inner function's\n * parameter bare \u2014 `TextInput`, whose `size` was missed until this read it.\n */\n const propsOfInitializer = (initializer: ts.Expression | undefined): ts.TypeNode | undefined => {\n if (!initializer) return undefined\n if (ts.isArrowFunction(initializer) || ts.isFunctionExpression(initializer)) return propsTypeOf(initializer.parameters)\n if (ts.isCallExpression(initializer)) {\n const callee = ts.isPropertyAccessExpression(initializer.expression) ? initializer.expression.name.text : ts.isIdentifier(initializer.expression) ? initializer.expression.text : ''\n if (callee === 'forwardRef' && initializer.typeArguments?.[1]) return initializer.typeArguments[1]\n // `memo(function X({ \u2026 }: Props) { \u2026 })` and anything else that wraps a\n // function written out at the call.\n const wrapped = initializer.arguments.find((argument) => ts.isArrowFunction(argument) || ts.isFunctionExpression(argument))\n if (wrapped) return propsTypeOf((wrapped as ts.ArrowFunction | ts.FunctionExpression).parameters)\n }\n return undefined\n }\n\n // The file's header comment: the first `/**` above the first thing that is\n // not an import. It belongs to the file, whatever export happens to follow it.\n const opening = file.statements.find((statement) => !ts.isImportDeclaration(statement))\n const headerPos = opening ? ((ts.getLeadingCommentRanges(source, opening.getFullStart()) ?? []).find((range) => source.slice(range.pos, range.pos + 3) === '/**')?.pos ?? null) : null\n\n for (const statement of file.statements) {\n if (ts.isImportDeclaration(statement) && ts.isStringLiteral(statement.moduleSpecifier)) {\n const bindings = statement.importClause?.namedBindings\n if (bindings && ts.isNamedImports(bindings)) {\n for (const element of bindings.elements) importedFrom.set(element.name.text, statement.moduleSpecifier.text)\n }\n }\n if (ts.isTypeAliasDeclaration(statement)) aliases.set(statement.name.text, statement.type)\n if (ts.isInterfaceDeclaration(statement)) {\n shapes.set(statement.name.text, [...statement.members])\n // The whole clause, not its name: `extends Omit<IdentityMenuProps,\n // 'compact'>` reads as the name `Omit` and loses both the type it wraps\n // and the key it drops.\n const extended = (statement.heritageClauses ?? []).flatMap((clause) => [...clause.types])\n if (extended.length) bases.set(statement.name.text, extended)\n }\n if (ts.isTypeAliasDeclaration(statement) && ts.isTypeLiteralNode(statement.type)) shapes.set(statement.name.text, [...statement.type.members])\n\n const exported = ts.canHaveModifiers(statement) && ts.getModifiers(statement)?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)\n if (!exported) continue\n const doc = docAbove(source, statement, headerPos)\n const deprecated = /(^|\\n)@deprecated\\b/.test(doc) || /\\*\\s*@deprecated\\b/.test(source.slice(Math.max(0, statement.getFullStart()), statement.getStart()))\n\n if (ts.isFunctionDeclaration(statement) && statement.name) {\n declarations.set(statement.name.text, { doc, deprecated, propsType: propsTypeOf(statement.parameters) })\n continue\n }\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n if (!ts.isIdentifier(declaration.name)) continue\n declarations.set(declaration.name.text, { doc, deprecated, propsType: propsOfInitializer(declaration.initializer) })\n }\n }\n }\n /**\n * A type's props and its word-choices, **resolved in the file that declares\n * them**.\n *\n * This is the whole shape of the thing, and the reason for it is a bug that\n * looked like nothing: a `ts.TypeElement` carries positions into *its own*\n * source text, so handing a sibling's node to this file's `getText`, `aliases`\n * and `docAbove` reads the wrong file at those offsets. `ToolbarButton` came\n * out with `variant: \"ats over what it a\"` and `children: \"omeAndEndK\"` \u2014\n * real prop names, and slices of another file for their types. Nothing caught\n * it: the names were right, and the cross-check against `react-docgen`\n * compared names.\n *\n * So a sibling never returns nodes. It returns finished props, read by the\n * module that owns them, and this file only merges them.\n */\n const EMPTY: Resolved = { props: [], variants: [] }\n\n /** The keys named by an `Omit`/`Pick` argument: `'a'` or `'a' | 'b'`. */\n const keysOf = (type: ts.TypeNode | undefined): string[] | null => {\n if (!type) return null\n if (ts.isLiteralTypeNode(type) && ts.isStringLiteral(type.literal)) return [type.literal.text]\n if (!ts.isUnionTypeNode(type)) return null\n const keys: string[] = []\n for (const member of type.types) {\n if (!ts.isLiteralTypeNode(member) || !ts.isStringLiteral(member.literal)) return null\n keys.push(member.literal.text)\n }\n return keys\n }\n\n /** `Omit` drops the keys it names, `Pick` keeps only them. Unreadable keys change nothing. */\n const narrow = (resolved: Resolved, how: 'Omit' | 'Pick', keys: string[] | null): Resolved => {\n if (!keys) return resolved\n const named = new Set(keys)\n const keep = (name: string) => (how === 'Omit' ? !named.has(name) : named.has(name))\n return { props: resolved.props.filter((prop) => keep(prop.name)), variants: resolved.variants.filter((variant) => keep(variant.prop)) }\n }\n\n /** The first of each name wins, so what a type declares itself beats what it inherits. */\n const merge = (parts: Resolved[]): Resolved => {\n const props: EntryProp[] = []\n const variants: EntryVariant[] = []\n const seenProp = new Set<string>()\n const seenVariant = new Set<string>()\n for (const part of parts) {\n for (const prop of part.props) if (!seenProp.has(prop.name)) (seenProp.add(prop.name), props.push(prop))\n for (const variant of part.variants) if (!seenVariant.has(variant.prop)) (seenVariant.add(variant.prop), variants.push(variant))\n }\n return { props, variants }\n }\n\n /**\n * What a prop takes, in a word a person reads. The type as written is the\n * fallback, not the answer: `(next: string) => void` tells a reader nothing\n * they cannot guess, and \"a handler\" tells them what to pass.\n */\n const takes = (type: ts.TypeNode | undefined, values: string[] | null): string => {\n if (values) return values.join(' | ')\n if (!type) return 'anything'\n const written = type.getText(file).replace(/\\s+/g, ' ').trim()\n if (written === 'boolean') return 'true/false'\n if (written === 'number') return 'number'\n if (written === 'string') return 'text'\n if (/^React(Node|Element)\\b/.test(written)) return 'anything'\n if (written.includes('=>')) return 'a handler'\n return written.length > 60 ? `${written.slice(0, 57)}\u2026` : written\n }\n\n /** Members of this file, read with this file's text and aliases. */\n const fromMembers = (members: readonly ts.TypeElement[]): Resolved => {\n const props: EntryProp[] = []\n const variants: EntryVariant[] = []\n for (const member of members) {\n const name = propName(member)\n if (name === null || !ts.isPropertySignature(member)) continue\n const values = literalUnion(member.type, aliases)\n const note = firstSentence(docAbove(source, member))\n props.push({ name, takes: takes(member.type, values), required: !member.questionToken, note: note || null })\n if (values) variants.push({ prop: name, values })\n }\n return { props, variants }\n }\n\n const resolveNode = (type: ts.TypeNode | undefined, seen: Set<string>): Resolved => {\n if (!type || seen.size > 12) return EMPTY\n // `{ tone?: 'primary' | 'secondary' }` written out at the parameter.\n if (ts.isTypeLiteralNode(type)) return fromMembers(type.members)\n if (ts.isIntersectionTypeNode(type)) return merge(type.types.map((side) => resolveNode(side, seen)))\n if (ts.isTypeReferenceNode(type) && ts.isIdentifier(type.typeName)) {\n const named = type.typeName.text\n if (named === 'Omit' || named === 'Pick') {\n return narrow(resolveNode(type.typeArguments?.[0], seen), named, keysOf(type.typeArguments?.[1]))\n }\n return resolveName(named, seen)\n }\n return EMPTY\n }\n\n /** A heritage clause is not a `TypeNode`, and carries the same `Omit<\u2026>` shapes. */\n const resolveBase = (base: ts.ExpressionWithTypeArguments, seen: Set<string>): Resolved => {\n if (!ts.isIdentifier(base.expression)) return EMPTY\n const named = base.expression.text\n if (named === 'Omit' || named === 'Pick') {\n return narrow(resolveNode(base.typeArguments?.[0], seen), named, keysOf(base.typeArguments?.[1]))\n }\n return resolveName(named, seen)\n }\n\n /**\n * A named type: its own props, plus everything it extends **within this\n * package**.\n *\n * It stops at React and Base UI on purpose. `ToolbarButtonProps extends\n * IconButtonProps` is ours, and `variant`, `pressed` and `tooltip` are things\n * `ToolbarButton` genuinely takes; `ButtonProps extends\n * ComponentPropsWithRef<'button'>` is the DOM, and listing `onCopy` and\n * `spellCheck` would bury the answer. The rule is where the type is declared,\n * not what it is called.\n */\n function resolveName(name: string, seen: Set<string>): Resolved {\n if (seen.has(name) || seen.size > 12) return EMPTY\n seen.add(name)\n const own = shapes.get(name)\n if (own) {\n const inherited = (bases.get(name) ?? []).map((base) => resolveBase(base, seen))\n return merge([fromMembers(own), ...inherited])\n }\n // `type ToolbarInputProps = TextInputProps` \u2014 an alias, not an interface.\n const alias = aliases.get(name)\n if (alias) return resolveNode(alias, seen)\n // Not declared here at all. Follow the import, but only into this package.\n const from = importedFrom.get(name)\n return (from?.startsWith('./') ? sibling(from.slice(2), name) : undefined) ?? EMPTY\n }\n\n /** What one declaration's first parameter takes. */\n const resolve = (propsType: ts.TypeNode | undefined): Resolved => resolveNode(propsType, new Set())\n\n return { declarations, resolve, resolveName: (name: string) => resolveName(name, new Set()) }\n}\n\n/** The `title` a stories file gives Storybook, and the stories it exports. */\nfunction readStories(source: string): { title: string | null; stories: string[] } {\n const file = ts.createSourceFile('x.stories.tsx', source, ts.ScriptTarget.Latest, true)\n let title: string | null = null\n const stories: string[] = []\n for (const statement of file.statements) {\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n if (!ts.isIdentifier(declaration.name)) continue\n const initializer = declaration.initializer\n const object = initializer && ts.isSatisfiesExpression(initializer) ? initializer.expression : initializer\n if (declaration.name.text === 'meta' && object && ts.isObjectLiteralExpression(object)) {\n for (const property of object.properties) {\n if (ts.isPropertyAssignment(property) && ts.isIdentifier(property.name) && property.name.text === 'title' && ts.isStringLiteral(property.initializer)) {\n title = property.initializer.text\n }\n }\n }\n const exported = ts.getModifiers(statement)?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)\n if (exported && declaration.name.text !== 'meta') stories.push(declaration.name.text)\n }\n }\n }\n return { title, stories }\n}\n\nconst isAllCaps = (name: string) => /^[A-Z0-9_]+$/.test(name)\n\n/** What a name is. A constant and a function are both helpers; only a `use\u2026` is a hook. */\nfunction kindOf(name: string): EntryKind {\n if (/^use[A-Z]/.test(name)) return 'hook'\n return /^[A-Z]/.test(name) && !isAllCaps(name) ? 'component' : 'helper'\n}\n\n/** What UIG-8's enumeration says this component owns. */\nfunction behavioursOf(name: string): EntryBehaviour[] {\n return OWNED_BEHAVIOURS.filter((owned) => owned.owners.includes(name)).map((owned) => ({ id: owned.id, behaviour: owned.behaviour }))\n}\n\n/**\n * Read the repository and return the catalogue.\n *\n * Throws on anything it cannot explain \u2014 a missing sibling, a name with no\n * purpose anywhere. A registry that quietly drops what it could not read is\n * worse than no registry, because a reader cannot tell the difference between\n * \"we have nothing for that\" and \"the builder gave up\".\n */\nexport function buildRegistry({ root = process.cwd(), repo = 'estiva-ui' }: BuildOptions = {}): Registry {\n const src = join(root, 'src')\n const manifest = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')) as { name: string; version: string }\n const files = new Set(readdirSync(src))\n const exported = readIndexExports(readFileSync(join(src, 'index.ts'), 'utf8'))\n const values = exported.filter((entry) => !entry.isType)\n\n type Module = ReturnType<typeof readModule> & { file: string }\n const modules = new Map<string, Module>()\n const moduleOf = (name: string): Module => {\n const held = modules.get(name)\n if (held) return held\n const file = ['.tsx', '.ts'].map((extension) => `${name}${extension}`).find((candidate) => files.has(candidate))\n if (!file) throw new Error(`src/index.ts exports from './${name}', which is not a file in src/`)\n // The callback lets one file's props type reach a type declared in another\n // \u2014 `ToolbarButtonProps extends IconButtonProps`. It is only called later,\n // by which time this module is in the cache, so the recursion terminates.\n const read = { ...readModule(readFileSync(join(src, file), 'utf8'), (module, typeName) => moduleOf(module).resolveName(typeName)), file: `src/${file}` }\n modules.set(name, read)\n return read\n }\n\n const problems: string[] = []\n const entries: RegistryEntry[] = []\n\n for (const value of values) {\n const module = moduleOf(value.module)\n const declared = module.declarations.get(value.name)\n if (!declared) {\n problems.push(`${value.name} is exported from './${value.module}' but is not declared there`)\n continue\n }\n\n // A name with a page of its own takes its purpose from the page; the rest\n // are documented on a sibling's page, and take it from the comment above\n // the export. Every one of them has one \u2014 the build fails below if not.\n const pageFile = files.has(`${value.name}.mdx`) ? `src/${value.name}.mdx` : null\n const fromPage = pageFile ? firstSentence(pageOpening(readFileSync(join(root, pageFile), 'utf8'))) : ''\n const fromComment = firstSentence(declared.doc)\n const purpose = fromPage || fromComment\n if (!purpose) {\n problems.push(`${value.name} has no purpose: no opening paragraph on its page, and no doc comment above it in ${module.file}`)\n continue\n }\n\n // A name with stories of its own uses them; otherwise the sibling's, which\n // is the page that documents it.\n const storiesFile = files.has(`${value.name}.stories.tsx`) ? `${value.name}.stories.tsx` : files.has(`${value.module}.stories.tsx`) ? `${value.module}.stories.tsx` : null\n const stories = storiesFile ? readStories(readFileSync(join(src, storiesFile), 'utf8')) : { title: null, stories: [] }\n const title = stories.title\n const story = stories.stories.includes(value.name) ? value.name : stories.stories[0]\n\n const shape = module.resolve(declared.propsType)\n\n entries.push({\n name: value.name,\n repo,\n kind: kindOf(value.name),\n importPath: PACKAGE_IMPORT,\n sourceFile: module.file,\n purpose,\n purposeFrom: fromPage ? 'page' : 'comment',\n props: shape.props,\n variants: shape.variants,\n ownsBehaviours: behavioursOf(value.name),\n status: declared.deprecated ? 'deprecated' : 'stable',\n migrationStage: null,\n docsId: title ? `${sanitize(title)}--docs` : null,\n storyId: title && story ? toId(title, story) : null,\n docPage: pageFile,\n })\n }\n\n if (problems.length) throw new Error(`the registry cannot be built:\\n ${problems.join('\\n ')}`)\n\n entries.sort((a, b) => a.name.localeCompare(b.name))\n\n return {\n schemaVersion: SCHEMA_VERSION,\n builtFrom: {\n repo,\n package: manifest.name,\n packageVersion: manifest.version,\n exports: values.length,\n typeExports: exported.length - values.length,\n },\n storybook: {\n docsPath: '/?path=/docs/{docsId}',\n storyPath: '/?path=/story/{storyId}',\n devUrl: 'http://localhost:6008',\n },\n entries,\n // Nothing is excluded: every value export is an entry, helpers and the one\n // hook included, each marked by `kind`. The field stays because the count\n // has to reconcile out loud \u2014 see validateRegistry.\n excluded: [],\n }\n}\n\n/** The committed file's text, so a check and a write produce the same bytes. */\nexport function serializeRegistry(registry: Registry): string {\n return `${JSON.stringify(registry, null, 2)}\\n`\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;AAiBA,S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