@estiva-app/ui 0.35.2 → 0.36.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.
Files changed (123) hide show
  1. package/dist/eslint/escape.d.ts +23 -6
  2. package/dist/eslint/escape.d.ts.map +1 -1
  3. package/dist/eslint/index.js +70 -9
  4. package/dist/eslint/index.js.map +2 -2
  5. package/dist/eslint/no-raw-element.d.ts +7 -0
  6. package/dist/eslint/no-raw-element.d.ts.map +1 -1
  7. package/dist/eslint/no-restyled-part.d.ts +8 -0
  8. package/dist/eslint/no-restyled-part.d.ts.map +1 -1
  9. package/dist/gates/app-checks.d.ts.map +1 -1
  10. package/dist/gates/{chunk-DRIHHXQK.js → chunk-CC6L4B5U.js} +23 -17
  11. package/dist/gates/chunk-CC6L4B5U.js.map +7 -0
  12. package/dist/gates/chunk-SYVKGOWM.js +1131 -0
  13. package/dist/gates/chunk-SYVKGOWM.js.map +7 -0
  14. package/dist/gates/ci.d.ts +18 -0
  15. package/dist/gates/ci.d.ts.map +1 -0
  16. package/dist/gates/cli.js +20 -3
  17. package/dist/gates/cli.js.map +2 -2
  18. package/dist/gates/create-app.d.ts.map +1 -1
  19. package/dist/gates/create-app.js +1 -1
  20. package/dist/gates/escapes.d.ts +23 -0
  21. package/dist/gates/escapes.d.ts.map +1 -0
  22. package/dist/gates/gate-config.d.ts.map +1 -1
  23. package/dist/gates/hook.d.ts +2 -0
  24. package/dist/gates/hook.d.ts.map +1 -1
  25. package/dist/gates/index.d.ts +5 -1
  26. package/dist/gates/index.d.ts.map +1 -1
  27. package/dist/gates/index.js +37 -183
  28. package/dist/gates/index.js.map +4 -4
  29. package/dist/gates/name-escapes.d.ts +14 -0
  30. package/dist/gates/name-escapes.d.ts.map +1 -0
  31. package/dist/gates/status.d.ts +3 -1
  32. package/dist/gates/status.d.ts.map +1 -1
  33. package/dist/gates/token-lint.d.ts.map +1 -1
  34. package/dist/gates/token-style.d.ts +21 -0
  35. package/dist/gates/token-style.d.ts.map +1 -0
  36. package/dist/index.js +13 -13
  37. package/dist/index.js.map +1 -1
  38. package/dist/registry/{app-3ALZE6XO.js → app-YMABQII6.js} +3 -3
  39. package/dist/registry/app.d.ts.map +1 -1
  40. package/dist/registry/behaviours.d.ts +71 -0
  41. package/dist/registry/behaviours.d.ts.map +1 -0
  42. package/dist/registry/{build-NDXMVFQ5.js → build-3EANARLQ.js} +2 -2
  43. package/dist/registry/build.d.ts.map +1 -1
  44. package/dist/registry/{chunk-3WJ7ZZ7Z.js → chunk-EVJW26UR.js} +51 -4
  45. package/dist/registry/chunk-EVJW26UR.js.map +7 -0
  46. package/dist/registry/{chunk-XVII7P6G.js → chunk-SIB44CES.js} +276 -90
  47. package/dist/registry/chunk-SIB44CES.js.map +7 -0
  48. package/dist/registry/{chunk-5K2TRR4X.js → chunk-XK747STJ.js} +18 -3
  49. package/dist/registry/chunk-XK747STJ.js.map +7 -0
  50. package/dist/registry/cli.js +7 -6
  51. package/dist/registry/cli.js.map +2 -2
  52. package/dist/registry/contract.d.ts +13 -1
  53. package/dist/registry/contract.d.ts.map +1 -1
  54. package/dist/registry/index.d.ts +1 -1
  55. package/dist/registry/index.d.ts.map +1 -1
  56. package/dist/registry/index.js +11 -5
  57. package/package.json +4 -1
  58. package/registry.json +293 -17
  59. package/skill/estiva-ui.md +2 -1
  60. package/src/AppShell.mdx +2 -1
  61. package/src/AttachmentCard.tsx +7 -7
  62. package/src/Button.tsx +1 -1
  63. package/src/Card.tsx +2 -2
  64. package/src/ChipInput.mdx +2 -0
  65. package/src/ChipInput.tsx +1 -1
  66. package/src/CommandPalette.tsx +3 -3
  67. package/src/DialogShell.tsx +1 -1
  68. package/src/EmptyState.mdx +4 -3
  69. package/src/Lightbox.tsx +1 -1
  70. package/src/NavItem.tsx +1 -1
  71. package/src/PersonTrigger.tsx +1 -1
  72. package/src/Reaction.tsx +1 -1
  73. package/src/ScrollArea.mdx +4 -0
  74. package/src/Select.tsx +1 -1
  75. package/src/TopBar.mdx +1 -1
  76. package/src/eslint/escape.ts +43 -14
  77. package/src/eslint/has-a-page-and-a-story.test.ts +1 -1
  78. package/src/eslint/index.test.ts +2 -2
  79. package/src/eslint/no-copied-look.test.ts +1 -1
  80. package/src/eslint/no-hand-rolled-behaviour.test.ts +3 -3
  81. package/src/eslint/no-handmade-empty-state.test.ts +2 -2
  82. package/src/eslint/no-handmade-header.test.ts +2 -2
  83. package/src/eslint/no-native-title.test.ts +2 -2
  84. package/src/eslint/no-raw-element.test.ts +47 -15
  85. package/src/eslint/no-raw-element.ts +53 -3
  86. package/src/eslint/no-rebuilt-behaviour.test.ts +9 -9
  87. package/src/eslint/no-restyled-part.test.ts +21 -2
  88. package/src/eslint/no-restyled-part.ts +30 -0
  89. package/src/eslint/raw-element-outside-a-wrapper.test.ts +3 -3
  90. package/src/gates/app-checks.ts +4 -3
  91. package/src/gates/ci.ts +152 -0
  92. package/src/gates/cli.ts +19 -3
  93. package/src/gates/count.ts +1 -1
  94. package/src/gates/create-app.test.ts +2 -2
  95. package/src/gates/create-app.ts +22 -16
  96. package/src/gates/escapes.ts +111 -0
  97. package/src/gates/gate-config.ts +2 -0
  98. package/src/gates/gates.test.ts +86 -1
  99. package/src/gates/hook.ts +38 -4
  100. package/src/gates/index.ts +5 -1
  101. package/src/gates/name-escapes.ts +77 -0
  102. package/src/gates/status.ts +45 -2
  103. package/src/gates/token-lint.ts +11 -4
  104. package/src/gates/token-style.ts +79 -0
  105. package/src/how.test.ts +282 -0
  106. package/src/pages.test.ts +6 -0
  107. package/src/registry/app.test.ts +34 -0
  108. package/src/registry/app.ts +52 -2
  109. package/src/registry/behaviours.ts +223 -0
  110. package/src/registry/build.ts +36 -0
  111. package/src/registry/cli.ts +5 -3
  112. package/src/registry/contract.test.ts +27 -2
  113. package/src/registry/contract.ts +28 -3
  114. package/src/registry/index.ts +1 -1
  115. package/src/registry/registry.test.ts +14 -0
  116. package/dist/gates/chunk-DBMUQAR6.js +0 -607
  117. package/dist/gates/chunk-DBMUQAR6.js.map +0 -7
  118. package/dist/gates/chunk-DRIHHXQK.js.map +0 -7
  119. package/dist/registry/chunk-3WJ7ZZ7Z.js.map +0 -7
  120. package/dist/registry/chunk-5K2TRR4X.js.map +0 -7
  121. package/dist/registry/chunk-XVII7P6G.js.map +0 -7
  122. /package/dist/registry/{app-3ALZE6XO.js.map → app-YMABQII6.js.map} +0 -0
  123. /package/dist/registry/{build-NDXMVFQ5.js.map → build-3EANARLQ.js.map} +0 -0
