create-kerf-component 4.4.0 → 4.5.0-beta.1

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,27 +21,47 @@ 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
27
28
  the package boundary.
28
29
  - **ESM + `.d.ts` output** via `tsup`, with **subpath exports** (`.` and
29
30
  `./counter`).
31
+ - **An MIT `LICENSE`** carrying the generated package's contributor notice and
32
+ included in the package publish allowlist.
30
33
  - **`tsconfig` with `jsxImportSource: "kerfjs"`** so the author's `.tsx` compiles
31
34
  against kerf's JSX runtime; consumers need no extra setup.
32
35
  - **An example `Counter` component** demonstrating the two patterns every kerf
33
36
  component needs:
34
37
  - **per-instance state via a factory + props** (`createCounter` → `<Counter store={…} />`), and
35
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.
36
50
 
37
51
  ## Layout produced
38
52
 
39
53
  ```
40
54
  my-widgets/
41
- ├── package.json # peerDependencies.kerfjs, exports map, files: [dist]
55
+ ├── package.json # peerDependencies.kerfjs, exports map, publish files
42
56
  ├── tsconfig.json # jsxImportSource: "kerfjs"
43
57
  ├── tsup.config.ts # external: ['kerfjs'], format esm, dts
58
+ ├── kerf.components.json # explicit source metadata (never inferred from pixels)
59
+ ├── component-catalog-v2.json # deterministic generated AI catalog
60
+ ├── scripts/
61
+ │ ├── kerf-component-catalog.mjs # local generator + check mode
62
+ │ ├── component-metadata.schema.json # author-source schema used by the checker
63
+ │ └── component-catalog-v2.schema.json # emitted-catalog schema used by the checker
64
+ ├── LICENSE # MIT license with the package contributor notice
44
65
  ├── .gitignore
45
66
  ├── README.md
46
67
  └── src/
@@ -50,3 +71,13 @@ my-widgets/
50
71
 
51
72
  This package is part of the kerf repository and releases in lockstep with
52
73
  `kerfjs`.
74
+
75
+ The package also exposes `kerf-component-catalog`. It accepts `--write` (the
76
+ default), `--check`, and `--root <path>`. A root package with npm `workspaces`
77
+ generates every child package that declares `package.json#kerfComponentCatalog`,
78
+ in deterministic package and component order.
79
+
80
+ Application projects do not need this package scaffold. `npx kerfjs setup
81
+ --ui` creates an empty, schema-valid author metadata file, wires this catalog
82
+ command, and publishes the generated app catalog through the workspace UI
83
+ profile.