diff --git a/.changeset/warm-planes-refactor.md b/.changeset/warm-planes-refactor.md deleted file mode 100644 index 1afeb23..0000000 --- a/.changeset/warm-planes-refactor.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -"@openproject/stimulus-elements": minor ---- - -Fix `WithElements` to camelize keys like the runtime, and warn on colliding element keys - -- `WithElements<{ menu_item: string }>` now yields `menuItemElement` / - `menuItemElements` / `hasMenuItemElement`, matching the runtime accessors. - Previously it produced the wrong `menu_itemElement` names; if you worked - around this by passing pre-camelized keys, those still work — but usages - typed against the old snake_case accessor names must be renamed. -- Element keys whose generated accessor names collide (e.g. `foo` and `_foo` - both produce `hasFooElement`, or `foo`'s predicate vs `hasFoo`'s getter) - now emit a console warning naming both keys; the later definition wins that - property, as before. -- The naming rule (key → accessor triple + attribute suffix) now lives in one - module, with the acronym behaviour (`htmlURL` → `html-u-r-l`) locked in by - tests. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..61f4746 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# @openproject/stimulus-elements + +## 0.3.0 + +### Minor Changes + +- [#1](https://github.com/opf/stimulus-elements/pull/1) [`5d606a3`](https://github.com/opf/stimulus-elements/commit/5d606a38e1a14f8b5f43ddd3a49c4740852a5c0d) Thanks [@myabc](https://github.com/myabc)! - Fix `WithElements` to camelize keys like the runtime, and warn on colliding element keys + + - `WithElements<{ menu_item: string }>` now yields `menuItemElement` / + `menuItemElements` / `hasMenuItemElement`, matching the runtime accessors. + Previously it produced the wrong `menu_itemElement` names; if you worked + around this by passing pre-camelized keys, those still work — but usages + typed against the old snake_case accessor names must be renamed. + - Element keys whose generated accessor names collide (e.g. `foo` and `_foo` + both produce `hasFooElement`, or `foo`'s predicate vs `hasFoo`'s getter) + now emit a console warning naming both keys; the later definition wins that + property, as before. + - The naming rule (key → accessor triple + attribute suffix) now lives in one + module, with the acronym behaviour (`htmlURL` → `html-u-r-l`) locked in by + tests. diff --git a/package.json b/package.json index 728ffe4..0250f23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openproject/stimulus-elements", - "version": "0.2.0", + "version": "0.3.0", "description": "Declarative, controller-scoped element lookups for Stimulus — like targets, backed by any CSS selector.", "type": "module", "main": "./dist/index.js",