@@ -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 const broken = contractProblems(registry, root)\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 pkg = readPackageRegistry()\n const stale = nameProblems(registry, root, {\n known: new Set([...pkg.entries, ...registry.entries].map((e) => e.name)),\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,MAAM,CAAC;AAAA,EAC9C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,SAAS,QAAQ,QAA+B;AACrD,QAAM,IAAI,SAAS,MAAM;AACzB,MAAI,CAAC,KAAK,EAAE,SAAS,aAAc,QAAO;AAC1C,QAAM,OAAO,QAAQ,EAAE,eAAe,YAAY,KAAK,EAAE,kBAAkB,YAAY,CAAC;AACxF,SAAO,QAAQ,WAAW,KAAK,QAAQ,KAAK,CAAC,IAAK,EAAE,QAAQ,SAAS,MAAM,IAAK;AAClF;AAEA,IAAM,QAAQ,CAAC,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Q,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, 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": ";;;;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,MAAM,KAAK;AACvB,YAAM,SAAS,MAAMD,SAAQ,GAAG,IAAI,aAAa,IAAI;AAGrD,UAAIW,UAAS,QAAQ,YAAY,CAAC,EAAE,WAAW,IAAI,GAAG;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;",
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
  }
@@ -25,7 +25,19 @@ export declare function linkProblems(registry: Registry, ids: ReadonlySet<string
25
25
  *
26
26
  * `root` is the app's own folder: the one its catalogue's paths are relative to.
27
27
  */
28
- export declare function contractProblems(registry: Registry, root: string): string[];
28
+ export declare function contractProblems(registry: Registry, root: string, known?: ReadonlySet<string>): string[];
29
+ /** The names a page's section writes as a part: bold or in backticks, starting with a capital. */
30
+ export declare function namedParts(section: string): string[];
31
+ /** The line a "When not" starts where no part stands in (Katerina's ruling B8). */
32
+ export declare const NO_ALTERNATIVE: RegExp;
33
+ /**
34
+ * Why a page's `When not` breaks the ruling B8 (25 September), or null. The plan
35
+ * asked for "When not — naming the alternative"; CI checked only that the
36
+ * heading was there, and 29 pages across the three repos named nothing. Now the
37
+ * section names a real part other than the page's own (`own`), from `known`, or
38
+ * a line of it starts "No alternative:" and says why there is none.
39
+ */
40
+ export declare function whenNotProblem(source: string, own: readonly string[], known: ReadonlySet<string>): string | null;
29
41
  /**
30
42
  * What an app's usage pages name that is not there (the re-review after the audit
31
43
  * before UIG-26, R14): a part named under When or When not that no catalogue has —
@@ -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,aAAa,sDAAuD,CAAA;AAEjF,iDAAiD;AACjD,eAAO,MAAM,cAAc,4CAA6C,CAAA;AAKxE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAoBzD;AAED,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CASnF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAqB3E;AAcD;;;;;;;;GAQG;AACH,w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AK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAMhH;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,UAAe,EAAE,EAAE;IAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,EAAE,CAsBhL"}
@@ -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, PAGE_SECTIONS, contractProblems, hasSeenIn, linkProblems, pageProblem } from './contract';
15
+ export { CONTRACT_KINDS, NO_ALTERNATIVE, PAGE_SECTIONS, contractProblems, hasSeenIn, linkProblems, 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,aAAa,EAAE,g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@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CONTRACT_KINDS,
4
+ NO_ALTERNATIVE,
4
5
  PAGE_SECTIONS,
5
6
  contractProblems,
6
7
  docsLink,
@@ -9,16 +10,18 @@ import {
9
10
  formatFindings,
10
11
  hasSeenIn,
11
12
  linkProblems,
12
- pageProblem
13
- } from "./chunk-5K2TRR4X.js";
13
+ namedParts,
14
+ pageProblem,
15
+ whenNotProblem
16
+ } from "./chunk-XK747STJ.js";
14
17
  import {
15
18
  buildAppRegistry
16
- } from "./chunk-3WJ7ZZ7Z.js";
19
+ } from "./chunk-EVJW26UR.js";
17
20
  import {
18
21
  buildRegistry,
19
22
  readIndexExports,
20
23
  serializeRegistry
21
- } from "./chunk-XVII7P6G.js";
24
+ } from "./chunk-SIB44CES.js";
22
25
  import {
23
26
  CLASSES,
24
27
  SCHEMA_VERSION,
@@ -27,6 +30,7 @@ import {
27
30
  export {
28
31
  CLASSES,
29
32
  CONTRACT_KINDS,
33
+ NO_ALTERNATIVE,
30
34
  PAGE_SECTIONS,
31
35
  SCHEMA_VERSION,
32
36
  buildAppRegistry,
@@ -38,9 +42,11 @@ export {
38
42
  formatFindings,
39
43
  hasSeenIn,
40
44
  linkProblems,
45
+ namedParts,
41
46
  pageProblem,
42
47
  readIndexExports,
43
48
  serializeRegistry,
44
- validateRegistry
49
+ validateRegistry,
50
+ whenNotProblem
45
51
  };
46
52
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estiva-app/ui",
3
- "version": "0.35.2",
3
+ "version": "0.36.0",
4
4
  "description": "Estiva's design tokens (the contract) and a small set of primitives (a convenience) for every Estiva app.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -52,12 +52,15 @@
52
52
  "test": "vitest run --project unit",
53
53
  "test:watch": "vitest --project unit",
54
54
  "test:a11y": "vitest run --project storybook-signal --project storybook-ship",
55
+ "test:stories": "vitest run --project storybook-draw",
55
56
  "typecheck": "tsc --noEmit",
56
57
  "prelint": "node build.mjs",
57
58
  "lint": "eslint .",
58
59
  "prelint:rules": "node build.mjs",
59
60
  "lint:rules": "eslint --config eslint.gates.config.js .",
60
61
  "postlint:rules": "node dist/gates/cli.js count --repo estiva-ui --package",
62
+ "pregates:ci": "node build.mjs",
63
+ "gates:ci": "node dist/gates/cli.js ci --package",
61
64
  "pregates:status": "node build.mjs",
62
65
  "gates:status": "node dist/gates/cli.js status",
63
66
  "pregates:compare": "node build.mjs",