create-kerf-component 5.0.0-beta.1 → 5.0.0-beta.100

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.
@@ -0,0 +1,381 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/brianwestphal/kerf/main/create-kerf-component/component-metadata.schema.json",
4
+ "title": "Kerf consumer component metadata source",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "components"],
7
+ "properties": {
8
+ "$schema": { "type": "string" },
9
+ "schemaVersion": { "const": 1 },
10
+ "componentCatalog": {
11
+ "type": "string",
12
+ "minLength": 1,
13
+ "description": "Relative path to the package's component (selection) catalog, copied into the generated composition catalog's compatibility.componentCatalog. When package.json#kerfComponentCatalog.selectionOutput is configured and this is absent or \"not-applicable\", the generator derives it from that output path; otherwise it defaults to \"not-applicable\"."
14
+ },
15
+ "description": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "description": "One-line description of the package's components, emitted as the selection catalog's description. Required when package.json#kerfComponentCatalog.selectionOutput is configured."
19
+ },
20
+ "components": {
21
+ "type": "array",
22
+ "items": { "$ref": "#/$defs/component" }
23
+ }
24
+ },
25
+ "additionalProperties": false,
26
+ "$defs": {
27
+ "stateAttribute": {
28
+ "type": "object",
29
+ "required": ["name", "on", "helper", "meaning"],
30
+ "properties": {
31
+ "name": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "pattern": "^data-[a-z0-9]+(-[a-z0-9]+)*$"
35
+ },
36
+ "on": {
37
+ "type": "string",
38
+ "minLength": 1,
39
+ "description": "The element that carries it: a public class, or the element passed to the helper."
40
+ },
41
+ "helper": {
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "description": "The helper, one of wiring.helpers, that writes it."
45
+ },
46
+ "meaning": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "description": "What its presence or value means."
50
+ }
51
+ },
52
+ "additionalProperties": false
53
+ },
54
+ "repositoryPath": {
55
+ "description": "A package-relative POSIX path without traversal or empty segments.",
56
+ "type": "string",
57
+ "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9._-]+(?:/[A-Za-z0-9._-]+)*$"
58
+ },
59
+ "selection": {
60
+ "description": "Selection facts for the generated selection catalog (package.json#kerfComponentCatalog.selectionOutput). name, kind, purpose, source, publicClasses, publicTokens, and geometry are derived from the component; only the facts the composition metadata cannot express live here. Required on every component and composition when selectionOutput is configured; recipes are not selection entries.",
61
+ "type": "object",
62
+ "required": ["useWhen", "avoidWhen"],
63
+ "properties": {
64
+ "useWhen": {
65
+ "type": "array",
66
+ "items": { "type": "string", "minLength": 1 },
67
+ "minItems": 1
68
+ },
69
+ "avoidWhen": {
70
+ "type": "array",
71
+ "items": { "type": "string", "minLength": 1 },
72
+ "minItems": 1
73
+ },
74
+ "uses": {
75
+ "description": "Directly composed catalog entry ids: this package's own component ids or @kerfjs/ui selection catalog ids.",
76
+ "$ref": "#/$defs/stringList"
77
+ },
78
+ "styleSources": {
79
+ "description": "Stylesheets this component owns, relative to the package root.",
80
+ "type": "array",
81
+ "items": {
82
+ "allOf": [
83
+ { "$ref": "#/$defs/repositoryPath" },
84
+ { "pattern": "\\.css$" }
85
+ ]
86
+ },
87
+ "minItems": 1,
88
+ "uniqueItems": true
89
+ },
90
+ "demoSource": { "$ref": "#/$defs/repositoryPath" },
91
+ "documentation": { "type": "string", "minLength": 1 },
92
+ "geometry": {
93
+ "description": "Overrides composition.layout.geometry in the selection catalog. Required when that geometry uses the composition-only owner \"composed\".",
94
+ "type": "object",
95
+ "required": ["margin", "border", "padding"],
96
+ "properties": {
97
+ "margin": { "$ref": "#/$defs/selectionGeometryOwner" },
98
+ "border": { "$ref": "#/$defs/selectionGeometryOwner" },
99
+ "padding": { "$ref": "#/$defs/selectionGeometryOwner" },
100
+ "notes": {
101
+ "type": "array",
102
+ "items": { "type": "string", "minLength": 1 },
103
+ "minItems": 1
104
+ }
105
+ },
106
+ "additionalProperties": false
107
+ }
108
+ },
109
+ "additionalProperties": false
110
+ },
111
+ "selectionGeometryOwner": {
112
+ "enum": ["self", "parent", "child", "none", "conditional"]
113
+ },
114
+ "stringList": {
115
+ "type": "array",
116
+ "items": { "type": "string", "minLength": 1 },
117
+ "uniqueItems": true
118
+ },
119
+ "cardinality": {
120
+ "type": "object",
121
+ "required": ["min", "max"],
122
+ "properties": {
123
+ "min": { "type": "integer", "minimum": 0 },
124
+ "max": {
125
+ "anyOf": [
126
+ { "type": "integer", "minimum": 1 },
127
+ { "const": "unbounded" }
128
+ ]
129
+ }
130
+ },
131
+ "additionalProperties": false
132
+ },
133
+ "diagnostic": {
134
+ "type": "object",
135
+ "required": ["id", "severity", "when", "message"],
136
+ "properties": {
137
+ "id": { "type": "string", "pattern": "^KUI-C[0-9]{3}$" },
138
+ "severity": { "enum": ["error", "warning"] },
139
+ "when": { "type": "string", "minLength": 1 },
140
+ "message": { "type": "string", "minLength": 1 }
141
+ },
142
+ "additionalProperties": false
143
+ },
144
+ "component": {
145
+ "type": "object",
146
+ "required": [
147
+ "id",
148
+ "name",
149
+ "kind",
150
+ "purpose",
151
+ "source",
152
+ "publicExports",
153
+ "sourceLinks",
154
+ "composition",
155
+ "boundaries",
156
+ "accessibility",
157
+ "diagnostics",
158
+ "provenance"
159
+ ],
160
+ "properties": {
161
+ "id": { "type": "string", "minLength": 1 },
162
+ "name": { "type": "string", "minLength": 1 },
163
+ "kind": { "enum": ["component", "composition", "recipe"] },
164
+ "purpose": { "type": "string", "minLength": 1 },
165
+ "source": { "type": "string", "minLength": 1 },
166
+ "publicExports": {
167
+ "type": "array",
168
+ "minItems": 1,
169
+ "description": "Each export's name and package.json#exports subpath. A private application (package.json#private) may omit subpath; the name is then verified against the component's source file.",
170
+ "items": {
171
+ "type": "object",
172
+ "required": ["name"],
173
+ "properties": {
174
+ "name": { "type": "string", "minLength": 1 },
175
+ "subpath": { "type": "string", "pattern": "^\\." }
176
+ },
177
+ "additionalProperties": false
178
+ }
179
+ },
180
+ "sourceLinks": { "$ref": "#/$defs/stringList" },
181
+ "composition": { "$ref": "#/$defs/composition" },
182
+ "boundaries": {
183
+ "type": "object",
184
+ "required": ["rootClass", "publicClasses", "publicTokens"],
185
+ "properties": {
186
+ "rootClass": {
187
+ "oneOf": [
188
+ { "type": "string", "minLength": 1 },
189
+ { "type": "null" }
190
+ ]
191
+ },
192
+ "publicClasses": { "$ref": "#/$defs/stringList" },
193
+ "placeableClasses": {
194
+ "$ref": "#/$defs/stringList",
195
+ "description": "The subset of publicClasses an application may place on its own elements (a layout utility, item geometry on another carrier). Absent means none: every public class is the component's rendered anatomy, which eslint-plugin-kerfjs reports on an application-owned element as KUI-L103 with the component to render."
196
+ },
197
+ "rootElement": {
198
+ "type": "string",
199
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
200
+ "description": "The intrinsic element the component renders around its own placeableClasses. A placeable class on a plain element of this tag is the component recreated (KUI-L103); another carrier element keeps it. Requires placeableClasses."
201
+ },
202
+ "publicTokens": { "$ref": "#/$defs/stringList" }
203
+ },
204
+ "additionalProperties": false
205
+ },
206
+ "accessibility": {
207
+ "type": "object",
208
+ "required": ["obligations"],
209
+ "properties": { "obligations": { "$ref": "#/$defs/stringList" } },
210
+ "additionalProperties": false
211
+ },
212
+ "diagnostics": {
213
+ "type": "array",
214
+ "items": { "$ref": "#/$defs/diagnostic" }
215
+ },
216
+ "provenance": {
217
+ "type": "object",
218
+ "required": ["selection", "composition"],
219
+ "properties": {
220
+ "selection": { "type": "string", "minLength": 1 },
221
+ "composition": { "type": "string", "minLength": 1 }
222
+ },
223
+ "additionalProperties": false
224
+ },
225
+ "selection": { "$ref": "#/$defs/selection" }
226
+ },
227
+ "additionalProperties": false
228
+ },
229
+ "composition": {
230
+ "type": "object",
231
+ "required": [
232
+ "parents",
233
+ "contexts",
234
+ "zones",
235
+ "children",
236
+ "state",
237
+ "wiring",
238
+ "responsive",
239
+ "layout"
240
+ ],
241
+ "properties": {
242
+ "rendersAs": {
243
+ "description": "For a wrapper component: the cataloged roots it renders (package-qualified keys such as @kerfjs/ui:toolbar-control-group), any one of them or nothing. UI composition checks treat the wrapper as each declared root.",
244
+ "type": "array",
245
+ "minItems": 1,
246
+ "items": { "type": "string", "pattern": "^[^:]+:[^:]+$" },
247
+ "uniqueItems": true
248
+ },
249
+ "parents": {
250
+ "type": "object",
251
+ "required": ["mode", "entries"],
252
+ "properties": {
253
+ "mode": { "enum": ["any", "root", "listed"] },
254
+ "entries": { "$ref": "#/$defs/stringList" }
255
+ },
256
+ "additionalProperties": false
257
+ },
258
+ "contexts": { "$ref": "#/$defs/stringList" },
259
+ "zones": {
260
+ "type": "array",
261
+ "items": {
262
+ "type": "object",
263
+ "required": ["id", "accepts", "cardinality", "exclusiveWith"],
264
+ "properties": {
265
+ "id": { "type": "string", "minLength": 1 },
266
+ "jsx": {
267
+ "description": "The JSX prop that fills this zone (children for the default slot), so composition checks can map a prop's value to its zone. Unique per component.",
268
+ "type": "object",
269
+ "required": ["prop"],
270
+ "properties": {
271
+ "prop": { "type": "string", "minLength": 1 }
272
+ },
273
+ "additionalProperties": false
274
+ },
275
+ "accepts": { "$ref": "#/$defs/stringList" },
276
+ "cardinality": { "$ref": "#/$defs/cardinality" },
277
+ "exclusiveWith": { "$ref": "#/$defs/stringList" }
278
+ },
279
+ "additionalProperties": false
280
+ }
281
+ },
282
+ "children": {
283
+ "type": "object",
284
+ "required": ["mode", "concepts", "requiredConcepts"],
285
+ "properties": {
286
+ "mode": { "enum": ["any", "none", "listed"] },
287
+ "concepts": { "$ref": "#/$defs/stringList" },
288
+ "requiredConcepts": { "$ref": "#/$defs/stringList" }
289
+ },
290
+ "additionalProperties": false
291
+ },
292
+ "state": {
293
+ "type": "array",
294
+ "items": {
295
+ "type": "object",
296
+ "required": ["id", "owner", "required"],
297
+ "properties": {
298
+ "id": { "type": "string", "minLength": 1 },
299
+ "owner": { "enum": ["application", "controlled", "component"] },
300
+ "required": { "type": "boolean" }
301
+ },
302
+ "additionalProperties": false
303
+ }
304
+ },
305
+ "wiring": {
306
+ "type": "object",
307
+ "required": ["required", "helpers", "obligations"],
308
+ "properties": {
309
+ "required": { "type": "boolean" },
310
+ "scope": {
311
+ "description": "Where a required helper must run: application (default) anywhere reachable from a profile wiring entry, or module in the module that renders the component.",
312
+ "enum": ["application", "module"]
313
+ },
314
+ "helpers": { "$ref": "#/$defs/stringList" },
315
+ "sources": {
316
+ "description": "Where each application-owned helper in helpers is defined: its export name and source file relative to the package root. UI lint resolves relative imports of these helpers to verify page-root wiring (KUI-L401).",
317
+ "type": "array",
318
+ "items": {
319
+ "type": "object",
320
+ "required": ["export", "source"],
321
+ "properties": {
322
+ "export": { "type": "string", "minLength": 1 },
323
+ "source": { "type": "string", "minLength": 1 }
324
+ },
325
+ "additionalProperties": false
326
+ }
327
+ },
328
+ "actions": {
329
+ "description": "data-action values the application must handle with a root-delegated listener (delegate or delegateActions) instead of a named helper. Required wiring names at least one helper or action; UI lint verifies a reachable handler (KUI-L401).",
330
+ "$ref": "#/$defs/stringList"
331
+ },
332
+ "obligations": { "$ref": "#/$defs/stringList" },
333
+ "stateAttributes": {
334
+ "description": "Optional wiring-owned state attributes: data-* attributes a wiring helper writes at runtime, which the application must not render, remove, or treat as its own state.",
335
+ "type": "array",
336
+ "items": { "$ref": "#/$defs/stateAttribute" }
337
+ }
338
+ },
339
+ "additionalProperties": false
340
+ },
341
+ "responsive": {
342
+ "type": "object",
343
+ "required": ["owner", "behaviors"],
344
+ "properties": {
345
+ "owner": {
346
+ "enum": ["application", "component", "shared", "not-applicable"]
347
+ },
348
+ "behaviors": { "$ref": "#/$defs/stringList" }
349
+ },
350
+ "additionalProperties": false
351
+ },
352
+ "layout": {
353
+ "type": "object",
354
+ "required": ["roles", "geometry"],
355
+ "properties": {
356
+ "roles": {
357
+ "description": "One or more grouping roles for selection and catalog navigation. Prefer @kerfjs/ui's vocabulary so merged catalogs group consistently: structure, navigation, controls, actions, forms, feedback, foundation, media, layout, helpers, reference-composition (see docs/13-component-packages.md, Layout roles).",
358
+ "$ref": "#/$defs/stringList"
359
+ },
360
+ "geometry": {
361
+ "type": "object",
362
+ "required": ["margin", "border", "padding"],
363
+ "properties": {
364
+ "margin": { "$ref": "#/$defs/geometryOwner" },
365
+ "border": { "$ref": "#/$defs/geometryOwner" },
366
+ "padding": { "$ref": "#/$defs/geometryOwner" },
367
+ "notes": { "$ref": "#/$defs/stringList" }
368
+ },
369
+ "additionalProperties": false
370
+ }
371
+ },
372
+ "additionalProperties": false
373
+ }
374
+ },
375
+ "additionalProperties": false
376
+ },
377
+ "geometryOwner": {
378
+ "enum": ["self", "parent", "child", "none", "conditional", "composed"]
379
+ }
380
+ }
381
+ }
package/index.js CHANGED
@@ -17,8 +17,18 @@
17
17
  // kerf-component` alone just works. No third-party dependencies — the
