Skip to content

0.4.0 release prep: ship FORMAT.md, presence docs, error hygiene - #10

Merged
deepfates merged 2 commits into
mainfrom
release/0.4.0-prep
Jul 17, 2026
Merged

0.4.0 release prep: ship FORMAT.md, presence docs, error hygiene#10
deepfates merged 2 commits into
mainfrom
release/0.4.0-prep

Conversation

@deepfates

Copy link
Copy Markdown
Owner

Pre-publish fixes for the 0.4.0 npm release, from a cold-read of the package as a stranger would install it. Prep only — do not merge or publish without the owner's call.

1. Ship the spec in the tarball

files was ["bin", "dist"], so the README's links to FORMAT.md and pacts/*.md were dead from node_modules. Added FORMAT.md and pacts to files.

npm pack --dry-run (dist/* elided — 136 files, unchanged):

npm notice package: @deepfates/lync@0.4.0
npm notice 22.2kB FORMAT.md
npm notice 1.1kB LICENSE
npm notice 20.6kB README.md
npm notice 49B bin/lync.js
npm notice 5.4kB package.json
npm notice 1.2kB pacts/authorship.md
npm notice 6.7kB pacts/export.md
npm notice 9.5kB pacts/import.md
npm notice 690B pacts/ordering.md
npm notice package size: 116.5 kB
npm notice unpacked size: 501.6 kB
npm notice total files: 145

2. Document ./presence-awareness

The export existed with no README surface. New "Presence: who is here right now" section with a runnable example (two awareness instances wired to each other; the SyncedStore wiring is stated in prose), plus a line in Subpath exports. The example carries no fragment directive, so check-readme-examples executes it in pnpm verify and CI — it runs as example 6.

3. Non-empty socket error reason

lync sync against a dead relay printed socket error from ws://...: with nothing after the colon — Node's built-in WebSocket fires an ErrorEvent whose message can be the empty string. New socketErrorReason in src/cli/sync.ts falls back to the underlying error's message, then its code (e.g. ECONNREFUSED), then its name, and never returns empty. Covered by a dead-relay integration test (relay started, port noted, relay killed, sync attempted) asserting the reason after the colon is non-empty, plus unit tests over every event shape.

4. README status line

Top of the README now states: format is a v0 draft (matching FORMAT.md's own status line), envelope v:1 is stable.

5. "Why not Yjs / Automerge?"

Short honest section grounded in FORMAT.md's actual argument: events are immutable so there is no concurrent-mutation problem; merge is set union by id with no merge logic; same-id-different-bytes is surfaced, not resolved; CRDTs solve a different problem and are the right choice when state mutates. Notes that presence uses LWW clocks, not a CRDT.

Verification

  • pnpm test: 21 test files, 125 tests, all passed (includes the 2 new socket-error tests).
  • pnpm verify (path guard + tests + build + typecheck + README examples): passed. Examples: 9 executed (including the new presence example), 4 skipped as declared fragments.
  • npm pack --dry-run: file list above; FORMAT.md and all four pacts included.

- Ship the spec: add FORMAT.md and pacts/ to the npm tarball so README
  links resolve from node_modules (files was bin+dist only).
- Document the ./presence-awareness export with a runnable README example,
  executed by check-readme-examples like every other fenced block.
- lync sync against a dead relay printed 'socket error from ws://...:'
  with an empty reason (Node ErrorEvent.message can be ""). New
  socketErrorReason falls back to the underlying error's message, code
  (e.g. ECONNREFUSED), or name, and never returns empty. Covered by a
  dead-relay integration test and unit tests.
- README status line: format is a v0 draft, envelope v:1 is stable.
- README 'Why not Yjs / Automerge?' section grounded in FORMAT.md's
  actual argument (immutable events, union by id, no merge logic).
@deepfates
deepfates merged commit 449f18c into main Jul 17, 2026
2 checks passed
@deepfates
deepfates deleted the release/0.4.0-prep branch July 17, 2026 07:11
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