Repository navigation
chore: version packages - #16
Merged
Merged
Conversation
vethman
approved these changes
Oct 6, 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.
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
@cerios/cerios-builder@1.8.0
Minor Changes
84cb7b5:
BuilderWithandClassBuilderWithtake an optional third type argument, the builder class, so property names autocomplete in instance methods:thiskeeps everything set earlier in the chain. The builder class is where the property names are looked up, and is the classthismust extend.BuilderWith<this, "city">describes exactly the same type and keeps working, but editors cannot list property names for the genericthis, so it offers no suggestions inside the quotes. An existing two-argument method only needs the class appended. The third argument defaults to the first, so existing uses are unaffected.Inside a string literal, VS Code only suggests on the opening quote or Ctrl+Space by default. Set
"editor.quickSuggestions": { "strings": "on" }to get suggestions while typing.84cb7b5: Calling
build()(orbuildFrozen(),buildSealed(), and the other compile-time-checked variants) before every required property is set now gives a short compile error that names the missing properties:Previously the error was a four-line chain that printed the builder's full brand type up to three times before reaching the missing names. The build variants now infer the receiver type and check it against the required brand themselves. When the check fails, the
thistype they demand isMissingRequiredProperties<...>, which no builder can satisfy, so the error stops there instead of elaborating on the builder type. This applies to the auto builders and to the deprecatedCeriosBuilder/CeriosClassBuilder.Nothing that compiled before stops compiling. That includes calling
build()onthisinside a builder's own method after setting every required property, generic helpers that accept a fully branded builder, overridingbuild()in a subclass, andReturnType<UserBuilder["build"]>.BuildGate/ClassBuildGateare still exported and still describe the same condition. They are now deprecated in favour ofBuilderWith<YourBuilder>/ClassBuilderWith<YourBuilder>. The newMissingRequiredPropertiestype is exported too.84cb7b5: Deprecate the helper types that the auto builders and
BuilderWithmade redundant. They are still exported and still work. Each@deprecatedtag names its replacement, and MIGRATION.md has a before/after table:BuilderStep/ClassBuilderStepBuilderWith<this, "key", YourBuilder>/ClassBuilderWithBuilderPreset/ClassBuilderPresetBuilderWith<YourBuilder, "key">/ClassBuilderWithBuilderComposer/ClassBuilderComposerBuilderComposerFromFactory/ClassBuilderComposerFromFactoryBuildGate/ClassBuildGateBuilderWith<YourBuilder>/ClassBuilderWith<YourBuilder>RequiredFieldsTemplateRequiredFieldsRecord<T>, orReadonlyArray<Path<T>>for nested pathsThe generated setters used to be declared with
BuilderStep. They now return the newInternalBuilderStep/InternalClassBuilderStep, which are exported, so hovers and the too-earlybuild()error no longer name a deprecated type:It is the same type under a new name. You never need to write it yourself: annotate your own methods with
BuilderWith. Nothing that compiled before stops compiling, and nothing changes at runtime. Only a project whose lint rule reports deprecated APIs will see a warning where it names one of these types.84cb7b5: Add
removeRequiredProperty(key), the counterpart ofremoveOptionalProperty(key), on the auto builders and the deprecated builders. It accepts only required keys (andremoveOptionalPropertyonly optional ones), and returns a new builder without that property. The main use is building an invalid object for a negative test:The returned builder can no longer use the compile-time-checked build variants:
build()reportsMissingRequiredProperties<"name">. UsebuildUnsafe()orbuildPartial()for the incomplete object, whilebuildWithoutCompileTimeValidation()still runs the runtime checks. Setting the property again on that same builder does not lift the restriction, because the compile-time tracking cannot forget a removal. Builders are immutable, so build from the builder you had before the removal instead. The marker type it adds,RemovedRequiredProperties, is exported.removeRequiredPropertyis now a reserved builder name: a property literally namedremoveRequiredPropertyis set withremoveRequiredPropertyProp, like every other property named after a builder member.84cb7b5: Auto-builder setters are now linked to the property they set. Ctrl+Click (Go to Definition) on
builder.city(...)openscityin your type or class instead of the library's internal mapped type. Hovering a setter shows the property's own documentation comment, and renaming the property also renames the setter calls.TypeScript only links a mapped member to its source property when the mapped type iterates
keyofthe source and itsasclause filters keys rather than renaming them. The setters used to be generated fromkeyof T & stringwith anasclause that renamed reserved keys to${key}Prop, which broke both conditions. They are now generated by two maps: one that keeps every ordinary property under its own name, which is linked, and one for the rare reserved names, which keep theirPropsuffix and are not linked. The setter names, parameter types and union-target behaviour are unchanged. The change also roughly halves the number of type instantiations when compiling the package's own test suite.