Skip to content

feat: add channels entrypoint - #55

Draft
fratzinger wants to merge 1 commit into
mainfrom
feat/channels
Draft

fratzinger wants to merge 1 commit into
mainfrom
feat/channels

Conversation

@fratzinger

Copy link
Copy Markdown
Member

Adds a new feathers-utils/channels entry point with four helpers for writing an app.publish publisher that composes with another one.

What

export purpose
toChannelLeaves normalize the four shapes a publisher may return into a flat list of leaf channels
filterChannelLeaves narrow that list without destroying the payload a channel carries for its connections
collapseChannels turn the list back into something Feathers dispatches correctly
chainChannels compose several publishers into one
import { chainChannels } from 'feathers-utils/channels'

Why its own entry point

The helpers need @feathersjs/transport-commons, which only an app with a realtime transport has installed. It is added as an optional peer dependency, and channels is deliberately absent from the root barrel so it cannot be pulled into a bundle that has no transport.

Also in here

  • @feathersjs/* bumped to ^5.0.50, plus socket.io-client as a dev dependency for the socket test harness
  • *.fixture.ts excluded from the published files
  • docs: channels category, sidebar entries, <ChannelsTable /> and a docs/channels/ section
  • test/index.test.ts asserts the new export surface

Test plan

  • pnpm test — lint + typecheck + coverage, 139 files / 1513 tests pass

🤖 Generated with Claude Code

Add `feathers-utils/channels` with four helpers for composing `app.publish`
publishers:

- `toChannelLeaves` - normalize the four shapes a publisher may return into a
  flat list of leaf channels
- `filterChannelLeaves` - narrow that list without destroying the payload a
  channel carries for its connections
- `collapseChannels` - turn the list back into something Feathers dispatches
  correctly
- `chainChannels` - compose several publishers into one

They ship in their own entry point because they need
`@feathersjs/transport-commons`, added as an optional peer dependency, which
only an app with a realtime transport has installed. For that reason `channels`
is deliberately absent from the root barrel.

Also bumps the `@feathersjs/*` packages to ^5.0.50 and excludes `*.fixture.ts`
from the published files.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying feathers-utils with  Cloudflare Pages  Cloudflare Pages

Latest commit: e052773
Status: ✅  Deploy successful!
Preview URL: https://521286ab.feathers-utils.pages.dev
Branch Preview URL: https://feat-channels.feathers-utils.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant