@estiva-app/ui 0.45.0 → 0.47.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/dist/CollapsibleSection.d.ts +7 -1
- package/dist/CollapsibleSection.d.ts.map +1 -1
- package/dist/InlineChip.d.ts +1 -1
- package/dist/NavItem.d.ts +11 -1
- package/dist/NavItem.d.ts.map +1 -1
- package/dist/SectionHeader.d.ts +9 -1
- package/dist/SectionHeader.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-P5W6O5TF.js → chunk-BS5JASHV.js} +14 -9
- package/dist/gates/{chunk-P5W6O5TF.js.map → chunk-BS5JASHV.js.map} +3 -3
- package/dist/gates/cli.js +1 -1
- package/dist/gates/index.js +2 -1
- 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.js +76 -37
- package/dist/index.js.map +2 -2
- package/dist/looks.d.ts +3 -0
- package/dist/looks.d.ts.map +1 -1
- package/dist/registry/{chunk-XK747STJ.js → chunk-4QWD3EBY.js} +5 -1
- package/dist/registry/chunk-4QWD3EBY.js.map +7 -0
- package/dist/registry/cli.js +4 -3
- package/dist/registry/cli.js.map +2 -2
- package/dist/registry/contract.d.ts +7 -0
- package/dist/registry/contract.d.ts.map +1 -1
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +3 -1
- package/package.json +1 -1
- package/registry.json +51 -9
- package/skill/estiva-ui.md +14 -11
- package/src/Chip.tsx +1 -1
- package/src/CollapsibleSection.mdx +5 -0
- package/src/CollapsibleSection.stories.tsx +5 -0
- package/src/CollapsibleSection.tsx +10 -3
- package/src/CommandPalette.tsx +1 -1
- package/src/InlineChip.test.tsx +1 -1
- package/src/InlineChip.tsx +1 -1
- package/src/NavItem.mdx +9 -0
- package/src/NavItem.stories.tsx +23 -0
- package/src/NavItem.tsx +56 -6
- package/src/Reaction.tsx +1 -1
- package/src/SectionHeader.mdx +9 -0
- package/src/SectionHeader.stories.tsx +15 -0
- package/src/SectionHeader.tsx +28 -7
- package/src/eslint/no-restyled-part.ts +2 -1
- package/src/gates/app-checks.ts +1 -0
- package/src/gates/gates.test.ts +22 -0
- package/src/gates/status.ts +19 -8
- package/src/looks.ts +4 -0
- package/src/registry/cli.ts +2 -2
- package/src/registry/contract.test.ts +18 -2
- package/src/registry/contract.ts +10 -0
- package/src/registry/index.ts +1 -1
- package/src/registry/skill.test.ts +2 -0
- package/tailwind-preset.js +1 -0
- package/tokens.css +19 -4
- package/dist/registry/chunk-XK747STJ.js.map +0 -7
package/dist/looks.d.ts
CHANGED
|
@@ -33,4 +33,7 @@ export declare const FLOATING_SURFACE_CLASSES = "rounded-lg border border-border
|
|
|
33
33
|
export declare const CHIP_TEXT_CLASSES = "text-chip signal:font-mono signal:text-small signal:font-semibold signal:tabular-nums";
|
|
34
34
|
/** Words typed straight into an input with no box of its own: SearchInput and ChipInput. */
|
|
35
35
|
export declare const BARE_INPUT_CLASSES = "bg-transparent text-text-primary placeholder:text-text-muted outline-none";
|
|
36
|
+
/** A sidebar row's shape and its words at rest, brightening under the pointer: NavItem, and SectionHeader's `row` (a folder among rows). */
|
|
37
|
+
export declare const SIDEBAR_ROW_CLASSES = "rounded-md transition-colors";
|
|
38
|
+
export declare const SIDEBAR_ROW_TEXT_CLASSES = "text-text-secondary hover:text-text-primary";
|
|
36
39
|
//# sourceMappingURL=looks.d.ts.map
|
package/dist/looks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"looks.d.ts","sourceRoot":"","sources":["../src/looks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,2MAA2M,CAAA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33
33
|
return problems;
|
|
34
34
|
}
|
|
35
|
+
function nameableParts(app, pkg) {
|
|
36
|
+
return new Set([...pkg.entries, ...app.entries].map((e) => e.name));
|
|
37
|
+
}
|
|
35
38
|
function contractProblems(registry, root, known = new Set(registry.entries.map((e) => e.name))) {
|
|
36
39
|
const problems = [];
|
|
37
40
|
for (const entry of registry.entries) {
|
|
@@ -279,6 +282,7 @@ export {
|
|
|
279
282
|
pageProblem,
|
|
280
283
|
hasSeenIn,
|
|
281
284
|
linkProblems,
|
|
285
|
+
nameableParts,
|
|
282
286
|
contractProblems,
|
|
283
287
|
namedParts,
|
|
284
288
|
NO_ALTERNATIVE,
|
|
@@ -289,4 +293,4 @@ export {
|
|
|
289
293
|
docsLink,
|
|
290
294
|
formatFindings
|
|
291
295
|
};
|
|
292
|
-
//# sourceMappingURL=chunk-
|
|
296
|
+
//# sourceMappingURL=chunk-4QWD3EBY.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/registry/contract.ts", "../../src/registry/find.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * The usage-page contract, checked against an app's catalogue (UIG-19).\n *\n * Every part an app classifies **reusable** (or **promote-candidate**) has a\n * page beside it \u2014 `<PartName>.mdx` in the component's own folder \u2014 that opens\n * with a line saying what the part is, then `When`, `When not`, `How` (with\n * code) and `What it owns`, in that order. And it is drawn somewhere: a story\n * of its own, or a **Seen in** line on its page naming the stories that draw\n * it, or saying why none can (Katerina, 21 and 23 September 2026). A one-off\n * needs only its class and a purpose line, which the catalogue already refuses\n * to build without.\n *\n * This is the one copy. Peek and Ship each used to carry their own, pasted into\n * their `scripts/gates-checks.mjs` and run only by `gates:status`, so a page\n * could lose its `When not` and still merge. `estiva-ui check` runs this in\n * every app's `gate` job (docs/GATES.md \u00A723: one copy, in the package).\n *\n * The package's own pages keep the fuller contract in `src/pages.test.ts`,\n * which also reads `What it owns` back against the lint rule.\n */\nimport { existsSync, readFileSync } from 'node:fs'\nimport { join } from 'node:path'\nimport type { Registry } from './schema'\n\n/** The four headings, in the order a page carries them. */\nexport const PAGE_SECTIONS = ['When', 'When not', 'How', 'What it owns'] as const\n\n/** The classes that owe a page and a picture. */\nexport const CONTRACT_KINDS = ['reusable', 'promote-candidate'] as const\n\n/** The line that stands in for a story of the part's own. */\nconst SEEN_IN = /^\\*\\*Seen in\\*\\*/m\n\n/**\n * Why a page breaks the contract, or null when it keeps it.\n *\n * Read on normalised text: the apps are checked out with CRLF on Windows.\n */\nexport function pageProblem(source: string): string | null {\n const text = source.replace(/\\r\\n/g, '\\n')\n const heads = [...text.matchAll(/^##+\\s+(.+?)\\s*$/gm)].map((m) => m[1])\n const at = PAGE_SECTIONS.map((s) => heads.indexOf(s))\n const missing = PAGE_SECTIONS.filter((_, i) => at[i] < 0)\n if (missing.length) return `no ${missing.map((s) => `\"${s}\"`).join(', ')} section`\n if (at.some((i, n) => n > 0 && i < at[n - 1])) return `sections out of order: they go ${PAGE_SECTIONS.join(', ')}`\n // The opening line: the first paragraph under the title that is not markup.\n const opening = text\n .split(/^# .*$/m)[1]\n ?.split(/^##\\s/m)[0]\n ?.split(/\\n\\s*\\n/)\n .map((s) => s.trim())\n .find((s) => s && !s.startsWith('<') && !s.startsWith('import '))\n if (!opening) return 'no opening line under the title saying what the part is'\n // Only the How section: the code block must sit under How, not in a later section\n // (a page with none under How and one under What it owns passed, R18).\n const how = text.split(/^##\\s+How\\s*$/m)[1]?.split(/^##\\s/m)[0] ?? ''\n if (!/```tsx?\\n/.test(how)) return 'no code under \"How\"'\n return null\n}\n\n/** Whether a page records where the part is drawn, in place of a story of its own. */\nexport function hasSeenIn(source: string): boolean {\n return SEEN_IN.test(source.replace(/\\r\\n/g, '\\n'))\n}\n\n/**\n * Every catalogue link that names a story or a docs page its Storybook does not\n * have (UIG-19: a dead link is a build failure, not a dead end found six weeks\n * later). `ids` is every entry id in the Storybook's own index \u2014 what\n * `storybook index` writes \u2014 so this is Storybook's answer, not a guess at how\n * it builds an id.\n */\nexport function linkProblems(registry: Registry, ids: ReadonlySet<string>): string[] {\n const problems: string[] = []\n for (const entry of registry.entries) {\n for (const key of ['storyId', 'docsId'] as const) {\n const id = entry[key]\n if (id && !ids.has(id)) problems.push(`${entry.name} (${entry.sourceFile}) links to ${key === 'storyId' ? 'a story' : 'a docs page'} its Storybook does not have: ${id}`)\n }\n }\n return problems\n}\n\n/**\n * The parts an app's page may name under When and When not: the package's and\n * the app's own (B8). The one copy: `estiva-ui check` and `gates:status` both\n * read it, so they cannot disagree. Status once knew the app's parts only, and\n * read six of Peek's pages as broken that CI passed (UIG-26).\n */\nexport function nameableParts(app: Registry, pkg: Registry): Set<string> {\n return new Set([...pkg.entries, ...app.entries].map((e) => e.name))\n}\n\n/**\n * Every way an app's catalogue breaks the contract, one line each, naming the\n * part, its file and what to do. Empty when it keeps it.\n *\n * `root` is the app's own folder: the one its catalogue's paths are relative to.\n */\nexport function contractProblems(registry: Registry, root: string, known: ReadonlySet<string> = new Set(registry.entries.map((e) => e.name))): string[] {\n const problems: string[] = []\n for (const entry of registry.entries) {\n const cls = entry.app?.class\n if (!cls || !(CONTRACT_KINDS as readonly string[]).includes(cls)) continue\n // Where the page must be: beside the component, named after the part \u2014\n // the same place the catalogue looks (src/registry/app.ts).\n const page = join(entry.sourceFile.replace(/[^/\\\\]+$/, ''), `${entry.name}.mdx`).replace(/\\\\/g, '/')\n const where = `${entry.name} (${cls}, ${entry.sourceFile})`\n if (!existsSync(join(root, page))) {\n problems.push(`${where} has no usage page: write ${page}, with an opening line, then ${PAGE_SECTIONS.join(', ')}`)\n continue\n }\n const text = readFileSync(join(root, page), 'utf8')\n const problem = pageProblem(text)\n if (problem) problems.push(`${where}: ${page} has ${problem}`)\n const whenNot = whenNotProblem(text, [entry.name], known)\n if (whenNot) problems.push(`${where}: ${page}: ${whenNot}`)\n if (entry.storyId === null && !hasSeenIn(text)) {\n problems.push(`${where} is drawn nowhere: give it a story, or write a \"**Seen in**\" line on ${page} naming the stories that draw it, or why none can`)\n }\n // A reusable part links to its page or a story (Katerina's ruling B10, 25 September):\n // the catalogue reads the page's `<Meta title>`, so a page without one leaves it unlinked.\n if (entry.storyId === null && entry.docsId === null) {\n problems.push(`${where} links to nothing in Storybook: give ${page} a \\`<Meta title=\"\u2026\" />\\`, or give the part a story`)\n }\n }\n return problems\n}\n\n/** Storybook's id for a title: lower case, every run of other characters one hyphen. */\nconst toStoryId = (title: string) =>\n title\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n\n/** The names a page's section writes as a part: bold or in backticks, starting with a capital. */\nexport function namedParts(section: string): string[] {\n return [...section.matchAll(/\\*\\*`?([A-Z][A-Za-z0-9]+)`?\\*\\*|`([A-Z][A-Za-z0-9]+)`/g)].map((m) => m[1] ?? m[2])\n}\n\n/** The line a \"When not\" starts where no part stands in (Katerina's ruling B8). */\nexport const NO_ALTERNATIVE = /^No alternative:/m\n\n/**\n * Why a page's `When not` breaks the ruling B8 (25 September), or null. The plan\n * asked for \"When not \u2014 naming the alternative\"; CI checked only that the\n * heading was there, and 29 pages across the three repos named nothing. Now the\n * section names a real part other than the page's own (`own`), from `known`, or\n * a line of it starts \"No alternative:\" and says why there is none.\n */\nexport function whenNotProblem(source: string, own: readonly string[], known: ReadonlySet<string>): string | null {\n const section = source.replace(/\\r\\n/g, '\\n').split(/^##\\s+When not\\s*$/m)[1]?.split(/^##\\s/m)[0]\n // A missing section is pageProblem's to report.\n if (section === undefined || NO_ALTERNATIVE.test(section)) return null\n if (namedParts(section).some((name) => known.has(name) && !own.includes(name))) return null\n return '\"When not\" names no other part: name the part to use instead, as **Name** or `Name`, or start a line \"No alternative:\" that says why there is none'\n}\n\n/**\n * What an app's usage pages name that is not there (the re-review after the audit\n * before UIG-26, R14): a part named under When or When not that no catalogue has \u2014\n * Peek's StartTopicDialog sent readers to CreateTopicDialog, deleted by FOL-23 \u2014\n * and a story a **Seen in** line names that no Storybook has. `known` is every part\n * of the package and the app; `titles` is the app's Storybook titles, when there\n * is an index to read them from; `packageIds` the package's story and docs ids, so\n * a page may send readers to the package's Storybook too.\n */\nexport function nameProblems(registry: Registry, root: string, { known, titles, packageIds = [] }: { known: Set<string>; titles?: Set<string>; packageIds?: string[] }): string[] {\n const problems: string[] = []\n for (const entry of registry.entries) {\n if (!entry.docPage || !existsSync(join(root, entry.docPage))) continue\n const text = readFileSync(join(root, entry.docPage), 'utf8').replace(/\\r\\n/g, '\\n')\n for (const heading of ['When', 'When not']) {\n const section = text.split(new RegExp(`^##\\\\s+${heading}\\\\s*$`, 'm'))[1]?.split(/^##\\s/m)[0] ?? ''\n for (const name of new Set(namedParts(section).filter((n) => !known.has(n)))) {\n problems.push(`${entry.docPage}: \"${heading}\" names ${name}, which is no part of the package or this app`)\n }\n }\n if (!titles) continue\n const seenIn = text.match(/^\\*\\*Seen in\\*\\*[^\\n]*(?:\\n(?!\\n)[^\\n]*)*/m)?.[0] ?? ''\n for (const [, raw] of seenIn.matchAll(/\\*([A-Z][^*/]*\\/[^*]+)\\*/g)) {\n // A title may wrap across lines, and a line may break after its slash.\n const title = raw.replace(/\\s+/g, ' ').replace(/\\s*\\/\\s*/g, '/').trim()\n const id = toStoryId(title)\n if (titles.has(title) || packageIds.some((p) => p.startsWith(`${id}--`))) continue\n problems.push(`${entry.docPage}: \"Seen in\" names ${title}, which no Storybook has`)\n }\n }\n return problems\n}\n", "/**\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 return findInRegistries([registry], query, { limit })\n}\n\n/**\n * Search several catalogues as one: the package's, the app's own, and any app\n * beside it (UIG-13).\n *\n * An app's pass-on is not a result of its own \u2014 it is the package's part, and\n * the package's entry answers for it, saying which apps hand it on. At the\n * same strength the package's part comes first: it is the one to reach for.\n * And a package part whose name carries one of the words comes before an app's\n * part answering as many words, whatever each scored: \"panel header\" put an\n * app's own `Header`, whose whole name is one of the words, above the package's\n * `ContainerHeader` (UIG-20). Only by name: a package part the words reach\n * through its notes alone would bury the app part that is the answer.\n */\nexport function findInRegistries(registries: 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 const entries = registries.flatMap((registry) => registry.entries).filter((entry) => entry.app?.class !== 're-export')\n for (const entry of 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 const fromPackage = (finding: Finding) => (finding.entry.app === null ? 0 : 1)\n const namedInPackage = (finding: Finding) => (finding.entry.app === null && finding.where.includes('name') ? 0 : 1)\n findings.sort(\n (a, b) =>\n b.matched - a.matched || namedInPackage(a) - namedInPackage(b) || b.score - a.score || fromPackage(a) - fromPackage(b) || a.entry.name.localeCompare(b.entry.name),\n )\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 an app's part is, in the words the search prints. */\nconst CLASS_WORDS: Record<string, string> = {\n 'one-off': 'used in one place',\n reusable: 'used in several places',\n 'promote-candidate': 'used in several places; could move into the package',\n unused: 'used nowhere in the app',\n}\n\n/** What the command prints: the import line first, because that is what the reader came for. */\nexport function formatFindings(searched: Registry | Registry[], findings: Finding[], query: string): string {\n const registries = Array.isArray(searched) ? searched : [searched]\n if (findings.length === 0) {\n return [\n `Nothing in ${registries.map((registry) => registry.builtFrom.repo).join(', ')} 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 const registryOf = (entry: RegistryEntry) => registries.find((registry) => registry.builtFrom.repo === entry.repo) ?? registries[0]\n // Which apps hand a package part on, and from where: in Peek, `Button` is\n // imported from `@/components/ui/Button`, and the answer should say so.\n const handedOn = new Map<string, string[]>()\n for (const registry of registries) {\n for (const entry of registry.entries) {\n if (entry.app?.class !== 're-export' || entry.app.handsOn === null) continue\n handedOn.set(entry.app.handsOn, [...(handedOn.get(entry.app.handsOn) ?? []), `${entry.repo} hands it on${entry.name === entry.app.handsOn ? '' : ` as ${entry.name}`} from ${entry.importPath}`])\n }\n }\n\n const blocks = findings.map((finding) => {\n const { entry } = finding\n const facts = entry.app\n const lines = [\n `${entry.name} \u00B7 ${facts ? CLASS_WORDS[facts.class] ?? facts.class : entry.kind} \u00B7 ${entry.repo} (matched ${finding.where.join(', ')})`,\n ` ${entry.purpose}`,\n facts?.defaultExport ? ` import ${entry.name} from '${entry.importPath}'` : ` import { ${entry.name} } from '${entry.importPath}'`,\n ]\n if (!facts) for (const said of handedOn.get(entry.name) ?? []) lines.push(` ${said}`)\n if (facts?.packageNamesake) lines.push(` the package has a ${facts.packageNamesake} too: check it first`)\n if (facts && facts.usedIn.length) lines.push(` used in ${facts.usedIn.slice(0, 2).join(', ')}${facts.usedIn.length > 2 ? ` and ${facts.usedIn.length - 2} more` : ''}`)\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 ${entry.docsId ? 'the page' : entry.sourceFile} for the rest`)\n const link = docsLink(registryOf(entry), entry)\n if (link) lines.push(` ${link}`)\n return lines.join('\\n')\n })\n\n return blocks.join('\\n\\n')\n}\n"],
|
|
5
|
+
"mappings": ";;;AAoBA,SAAS,YAAY,oBAAoB;AACzC,SAAS,YAAY;AAId,IAAM,gBAAgB,CAAC,QAAQ,YAAY,OAAO,cAAc;AAGhE,IAAM,iBAAiB,CAAC,YAAY,mBAAmB;AAG9D,IAAM,UAAU;AAOT,SAAS,YAAY,QAA+B;AACzD,QAAM,OAAO,OAAO,QAAQ,SAAS,IAAI;AACzC,QAAM,QAAQ,CAAC,GAAG,KAAK,SAAS,oBAAoB,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AACtE,QAAM,KAAK,cAAc,IAAI,CAAC,MAAM,MAAM,QAAQ,CAAC,CAAC;AACpD,QAAM,UAAU,cAAc,OAAO,CAAC,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC;AACxD,MAAI,QAAQ,OAAQ,QAAO,MAAM,QAAQ,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,KAAK,IAAI,CAAC;AACxE,MAAI,GAAG,KAAK,CAAC,GAAG,MAAM,IAAI,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC,EAAG,QAAO,kCAAkC,cAAc,KAAK,IAAI,CAAC;AAEhH,QAAM,UAAU,KACb,MAAM,SAAS,EAAE,CAAC,GACjB,MAAM,QAAQ,EAAE,CAAC,GACjB,MAAM,SAAS,EAChB,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,EAAE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;AACA,QAAI,MAAM,MAAM,OAAQ,OAAM,KAAK,KAAK,MAAM,MAAM,MAAM,sBAAsB,MAAM,SAAS,aAAa,MAAM,UAAU,eAAe;AAC3I,UAAM,OAAO,SAAS,WAAW,KAAK,GAAG,KAAK;AAC9C,QAAI,KAAM,OAAM,KAAK,KAAK,IAAI,EAAE;AAChC,WAAO,MAAM,KAAK,IAAI;AAAA,EACxB,CAAC;AAED,SAAO,OAAO,KAAK,MAAM;AAC3B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/registry/cli.js
CHANGED
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
findInRegistries,
|
|
6
6
|
formatFindings,
|
|
7
7
|
linkProblems,
|
|
8
|
-
nameProblems
|
|
9
|
-
|
|
8
|
+
nameProblems,
|
|
9
|
+
nameableParts
|
|
10
|
+
} from "./chunk-4QWD3EBY.js";
|
|
10
11
|
import {
|
|
11
12
|
CLASSES,
|
|
12
13
|
validateRegistry
|
|
@@ -456,7 +457,7 @@ ${more.slice(0, 3).join("\n")}${more.length > 3 ? `
|
|
|
456
457
|
process.stdout.write(`${summary(registry)}
|
|
457
458
|
`);
|
|
458
459
|
const pkg = readPackageRegistry();
|
|
459
|
-
const known =
|
|
460
|
+
const known = nameableParts(registry, pkg);
|
|
460
461
|
const broken = contractProblems(registry, root, known);
|
|
461
462
|
if (broken.length) {
|
|
462
463
|
process.stderr.write(`${broken.length === 1 ? "a part breaks" : `${broken.length} parts break`} the usage-page contract:
|
package/dist/registry/cli.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/registry/cli.ts", "../../src/registry/siblings.ts", "../../src/registry/skill.ts", "../../src/registry/storymap.ts"],
|
|
4
|
-
"sourcesContent": ["/// <reference types=\"node\" />\n/**\n * `estiva-ui` \u2014 the catalogue as a command (UIG-12, UIG-13; docs/GATES.md \u00A723\n * for why it ships in the package rather than as a script pasted into each repo).\n *\n * estiva-ui find <words\u2026> [--here | --also [name=]<folder>\u2026] [--json] [--limit n]\n * estiva-ui build [--out <path>]\n * estiva-ui check\n * estiva-ui skill [--out <folder>]\n *\n * Every command takes `--root <folder>` (the library it reads; default: here)\n * and `--repo <name>` (what an app's entries are called; default: its package name).\n *\n * **In the package** (`@estiva-app/ui` itself): `build` writes the committed\n * `registry.json`, and `check` rebuilds it and fails on a single byte of drift.\n *\n * **In an app**: nothing is committed (Katerina, 18 September 2026 \u2014 the\n * package is public, the apps are private). `check` builds the app's catalogue\n * and fails when a part has no one-line description or cannot be sorted, or\n * when a reusable part breaks the usage-page contract (UIG-19, `./contract`),\n * or when the app's hand-written map of its Storybook no longer matches it\n * (`./storymap`); CI's `gate` job runs it. `build` writes the catalogue to a file only when asked.\n *\n * `find` searches the package's catalogue \u2014 the one shipped inside the installed\n * package, or this repo's own in the package \u2014 plus, in an app, the app's own,\n * built fresh, plus every app beside it (UIG-20, `./siblings`): found, not\n * named, so one command answers the same from any repository, or from the\n * folder that holds them. `--here` searches no neighbour; `--also` names them.\n *\n * `skill` writes the repository's Claude skill loader (UIG-20, `./skill`), or\n * the one for `--out <folder>`; `check` fails when the repository's is missing\n * or differs.\n */\nimport { spawnSync } from 'node:child_process'\nimport { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { basename, dirname, join, relative, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { CONTRACT_KINDS, contractProblems, linkProblems, nameProblems } from './contract'\nimport { findInRegistries, formatFindings } from './find'\nimport { behindBy, findSiblings, workspaceOf } from './siblings'\nimport { loaderPath, loaderProblem, loaderText, repositoryOf, settingsPath, settingsWithSearch } from './skill'\nimport { indexHeadings, storyMapProblems } from './storymap'\nimport { CLASSES, validateRegistry, type Registry } from './schema'\n\n/**\n * The builders, loaded only when they are used.\n *\n * They read TypeScript with TypeScript, and `typescript` is a dev dependency of\n * the app that installs this package \u2014 a real one in Peek, Ship and this repo,\n * and possibly absent elsewhere. A static import made the bundler put the whole\n * builder in the same chunk as `find`, so `npx estiva-ui find \u2026` died with\n * ERR_MODULE_NOT_FOUND before opening the file it needed.\n */\nconst packageBuilder = () => import('./build')\nconst appBuilder = () => import('./app')\nconst gatedScan = () => import('./gated')\n\nconst [command, ...rest] = process.argv.slice(2)\nconst VALUED = ['--limit', '--out', '--file', '--root', '--repo', '--also']\nconst flag = (name: string) => rest.includes(`--${name}`)\nconst value = (name: string) => {\n const at = rest.indexOf(`--${name}`)\n return at === -1 ? undefined : rest[at + 1]\n}\nconst values = (name: string) => rest.flatMap((word, i) => (word === `--${name}` && rest[i + 1] !== undefined ? [rest[i + 1]] : []))\n/** Everything that is not a flag or a flag's value: the words of the question. */\nconst plain = () => {\n const out: string[] = []\n for (let i = 0; i < rest.length; i++) {\n if (rest[i].startsWith('--')) {\n if (VALUED.includes(rest[i])) i += 1\n continue\n }\n out.push(rest[i])\n }\n return out\n}\n\nconst root = resolve(value('root') ?? '.')\nconst manifestAt = (folder: string) => JSON.parse(readFileSync(resolve(folder, 'package.json'), 'utf8')) as { name?: string }\n/** The package itself, or an app that installs it. */\nconst isPackage = existsSync(resolve(root, 'package.json')) && manifestAt(root).name === '@estiva-app/ui'\n\n/** The package's committed catalogue: `--file`, this repo's own in the package, else the copy inside the installed package. */\nfunction packageRegistryPath(): string {\n const named = value('file')\n if (named) return resolve(named)\n if (isPackage) return resolve(root, 'registry.json')\n // dist/registry/cli.js \u2192 the package's own root. Never an app's own folder:\n // a registry.json there is the app's, written by `estiva-ui build`.\n return fileURLToPath(new URL('../../registry.json', import.meta.url))\n}\n\nfunction readPackageRegistry(): Registry {\n const path = packageRegistryPath()\n if (!existsSync(path)) throw new Error(`no registry.json at ${path} \u2014 run \"estiva-ui build\" in the package first`)\n const registry = JSON.parse(readFileSync(path, 'utf8')) as Registry\n const problems = validateRegistry(registry)\n // A malformed catalogue is worse than none: it would answer, wrongly.\n if (problems.length) throw new Error(`${path} does not match the schema:\\n ${problems.join('\\n ')}`)\n return registry\n}\n\n/** The installed package whose skill text a loader reads: this repo in the package, else the app's install. */\nconst packageRoot = () => (isPackage ? root : resolve(root, 'node_modules', '@estiva-app', 'ui'))\n\n/** The Claude skill loader (UIG-20): reports, and says whether it passed. */\nfunction checkLoader(): boolean {\n const problem = loaderProblem(repositoryOf(root), packageRoot())\n if (problem) {\n process.stderr.write(`claude skill: ${problem}\\n`)\n return false\n }\n process.stdout.write('claude skill: the loader reads the package\u2019s text\\n')\n return true\n}\n\nasync function buildApp(folder: string, repo: string | undefined): Promise<Registry> {\n const { buildAppRegistry } = await appBuilder()\n const registry = buildAppRegistry({ root: folder, repo })\n const problems = validateRegistry(registry)\n if (problems.length) throw new Error(`the catalogue of ${registry.builtFrom.repo} does not match its own schema:\\n ${problems.join('\\n ')}`)\n return registry\n}\n\n/**\n * Every story and docs link in a catalogue, against the Storybook beside it\n * (UIG-19). `storybook index` writes the ids Storybook itself would serve \u2014 no\n * server, no browser, seconds \u2014 so a renamed story, or a page that no longer\n * compiles, fails here rather than as a dead link somebody finds later.\n * Reports, and says whether it passed. A folder with no Storybook has nothing\n * to check.\n */\nfunction checkLinks(registry: Registry, folder: string): { ok: boolean; headings?: Set<string>; titles?: Set<string> } {\n const bin = resolve(folder, 'node_modules', '.bin', process.platform === 'win32' ? 'storybook.cmd' : 'storybook')\n if (!existsSync(resolve(folder, '.storybook')) || !existsSync(bin)) {\n process.stdout.write('story links: no Storybook here, nothing to check\\n')\n return { ok: true }\n }\n const out = join(mkdtempSync(join(tmpdir(), 'estiva-ui-index-')), 'index.json')\n // A `.cmd` needs a shell on Windows, and Node wants that as one quoted line\n // rather than an argument list. Both paths are ours: the app's folder and a temp file.\n const run =\n process.platform === 'win32'\n ? spawnSync(`\"${bin}\" index -o \"${out}\" --quiet`, { cwd: folder, encoding: 'utf8', shell: true })\n : spawnSync(bin, ['index', '-o', out, '--quiet'], { cwd: folder, encoding: 'utf8' })\n if (run.status !== 0 || !existsSync(out)) {\n process.stderr.write(`story links: Storybook could not index its stories, so no link can be trusted:\\n${(run.stderr || run.stdout || '').trim()}\\n`)\n return { ok: false }\n }\n const entries = (JSON.parse(readFileSync(out, 'utf8')) as { entries: Record<string, { title?: string }> }).entries\n const ids = new Set(Object.keys(entries))\n const headings = indexHeadings(entries)\n const titles = new Set(Object.values(entries).flatMap((e) => (e.title ? [e.title] : [])))\n const dead = linkProblems(registry, ids)\n const count = registry.entries.reduce((n, entry) => n + (entry.storyId ? 1 : 0) + (entry.docsId ? 1 : 0), 0)\n if (dead.length) {\n process.stderr.write(`story links: ${dead.length} of ${count} lead nowhere:\\n ${dead.join('\\n ')}\\n`)\n return { ok: false, headings, titles }\n }\n process.stdout.write(`story links: all ${count} open a story or docs page Storybook has\\n`)\n return { ok: true, headings, titles }\n}\n\n/**\n * What a part draws only when a prop is passed, where no story passes it\n * (UIG-19, `./gated`). Strict, by Katerina's ruling: a part's own stories show\n * everything it can draw. In an app it reads the reusable parts; in the package,\n * every component (`kinds` is the package's one class, `component`).\n */\nasync function checkGated(registry: Registry, folder: string, kinds?: string[]): Promise<boolean> {\n const { gatedFindings } = await gatedScan()\n const found = gatedFindings(registry, folder, { ...(kinds ? { kinds } : {}), pictured: 'own' })\n if (found.length) {\n const lines = found.map((f) => `${f.part} (${f.file}) draws something only when given \\`${f.prop}\\`, and no story that draws it passes \\`${f.prop}\\`: pass it in a story`)\n process.stderr.write(`stories: ${found.length === 1 ? 'one thing a part draws is' : `${found.length} things parts draw are`} never shown:\\n ${lines.join('\\n ')}\\n`)\n return false\n }\n process.stdout.write('stories: everything a part draws behind a prop is shown by a story\\n')\n return true\n}\n\n/**\n * The repository's hand-written map of its Storybook \u2014 the heading order and the\n * Introduction \u2014 against the Storybook (its own index, when there is one) and,\n * in an app, the catalogue (`./storymap`). Reports, and says whether it passed.\n */\nfunction checkStoryMap(folder: string, registry?: Registry, headings?: Set<string>): boolean {\n const problems = storyMapProblems(folder, { ...(registry ? { registry } : {}), ...(headings ? { real: headings } : {}) })\n if (problems.length) {\n process.stderr.write(`storybook map: ${problems.length === 1 ? 'one line no longer matches' : `${problems.length} lines no longer match`}:\\n ${problems.join('\\n ')}\\n`)\n return false\n }\n process.stdout.write('storybook map: the heading order and the Introduction match the Storybook and the catalogue\\n')\n return true\n}\n\n/** One line per kind, in a fixed order, so two runs read the same. */\nfunction summary(registry: Registry): string {\n const count = (cls: string) => registry.entries.filter((entry) => entry.app?.class === cls).length\n const kinds = CLASSES.map((cls) => `${count(cls)} ${cls}`).join(', ')\n const files = registry.builtFrom.files ?? 0\n return `${registry.builtFrom.repo}: ${registry.entries.length} parts in ${files - registry.filesWithoutParts.length} files (${registry.filesWithoutParts.length} more hold none) \u2014 ${kinds}. Every part is described and sorted.`\n}\n\nasync function main(): Promise<number> {\n switch (command) {\n case 'find': {\n const query = plain().join(' ')\n if (!query.trim()) {\n process.stderr.write('estiva-ui find <words\u2026> \u2014 what the thing you need does, in words\\n')\n return 1\n }\n const registries: Registry[] = [readPackageRegistry()]\n // An app that cannot be read is said out loud, and the rest still answer.\n const add = async (folder: string, repo: string | undefined) => {\n const behind = behindBy(folder)\n if (behind) process.stderr.write(`note: ${repo ?? basename(folder)} (${folder}) is ${behind} commit${behind === 1 ? '' : 's'} behind main as last fetched \u2014 its answers may name parts that are gone; pull it\\n`)\n try {\n registries.push(await buildApp(folder, repo))\n } catch (error) {\n const [first, ...more] = String(error instanceof Error ? error.message : error).split('\\n')\n process.stderr.write(`not searched: ${first}${more.length ? `\\n${more.slice(0, 3).join('\\n')}${more.length > 3 ? `\\n \u2026and ${more.length - 3} more \u2014 run \"estiva-ui check\" there` : ''}` : ''}\\n`)\n }\n }\n // The folder it runs in is searched when it is an app; the folder that\n // holds the repositories is not one, and only its neighbours answer.\n const here = !isPackage && existsSync(resolve(root, 'package.json')) ? (manifestAt(root).name ?? basename(root)) : null\n if (here) await add(root, value('repo'))\n if (!values('also').length && !flag('here')) {\n for (const sibling of findSiblings(workspaceOf(root), { skip: here ? [here] : [] })) await add(sibling.folder, sibling.name)\n }\n for (const also of values('also')) {\n const [name, folder] = also.includes('=') ? [also.slice(0, also.indexOf('=')), also.slice(also.indexOf('=') + 1)] : [undefined, also]\n const at = resolve(root, folder)\n if (!existsSync(resolve(at, 'package.json'))) {\n process.stderr.write(`not searched: ${name ?? basename(at)} \u2014 nothing at ${at}\\n`)\n continue\n }\n await add(at, name)\n }\n const limit = Number(value('limit') ?? 5)\n const findings = findInRegistries(registries, query, { limit: Number.isFinite(limit) && limit > 0 ? limit : 5 })\n if (flag('json')) {\n process.stdout.write(`${JSON.stringify(findings.map((finding) => finding.entry), null, 2)}\\n`)\n return 0\n }\n process.stdout.write(`${formatFindings(registries, findings, query)}\\n`)\n // Nothing found is not a failure \u2014 it is the answer that sends a session\n // to ask rather than to invent.\n return 0\n }\n\n case 'build': {\n const out = resolve(root, value('out') ?? 'registry.json')\n if (isPackage) {\n const { buildRegistry, serializeRegistry } = await packageBuilder()\n const registry = buildRegistry({ root })\n const problems = validateRegistry(registry)\n if (problems.length) {\n process.stderr.write(`the registry this build produced does not match its own schema:\\n ${problems.join('\\n ')}\\n`)\n return 1\n }\n writeFileSync(out, serializeRegistry(registry), 'utf8')\n process.stdout.write(`${out}: ${registry.entries.length} entries from ${registry.builtFrom.exports} exports\\n`)\n return 0\n }\n const { serializeRegistry } = await packageBuilder()\n const registry = await buildApp(root, value('repo'))\n writeFileSync(out, serializeRegistry(registry), 'utf8')\n process.stdout.write(`${out}: ${summary(registry)}\\n`)\n return 0\n }\n\n case 'check': {\n if (!isPackage) {\n const registry = await buildApp(root, value('repo'))\n process.stdout.write(`${summary(registry)}\\n`)\n // The usage-page contract and the story links (UIG-19): the one copy, run by every app's `gate` job.\n // A When not may name a part of the package or of this app (B8).\n const pkg = readPackageRegistry()\n const known = new Set([...pkg.entries, ...registry.entries].map((e) => e.name))\n const broken = contractProblems(registry, root, known)\n if (broken.length) {\n process.stderr.write(`${broken.length === 1 ? 'a part breaks' : `${broken.length} parts break`} the usage-page contract:\\n ${broken.join('\\n ')}\\n`)\n } else {\n const owed = registry.entries.filter((entry) => (CONTRACT_KINDS as readonly string[]).includes(entry.app?.class ?? '')).length\n process.stdout.write(`usage pages: all ${owed} reusable parts keep the contract and are drawn somewhere\\n`)\n }\n const linked = checkLinks(registry, root)\n const shown = await checkGated(registry, root)\n const loaded = checkLoader()\n const mapped = checkStoryMap(root, registry, linked.headings)\n // What the pages name must still be there (R14): parts under When and When not,\n // and the stories a Seen in line sends a reader to, here or in the package.\n const stale = nameProblems(registry, root, {\n known,\n ...(linked.titles ? { titles: linked.titles } : {}),\n packageIds: pkg.entries.flatMap((e) => [e.storyId, e.docsId].filter((id): id is string => Boolean(id))),\n })\n if (stale.length) process.stderr.write(`usage pages: ${stale.length === 1 ? 'one name leads' : `${stale.length} names lead`} nowhere:\\n ${stale.join('\\n ')}\\n`)\n else process.stdout.write('usage pages: every part and story they name is there\\n')\n return broken.length || stale.length || !linked.ok || !shown || !loaded || !mapped ? 1 : 0\n }\n const { buildRegistry, serializeRegistry } = await packageBuilder()\n const path = packageRegistryPath()\n const built = buildRegistry({ root })\n const problems = validateRegistry(built)\n if (problems.length) {\n process.stderr.write(`the registry does not match its own schema:\\n ${problems.join('\\n ')}\\n`)\n return 1\n }\n if (!existsSync(path)) {\n process.stderr.write(`${path} is missing \u2014 run \"npm run registry\"\\n`)\n return 1\n }\n // Byte for byte. The point of the check is that the committed file cannot\n // drift from the code; \"near enough\" is drift.\n if (readFileSync(path, 'utf8').replace(/\\r\\n/g, '\\n') !== serializeRegistry(built)) {\n process.stderr.write(`${path} is not what the code produces \u2014 run \"npm run registry\" and commit the result\\n`)\n return 1\n }\n process.stdout.write(`${path}: current, ${built.entries.length} entries from ${built.builtFrom.exports} exports\\n`)\n const linked = checkLinks(built, root)\n const shown = await checkGated(built, root, ['component'])\n const loaded = checkLoader()\n // The package keeps a heading order too (R16): it left out Layout, and nothing saw.\n const mapped = checkStoryMap(root, undefined, linked.headings)\n return linked.ok && shown && loaded && mapped ? 0 : 1\n }\n\n case 'skill': {\n const out = value('out')\n const folder = out ? resolve(out) : repositoryOf(root)\n // The loader's path starts where the session does and cannot climb out:\n // Claude Code refuses a `..` in it.\n if (relative(folder, packageRoot()).startsWith('..')) {\n process.stderr.write(`${folder} does not hold ${packageRoot()}: a loader there could not reach the skill's text\\n`)\n return 1\n }\n const path = loaderPath(folder)\n mkdirSync(dirname(path), { recursive: true })\n writeFileSync(path, loaderText(folder, packageRoot()), 'utf8')\n process.stdout.write(`${path}: the Claude skill, read from ${packageRoot()}\\n`)\n const settings = settingsWithSearch(folder)\n if (settings) {\n writeFileSync(settingsPath(folder), settings, 'utf8')\n process.stdout.write(`${settingsPath(folder)}: the search allowed without a prompt\\n`)\n }\n return 0\n }\n\n default:\n process.stderr.write('estiva-ui <find | build | check | skill>\\n')\n return 1\n }\n}\n\ntry {\n process.exitCode = await main()\n} catch (error) {\n process.stderr.write(`${error instanceof Error ? error.message : String(error)}\\n`)\n process.exitCode = 1\n}\n", "/// <reference types=\"node\" />\n/**\n * The apps beside this one, found rather than named (UIG-20).\n *\n * `estiva-ui find` with nothing else typed searches the package, the app it is\n * run in, and every app that sits beside it. Katerina's condition for having no\n * shared Storybook is that one search, run unasked from any repository, covers\n * every catalogue; a list of names written into each repository's script would\n * be the drifting copy the gates exist to remove, and would miss the next app.\n *\n * An app is a folder, or one folder inside it, whose `package.json` depends on\n * `@estiva-app/ui` and which has a `src` to read. A service that does not\n * install the package is not an app of this catalogue until it does.\n *\n * Each app is searched once. A second checkout of the same app (a worktree, or\n * somebody's copy) carries the same package name; the app the search runs in\n * wins, then the one whose top folder has the shortest name.\n */\nimport { execFileSync } from 'node:child_process'\nimport { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'\nimport { basename, dirname, join, resolve } from 'node:path'\n\nexport const PACKAGE_NAME = '@estiva-app/ui'\n\nexport interface Sibling {\n /** What its entries are called: its top folder's name. */\n name: string\n /** The folder the catalogue is built from. */\n folder: string\n /** Its `package.json` name, which says two checkouts are one app. */\n packageName: string\n}\n\nfunction manifest(folder: string): { name?: string; dependencies?: Record<string, string>; devDependencies?: Record<string, string> } | null {\n const file = join(folder, 'package.json')\n if (!existsSync(file)) return null\n try {\n return JSON.parse(readFileSync(file, 'utf8'))\n } catch {\n return null\n }\n}\n\n/** The name of the app in `folder`, or null when the folder is not one. */\nexport function appName(folder: string): string | null {\n const m = manifest(folder)\n if (!m || m.name === PACKAGE_NAME) return null\n const uses = Boolean(m.dependencies?.[PACKAGE_NAME] ?? m.devDependencies?.[PACKAGE_NAME])\n return uses && existsSync(join(folder, 'src')) ? (m.name ?? basename(folder)) : null\n}\n\nconst isDir = (path: string) => {\n try {\n return statSync(path).isDirectory()\n } catch {\n return false\n }\n}\n\n/**\n * The folder that holds the repositories: the parent of the repository `from`\n * is in, or `from` itself when it is in none (a folder that only holds them).\n */\nexport function workspaceOf(from: string): string {\n let at = resolve(from)\n for (;;) {\n if (existsSync(join(at, '.git'))) return dirname(at)\n const up = dirname(at)\n if (up === at) return resolve(from)\n at = up\n }\n}\n\n/** Every app in `workspace`, one per package name, except those named in `skip`. */\nexport function findSiblings(workspace: string, { skip = [] }: { skip?: string[] } = {}): Sibling[] {\n let tops: string[]\n try {\n tops = readdirSync(workspace).filter((name) => !name.startsWith('.') && name !== 'node_modules' && isDir(join(workspace, name)))\n } catch {\n return []\n }\n const found: Sibling[] = []\n for (const top of tops) {\n const folder = join(workspace, top)\n const inside = readdirSync(folder).filter((name) => !name.startsWith('.') && name !== 'node_modules' && isDir(join(folder, name)))\n for (const candidate of [folder, ...inside.map((name) => join(folder, name))]) {\n const packageName = appName(candidate)\n if (packageName) found.push({ name: top, folder: candidate, packageName })\n }\n }\n const byPackage = new Map<string, Sibling>()\n for (const sibling of found.sort((a, b) => a.name.length - b.name.length || a.name.localeCompare(b.name))) {\n if (skip.includes(sibling.packageName) || byPackage.has(sibling.packageName)) continue\n byPackage.set(sibling.packageName, sibling)\n }\n return [...byPackage.values()].sort((a, b) => a.name.localeCompare(b.name))\n}\n\n/**\n * How many commits the checkout that holds `folder` is behind its remote's main,\n * as last fetched: nothing is fetched, so a search stays quick. Null when it is\n * not a git checkout or has no remote main. A search that reads a stale copy\n * answers with parts that are gone (the re-review after the audit before UIG-26:\n * \"files panel\" found Peek's deleted FilesPanel in an old checkout), so `find`\n * says so beside its answer.\n */\nexport function behindBy(folder: string): number | null {\n const git = (...a: string[]) => {\n try {\n return execFileSync('git', ['-C', folder, ...a], { stdio: ['ignore', 'pipe', 'ignore'], timeout: 10000 }).toString().trim()\n } catch {\n return null\n }\n }\n const main = git('symbolic-ref', '--short', 'refs/remotes/origin/HEAD') ?? (git('rev-parse', '--verify', '--quiet', 'origin/main') ? 'origin/main' : null)\n if (!main) return null\n const count = Number(git('rev-list', '--count', `HEAD..${main}`))\n return Number.isFinite(count) ? count : null\n}\n", "/// <reference types=\"node\" />\n/**\n * The Claude skill (UIG-20): search the catalogue before building anything.\n *\n * Its text lives once, in this package, as `skill/estiva-ui.md` (Katerina,\n * 17 September 2026: the same gate text pasted into two repositories is a\n * defect). Claude Code only loads a skill from a `SKILL.md` under a folder's\n * `.claude/skills/`, and no plugin source can point into `node_modules`, so each\n * repository commits a loader: the trigger below, and one line that reads the\n * installed package's text into the skill when it opens (`` !`\u2026` `` runs before\n * Claude sees the skill). `estiva-ui skill` writes it; `estiva-ui check` fails\n * when a repository's loader is missing or is not what this writes.\n *\n * Measured with fresh sessions of Claude Code 2.1.215 (UIG-20), three things\n * shape that line and the settings beside it:\n *\n * - An injected command runs without a prompt only when Claude Code can read it\n * statically as read-only: a plain `cat` of a plain path. A path with `..`\n * (\"may follow a symlink outside the working directory\"), a `$(\u2026)`, or a\n * `node -e` are all refused, and a refused command stops the skill opening.\n * So the path starts at `${CLAUDE_PROJECT_DIR}`, the folder the session\n * started in, as the editor gate's hook does: a session started above or\n * below the repository gets neither.\n * - An `allowed-tools` line makes opening the skill itself ask for permission\n * (\"Execute skill\"). So the search is allowed in the repository's committed\n * `.claude/settings.json` instead, and the skill carries no `allowed-tools`.\n * - Claude reads a skill's description before it opens the skill, so the\n * trigger is written into the loader; it is the one part that cannot be\n * pulled in later.\n */\nimport { existsSync, readFileSync } from 'node:fs'\nimport { dirname, join, relative, resolve, sep } from 'node:path'\n\nexport const SKILL_NAME = 'estiva-ui'\n\n/** When Claude opens the skill by itself. Kept under Claude Code's 1,536 characters. */\nexport const SKILL_DESCRIPTION =\n 'Use before building, adding or changing anything on screen in an app that uses @estiva-app/ui, or in @estiva-app/ui itself: ' +\n 'a screen, panel, list, row, header, dialog, menu, empty state, a new component, or how something looks. ' +\n 'Also when someone asks for a component in plain words (\"I need a\u2026\", \"add a\u2026\", \"is there a\u2026\"). ' +\n \"It searches every catalogue at once, the package's and each app's Storybook, for a part that already does the job, \" +\n 'and lists the mistakes this codebase keeps making.'\n\n/** The search, allowed without a prompt in the folder's committed `.claude/settings.json`. */\nexport const SEARCH_RULES = ['Bash(npm run ui:find *)', 'Bash(npm --prefix * run ui:find *)', 'PowerShell(npm run ui:find *)', 'PowerShell(npm --prefix * run ui:find *)']\n\n/** The skill's text, inside a package folder. */\nexport const skillTextPath = (packageRoot: string) => join(packageRoot, 'skill', `${SKILL_NAME}.md`)\n\n/** Where a folder keeps its loader. */\nexport const loaderPath = (folder: string) => join(folder, '.claude', 'skills', SKILL_NAME, 'SKILL.md')\n\n/** Where a folder keeps the settings that allow the search. */\nexport const settingsPath = (folder: string) => join(folder, '.claude', 'settings.json')\n\n/** The loader for `folder`, reading the text from `packageRoot`, from where a session in `folder` starts. */\nexport function loaderText(folder: string, packageRoot: string): string {\n const fromTop = relative(folder, skillTextPath(packageRoot)).split(sep).join('/')\n return [\n '---',\n `name: ${SKILL_NAME}`,\n `description: ${JSON.stringify(SKILL_DESCRIPTION)}`,\n '---',\n '',\n '<!-- Written by `estiva-ui skill` from @estiva-app/ui; `estiva-ui check` fails when it differs. The text is the installed package\u2019s, read in below. -->',\n '',\n `!\\`cat \"\\${CLAUDE_PROJECT_DIR}/${fromTop}\"\\``,\n '',\n ].join('\\n')\n}\n\ntype Settings = { permissions?: { allow?: string[] } & Record<string, unknown> } & Record<string, unknown>\n\nconst readSettings = (folder: string): Settings | null => {\n const path = settingsPath(folder)\n if (!existsSync(path)) return {}\n try {\n return JSON.parse(readFileSync(path, 'utf8')) as Settings\n } catch {\n return null\n }\n}\n\n/** `folder`'s settings with the search allowed, everything else as it was; null when they cannot be read. */\nexport function settingsWithSearch(folder: string): string | null {\n const settings = readSettings(folder)\n if (!settings) return null\n const allow = settings.permissions?.allow ?? []\n const missing = SEARCH_RULES.filter((rule) => !allow.includes(rule))\n if (!missing.length && existsSync(settingsPath(folder))) return null\n settings.permissions = { ...settings.permissions, allow: [...allow, ...missing] }\n return `${JSON.stringify(settings, null, 2)}\\n`\n}\n\n/** The repository `from` is in: the nearest folder with `.git`, or `from` when there is none. */\nexport function repositoryOf(from: string): string {\n let at = resolve(from)\n for (;;) {\n if (existsSync(join(at, '.git'))) return at\n const up = dirname(at)\n if (up === at) return resolve(from)\n at = up\n }\n}\n\n/** What is wrong with `folder`'s loader, or null when it is what `loaderText` writes. */\nexport function loaderProblem(folder: string, packageRoot: string): string | null {\n const path = loaderPath(folder)\n const shown = relative(process.cwd(), path).split(sep).join('/') || path\n if (!existsSync(path)) return `${shown} is missing: run \"estiva-ui skill\" and commit it`\n if (readFileSync(path, 'utf8').replace(/\\r\\n/g, '\\n') !== loaderText(folder, packageRoot)) return `${shown} is not what the package writes: run \"estiva-ui skill\" and commit it`\n if (!existsSync(skillTextPath(packageRoot))) return `${shown} reads ${skillTextPath(packageRoot)}, which is not there`\n const allow = readSettings(folder)?.permissions?.allow ?? []\n const missing = SEARCH_RULES.filter((rule) => !allow.includes(rule))\n if (missing.length) return `.claude/settings.json does not allow the search (${missing.join(', ')}): run \"estiva-ui skill\" and commit it`\n return null\n}\n", "/// <reference types=\"node\" />\n/**\n * The hand-written map of a Storybook, held against the Storybook it describes\n * (moved here from Peek's own status checks, audit A3; widened by the re-review\n * after it, R16).\n *\n * A repository may keep two maps of its sidebar: the order of its top-level\n * headings in `.storybook/preview.tsx` \u2014 a `const HEADINGS = [...]` list read by\n * a `storySort` function (Peek), or `storySort: { order: [...] }` (Ship, this\n * package) \u2014 and the Introduction page, which names each heading, in a table row\n * (`| **Folders** | \u2026 |`, Peek) or a bullet (`- **Primitives \u00B7 Inputs** \u2014 \u2026`,\n * Ship), and in an app states how many parts are worth reusing. Both are written\n * by hand and both describe something that moves, so both rot: Peek's named a\n * Huddles heading for a day after its stories were deleted and said 49 reusable\n * parts when the catalogue built 41; Ship's named a Feedback heading it does not\n * have and left out four it does.\n *\n * The real headings are read from Storybook's own index when the command has\n * one, so a title written any way at all counts; otherwise from the story files.\n * Every check runs only when the repository states the thing it checks.\n */\nimport { existsSync, readdirSync, readFileSync } from 'node:fs'\nimport { join } from 'node:path'\nimport type { Registry } from './schema'\n\nconst PREVIEW = '.storybook/preview.tsx'\nconst INTRODUCTIONS = ['src/stories/Introduction.mdx', 'stories/Introduction.mdx']\n/** The classes an app's Introduction counts as \"worth reusing\". */\nconst WORTH_REUSING = ['reusable', 'promote-candidate']\n\nfunction storyFiles(root: string): string[] {\n const out: string[] = []\n const walk = (dir: string) => {\n if (!existsSync(dir)) return\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n if (entry.name === 'node_modules' || entry.name.startsWith('.')) continue\n const path = join(dir, entry.name)\n if (entry.isDirectory()) walk(path)\n else if (entry.name.endsWith('.stories.tsx') || entry.name.endsWith('.mdx')) out.push(path)\n }\n }\n walk(join(root, 'src'))\n walk(join(root, 'stories'))\n return out\n}\n\n/** Every top-level heading the sidebar has, read from the story files: the first segment of each title. */\nexport function sidebarHeadings(root: string): Set<string> {\n const real = new Set<string>()\n for (const file of storyFiles(root)) {\n const text = readFileSync(file, 'utf8')\n const start = text.indexOf('const meta')\n const meta = start === -1 ? '' : text.slice(start, text.indexOf('satisfies Meta', start) + 1 || undefined)\n const title = meta.match(/\\btitle: *['\"]([^'\"]+)['\"]/) ?? text.match(/<Meta\\s+title=['\"]([^'\"]+)['\"]/)\n if (title) real.add(title[1].split('/')[0].trim())\n }\n return real\n}\n\n/** The top-level headings of Storybook's own index (`storybook index`): the first segment of every entry's title. */\nexport function indexHeadings(entries: Record<string, { title?: string }>): Set<string> {\n return new Set(Object.values(entries).flatMap((e) => (e.title ? [e.title.split('/')[0].trim()] : [])))\n}\n\n/** The strings at the top level of the array that starts at `open` (the index of its `[`), skipping nested arrays. */\nfunction topLevelStrings(text: string, open: number): string[] {\n const out: string[] = []\n let depth = 0\n for (let i = open; i < text.length; i++) {\n const c = text[i]\n if (c === '/' && text[i + 1] === '*') {\n const end = text.indexOf('*/', i + 2)\n if (end < 0) break\n i = end + 1\n } else if (c === '/' && text[i + 1] === '/') i = text.indexOf('\\n', i)\n else if (c === '[') depth++\n else if (c === ']') {\n if (--depth === 0) return out\n } else if (c === \"'\" || c === '\"') {\n const end = text.indexOf(c, i + 1)\n if (depth === 1) out.push(text.slice(i + 1, end))\n i = end\n }\n if (i < 0) break\n }\n return out\n}\n\n/** The headings the preview orders \u2014 a `HEADINGS` list or `storySort: { order: [...] }` \u2014 or null when it keeps no order. */\nexport function orderedHeadings(previewText: string): string[] | null {\n const list = /const HEADINGS = \\[/.exec(previewText) ?? /\\border:\\s*\\[/.exec(previewText)\n if (!list) return null\n return topLevelStrings(previewText, list.index + list[0].length - 1)\n}\n\n/**\n * The headings the Introduction names: a table row that opens with a bold name,\n * or a bullet that opens with bold names joined by \" \u00B7 \".\n */\nexport function introductionHeadings(introText: string): Set<string> {\n const rows = [...introText.matchAll(/^\\|\\s*\\*\\*([^*]+)\\*\\*\\s*\\|/gm)].map((m) => m[1])\n const bullets = [...introText.matchAll(/^[-*]\\s+\\*\\*([^*]+)\\*\\*\\s*[\u2014\u2013-]/gm)].flatMap((m) => m[1].split('\u00B7'))\n return new Set([...rows, ...bullets].map((h) => h.trim()).filter(Boolean))\n}\n\n/** The number the Introduction states, or null when it states none. */\nexport function introductionCount(introText: string): number | null {\n const said = introText.match(/\\*\\*(\\d+) parts worth reusing\\*\\*/)\n return said ? Number(said[1]) : null\n}\n\n/**\n * What is wrong with the repository's hand-written map of its Storybook; empty\n * when nothing is. `real` is the sidebar's top-level headings from Storybook's\n * index, when the caller has it; `registry` is needed only for an app's count.\n */\nexport function storyMapProblems(root: string, { registry, real = sidebarHeadings(root) }: { registry?: Registry; real?: Set<string> } = {}): string[] {\n const problems: string[] = []\n const previewPath = join(root, PREVIEW)\n if (existsSync(previewPath)) {\n const ordered = orderedHeadings(readFileSync(previewPath, 'utf8'))\n if (ordered) {\n const unordered = [...real].filter((r) => !ordered.includes(r))\n const empty = ordered.filter((o) => !real.has(o))\n if (unordered.length) problems.push(`${PREVIEW}: not in the heading order, so they fall to the bottom of the sidebar: ${unordered.join(', ')}`)\n if (empty.length) problems.push(`${PREVIEW}: in the heading order but no story uses them: ${empty.join(', ')}`)\n }\n }\n const intro = INTRODUCTIONS.find((p) => existsSync(join(root, p)))\n if (intro) {\n const text = readFileSync(join(root, intro), 'utf8')\n const named = introductionHeadings(text)\n if (named.size) {\n const missing = [...real].filter((r) => !named.has(r))\n const stale = [...named].filter((n) => !real.has(n))\n if (missing.length) problems.push(`${intro}: the sidebar has, the page does not name: ${missing.join(', ')}`)\n if (stale.length) problems.push(`${intro}: the page names, the sidebar does not have: ${stale.join(', ')}`)\n }\n const said = introductionCount(text)\n if (said !== null && registry) {\n const reusable = registry.entries.filter((entry) => WORTH_REUSING.includes(entry.app?.class ?? '')).length\n if (said !== reusable) problems.push(`${intro}: says ${said} parts worth reusing; the catalogue builds ${reusable}`)\n }\n }\n return problems\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAiCA,SAAS,iBAAiB;AAC1B,SAAS,cAAAA,aAAY,WAAW,aAAa,gBAAAC,eAAc,qBAAqB;AAChF,SAAS,cAAc;AACvB,SAAS,YAAA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G;AACpD,gBAAQ,OAAO,MAAM,GAAG,MAAM,kBAAkB,YAAY,CAAC;AAAA,CAAqD;AAClH,eAAO;AAAA,MACT;AACA,YAAM,OAAO,WAAW,MAAM;AAC9B,gBAAUC,SAAQ,IAAI,GAAG,EAAE,WAAW,KAAK,CAAC;AAC5C,oBAAc,MAAM,WAAW,QAAQ,YAAY,CAAC,GAAG,MAAM;AAC7D,cAAQ,OAAO,MAAM,GAAG,IAAI,iCAAiC,YAAY,CAAC;AAAA,CAAI;AAC9E,YAAM,WAAW,mBAAmB,MAAM;AAC1C,UAAI,UAAU;AACZ,sBAAc,aAAa,MAAM,GAAG,UAAU,MAAM;AACpD,gBAAQ,OAAO,MAAM,GAAG,aAAa,MAAM,CAAC;AAAA,CAAyC;AAAA,MACvF;AACA,aAAO;AAAA,IACT;AAAA,IAEA;AACE,cAAQ,OAAO,MAAM,4CAA4C;AACjE,aAAO;AAAA,EACX;AACF;AAEA,IAAI;AACF,UAAQ,WAAW,MAAM,KAAK;AAChC,SAAS,OAAO;AACd,UAAQ,OAAO,MAAM,GAAG,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,CAAI;AAClF,UAAQ,WAAW;AACrB;",
|
|
4
|
+
"sourcesContent": ["/// <reference types=\"node\" />\n/**\n * `estiva-ui` \u2014 the catalogue as a command (UIG-12, UIG-13; docs/GATES.md \u00A723\n * for why it ships in the package rather than as a script pasted into each repo).\n *\n * estiva-ui find <words\u2026> [--here | --also [name=]<folder>\u2026] [--json] [--limit n]\n * estiva-ui build [--out <path>]\n * estiva-ui check\n * estiva-ui skill [--out <folder>]\n *\n * Every command takes `--root <folder>` (the library it reads; default: here)\n * and `--repo <name>` (what an app's entries are called; default: its package name).\n *\n * **In the package** (`@estiva-app/ui` itself): `build` writes the committed\n * `registry.json`, and `check` rebuilds it and fails on a single byte of drift.\n *\n * **In an app**: nothing is committed (Katerina, 18 September 2026 \u2014 the\n * package is public, the apps are private). `check` builds the app's catalogue\n * and fails when a part has no one-line description or cannot be sorted, or\n * when a reusable part breaks the usage-page contract (UIG-19, `./contract`),\n * or when the app's hand-written map of its Storybook no longer matches it\n * (`./storymap`); CI's `gate` job runs it. `build` writes the catalogue to a file only when asked.\n *\n * `find` searches the package's catalogue \u2014 the one shipped inside the installed\n * package, or this repo's own in the package \u2014 plus, in an app, the app's own,\n * built fresh, plus every app beside it (UIG-20, `./siblings`): found, not\n * named, so one command answers the same from any repository, or from the\n * folder that holds them. `--here` searches no neighbour; `--also` names them.\n *\n * `skill` writes the repository's Claude skill loader (UIG-20, `./skill`), or\n * the one for `--out <folder>`; `check` fails when the repository's is missing\n * or differs.\n */\nimport { spawnSync } from 'node:child_process'\nimport { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs'\nimport { tmpdir } from 'node:os'\nimport { basename, dirname, join, relative, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { CONTRACT_KINDS, contractProblems, linkProblems, nameableParts, nameProblems } from './contract'\nimport { findInRegistries, formatFindings } from './find'\nimport { behindBy, findSiblings, workspaceOf } from './siblings'\nimport { loaderPath, loaderProblem, loaderText, repositoryOf, settingsPath, settingsWithSearch } from './skill'\nimport { indexHeadings, storyMapProblems } from './storymap'\nimport { CLASSES, validateRegistry, type Registry } from './schema'\n\n/**\n * The builders, loaded only when they are used.\n *\n * They read TypeScript with TypeScript, and `typescript` is a dev dependency of\n * the app that installs this package \u2014 a real one in Peek, Ship and this repo,\n * and possibly absent elsewhere. A static import made the bundler put the whole\n * builder in the same chunk as `find`, so `npx estiva-ui find \u2026` died with\n * ERR_MODULE_NOT_FOUND before opening the file it needed.\n */\nconst packageBuilder = () => import('./build')\nconst appBuilder = () => import('./app')\nconst gatedScan = () => import('./gated')\n\nconst [command, ...rest] = process.argv.slice(2)\nconst VALUED = ['--limit', '--out', '--file', '--root', '--repo', '--also']\nconst flag = (name: string) => rest.includes(`--${name}`)\nconst value = (name: string) => {\n const at = rest.indexOf(`--${name}`)\n return at === -1 ? undefined : rest[at + 1]\n}\nconst values = (name: string) => rest.flatMap((word, i) => (word === `--${name}` && rest[i + 1] !== undefined ? [rest[i + 1]] : []))\n/** Everything that is not a flag or a flag's value: the words of the question. */\nconst plain = () => {\n const out: string[] = []\n for (let i = 0; i < rest.length; i++) {\n if (rest[i].startsWith('--')) {\n if (VALUED.includes(rest[i])) i += 1\n continue\n }\n out.push(rest[i])\n }\n return out\n}\n\nconst root = resolve(value('root') ?? '.')\nconst manifestAt = (folder: string) => JSON.parse(readFileSync(resolve(folder, 'package.json'), 'utf8')) as { name?: string }\n/** The package itself, or an app that installs it. */\nconst isPackage = existsSync(resolve(root, 'package.json')) && manifestAt(root).name === '@estiva-app/ui'\n\n/** The package's committed catalogue: `--file`, this repo's own in the package, else the copy inside the installed package. */\nfunction packageRegistryPath(): string {\n const named = value('file')\n if (named) return resolve(named)\n if (isPackage) return resolve(root, 'registry.json')\n // dist/registry/cli.js \u2192 the package's own root. Never an app's own folder:\n // a registry.json there is the app's, written by `estiva-ui build`.\n return fileURLToPath(new URL('../../registry.json', import.meta.url))\n}\n\nfunction readPackageRegistry(): Registry {\n const path = packageRegistryPath()\n if (!existsSync(path)) throw new Error(`no registry.json at ${path} \u2014 run \"estiva-ui build\" in the package first`)\n const registry = JSON.parse(readFileSync(path, 'utf8')) as Registry\n const problems = validateRegistry(registry)\n // A malformed catalogue is worse than none: it would answer, wrongly.\n if (problems.length) throw new Error(`${path} does not match the schema:\\n ${problems.join('\\n ')}`)\n return registry\n}\n\n/** The installed package whose skill text a loader reads: this repo in the package, else the app's install. */\nconst packageRoot = () => (isPackage ? root : resolve(root, 'node_modules', '@estiva-app', 'ui'))\n\n/** The Claude skill loader (UIG-20): reports, and says whether it passed. */\nfunction checkLoader(): boolean {\n const problem = loaderProblem(repositoryOf(root), packageRoot())\n if (problem) {\n process.stderr.write(`claude skill: ${problem}\\n`)\n return false\n }\n process.stdout.write('claude skill: the loader reads the package\u2019s text\\n')\n return true\n}\n\nasync function buildApp(folder: string, repo: string | undefined): Promise<Registry> {\n const { buildAppRegistry } = await appBuilder()\n const registry = buildAppRegistry({ root: folder, repo })\n const problems = validateRegistry(registry)\n if (problems.length) throw new Error(`the catalogue of ${registry.builtFrom.repo} does not match its own schema:\\n ${problems.join('\\n ')}`)\n return registry\n}\n\n/**\n * Every story and docs link in a catalogue, against the Storybook beside it\n * (UIG-19). `storybook index` writes the ids Storybook itself would serve \u2014 no\n * server, no browser, seconds \u2014 so a renamed story, or a page that no longer\n * compiles, fails here rather than as a dead link somebody finds later.\n * Reports, and says whether it passed. A folder with no Storybook has nothing\n * to check.\n */\nfunction checkLinks(registry: Registry, folder: string): { ok: boolean; headings?: Set<string>; titles?: Set<string> } {\n const bin = resolve(folder, 'node_modules', '.bin', process.platform === 'win32' ? 'storybook.cmd' : 'storybook')\n if (!existsSync(resolve(folder, '.storybook')) || !existsSync(bin)) {\n process.stdout.write('story links: no Storybook here, nothing to check\\n')\n return { ok: true }\n }\n const out = join(mkdtempSync(join(tmpdir(), 'estiva-ui-index-')), 'index.json')\n // A `.cmd` needs a shell on Windows, and Node wants that as one quoted line\n // rather than an argument list. Both paths are ours: the app's folder and a temp file.\n const run =\n process.platform === 'win32'\n ? spawnSync(`\"${bin}\" index -o \"${out}\" --quiet`, { cwd: folder, encoding: 'utf8', shell: true })\n : spawnSync(bin, ['index', '-o', out, '--quiet'], { cwd: folder, encoding: 'utf8' })\n if (run.status !== 0 || !existsSync(out)) {\n process.stderr.write(`story links: Storybook could not index its stories, so no link can be trusted:\\n${(run.stderr || run.stdout || '').trim()}\\n`)\n return { ok: false }\n }\n const entries = (JSON.parse(readFileSync(out, 'utf8')) as { entries: Record<string, { title?: string }> }).entries\n const ids = new Set(Object.keys(entries))\n const headings = indexHeadings(entries)\n const titles = new Set(Object.values(entries).flatMap((e) => (e.title ? [e.title] : [])))\n const dead = linkProblems(registry, ids)\n const count = registry.entries.reduce((n, entry) => n + (entry.storyId ? 1 : 0) + (entry.docsId ? 1 : 0), 0)\n if (dead.length) {\n process.stderr.write(`story links: ${dead.length} of ${count} lead nowhere:\\n ${dead.join('\\n ')}\\n`)\n return { ok: false, headings, titles }\n }\n process.stdout.write(`story links: all ${count} open a story or docs page Storybook has\\n`)\n return { ok: true, headings, titles }\n}\n\n/**\n * What a part draws only when a prop is passed, where no story passes it\n * (UIG-19, `./gated`). Strict, by Katerina's ruling: a part's own stories show\n * everything it can draw. In an app it reads the reusable parts; in the package,\n * every component (`kinds` is the package's one class, `component`).\n */\nasync function checkGated(registry: Registry, folder: string, kinds?: string[]): Promise<boolean> {\n const { gatedFindings } = await gatedScan()\n const found = gatedFindings(registry, folder, { ...(kinds ? { kinds } : {}), pictured: 'own' })\n if (found.length) {\n const lines = found.map((f) => `${f.part} (${f.file}) draws something only when given \\`${f.prop}\\`, and no story that draws it passes \\`${f.prop}\\`: pass it in a story`)\n process.stderr.write(`stories: ${found.length === 1 ? 'one thing a part draws is' : `${found.length} things parts draw are`} never shown:\\n ${lines.join('\\n ')}\\n`)\n return false\n }\n process.stdout.write('stories: everything a part draws behind a prop is shown by a story\\n')\n return true\n}\n\n/**\n * The repository's hand-written map of its Storybook \u2014 the heading order and the\n * Introduction \u2014 against the Storybook (its own index, when there is one) and,\n * in an app, the catalogue (`./storymap`). Reports, and says whether it passed.\n */\nfunction checkStoryMap(folder: string, registry?: Registry, headings?: Set<string>): boolean {\n const problems = storyMapProblems(folder, { ...(registry ? { registry } : {}), ...(headings ? { real: headings } : {}) })\n if (problems.length) {\n process.stderr.write(`storybook map: ${problems.length === 1 ? 'one line no longer matches' : `${problems.length} lines no longer match`}:\\n ${problems.join('\\n ')}\\n`)\n return false\n }\n process.stdout.write('storybook map: the heading order and the Introduction match the Storybook and the catalogue\\n')\n return true\n}\n\n/** One line per kind, in a fixed order, so two runs read the same. */\nfunction summary(registry: Registry): string {\n const count = (cls: string) => registry.entries.filter((entry) => entry.app?.class === cls).length\n const kinds = CLASSES.map((cls) => `${count(cls)} ${cls}`).join(', ')\n const files = registry.builtFrom.files ?? 0\n return `${registry.builtFrom.repo}: ${registry.entries.length} parts in ${files - registry.filesWithoutParts.length} files (${registry.filesWithoutParts.length} more hold none) \u2014 ${kinds}. Every part is described and sorted.`\n}\n\nasync function main(): Promise<number> {\n switch (command) {\n case 'find': {\n const query = plain().join(' ')\n if (!query.trim()) {\n process.stderr.write('estiva-ui find <words\u2026> \u2014 what the thing you need does, in words\\n')\n return 1\n }\n const registries: Registry[] = [readPackageRegistry()]\n // An app that cannot be read is said out loud, and the rest still answer.\n const add = async (folder: string, repo: string | undefined) => {\n const behind = behindBy(folder)\n if (behind) process.stderr.write(`note: ${repo ?? basename(folder)} (${folder}) is ${behind} commit${behind === 1 ? '' : 's'} behind main as last fetched \u2014 its answers may name parts that are gone; pull it\\n`)\n try {\n registries.push(await buildApp(folder, repo))\n } catch (error) {\n const [first, ...more] = String(error instanceof Error ? error.message : error).split('\\n')\n process.stderr.write(`not searched: ${first}${more.length ? `\\n${more.slice(0, 3).join('\\n')}${more.length > 3 ? `\\n \u2026and ${more.length - 3} more \u2014 run \"estiva-ui check\" there` : ''}` : ''}\\n`)\n }\n }\n // The folder it runs in is searched when it is an app; the folder that\n // holds the repositories is not one, and only its neighbours answer.\n const here = !isPackage && existsSync(resolve(root, 'package.json')) ? (manifestAt(root).name ?? basename(root)) : null\n if (here) await add(root, value('repo'))\n if (!values('also').length && !flag('here')) {\n for (const sibling of findSiblings(workspaceOf(root), { skip: here ? [here] : [] })) await add(sibling.folder, sibling.name)\n }\n for (const also of values('also')) {\n const [name, folder] = also.includes('=') ? [also.slice(0, also.indexOf('=')), also.slice(also.indexOf('=') + 1)] : [undefined, also]\n const at = resolve(root, folder)\n if (!existsSync(resolve(at, 'package.json'))) {\n process.stderr.write(`not searched: ${name ?? basename(at)} \u2014 nothing at ${at}\\n`)\n continue\n }\n await add(at, name)\n }\n const limit = Number(value('limit') ?? 5)\n const findings = findInRegistries(registries, query, { limit: Number.isFinite(limit) && limit > 0 ? limit : 5 })\n if (flag('json')) {\n process.stdout.write(`${JSON.stringify(findings.map((finding) => finding.entry), null, 2)}\\n`)\n return 0\n }\n process.stdout.write(`${formatFindings(registries, findings, query)}\\n`)\n // Nothing found is not a failure \u2014 it is the answer that sends a session\n // to ask rather than to invent.\n return 0\n }\n\n case 'build': {\n const out = resolve(root, value('out') ?? 'registry.json')\n if (isPackage) {\n const { buildRegistry, serializeRegistry } = await packageBuilder()\n const registry = buildRegistry({ root })\n const problems = validateRegistry(registry)\n if (problems.length) {\n process.stderr.write(`the registry this build produced does not match its own schema:\\n ${problems.join('\\n ')}\\n`)\n return 1\n }\n writeFileSync(out, serializeRegistry(registry), 'utf8')\n process.stdout.write(`${out}: ${registry.entries.length} entries from ${registry.builtFrom.exports} exports\\n`)\n return 0\n }\n const { serializeRegistry } = await packageBuilder()\n const registry = await buildApp(root, value('repo'))\n writeFileSync(out, serializeRegistry(registry), 'utf8')\n process.stdout.write(`${out}: ${summary(registry)}\\n`)\n return 0\n }\n\n case 'check': {\n if (!isPackage) {\n const registry = await buildApp(root, value('repo'))\n process.stdout.write(`${summary(registry)}\\n`)\n // The usage-page contract and the story links (UIG-19): the one copy, run by every app's `gate` job.\n // A When not may name a part of the package or of this app (B8).\n const pkg = readPackageRegistry()\n const known = nameableParts(registry, pkg)\n const broken = contractProblems(registry, root, known)\n if (broken.length) {\n process.stderr.write(`${broken.length === 1 ? 'a part breaks' : `${broken.length} parts break`} the usage-page contract:\\n ${broken.join('\\n ')}\\n`)\n } else {\n const owed = registry.entries.filter((entry) => (CONTRACT_KINDS as readonly string[]).includes(entry.app?.class ?? '')).length\n process.stdout.write(`usage pages: all ${owed} reusable parts keep the contract and are drawn somewhere\\n`)\n }\n const linked = checkLinks(registry, root)\n const shown = await checkGated(registry, root)\n const loaded = checkLoader()\n const mapped = checkStoryMap(root, registry, linked.headings)\n // What the pages name must still be there (R14): parts under When and When not,\n // and the stories a Seen in line sends a reader to, here or in the package.\n const stale = nameProblems(registry, root, {\n known,\n ...(linked.titles ? { titles: linked.titles } : {}),\n packageIds: pkg.entries.flatMap((e) => [e.storyId, e.docsId].filter((id): id is string => Boolean(id))),\n })\n if (stale.length) process.stderr.write(`usage pages: ${stale.length === 1 ? 'one name leads' : `${stale.length} names lead`} nowhere:\\n ${stale.join('\\n ')}\\n`)\n else process.stdout.write('usage pages: every part and story they name is there\\n')\n return broken.length || stale.length || !linked.ok || !shown || !loaded || !mapped ? 1 : 0\n }\n const { buildRegistry, serializeRegistry } = await packageBuilder()\n const path = packageRegistryPath()\n const built = buildRegistry({ root })\n const problems = validateRegistry(built)\n if (problems.length) {\n process.stderr.write(`the registry does not match its own schema:\\n ${problems.join('\\n ')}\\n`)\n return 1\n }\n if (!existsSync(path)) {\n process.stderr.write(`${path} is missing \u2014 run \"npm run registry\"\\n`)\n return 1\n }\n // Byte for byte. The point of the check is that the committed file cannot\n // drift from the code; \"near enough\" is drift.\n if (readFileSync(path, 'utf8').replace(/\\r\\n/g, '\\n') !== serializeRegistry(built)) {\n process.stderr.write(`${path} is not what the code produces \u2014 run \"npm run registry\" and commit the result\\n`)\n return 1\n }\n process.stdout.write(`${path}: current, ${built.entries.length} entries from ${built.builtFrom.exports} exports\\n`)\n const linked = checkLinks(built, root)\n const shown = await checkGated(built, root, ['component'])\n const loaded = checkLoader()\n // The package keeps a heading order too (R16): it left out Layout, and nothing saw.\n const mapped = checkStoryMap(root, undefined, linked.headings)\n return linked.ok && shown && loaded && mapped ? 0 : 1\n }\n\n case 'skill': {\n const out = value('out')\n const folder = out ? resolve(out) : repositoryOf(root)\n // The loader's path starts where the session does and cannot climb out:\n // Claude Code refuses a `..` in it.\n if (relative(folder, packageRoot()).startsWith('..')) {\n process.stderr.write(`${folder} does not hold ${packageRoot()}: a loader there could not reach the skill's text\\n`)\n return 1\n }\n const path = loaderPath(folder)\n mkdirSync(dirname(path), { recursive: true })\n writeFileSync(path, loaderText(folder, packageRoot()), 'utf8')\n process.stdout.write(`${path}: the Claude skill, read from ${packageRoot()}\\n`)\n const settings = settingsWithSearch(folder)\n if (settings) {\n writeFileSync(settingsPath(folder), settings, 'utf8')\n process.stdout.write(`${settingsPath(folder)}: the search allowed without a prompt\\n`)\n }\n return 0\n }\n\n default:\n process.stderr.write('estiva-ui <find | build | check | skill>\\n')\n return 1\n }\n}\n\ntry {\n process.exitCode = await main()\n} catch (error) {\n process.stderr.write(`${error instanceof Error ? error.message : String(error)}\\n`)\n process.exitCode = 1\n}\n", "/// <reference types=\"node\" />\n/**\n * The apps beside this one, found rather than named (UIG-20).\n *\n * `estiva-ui find` with nothing else typed searches the package, the app it is\n * run in, and every app that sits beside it. Katerina's condition for having no\n * shared Storybook is that one search, run unasked from any repository, covers\n * every catalogue; a list of names written into each repository's script would\n * be the drifting copy the gates exist to remove, and would miss the next app.\n *\n * An app is a folder, or one folder inside it, whose `package.json` depends on\n * `@estiva-app/ui` and which has a `src` to read. A service that does not\n * install the package is not an app of this catalogue until it does.\n *\n * Each app is searched once. A second checkout of the same app (a worktree, or\n * somebody's copy) carries the same package name; the app the search runs in\n * wins, then the one whose top folder has the shortest name.\n */\nimport { execFileSync } from 'node:child_process'\nimport { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'\nimport { basename, dirname, join, resolve } from 'node:path'\n\nexport const PACKAGE_NAME = '@estiva-app/ui'\n\nexport interface Sibling {\n /** What its entries are called: its top folder's name. */\n name: string\n /** The folder the catalogue is built from. */\n folder: string\n /** Its `package.json` name, which says two checkouts are one app. */\n packageName: string\n}\n\nfunction manifest(folder: string): { name?: string; dependencies?: Record<string, string>; devDependencies?: Record<string, string> } | null {\n const file = join(folder, 'package.json')\n if (!existsSync(file)) return null\n try {\n return JSON.parse(readFileSync(file, 'utf8'))\n } catch {\n return null\n }\n}\n\n/** The name of the app in `folder`, or null when the folder is not one. */\nexport function appName(folder: string): string | null {\n const m = manifest(folder)\n if (!m || m.name === PACKAGE_NAME) return null\n const uses = Boolean(m.dependencies?.[PACKAGE_NAME] ?? m.devDependencies?.[PACKAGE_NAME])\n return uses && existsSync(join(folder, 'src')) ? (m.name ?? basename(folder)) : null\n}\n\nconst isDir = (path: string) => {\n try {\n return statSync(path).isDirectory()\n } catch {\n return false\n }\n}\n\n/**\n * The folder that holds the repositories: the parent of the repository `from`\n * is in, or `from` itself when it is in none (a folder that only holds them).\n */\nexport function workspaceOf(from: string): string {\n let at = resolve(from)\n for (;;) {\n if (existsSync(join(at, '.git'))) return dirname(at)\n const up = dirname(at)\n if (up === at) return resolve(from)\n at = up\n }\n}\n\n/** Every app in `workspace`, one per package name, except those named in `skip`. */\nexport function findSiblings(workspace: string, { skip = [] }: { skip?: string[] } = {}): Sibling[] {\n let tops: string[]\n try {\n tops = readdirSync(workspace).filter((name) => !name.startsWith('.') && name !== 'node_modules' && isDir(join(workspace, name)))\n } catch {\n return []\n }\n const found: Sibling[] = []\n for (const top of tops) {\n const folder = join(workspace, top)\n const inside = readdirSync(folder).filter((name) => !name.startsWith('.') && name !== 'node_modules' && isDir(join(folder, name)))\n for (const candidate of [folder, ...inside.map((name) => join(folder, name))]) {\n const packageName = appName(candidate)\n if (packageName) found.push({ name: top, folder: candidate, packageName })\n }\n }\n const byPackage = new Map<string, Sibling>()\n for (const sibling of found.sort((a, b) => a.name.length - b.name.length || a.name.localeCompare(b.name))) {\n if (skip.includes(sibling.packageName) || byPackage.has(sibling.packageName)) continue\n byPackage.set(sibling.packageName, sibling)\n }\n return [...byPackage.values()].sort((a, b) => a.name.localeCompare(b.name))\n}\n\n/**\n * How many commits the checkout that holds `folder` is behind its remote's main,\n * as last fetched: nothing is fetched, so a search stays quick. Null when it is\n * not a git checkout or has no remote main. A search that reads a stale copy\n * answers with parts that are gone (the re-review after the audit before UIG-26:\n * \"files panel\" found Peek's deleted FilesPanel in an old checkout), so `find`\n * says so beside its answer.\n */\nexport function behindBy(folder: string): number | null {\n const git = (...a: string[]) => {\n try {\n return execFileSync('git', ['-C', folder, ...a], { stdio: ['ignore', 'pipe', 'ignore'], timeout: 10000 }).toString().trim()\n } catch {\n return null\n }\n }\n const main = git('symbolic-ref', '--short', 'refs/remotes/origin/HEAD') ?? (git('rev-parse', '--verify', '--quiet', 'origin/main') ? 'origin/main' : null)\n if (!main) return null\n const count = Number(git('rev-list', '--count', `HEAD..${main}`))\n return Number.isFinite(count) ? count : null\n}\n", "/// <reference types=\"node\" />\n/**\n * The Claude skill (UIG-20): search the catalogue before building anything.\n *\n * Its text lives once, in this package, as `skill/estiva-ui.md` (Katerina,\n * 17 September 2026: the same gate text pasted into two repositories is a\n * defect). Claude Code only loads a skill from a `SKILL.md` under a folder's\n * `.claude/skills/`, and no plugin source can point into `node_modules`, so each\n * repository commits a loader: the trigger below, and one line that reads the\n * installed package's text into the skill when it opens (`` !`\u2026` `` runs before\n * Claude sees the skill). `estiva-ui skill` writes it; `estiva-ui check` fails\n * when a repository's loader is missing or is not what this writes.\n *\n * Measured with fresh sessions of Claude Code 2.1.215 (UIG-20), three things\n * shape that line and the settings beside it:\n *\n * - An injected command runs without a prompt only when Claude Code can read it\n * statically as read-only: a plain `cat` of a plain path. A path with `..`\n * (\"may follow a symlink outside the working directory\"), a `$(\u2026)`, or a\n * `node -e` are all refused, and a refused command stops the skill opening.\n * So the path starts at `${CLAUDE_PROJECT_DIR}`, the folder the session\n * started in, as the editor gate's hook does: a session started above or\n * below the repository gets neither.\n * - An `allowed-tools` line makes opening the skill itself ask for permission\n * (\"Execute skill\"). So the search is allowed in the repository's committed\n * `.claude/settings.json` instead, and the skill carries no `allowed-tools`.\n * - Claude reads a skill's description before it opens the skill, so the\n * trigger is written into the loader; it is the one part that cannot be\n * pulled in later.\n */\nimport { existsSync, readFileSync } from 'node:fs'\nimport { dirname, join, relative, resolve, sep } from 'node:path'\n\nexport const SKILL_NAME = 'estiva-ui'\n\n/** When Claude opens the skill by itself. Kept under Claude Code's 1,536 characters. */\nexport const SKILL_DESCRIPTION =\n 'Use before building, adding or changing anything on screen in an app that uses @estiva-app/ui, or in @estiva-app/ui itself: ' +\n 'a screen, panel, list, row, header, dialog, menu, empty state, a new component, or how something looks. ' +\n 'Also when someone asks for a component in plain words (\"I need a\u2026\", \"add a\u2026\", \"is there a\u2026\"). ' +\n \"It searches every catalogue at once, the package's and each app's Storybook, for a part that already does the job, \" +\n 'and lists the mistakes this codebase keeps making.'\n\n/** The search, allowed without a prompt in the folder's committed `.claude/settings.json`. */\nexport const SEARCH_RULES = ['Bash(npm run ui:find *)', 'Bash(npm --prefix * run ui:find *)', 'PowerShell(npm run ui:find *)', 'PowerShell(npm --prefix * run ui:find *)']\n\n/** The skill's text, inside a package folder. */\nexport const skillTextPath = (packageRoot: string) => join(packageRoot, 'skill', `${SKILL_NAME}.md`)\n\n/** Where a folder keeps its loader. */\nexport const loaderPath = (folder: string) => join(folder, '.claude', 'skills', SKILL_NAME, 'SKILL.md')\n\n/** Where a folder keeps the settings that allow the search. */\nexport const settingsPath = (folder: string) => join(folder, '.claude', 'settings.json')\n\n/** The loader for `folder`, reading the text from `packageRoot`, from where a session in `folder` starts. */\nexport function loaderText(folder: string, packageRoot: string): string {\n const fromTop = relative(folder, skillTextPath(packageRoot)).split(sep).join('/')\n return [\n '---',\n `name: ${SKILL_NAME}`,\n `description: ${JSON.stringify(SKILL_DESCRIPTION)}`,\n '---',\n '',\n '<!-- Written by `estiva-ui skill` from @estiva-app/ui; `estiva-ui check` fails when it differs. The text is the installed package\u2019s, read in below. -->',\n '',\n `!\\`cat \"\\${CLAUDE_PROJECT_DIR}/${fromTop}\"\\``,\n '',\n ].join('\\n')\n}\n\ntype Settings = { permissions?: { allow?: string[] } & Record<string, unknown> } & Record<string, unknown>\n\nconst readSettings = (folder: string): Settings | null => {\n const path = settingsPath(folder)\n if (!existsSync(path)) return {}\n try {\n return JSON.parse(readFileSync(path, 'utf8')) as Settings\n } catch {\n return null\n }\n}\n\n/** `folder`'s settings with the search allowed, everything else as it was; null when they cannot be read. */\nexport function settingsWithSearch(folder: string): string | null {\n const settings = readSettings(folder)\n if (!settings) return null\n const allow = settings.permissions?.allow ?? []\n const missing = SEARCH_RULES.filter((rule) => !allow.includes(rule))\n if (!missing.length && existsSync(settingsPath(folder))) return null\n settings.permissions = { ...settings.permissions, allow: [...allow, ...missing] }\n return `${JSON.stringify(settings, null, 2)}\\n`\n}\n\n/** The repository `from` is in: the nearest folder with `.git`, or `from` when there is none. */\nexport function repositoryOf(from: string): string {\n let at = resolve(from)\n for (;;) {\n if (existsSync(join(at, '.git'))) return at\n const up = dirname(at)\n if (up === at) return resolve(from)\n at = up\n }\n}\n\n/** What is wrong with `folder`'s loader, or null when it is what `loaderText` writes. */\nexport function loaderProblem(folder: string, packageRoot: string): string | null {\n const path = loaderPath(folder)\n const shown = relative(process.cwd(), path).split(sep).join('/') || path\n if (!existsSync(path)) return `${shown} is missing: run \"estiva-ui skill\" and commit it`\n if (readFileSync(path, 'utf8').replace(/\\r\\n/g, '\\n') !== loaderText(folder, packageRoot)) return `${shown} is not what the package writes: run \"estiva-ui skill\" and commit it`\n if (!existsSync(skillTextPath(packageRoot))) return `${shown} reads ${skillTextPath(packageRoot)}, which is not there`\n const allow = readSettings(folder)?.permissions?.allow ?? []\n const missing = SEARCH_RULES.filter((rule) => !allow.includes(rule))\n if (missing.length) return `.claude/settings.json does not allow the search (${missing.join(', ')}): run \"estiva-ui skill\" and commit it`\n return null\n}\n", "/// <reference types=\"node\" />\n/**\n * The hand-written map of a Storybook, held against the Storybook it describes\n * (moved here from Peek's own status checks, audit A3; widened by the re-review\n * after it, R16).\n *\n * A repository may keep two maps of its sidebar: the order of its top-level\n * headings in `.storybook/preview.tsx` \u2014 a `const HEADINGS = [...]` list read by\n * a `storySort` function (Peek), or `storySort: { order: [...] }` (Ship, this\n * package) \u2014 and the Introduction page, which names each heading, in a table row\n * (`| **Folders** | \u2026 |`, Peek) or a bullet (`- **Primitives \u00B7 Inputs** \u2014 \u2026`,\n * Ship), and in an app states how many parts are worth reusing. Both are written\n * by hand and both describe something that moves, so both rot: Peek's named a\n * Huddles heading for a day after its stories were deleted and said 49 reusable\n * parts when the catalogue built 41; Ship's named a Feedback heading it does not\n * have and left out four it does.\n *\n * The real headings are read from Storybook's own index when the command has\n * one, so a title written any way at all counts; otherwise from the story files.\n * Every check runs only when the repository states the thing it checks.\n */\nimport { existsSync, readdirSync, readFileSync } from 'node:fs'\nimport { join } from 'node:path'\nimport type { Registry } from './schema'\n\nconst PREVIEW = '.storybook/preview.tsx'\nconst INTRODUCTIONS = ['src/stories/Introduction.mdx', 'stories/Introduction.mdx']\n/** The classes an app's Introduction counts as \"worth reusing\". */\nconst WORTH_REUSING = ['reusable', 'promote-candidate']\n\nfunction storyFiles(root: string): string[] {\n const out: string[] = []\n const walk = (dir: string) => {\n if (!existsSync(dir)) return\n for (const entry of readdirSync(dir, { withFileTypes: true })) {\n if (entry.name === 'node_modules' || entry.name.startsWith('.')) continue\n const path = join(dir, entry.name)\n if (entry.isDirectory()) walk(path)\n else if (entry.name.endsWith('.stories.tsx') || entry.name.endsWith('.mdx')) out.push(path)\n }\n }\n walk(join(root, 'src'))\n walk(join(root, 'stories'))\n return out\n}\n\n/** Every top-level heading the sidebar has, read from the story files: the first segment of each title. */\nexport function sidebarHeadings(root: string): Set<string> {\n const real = new Set<string>()\n for (const file of storyFiles(root)) {\n const text = readFileSync(file, 'utf8')\n const start = text.indexOf('const meta')\n const meta = start === -1 ? '' : text.slice(start, text.indexOf('satisfies Meta', start) + 1 || undefined)\n const title = meta.match(/\\btitle: *['\"]([^'\"]+)['\"]/) ?? text.match(/<Meta\\s+title=['\"]([^'\"]+)['\"]/)\n if (title) real.add(title[1].split('/')[0].trim())\n }\n return real\n}\n\n/** The top-level headings of Storybook's own index (`storybook index`): the first segment of every entry's title. */\nexport function indexHeadings(entries: Record<string, { title?: string }>): Set<string> {\n return new Set(Object.values(entries).flatMap((e) => (e.title ? [e.title.split('/')[0].trim()] : [])))\n}\n\n/** The strings at the top level of the array that starts at `open` (the index of its `[`), skipping nested arrays. */\nfunction topLevelStrings(text: string, open: number): string[] {\n const out: string[] = []\n let depth = 0\n for (let i = open; i < text.length; i++) {\n const c = text[i]\n if (c === '/' && text[i + 1] === '*') {\n const end = text.indexOf('*/', i + 2)\n if (end < 0) break\n i = end + 1\n } else if (c === '/' && text[i + 1] === '/') i = text.indexOf('\\n', i)\n else if (c === '[') depth++\n else if (c === ']') {\n if (--depth === 0) return out\n } else if (c === \"'\" || c === '\"') {\n const end = text.indexOf(c, i + 1)\n if (depth === 1) out.push(text.slice(i + 1, end))\n i = end\n }\n if (i < 0) break\n }\n return out\n}\n\n/** The headings the preview orders \u2014 a `HEADINGS` list or `storySort: { order: [...] }` \u2014 or null when it keeps no order. */\nexport function orderedHeadings(previewText: string): string[] | null {\n const list = /const HEADINGS = \\[/.exec(previewText) ?? /\\border:\\s*\\[/.exec(previewText)\n if (!list) return null\n return topLevelStrings(previewText, list.index + list[0].length - 1)\n}\n\n/**\n * The headings the Introduction names: a table row that opens with a bold name,\n * or a bullet that opens with bold names joined by \" \u00B7 \".\n */\nexport function introductionHeadings(introText: string): Set<string> {\n const rows = [...introText.matchAll(/^\\|\\s*\\*\\*([^*]+)\\*\\*\\s*\\|/gm)].map((m) => m[1])\n const bullets = [...introText.matchAll(/^[-*]\\s+\\*\\*([^*]+)\\*\\*\\s*[\u2014\u2013-]/gm)].flatMap((m) => m[1].split('\u00B7'))\n return new Set([...rows, ...bullets].map((h) => h.trim()).filter(Boolean))\n}\n\n/** The number the Introduction states, or null when it states none. */\nexport function introductionCount(introText: string): number | null {\n const said = introText.match(/\\*\\*(\\d+) parts worth reusing\\*\\*/)\n return said ? Number(said[1]) : null\n}\n\n/**\n * What is wrong with the repository's hand-written map of its Storybook; empty\n * when nothing is. `real` is the sidebar's top-level headings from Storybook's\n * index, when the caller has it; `registry` is needed only for an app's count.\n */\nexport function storyMapProblems(root: string, { registry, real = sidebarHeadings(root) }: { registry?: Registry; real?: Set<string> } = {}): string[] {\n const problems: string[] = []\n const previewPath = join(root, PREVIEW)\n if (existsSync(previewPath)) {\n const ordered = orderedHeadings(readFileSync(previewPath, 'utf8'))\n if (ordered) {\n const unordered = [...real].filter((r) => !ordered.includes(r))\n const empty = ordered.filter((o) => !real.has(o))\n if (unordered.length) problems.push(`${PREVIEW}: not in the heading order, so they fall to the bottom of the sidebar: ${unordered.join(', ')}`)\n if (empty.length) problems.push(`${PREVIEW}: in the heading order but no story uses them: ${empty.join(', ')}`)\n }\n }\n const intro = INTRODUCTIONS.find((p) => existsSync(join(root, p)))\n if (intro) {\n const text = readFileSync(join(root, intro), 'utf8')\n const named = introductionHeadings(text)\n if (named.size) {\n const missing = [...real].filter((r) => !named.has(r))\n const stale = [...named].filter((n) => !real.has(n))\n if (missing.length) problems.push(`${intro}: the sidebar has, the page does not name: ${missing.join(', ')}`)\n if (stale.length) problems.push(`${intro}: the page names, the sidebar does not have: ${stale.join(', ')}`)\n }\n const said = introductionCount(text)\n if (said !== null && registry) {\n const reusable = registry.entries.filter((entry) => WORTH_REUSING.includes(entry.app?.class ?? '')).length\n if (said !== reusable) problems.push(`${intro}: says ${said} parts worth reusing; the catalogue builds ${reusable}`)\n }\n }\n return problems\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAiCA,SAAS,iBAAiB;AAC1B,SAAS,cAAAA,aAAY,WAAW,aAAa,gBAAAC,eAAc,qBAAqB;AAChF,SAAS,cAAc;AACvB,SAAS,YAAAC,WAAU,WAAAC,UAAS,QAAAC,OAAM,YAAAC,WAAU,WAAAC,gBAAe;AAC3D,SAAS,qBAAqB;;;ACnB9B,SAAS,oBAAoB;AAC7B,SAAS,YAAY,aAAa,cAAc,gBAAgB;AAChE,SAAS,UAAU,SAAS,MAAM,eAAe;AAE1C,IAAM,eAAe;AAW5B,SAAS,SAAS,QAA2H;AAC3I,QAAM,OAAO,KAAK,QAAQ,cAAc;AACxC,MAAI,CAAC,WAAW,IAAI,EAAG,QAAO;AAC9B,MAAI;AACF,WAAO,KAAK,MAAM,aAAa,MAAM,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AG,aAAa,MAAM,CAAC;AAAA,CAAyC;AAAA,MACvF;AACA,aAAO;AAAA,IACT;AAAA,IAEA;AACE,cAAQ,OAAO,MAAM,4CAA4C;AACjE,aAAO;AAAA,EACX;AACF;AAEA,IAAI;AACF,UAAQ,WAAW,MAAM,KAAK;AAChC,SAAS,OAAO;AACd,UAAQ,OAAO,MAAM,GAAG,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,CAAI;AAClF,UAAQ,WAAW;AACrB;",
|
|
6
6
|
"names": ["existsSync", "readFileSync", "basename", "dirname", "join", "relative", "resolve", "main", "existsSync", "readFileSync", "dirname", "join", "resolve", "packageRoot", "existsSync", "readdirSync", "readFileSync", "join", "root", "resolve", "readFileSync", "existsSync", "join", "basename", "serializeRegistry", "registry", "linked", "shown", "loaded", "mapped", "relative", "dirname"]
|
|
7
7
|
}
|
|
@@ -19,6 +19,13 @@ export declare function hasSeenIn(source: string): boolean;
|
|
|
19
19
|
* it builds an id.
|
|
20
20
|
*/
|
|
21
21
|
export declare function linkProblems(registry: Registry, ids: ReadonlySet<string>): string[];
|
|
22
|
+
/**
|
|
23
|
+
* The parts an app's page may name under When and When not: the package's and
|
|
24
|
+
* the app's own (B8). The one copy: `estiva-ui check` and `gates:status` both
|
|
25
|
+
* read it, so they cannot disagree. Status once knew the app's parts only, and
|
|
26
|
+
* read six of Peek's pages as broken that CI passed (UIG-26).
|
|
27
|
+
*/
|
|
28
|
+
export declare function nameableParts(app: Registry, pkg: Registry): Set<string>;
|
|
22
29
|
/**
|
|
23
30
|
* Every way an app's catalogue breaks the contract, one line each, naming the
|
|
24
31
|
* part, its file and what to do. Empty when it keeps it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/registry/contract.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC,2DAA2D;AAC3D,eAAO,MAAM,a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AM,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,EAAE,CAsBhL"}
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export { buildRegistry, readIndexExports, serializeRegistry, type BuildOptions } from './build';
|
|
14
14
|
export { buildAppRegistry, type AppBuildOptions } from './app';
|
|
15
|
-
export { CONTRACT_KINDS, NO_ALTERNATIVE, PAGE_SECTIONS, contractProblems, hasSeenIn, linkProblems, namedParts, pageProblem, whenNotProblem } from './contract';
|
|
15
|
+
export { CONTRACT_KINDS, NO_ALTERNATIVE, PAGE_SECTIONS, contractProblems, hasSeenIn, linkProblems, nameableParts, namedParts, pageProblem, whenNotProblem } from './contract';
|
|
16
16
|
export { docsLink, findInRegistries, findInRegistry, formatFindings, type Finding } from './find';
|
|
17
17
|
export { CLASSES, SCHEMA_VERSION, validateRegistry, type AppFacts, type EntryBehaviour, type EntryClass, type FileWithoutPart, type EntryKind, type EntryStatus, type EntryVariant, type PurposeSource, type Registry, type RegistryEntry, type RegistryExclusion, } from './schema';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAC/F,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAC/F,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAC7K,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAA;AACjG,OAAO,EACL,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAA"}
|
package/dist/registry/index.js
CHANGED
|
@@ -10,10 +10,11 @@ import {
|
|
|
10
10
|
formatFindings,
|
|
11
11
|
hasSeenIn,
|
|
12
12
|
linkProblems,
|
|
13
|
+
nameableParts,
|
|
13
14
|
namedParts,
|
|
14
15
|
pageProblem,
|
|
15
16
|
whenNotProblem
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4QWD3EBY.js";
|
|
17
18
|
import {
|
|
18
19
|
buildAppRegistry
|
|
19
20
|
} from "./chunk-TQ6UQER3.js";
|
|
@@ -42,6 +43,7 @@ export {
|
|
|
42
43
|
formatFindings,
|
|
43
44
|
hasSeenIn,
|
|
44
45
|
linkProblems,
|
|
46
|
+
nameableParts,
|
|
45
47
|
namedParts,
|
|
46
48
|
pageProblem,
|
|
47
49
|
readIndexExports,
|
package/package.json
CHANGED