18
18
  // initializer is plain Node so `npm create` runs it with zero install latency.
19
19
 
20
- import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
20
+ import {
21
+ copyFileSync,
22
+ cpSync,
23
+ existsSync,
24
+ mkdirSync,
25
+ readdirSync,
26
+ readFileSync,
27
+ renameSync,
28
+ writeFileSync,
29
+ } from 'node:fs';
21
30
  import { basename, dirname, join, resolve } from 'node:path';
31
+ import process from 'node:process';
22
32
  import { createInterface } from 'node:readline/promises';
23
33
  import { fileURLToPath } from 'node:url';
24
34
 
@@ -41,7 +51,9 @@ const USAGE =
41
51
  async function promptForTarget() {
42
52
  const rl = createInterface({ input: process.stdin, output: process.stdout });
43
53
  try {
44
- const answer = await rl.question(`Directory (\`.\` for current) [${DEFAULT_NAME}]: `);
54
+ const answer = await rl.question(
55
+ `Directory (\`.\` for current) [${DEFAULT_NAME}]: `,
56
+ );
45
57
  return answer.trim() || DEFAULT_NAME;
46
58
  } finally {
47
59
  rl.close();
@@ -117,6 +129,20 @@ async function main(argv) {
117
129
  // verbatim (`_gitignore` → `.gitignore`).
118
130
  mkdirSync(targetDir, { recursive: true });
119
131
  cpSync(TEMPLATE_DIR, targetDir, { recursive: true });
132
+ mkdirSync(join(targetDir, 'scripts'), { recursive: true });
133
+ copyFileSync(
134
+ join(dirname(fileURLToPath(import.meta.url)), 'catalog.js'),
135
+ join(targetDir, 'scripts', 'kerf-component-catalog.mjs'),
136
+ );
137
+ for (const schema of [
138
+ 'component-metadata.schema.json',
139
+ 'component-composition.schema.json',
140
+ 'component-catalog-extension.schema.json',
141
+ ])
142
+ copyFileSync(
143
+ join(dirname(fileURLToPath(import.meta.url)), schema),
144
+ join(targetDir, 'scripts', schema),
145
+ );
120
146
 
121
147
  for (const file of walk(targetDir)) {
122
148
  const text = readFileSync(file, 'utf8');
@@ -136,8 +162,10 @@ async function main(argv) {
136
162
  cdHint +
137
163
  ' npm install\n' +
138
164
  ' npm run build # tsup → ESM + .d.ts (kerfjs stays external)\n' +
165
+ ' npm run catalog:check # verify AI metadata and public exports\n' +
166
+ ' npm run check:styles # each component styles only itself (kerf-ui-analyze)\n' +
139
167
  ' npm run typecheck\n\n' +
140
- 'Edit src/counter.tsx, then publish with `npm publish --access public`.\n',
168
+ 'Edit src/counter.tsx, src/counter.css, and kerf.components.json, then publish with `npm publish --access public`.\n',
141
169
  );
142
170
  }
143
171
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kerf-component",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.0-beta.100",
4
4
  "description": "Scaffold a publishable kerf component package that already follows kerf's hard packaging rules.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -26,15 +26,23 @@
26
26
  "node": ">=18.0.0"
27
27
  },
28
28
  "bin": {
29
- "create-kerf-component": "index.js"
29
+ "create-kerf-component": "index.js",
30
+ "kerf-component-catalog": "catalog.js"
30
31
  },
31
32
  "files": [
32
33
  "index.js",
34
+ "catalog.js",
35
+ "component-metadata.schema.json",
36
+ "component-composition.schema.json",
37
+ "component-catalog-extension.schema.json",
33
38
  "template",
34
39
  "README.md",
35
40
  "LICENSE"
36
41
  ],
37
42
  "scripts": {
38
43
  "test": "node --test tests/*.test.js"
44
+ },
45
+ "dependencies": {
46
+ "typescript": "^5.0.0 || ^6.0.0"
39
47
  }
40
48
  }
@@ -1,4 +1,4 @@
1
- # __PKG_NAME__
1
+ # **PKG_NAME**
2
2
 
3
3
  A reusable [kerf](https://github.com/brianwestphal/kerf) component package,
4
4
  scaffolded with `create-kerf-component`.
@@ -7,8 +7,10 @@ scaffolded with `create-kerf-component`.
7
7
 
8
8
  ```bash
9
9
  npm install
10
- npm run build # tsup → dist/ (ESM + .d.ts); kerfjs stays external
10
+ npm run build # tsup → dist/ (ESM + .d.ts); kerfjs stays external
11
11
  npm run typecheck
12
+ npm run catalog:check # verify component-composition.json is current
13
+ npm run check:styles # each component styles only itself (kerf-ui-analyze)
12
14
  ```
13
15
 
14
16
  ## Use it
@@ -17,13 +19,14 @@ A kerf app that already has `jsxImportSource: "kerfjs"` configured can import an
17
19
  render the component like any local function — there's no extra toolchain:
18
20
 
19
21
  ```tsx
20
- import { mount } from 'kerfjs';
21
- import { Counter, createCounter, wireCounter } from '__PKG_NAME__';
22
+ import { mount } from "kerfjs";
23
+ import { Counter, createCounter, wireCounter } from "__PKG_NAME__";
24
+ import "__PKG_NAME__/counter.css";
22
25
 
23
- const counter = createCounter(0); // per-instance state (a factory)
24
- const root = document.getElementById('app')!;
26
+ const counter = createCounter(0); // per-instance state (a factory)
27
+ const root = document.getElementById("app")!;
25
28
 
26
- mount(root, () => <Counter store={counter} label="Clicks" />);
29
+ mount(root, () => <Counter store={counter} label="Clicks" size="compact" />);
27
30
 
28
31
  const dispose = wireCounter(root, counter); // delegation disposer (call on teardown)
29
32
  ```
@@ -31,7 +34,7 @@ const dispose = wireCounter(root, counter); // delegation disposer (call on tear
31
34
  ## The rules this package follows
32
35
 
33
36
  These are kerf's hard packaging rules (see the kerf docs,
34
- *Building reusable component packages*). The scaffold encodes them so you don't
37
+ _Building reusable component packages_). The scaffold encodes them so you don't
35
38
  have to:
