From 0a6e28dd066b176495d292ff22b6fc5cc1350a45 Mon Sep 17 00:00:00 2001 From: Benoit Travers Date: Tue, 6 Oct 2026 15:23:03 +0200 Subject: [PATCH] chore: release packages --- .changeset/aggregate-carries-version.md | 20 --------------- .changeset/aggregate-requires-identity.md | 12 --------- packages/entity/CHANGELOG.md | 30 +++++++++++++++++++++++ packages/entity/package.json | 2 +- 4 files changed, 31 insertions(+), 33 deletions(-) delete mode 100644 .changeset/aggregate-carries-version.md delete mode 100644 .changeset/aggregate-requires-identity.md diff --git a/.changeset/aggregate-carries-version.md b/.changeset/aggregate-carries-version.md deleted file mode 100644 index 96ce345..0000000 --- a/.changeset/aggregate-carries-version.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -"@btravstack/entity": minor ---- - -**Breaking:** an aggregate's decision now carries everything a repository -needs to save it. - -- `Entity.Decision` gains `expectedVersion`, the version the store must still - be at, and its `events` now hold **every** event decided since the aggregate - was loaded. A chain of commands saves as one decision without losing the - earlier events; reusing an already-saved state yields a conflict, never an - overwrite. -- An aggregate's `make` requires the version: `make(row, { version })`. - `replay` takes the stream's length, and `start` is version `0`. -- The version is kept beside the instance, not on it: no reserved field name, - nothing in `toJSON()`, and the package never interprets the number. - -To migrate, pass `{ version }` to an aggregate's `make`, and drop the separate -version argument from a repository's `save`: read `decision.expectedVersion` -instead. `Entity`'s `make` is unchanged. diff --git a/.changeset/aggregate-requires-identity.md b/.changeset/aggregate-requires-identity.md deleted file mode 100644 index afe40eb..0000000 --- a/.changeset/aggregate-requires-identity.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"@btravstack/entity": minor ---- - -**Breaking:** `Entity.aggregate` now requires at least one field flagged -`identity: true`. An aggregate root is what other aggregates reference and what -a repository loads, so a field map without one is a compile error, and a -declaration that gets past the types throws while it runs. `sameIdentityAs` is -therefore always available on an aggregate. - -To migrate, flag the aggregate's id: `id: Entity.field(SomeId, { identity: true })`. -`Entity` is unchanged: identity stays optional there. diff --git a/packages/entity/CHANGELOG.md b/packages/entity/CHANGELOG.md index f086565..2ffc581 100644 --- a/packages/entity/CHANGELOG.md +++ b/packages/entity/CHANGELOG.md @@ -1,5 +1,35 @@ # @btravstack/entity +## 0.9.0 + +### Minor Changes + +- 1af25ee: **Breaking:** an aggregate's decision now carries everything a repository + needs to save it. + + - `Entity.Decision` gains `expectedVersion`, the version the store must still + be at, and its `events` now hold **every** event decided since the aggregate + was loaded. A chain of commands saves as one decision without losing the + earlier events; reusing an already-saved state yields a conflict, never an + overwrite. + - An aggregate's `make` requires the version: `make(row, { version })`. + `replay` takes the stream's length, and `start` is version `0`. + - The version is kept beside the instance, not on it: no reserved field name, + nothing in `toJSON()`, and the package never interprets the number. + + To migrate, pass `{ version }` to an aggregate's `make`, and drop the separate + version argument from a repository's `save`: read `decision.expectedVersion` + instead. `Entity`'s `make` is unchanged. + +- 2370c4d: **Breaking:** `Entity.aggregate` now requires at least one field flagged + `identity: true`. An aggregate root is what other aggregates reference and what + a repository loads, so a field map without one is a compile error, and a + declaration that gets past the types throws while it runs. `sameIdentityAs` is + therefore always available on an aggregate. + + To migrate, flag the aggregate's id: `id: Entity.field(SomeId, { identity: true })`. + `Entity` is unchanged: identity stays optional there. + ## 0.8.0 ### Minor Changes diff --git a/packages/entity/package.json b/packages/entity/package.json index 001821f..7a429df 100644 --- a/packages/entity/package.json +++ b/packages/entity/package.json @@ -1,6 +1,6 @@ { "name": "@btravstack/entity", - "version": "0.8.0", + "version": "0.9.0", "description": "A domain-entity builder on zod v4: branded fields, immutable data, sealed construction, and Result instead of throws", "keywords": [ "ddd",