Repository navigation
Add new auto builders - #7
Merged
Merged
Conversation
wallie667
approved these changes
Jul 20, 2026
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.
Auto builders, deprecation of the hand-written builders, and a large round of fixes
New: auto builders
CeriosAutoBuilder<T>()andCeriosClassAutoBuilder(Class)— base-class factories that generate a bare-name setter for every property, so hand-writtensetPropertywrappers are no longer needed. Custom methods mix freely with the generated setters, and the existing compile-time required-property tracking is kept: callingbuild()before all required properties are set is a compiler error.BuilderComposerFromFactory/ClassBuilderComposerFromFactorynow accept auto-builder factories, so custom methods can hand callers a preconfigured child builder with full type safety.AutoBuilderBase<TBase>/ClassAutoBuilderBase<TBase>) and applied to each concrete auto builder viaBuilderExtension, replacing the old generic base-builder-class pattern.BuilderWith/ClassBuilderWith— ergonomic types for explicit return-type annotations, and one unified constructor shapenew Builder(data, { requiredFields, validators })for both factories.Deprecations
CeriosBuilderandCeriosClassBuilderare deprecated and will be removed in the next major version. See MIGRATION.md for a per-feature before/after guide.build()immediately — the compile-time gate dissolves when there are no required properties (all four base classes).Fixes (highlights)
build(),buildUnsafe(),buildFrozen(),buildSealed(), andbuildPartial()all return proper copies, so mutating a result can no longer corrupt the builder.Date,Map,Set,RegExp, and class prototypes, and handles circular references.__proto__is rejected as a key/path in all setters and is no longer a generated setter name.hasOwnProperty) can no longer silently invoke the real method, and copy-on-write preserves subclass instance fields, validators, and required fields.CeriosBuilderErrorwithmissingFields/validationErrors, and failing validators are identified by index and name.Packaging
.d.cts/.d.mts), built with tsdown (was tsup) and validated with@arethetypeswrong/cliin CI. Entry-point imports are unaffected.