36
39
 
37
40
  - **`kerfjs` is a `peerDependency` and is `external` in the build — never
@@ -43,9 +46,17 @@ have to:
43
46
  - **No inline JSX event handlers.** Components are pure `(props) => SafeHtml`
44
47
  string-builders; emit `data-action` hooks and let the host wire events with
45
48
  `delegate()` (see `wireCounter`), which returns a disposer.
49
+ - **Each component owns its styles; configure, never override.** `counter.css`
50
+ styles only `.kerf-counter` and its own internals and writes only
51
+ `--_kerf-counter-*` private variables (context it provides is named after
52
+ Counter). Consumers configure it through props (`size`) and its public token
53
+ (`--kerf-counter-gap`); when it must adapt inside a parent, Counter does so
54
+ in its own stylesheet (`.kui-toolbar .kerf-counter`). A needed variation with
55
+ no prop is a gap to add here, not an override for consumers.
56
+ `npm run check:styles` enforces this with `kerf-ui-analyze`.
46
57
  - **Build emits ESM + `.d.ts`; `tsconfig` sets `jsxImportSource: "kerfjs"`.**
47
58
  - **Never import `kerfjs/dev`.** kerf's dev diagnostics install global hooks, so
48
- installing them is the consuming *app's* call, not a library's — the app
59
+ installing them is the consuming _app's_ call, not a library's — the app
49
60
  writes `if (import.meta.env.DEV) await import('kerfjs/dev')` in its own entry.
