create-kerf-component 5.0.0-beta.5 → 5.0.0-beta.50
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 +29 -1
- package/catalog.js +773 -0
- package/component-catalog-v2.schema.json +298 -0
- package/component-metadata.schema.json +229 -0
- package/index.js +29 -3
- package/package.json +9 -2
- package/template/README.md +35 -9
- package/template/component-catalog-v2.json +142 -0
- package/template/kerf.components.json +71 -0
- package/template/package.json +10 -2
- package/template/src/counter.tsx +4 -1
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
|
-
(
|
|
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,17 @@ 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.
|
|
38
50
|
|
|
39
51
|
## Layout produced
|
|
40
52
|
|
|
@@ -43,6 +55,12 @@ my-widgets/
|
|
|
43
55
|
├── package.json # peerDependencies.kerfjs, exports map, publish files
|
|
44
56
|
├── tsconfig.json # jsxImportSource: "kerfjs"
|
|
45
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
|
|
46
64
|
├── LICENSE # MIT license with the package contributor notice
|
|
47
65
|
├── .gitignore
|
|
48
66
|
├── README.md
|
|
@@ -53,3 +71,13 @@ my-widgets/
|
|
|
53
71
|
|
|
54
72
|
This package is part of the kerf repository and releases in lockstep with
|
|
55
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.
|