- leaflet moves from `dependencies` to `peerDependencies` (^1.9.4), kept in
`devDependencies` for local dev/tests. The nesting protocol dispatches on
`instanceof` against Leaflet's own Layer/Popup/Tooltip, so a second copy
pulled in transitively would silently break child registration.
- `@types/leaflet` (and its `@types/geojson` dep, imported directly by
leaflet-geojson's emitted .d.ts) move to `dependencies` — the published
declarations reference them and `leaflet` ships no types of its own, so a
TS consumer had a broken type surface with nothing signalling why.
- Drop the `exports["./dist/*"]` wildcard: it exposed the whole internal
tree (`core/*`, explicitly "not a stable contract") as importable,
semver-relevant surface. Root + `./elements` + `./components/*.js` cover
every intended entry.
- `prepublishOnly` now runs `typecheck` + `test` + `build`, not just `build`.
Verified against a packed tarball: a fresh consumer with only the declared
deps present typechecks clean under `moduleResolution` bundler and nodenext.
CLAUDE.md / docs / README updated to match.
The npm entry (`src/index.npm.ts`) adds the `declare global` augmentations via `src/core/globals.ts`; the JSR entry (`src/index.ts`) can't, because JSR's "no slow types" check forbids `declare global` in its published graph. That constraint is also why every element file uses the explicitly-typed `const PROPS` / `const Base` shape (see the `WithProps` section). `npx jsr publish --dry-run` is the authoritative check; it must print "Success" with no slow-type errors.
The npm entry (`src/index.npm.ts`) adds the `declare global` augmentations via `src/core/globals.ts`; the JSR entry (`src/index.ts`) can't, because JSR's "no slow types" check forbids `declare global` in its published graph. That constraint is also why every element file uses the explicitly-typed `const PROPS` / `const Base` shape (see the `WithProps` section). `npx jsr publish --dry-run` is the authoritative check; it must print "Success" with no slow-type errors.
Also published to JSR as [`@buddy/leaflet-components`](https://jsr.io/@buddy/leaflet-components) (`deno add jsr:@buddy/leaflet-components`). `leaflet` is always a peer dependency you install yourself; there is no CommonJS or UMD build. The examples below use the npm name — substitute `@buddy/leaflet-components` if you pull from JSR.
`leaflet` is a **peer dependency** — you install it, and only one copy must be
present (the nesting protocol relies on `instanceof` against Leaflet's own
classes). The Leaflet type definitions (`@types/leaflet`, `@types/geojson`)
ship as regular dependencies, so TypeScript consumers need nothing extra.
Also published to JSR as [`@buddy/leaflet-components`](https://jsr.io/@buddy/leaflet-components) (`deno add jsr:@buddy/leaflet-components`). There is no CommonJS or UMD build. The examples below use the npm name — substitute `@buddy/leaflet-components` if you pull from JSR.