create-kerf-component 5.0.0-beta.5 → 5.0.0-beta.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,6 +11,7 @@ npm create kerf-component@latest my-widgets
11
11
  cd my-widgets
12
12
  npm install
13
13
  npm run build
14
+ npm run catalog:check
14
15
  ```
15
16
 
16
17
  Run it with **no argument** (`npm create kerf-component`) and it prompts for the
@@ -20,7 +21,7 @@ directory's basename is used as the package name.
20
21
  ## What you get
21
22
 
22
23
  A ready-to-publish component package that encodes the rules from the kerf docs
23
- (*Building reusable component packages*):
24
+ (_Building reusable component packages_):
24
25
 
25
26
  - **`kerfjs` as a `peerDependency`, `external` in the tsup build** — never
26
27
  bundled, so `isSafeHtml` brand checks and signal identity stay intact across
@@ -35,6 +36,24 @@ A ready-to-publish component package that encodes the rules from the kerf docs
35
36
  component needs:
36
37
  - **per-instance state via a factory + props** (`createCounter` → `<Counter store={…} />`), and
37
38
  - **a `wire(root)` delegation disposer** (`wireCounter`) instead of inline event handlers.
39
+ - **Author-owned AI metadata** in `kerf.components.json`, with explicit purpose,
40
+ exports, composition, geometry, public `rootClass`, tokens, accessibility,
41
+ and source links. Run
42
+ `npm run catalog:generate` to emit the package-qualified
43
+ `component-catalog-v2.json`; `npm run catalog:check` fails on drift, deleted
44
+ sources, renamed exports, duplicate ids, an omitted author decision, or any
45
+ source/output field that violates the shipped schemas. Export verification
46
+ uses the TypeScript/TSX syntax tree, so JSX text, nested scopes, comments, and
47
+ string/template/regular-expression literals cannot masquerade as public
48
+ exports. The scaffold already declares TypeScript; run `npm install` before
49
+ invoking its copied local checker in a fresh offline directory.
50
+ A component whose wiring helper writes runtime `data-*` state onto its DOM
51
+ can declare it under `composition.wiring.stateAttributes` — each item is
52
+ `{ name, on, helper, meaning }`, where `name` is a `data-*` name, `on` is the
53
+ element that carries it, and `helper` is one of `wiring.helpers`. Apps must
54
+ not render, remove, or treat those attributes as their own state. The field
55
+ is optional; names must be unique per component, and the checker rejects a
56
+ helper that is not listed in `wiring.helpers`.
38
57
 
39
58
  ## Layout produced
40
59
 
@@ -43,6 +62,12 @@ my-widgets/
43
62
  ├── package.json # peerDependencies.kerfjs, exports map, publish files
44
63
  ├── tsconfig.json # jsxImportSource: "kerfjs"
45
64
  ├── tsup.config.ts # external: ['kerfjs'], format esm, dts
65
+ ├── kerf.components.json # explicit source metadata (never inferred from pixels)
66
+ ├── component-catalog-v2.json # deterministic generated AI catalog
67
+ ├── scripts/
68
+ │ ├── kerf-component-catalog.mjs # local generator + check mode
69
+ │ ├── component-metadata.schema.json # author-source schema used by the checker
70
+ │ └── component-catalog-v2.schema.json # emitted-catalog schema used by the checker
46
71
  ├── LICENSE # MIT license with the package contributor notice
47
72
  ├── .gitignore
48
73
  ├── README.md
@@ -53,3 +78,13 @@ my-widgets/
53
78
 
54
79
  This package is part of the kerf repository and releases in lockstep with
55
80
  `kerfjs`.
81
+
82
+ The package also exposes `kerf-component-catalog`. It accepts `--write` (the
83
+ default), `--check`, and `--root <path>`. A root package with npm `workspaces`
84
+ generates every child package that declares `package.json#kerfComponentCatalog`,
85
+ in deterministic package and component order.
86
+
87
+ Application projects do not need this package scaffold. `npx kerfjs setup
88
+ --ui` creates an empty, schema-valid author metadata file, wires this catalog
89
+ command, and publishes the generated app catalog through the workspace UI
90
+ profile.