kerfjs 0.11.0 → 0.11.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/CHANGELOG.md CHANGED
@@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
7
  ## Unreleased
8
8
 
9
9
 
10
+ - KF-230 — `eslint-plugin-kerfjs` adds `kerfjs/prefer-attr-selector` (`warn` in recommended; plugin bumped to v0.11.0) — flags `delegate(_, _, '[name="value"]', _)` literal selectors and recommends `attr('name', 'value').selector`. Routing JSX `{...spec.attrs}` and the delegate target through one typed source means a rename can't desync the two. Conservative AST match: compound selectors (`[a="x"][b="y"]`), tag-qualified (`button[data-action="x"]`), bare-presence (`[data-new]`), and class / id selectors are left alone — those aren't 1:1 swaps for `attr()`. Severity `warn` because the literal form still works at runtime.
11
+ - KF-230 — `scripts/check-docs-examples.mjs` gains Check 3 (example doc/source import mirroring). For every paired `site/src/content/docs/examples/complete/<name>.md` ↔ `site/src/examples/complete/<name>/main.tsx`, every named kerfjs import the source pulls in must also appear in at least one kerf-import statement in the doc page. Catches "release adds a new public API (`attr()`, …) and updates the example source, but the rendered doc excerpt still uses the pre-release pattern" — the v0.11.0 release shipped exactly this drift across TodoMVC + chat doc pages, 12 migration pages, 7 reactivity-demo sections, and `docs/ai/usage-guide.md`, all corrected in the same ticket.
10
12
  - `attr()` now ships two overloads and a richer return type. **Static** `attr(name, value)` returns `AttrSpec<N, V>` — a frozen descriptor with `.name`, `.value`, `.selector`, and `.attrs` (a `{ readonly [name]: value }` object ready to spread into JSX, keeping the attribute name out of every call site so renames propagate automatically). **Dynamic** `attr<N, V extends string = string>(name)` pre-validates the attribute name and returns a per-render factory `(value: V) => { readonly [name]: V }` for per-row data attributes like `data-id`. `V` defaults to `string`; specify both generics explicitly (e.g. `attr<'data-sort', 'asc'|'desc'>('data-sort')`) to constrain the value set the factory accepts. `AttrSpec` gains two type parameters (`N extends string`, `V extends string`) for tighter `satisfies` constraints. `satisfies Record<string, AttrSpec<'data-action'>>` now catches a mismatched attribute name at compile time.
11
13
  - `delegate<T extends Element = Element>()` and `delegateCapture<T>()` now accept an optional element-type generic that narrows the matched element in the handler — `delegate<HTMLButtonElement>(...)` avoids the `as HTMLButtonElement` cast, zero runtime change.
12
14
  - `get()` inside `defineStore` actions is now typed `() => Readonly<TState>` — the compile-time counterpart to the existing dev-mode `Object.freeze` on the snapshot. Actions that try to mutate `get().prop = ...` now fail `tsc --noEmit` without a cast, before even reaching the runtime `TypeError`.
@@ -16,6 +18,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
16
18
  - `kerfjs` npm package now bundles the drop-in AI-assistant configs at `ai/skill.md`, `ai/cursorrules`, and `ai/manifest.json` — so `npm install kerfjs` lands them directly on disk instead of asking consumers to find them on GitHub. The repo-root `kerf.claude-skill.md` / `kerf.cursorrules` remain the source of truth; `ai/` is regenerated by `scripts/sync-ai-bundle.mjs` and kept honest by the new `npm run check:ai-bundle-in-sync` gate (wired into `npm run check`). Each bundled file carries a `kerf-skill-version` line + a `KERF-APP-CANONICAL-END` marker so the new ESLint rule can detect drift and auto-fix only the kerf-maintained section while preserving consumer customizations below the marker. See `docs/12-ai-assistant-configs.md`.
17
19
  - `eslint-plugin-kerfjs` v0.9.0 adds `kerfjs/ai-assistant-configs` (`warn` in recommended config) — once per lint pass, checks the consumer's `.claude/skills/kerf-app/SKILL.md` and `.cursorrules` against the bundled `kerfjs/ai/manifest.json`. Reports `missing` / `stale` / `forked` states; `eslint --fix` writes the bundled canonical above the `KERF-APP-CANONICAL-END` marker and preserves the consumer's append zone below it (the "versioned-section preservation" strategy). Granular disable via `['warn', { claude: false, cursor: true }]`.
18
20
 
21
+ ## [0.11.1] - 2026-05-21
22
+
23
+
24
+ - `attr()` redesign: typed `AttrSpec<N, V>` exposes `.attrs` with dual overloads for cleaner attribute handling
25
+
19
26
  ## [0.11.0] - 2026-05-21
20
27
 
21
28
 
package/ai/manifest.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "kerfjsVersion": "0.11.0",
2
+ "kerfjsVersion": "0.11.1",
3
3
  "files": [
4
4
  {
5
5
  "name": "skill",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kerfjs",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Tiny reactive UI framework — fine-grained signals + DOM morphing + JSX. Apply the smallest possible cut to update your DOM.",
5
5
  "type": "module",
6
6
  "sideEffects": false,