50
61
  To get the diagnostics while developing this package, add that line to your own
51
62
  test harness or demo page instead (it belongs to the harness, not to `src/`).
@@ -56,4 +67,36 @@ have to:
56
67
  npm publish --access public
57
68
  ```
58
69
 
59
- `prepublishOnly` runs the build first; `files` ships only `dist/` + docs.
70
+ `prepublishOnly` checks the catalog and runs the build; `files` ships `dist/`,
71
+ the metadata/catalog pair, the README, and the license.
72
+
73
+ ## AI component metadata
74
+
75
+ `kerf.components.json` is the author-owned source for the component's purpose,
76
+ public exports, composition rules, geometry ownership, tokens, accessibility,
77
+ and source links. `boundaries.rootClass` explicitly names the public class that
78
+ owns runtime geometry (or is `null` when none does); `publicClasses` order has no
79
+ semantic meaning. Every public class is the component's rendered anatomy unless
80
+ `boundaries.placeableClasses` lists it: once an app's `.kerf-ui-profile.json`
81
+ declares this package's catalog under `catalogs`, `eslint-plugin-kerfjs`
82
+ reports an app that writes `kerf-counter` onto its own `<div>` (`KUI-L103`) and
83
+ tells it to render `Counter` instead. List a class there only when apps may legitimately
84
+ place it themselves (a layout utility, item geometry on another carrier), and
85
+ add `rootElement` when the component itself renders those classes on that tag.
86
+ Keep decisions explicit: the generator deliberately does not
87
+ derive semantic or geometry ownership from rendered appearance. It validates
88
+ both this source and the generated catalog against the schema copies beside the
89
+ checker, including rejection of unknown fields. Named exports must exist in
90
+ the TypeScript/TSX syntax tree; JSX text, nested scopes, comments, and literals
91
+ are not exports. The checker uses this package's installed TypeScript compiler,
92
+ so run `npm install` before the first local catalog command.
93
+
94
+ ```bash
95
+ npm run catalog:generate # write component-composition.json
96
+ npm run catalog:check # no writes; fail when metadata, source, or output drift
97
+ ```
98
+
99
+ The generated catalog ships with the package. AI tools join each entry to
100
+ Kerf's catalog by its `package:id` key, search this package first for
101
+ application-specific concepts, and retain both packages' identities when
102
+ following cross-catalog composition references.