chore: release packages - #48
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This is an automated Changesets release PR for @btravstack/entity@0.4.0, preparing the package metadata and changelog for publishing.
Changes:
- Bump
@btravstack/entityversion from0.3.0to0.4.0. - Add the
0.4.0release notes topackages/entity/CHANGELOG.md. - Remove the consumed changeset file now that it’s been incorporated into the changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/entity/package.json | Updates package version to 0.4.0 for the release. |
| packages/entity/CHANGELOG.md | Records the 0.4.0 release notes (including the breaking change note) under Minor Changes. |
| .changeset/abstract-roots-and-union-classes.md | Deletes the changeset after it has been applied to the changelog. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
btravers
force-pushed
the
changeset-release/main
branch
from
August 9, 2026 00:27
c623421 to
39a3756
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@btravstack/entity@0.4.0
Minor Changes
3ba6b63: Add
Entity.abstract(name)(fields, options?), a tagless root that carries sharedfields and shared behaviour into every entity extended from it, and make
Entity.union(...)return a class so a union can be declared withclass X extends Entity.union(...) {}and used as a type.Entity.Instance<T>recovers an entity's or a union's instance type.
A root is a real supertype:
variant instanceof Rootis true, anabstractmember on the root is enforced on every variant (
TS2515), and abehaviour-only intermediate
abstract classbetween the two is picked up. Aunion's class body is for statics — it has no instances, and as a type it is
the root its members share;
Entity.Instance<typeof X>is the exact memberunion.
Breaking:
extendis no longer on an entity — an entity is final. Wrap theshared fields in an abstract root and declare both entities as variants of it:
A root is where behaviour shared by every variant lives, which is what the old
extendcould not carry: it rebuilt from the declaration alone, so class-bodymembers had to be written again per extension.
c554864:
extendoptions now accumulate instead of replacing.generatedandimmutableconcatenate root-then-variant, andcomputedmerges per key — therule
invariantsalready followed. A variant adds to what its root declared andcan no longer shed it.
Before, a variant that declared
immutablereplaced the root's list wholesale,so this silently made
issuedAtandissuedTopatchable:Now the variant's effective list is all four, and re-stating inherited keys is
unnecessary — delete them.
computedmerges per key rather than concatenating, because it is a map: avariant may add a derived field beside the root's, and may redefine one, but
cannot drop it. A redefined key gives the variant's schema and derivation on
output.shape,toJSON()andEntity.Output. One measured caveat: theinstance property keeps the root's type intersected in, because a root's
instance type is carried into every variant unmapped and subtracting from it is
what
TS2425forbids. Read a redefined key offEntity.Outputwhere its exacttype matters.
Breaking, in two ways.
Relaxing is no longer expressible:
immutable: []in a variant does not widenupdateInput. Code relying on it breaks loudly —updateInputshrinks, so thepatch call stops typechecking rather than changing behaviour silently. To fix
it, move the key the other way: a field only some variants need locked comes off
the root's
immutableand goes on each variant that wants it locked. The endstate is the same, and it is the only direction still expressible — a variant
can add to what the root declared, never subtract from it.
Entity.Static<…>'s fourth and fifth arguments are now unions of keys ratherthan tuples, so the empty case is
never:The tuple form could not express the merge —
readonly [...I, ...I2]isrejected with
TS2344, because TypeScript will not prove the parent's key set isa subset of the child's through zod's inference chain.
The same
TS2344loosens the constraint on both.Entity.StaticandEntity.BaseInstancenow take anyPropertyKeywhere they previously required atuple constrained to
keyof; tightening one back on its own reintroduces theerror, so it is not fixable asymmetrically. Hand-written entity declarations are
unaffected — the builders still constrain the real call sites — but both are
named in consumers' emitted declarations, which is why it is listed here.
For the same reason there is one new exported name,
MergedComputed(andEntity.MergedComputed): it is whatextendhandsEntity.Staticas itscomputed map, so it lands in the
.d.tsof any library that declares a variant.Not something to write against — written inline, the merge emitted an
unsubstituted type parameter and failed consumers on TypeScript 5.9.3 with
TS2304: Cannot find name 'A2'.