release: MessagePack wire contract and HTTP content negotiation #83

Merged
crapougnax merged 7 commits from claude-bot/release/msgpack-wire-contract into main 2026-11-23 15:11:28 +00:00 AGit
Member

Release

Promotes develop to main so the packages below are published with the latest dist-tag.

Content

Single change since the previous release: #82, the MessagePack wire contract.

  • @quatrain/core (1.2.22): normalizeForMsgPack(value, options) enforces the MessagePack representation on any value: toMsgPack() / toJSON() applied, every ref key emitted as path at any depth, null values omitted. refAsPath: false keeps ref; the option is handed down to toMsgPack() on AbstractObject and DataObject.
  • @quatrain/types (1.2.20): MsgPackOptions type; ObjectUri.toMsgPack(options); ObjectUri.toMsgPackReference() no longer overwrites an existing path key.
  • @quatrain/http (1.0.6): msgPackContentNegotiation(options), a framework-agnostic middleware that decodes MessagePack request bodies and encodes responses on demand.

Impact

  • Additive only: new exports and an optional parameter. JSON serialization and existing toMsgPack() calls without argument behave as before.
  • @quatrain/http gains two runtime dependencies: @msgpack/msgpack and @quatrain/core.

Why now

The beta versions cannot be consumed alongside the other published packages: their ^1.2.21 ranges on @quatrain/core exclude a 1.2.22 prerelease, so an application depending on both installs several copies of @quatrain/core. Publishing the final versions restores a single copy.

Validation

  • CI green on develop (runs 830 and 831), beta versions published from it.
  • 7 commits ahead of main, 0 behind.

After merge

Merge main back into develop (release commit and hashes), as for the previous releases.

## Release Promotes `develop` to `main` so the packages below are published with the `latest` dist-tag. ## Content Single change since the previous release: #82, the MessagePack wire contract. - **`@quatrain/core`** (1.2.22): `normalizeForMsgPack(value, options)` enforces the MessagePack representation on any value: `toMsgPack()` / `toJSON()` applied, every `ref` key emitted as `path` at any depth, `null` values omitted. `refAsPath: false` keeps `ref`; the option is handed down to `toMsgPack()` on `AbstractObject` and `DataObject`. - **`@quatrain/types`** (1.2.20): `MsgPackOptions` type; `ObjectUri.toMsgPack(options)`; `ObjectUri.toMsgPackReference()` no longer overwrites an existing `path` key. - **`@quatrain/http`** (1.0.6): `msgPackContentNegotiation(options)`, a framework-agnostic middleware that decodes MessagePack request bodies and encodes responses on demand. ## Impact - Additive only: new exports and an optional parameter. JSON serialization and existing `toMsgPack()` calls without argument behave as before. - `@quatrain/http` gains two runtime dependencies: `@msgpack/msgpack` and `@quatrain/core`. ## Why now The `beta` versions cannot be consumed alongside the other published packages: their `^1.2.21` ranges on `@quatrain/core` exclude a `1.2.22` prerelease, so an application depending on both installs several copies of `@quatrain/core`. Publishing the final versions restores a single copy. ## Validation - CI green on `develop` (runs 830 and 831), beta versions published from it. - 7 commits ahead of `main`, 0 behind. ## After merge Merge `main` back into `develop` (release commit and hashes), as for the previous releases.
chore(gitflow): merge the release back into develop
All checks were successful
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (pull_request) Successful in 4m2s
Quatrain Core CI / Publish Changed Packages to npm (pull_request) Has been skipped
a250e2f6da
The release commit on main (stable versions and hashes) is not in develop;
merging it now keeps the next develop -> main release free of conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge pull request 'chore(gitflow): merge the release back into develop' (#81) from chore/merge-release-into-develop into develop
All checks were successful
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (push) Successful in 2m51s
Quatrain Core CI / Publish Changed Packages to npm (push) Successful in 4m15s
8939fb7601
Reviewed-on: #81
Payloads sent as MessagePack were only converted when they still held live
objects exposing toMsgPack(). References already serialized with toJSON()
or toReference() kept their `ref` key.

normalizeForMsgPack() now enforces the contract on any value, whatever
produced it: toMsgPack() / toJSON() are applied and their output is
normalized again, every `ref` key is emitted as `path` at any depth,
null values are omitted, binary views are preserved, Map and Set are
converted, circular references are dropped.

ObjectUri.toMsgPackReference() no longer overwrites an existing `path`
key and ignores arrays.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
msgPackContentNegotiation decodes MessagePack request bodies and encodes
res.json() / res.send() payloads when the client asks for MessagePack
(Accept header or ?format=msgpack). It only negotiates and encodes: the
wire contract is delegated to normalizeForMsgPack() from @quatrain/core.

The middleware relies on structural request/response types, so it plugs
into Express or Connect without depending on them.

The package tsconfig now resets `paths` and excludes tests from the
build, like its sibling packages, so workspace dependencies resolve to
their built output.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(core): add a refAsPath option to the MessagePack wire contract
All checks were successful
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (push) Successful in 4m51s
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (pull_request) Successful in 5m0s
Quatrain Core CI / Publish Changed Packages to npm (push) Has been skipped
Quatrain Core CI / Publish Changed Packages to npm (pull_request) Has been skipped
f028cd6579
The `ref` to `path` rule stays on by default and can now be turned off
per application: normalizeForMsgPack(value, { refAsPath: false }).

The option is handed down to toMsgPack() on ObjectUri, AbstractObject
and DataObject, so live objects and already serialized references give
the same result. msgPackContentNegotiation() in @quatrain/http becomes a
factory taking the same options.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge pull request 'feat(core): single MessagePack wire contract with refAsPath option' (#82) from claude-bot/feat/msgpack-lowest-level-normalizer into develop
All checks were successful
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (push) Successful in 2m52s
Quatrain Core CI / Publish Changed Packages to npm (push) Successful in 4m31s
c154930bc9
Reviewed-on: #82
Sign in to join this conversation.
No description provided.