From 931076c753453cd59f3f0b0a8d97c3affab26cd8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Aug 2026 23:45:33 +0000 Subject: [PATCH] chore: release packages --- .changeset/heavy-buses-repair.md | 31 ----------------- .changeset/olive-hounds-search.md | 26 --------------- packages/entity/CHANGELOG.md | 55 +++++++++++++++++++++++++++++++ packages/entity/package.json | 2 +- 4 files changed, 56 insertions(+), 58 deletions(-) delete mode 100644 .changeset/heavy-buses-repair.md delete mode 100644 .changeset/olive-hounds-search.md diff --git a/.changeset/heavy-buses-repair.md b/.changeset/heavy-buses-repair.md deleted file mode 100644 index acf7ec5..0000000 --- a/.changeset/heavy-buses-repair.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -"@btravstack/entity": minor ---- - -Two correctness fixes, honest `toJSON` typing, and readable errors. - -- **Fix: `deepEqual` no longer remembers failed comparisons as equal.** The - cycle guard recorded every pair it entered and never forgot one that - finished `false`, so two `Set`/`Map` fields with plainly different contents - could compare equal once their elements shared a subtree. The guard is now a - stack of in-progress pairs, not a memo. -- **Fix: `deepFreeze` no longer freezes caller-owned values under a union - branch.** The schema walk lost context at `union`, `pipe` and - `intersection` boundaries, so a `z.custom(...)` value nested inside one was - frozen in place — mutating an object the caller still owns. The walk now - carries context through all three. -- **`toJSON()` returns `DeepReadonly`.** The projection is shallow: - the top-level object is fresh, but nested containers are the instance's own - frozen references, so the previous mutable type let - `toJSON().tags.push(…)` compile and throw at runtime. -- **`InvalidEntity.message` is populated** — `": : ; …"` — - so a log line or a failed assertion names the entity and the failing fields - instead of printing a blank `Error`. The structured `issues` are unchanged. -- **New `Entity.renderIssue` and `Entity.keysOf`** — the issue helpers an - adapter needs to turn an `InvalidEntity` into a response body, the same ones - the message is built from. -- **A duplicate union discriminant value is a declaration-time defect.** - `Entity.union` previously let the last member win while zod threw lazily at - the first parse; it now fails at the declaration, naming both members. -- **The construction seal's property is named `__useMakeOrFactoryInstead`**, so - the compile error on `new SomeEntity(…)` tells the reader what to do. diff --git a/.changeset/olive-hounds-search.md b/.changeset/olive-hounds-search.md deleted file mode 100644 index a872577..0000000 --- a/.changeset/olive-hounds-search.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -"@btravstack/entity": minor ---- - -`update()` rejects a patch key it cannot apply, instead of dropping it silently. - -A patch may now carry only keys `updateInput` accepts. A key that is -`immutable`, `computed`, or not a field of the entity at all comes back as an -`InvalidEntity` with that key in `path` — every offending key reports, not -just the first. - -All three were silently discarded before while `update` returned `Ok`: the -caller asked for a change, got a success, and the change never happened. The -patch type already excluded them, but TypeScript's excess-property check only -fires on object literals, so the common adapter shape — building a patch as a -`Record` from a request body — evaded it entirely and the key -vanished into a passing `Result`. - -`make` is deliberately unchanged: it still ignores extra keys, so a stored row -carrying computed columns round-trips. Rehydrating data and patching it are -different acts — one heals what is already written, the other states an intent. - -**Breaking** for code that relied on the drop, most likely -`update(someWholeOutputObject)`. Patch only the fields you mean to change, or -narrow the object first — `updateInput.parse(body)` strips unknown keys and -gives you a patch that is accepted by construction. diff --git a/packages/entity/CHANGELOG.md b/packages/entity/CHANGELOG.md index 225751b..79bf050 100644 --- a/packages/entity/CHANGELOG.md +++ b/packages/entity/CHANGELOG.md @@ -1,5 +1,60 @@ # @btravstack/entity +## 0.3.0 + +### Minor Changes + +- 5f1a395: Two correctness fixes, honest `toJSON` typing, and readable errors. + + - **Fix: `deepEqual` no longer remembers failed comparisons as equal.** The + cycle guard recorded every pair it entered and never forgot one that + finished `false`, so two `Set`/`Map` fields with plainly different contents + could compare equal once their elements shared a subtree. The guard is now a + stack of in-progress pairs, not a memo. + - **Fix: `deepFreeze` no longer freezes caller-owned values under a union + branch.** The schema walk lost context at `union`, `pipe` and + `intersection` boundaries, so a `z.custom(...)` value nested inside one was + frozen in place — mutating an object the caller still owns. The walk now + carries context through all three. + - **`toJSON()` returns `DeepReadonly`.** The projection is shallow: + the top-level object is fresh, but nested containers are the instance's own + frozen references, so the previous mutable type let + `toJSON().tags.push(…)` compile and throw at runtime. + - **`InvalidEntity.message` is populated** — `": : ; …"` — + so a log line or a failed assertion names the entity and the failing fields + instead of printing a blank `Error`. The structured `issues` are unchanged. + - **New `Entity.renderIssue` and `Entity.keysOf`** — the issue helpers an + adapter needs to turn an `InvalidEntity` into a response body, the same ones + the message is built from. + - **A duplicate union discriminant value is a declaration-time defect.** + `Entity.union` previously let the last member win while zod threw lazily at + the first parse; it now fails at the declaration, naming both members. + - **The construction seal's property is named `__useMakeOrFactoryInstead`**, so + the compile error on `new SomeEntity(…)` tells the reader what to do. + +- ce69f0a: `update()` rejects a patch key it cannot apply, instead of dropping it silently. + + A patch may now carry only keys `updateInput` accepts. A key that is + `immutable`, `computed`, or not a field of the entity at all comes back as an + `InvalidEntity` with that key in `path` — every offending key reports, not + just the first. + + All three were silently discarded before while `update` returned `Ok`: the + caller asked for a change, got a success, and the change never happened. The + patch type already excluded them, but TypeScript's excess-property check only + fires on object literals, so the common adapter shape — building a patch as a + `Record` from a request body — evaded it entirely and the key + vanished into a passing `Result`. + + `make` is deliberately unchanged: it still ignores extra keys, so a stored row + carrying computed columns round-trips. Rehydrating data and patching it are + different acts — one heals what is already written, the other states an intent. + + **Breaking** for code that relied on the drop, most likely + `update(someWholeOutputObject)`. Patch only the fields you mean to change, or + narrow the object first — `updateInput.parse(body)` strips unknown keys and + gives you a patch that is accepted by construction. + ## 0.2.0 ### Minor Changes diff --git a/packages/entity/package.json b/packages/entity/package.json index 7446cf4..5487e1e 100644 --- a/packages/entity/package.json +++ b/packages/entity/package.json @@ -1,6 +1,6 @@ { "name": "@btravstack/entity", - "version": "0.2.0", + "version": "0.3.0", "description": "A domain-entity builder on zod v4: branded fields, immutable data, sealed construction, and Result instead of throws", "keywords": [ "ddd",