2 Commits (cd2c8d0fc59d9cc3caf8a1481e7df126328e7bc6)

Author SHA1 Message Date
Buddy f9c07a263d refactor: split element classes from customElements.define
Every component is now two modules sharing a basename:

- src/elements/leaflet-foo.ts -- `export default class LeafletFooElement
  extends WithProps(...)`, the class only, no customElements.define, no
  side effects. src/elements/index.ts is an order-free barrel.
- src/components/leaflet-foo.ts -- three lines: import the class, define
  the tag, re-export. Importing this (or src/index.ts) registers the tag.

Plugin authors can now import a class without triggering the built-in
define, to subclass it or register it under a different tag name. Package
subpath exports `leaflet-components/elements`,
`leaflet-components/elements/leaflet-foo.js`, and
`leaflet-components/components/leaflet-foo.js` map onto dist/; jsr.json
gains an `./elements` entry.

The load-bearing ordering moves from the export statements in src/index.ts
to its `./components/*` side-effect imports (the elements barrel carries no
define, so its order is free). Classes are renamed LeafletFoo ->
LeafletFooElement, including in the HTMLElementTagNameMap augmentation.

Docs (CLAUDE.md, docs/, README.md) updated for the new layout.
2 weeks ago
Buddy 2c77784345 docs: add design docs breaking down architecture and major decisions
Eight docs under docs/ covering the current design: the WithProps mixin
and lifecycle, the PropDef/attribute model, the leaflet-register bubbling
protocol, generic event forwarding and its typing, per-component special
cases, the load-bearing export order in src/index.ts, and the toolchain
(TS 7, oxlint, oxfmt, Vitest, the no-bundle build, dual npm/JSR publish).

Also wire docs/**/*.md into the format script and point at docs/ from
CLAUDE.md and README.md.
3 weeks ago