Skip to content

Repository files navigation

durable-cf-streams

bounded, incarnation-fenced durable streams for cloudflare sql storage. the package owns stream persistence and conversation-store semantics; the examples provide the http wiring.

packages

examples

each storage example tracks the full durable-streams conformance suite:

  • d1 - d1 database backend
  • sqlite - sqlite store (for durable objects with persistence)

storage backends

  • SqliteStore - sqlite via durable object storage with bounded chunk rows
  • D1Store - cloudflare d1 database with bounded chunk rows

quick start

pnpm install
pnpm run build
pnpm run test

development

pnpm run lint        # run biome
pnpm run lint:fix    # fix lint issues
pnpm run check       # typecheck
pnpm run build       # build all packages
pnpm run test        # run all tests

bumping durable-streams

when the upstream protocol changes:

# 1. update conformance tests
# edit @durable-streams/server-conformance-tests in pnpm-workspace.yaml#catalog
pnpm install --lockfile-only --no-frozen-lockfile

# 2. build and test
pnpm run build
pnpm run test

# 3. fix any failures, repeat

note: protocol constants and utilities are implemented locally for cloudflare workers compatibility (no node.js dependencies).

conformance migration boundary

when a conformance bump needs new behavior, keep the line clear:

  • put protocol primitives in durable-cf-streams: constants, validators, serializers, parsers, offset/cursor helpers, error types, and storage semantics that are framework-neutral and useful to consumers.
  • keep http wiring in examples: routing, request parsing, mapping errors to Response, framework adapters, and small runtime coordination helpers needed by a particular storage backend or example.
  • if the same protocol detail appears in multiple examples and is easy to get subtly wrong, promote the pure part into the package before adding more example glue.
  • keep examples and package code current-protocol only: no legacy aliases, compatibility shims, or consumer data migrations.

releasing

release-please automatically creates a package release PR when you merge releasable changes to main. the manifest starts from the current packages/durable-cf-streams version, writes the package changelog in packages/durable-cf-streams/CHANGELOG.md, and uses the bootstrap sha in release-please-config.json to bridge the old release history.

to override the version, edit the version in packages/durable-cf-streams/package.json directly in the release PR before merging.

when the release PR is merged, release-please creates the github release and the same workflow publishes packages/durable-cf-streams to npm with provenance.

license

mit

About

No description, website, or topics provided.

Resources

Contributing

Stars

20 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages