• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

reactivando / use-pubsub-js / 28137965653
100%
master: 80%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 25 Jun 2026 12:12AM UTC
Jobs 1
Files 6
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Jun 2026 12:11AM UTC coverage: 100.0%. Remained the same
28137965653

push

github

web-flow
feat: createHierarchicalPubSub<E> — typed + hierarchical bus (#93)

* feat: add createHierarchicalPubSub<E> — typed + hierarchical bus

Fills the last capability gap: createPubSub is flat-typed, the PubSub singleton
is hierarchical-untyped — this is both. Publishing 'a.b.c' also notifies 'a.b'
and 'a' subscribers, with full payload typing.

- `DescendantKey<E, K>` (template-literal type): the keys a subscription to K
  receives — K plus dotted descendants ('order' matches 'order.created', not
  'orders'); symbol keys match only themselves. Adversarially reviewed with tsc.
- `HierarchicalPubSub<E>` interface + `createHierarchicalPubSub<E>(options?)`
  factory (reuses the existing hierarchical runtime). subscribe/on/subscribeOnce
  use a defaulted `D` param so the descendant union is computed once.
- Caveats (documented): a handler's `data` is narrowed by a property check, not
  by `token` (TS can't correlate the two params); only declared keys publish/sub.

Testing infra: `vitest --typecheck` type-level tests (`test:types` script, CI
step, no new deps) — `hierarchical.test-d.ts` pins DescendantKey edge cases
(prefix exclusion, symbols, leaf) + publish/subscribe/getSnapshot typing. Plus
runtime tests for delivery, retained getSnapshot, and onError.

Additive/non-breaking. 146 runtime tests + 7 type tests, 100% coverage, lint
clean, e2e 12/12, attw + publint clean, size within budget. README documented.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: exclude *.test-d.ts from the build; broaden export smoke tests

Adversarial review fixes:
- MAJOR: tsdown entry excluded *.spec.ts but not *.test-d.ts, so the type-test
  file (and its bundled vitest/expect-type chunks) was shipped to npm. Add
  '!src/**/*.test-d.ts' to the entry — dist is clean again, tarball back to size.
  (attw/publint didn't catch it — they only validate declared exports.)
- index.spec asserts createHierarchicalPubSub + useBusState in the public API.
- e2e ... (continued)

32 of 32 branches covered (100.0%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

214 of 214 relevant lines covered (100.0%)

182.84 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28137965653.1 25 Jun 2026 12:12AM UTC 6
100.0
GitHub Action Run
Source Files on build 28137965653
  • Tree
  • List 6
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #28137965653
  • d664ac86 on github
  • Prev Build on main (#28136139560)
  • Next Build on main (#28139058195)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc