Releases: dogmatiq/ferrite
Releases · dogmatiq/ferrite
Version 1.7.0
Added
- Added
TextEncoded()andTextEncodedP()builders for environment variables with types that implementencoding.TextMarshalerandencoding.TextUnmarshaler.
Fixed
- Environment variable values are now re-resolved when the environment changes, allowing
t.Setenv()to work naturally in tests without any special helpers. - Preconditions (e.g.,
RelevantIf(),RelevantWhen()) are now re-evaluated on every call toAvailability(), reflecting changes to dependent variables immediately.
Version 1.6.1
Version 1.6.0
Added
- Added
WithExample()to all builder types, allowing custom example values to be included in generated documentation. - Added
URLBuilder.WithConstraint()to allow user-defined validation of URL variables.
Changed
- Variables from imported registries are now listed after variables from the default registry in generated documentation and validation output. Within each registry, variables are still sorted alphabetically by name.
Version 1.5.1
Version 1.5.0
Added
- Added
ReleventWhen()option, which conditionally enables an environment variable when another variable has a specific value.
Changed
The following changes are technically not backwards compatible from a Go perspective, but under normal usage (as per the examples) they do not actually alter the usage of the Ferrite API:
- Changed the
VariableSetto accept a type parameter for the value produced. - Changed
ReleventIf(),SeeAlso()andSupersededBy()to accept a type parameter for the value produced.
Version 1.4.0
Added
- Added
FileBuilder.WithMustExist()constraint. - Added
Dir()builder for directory paths.
Changed
- Bumped minimum Go version to v1.22.
Version 1.3.0
Added
- Added
StringBuilder.WithMinimumLength(),WithMaximumLength(),WithLength(). - Added
BytesBuilder.WithMinimumLength(),WithMaximumLength(),WithLength().
Fixed
- Fixed wording of error message when a variable exceeds the maximum length.
Version 1.2.1
Changed
- Dropped support for Go v1.19, which reached end-of-life on 2023-08-08
- Removed use of the
slicesandmapspackages fromgolang.org/x/exp. These package are not versioned and as such breaking changes can cause conflicts with other dependencies. The experimentalconstraintspackage is still used, with the expectation that these will always remain valid for use as type parameter constraints.
Version 1.2.0
Added
- Added
RegistryandNewRegistry() - Added
RegistryOptionandWithDocumentationURL()
Changed
- Changed
WithRegistry()to accept aferrite.Registryinstead of the experimentalvariable.Registrytype - Passing
WithRegistry()toInit()is now additive, instead of replacing the default registry
Removed
- Removed the experimental
maybeandvariablesub-packages
Fixed
- Prevent registration of multiple environment variables with the same name
Version 1.1.0
Added
- Added
Binary()andBinaryAs()builders for binary variables - Added
variable.LengthLimitedschema for values that have minimum or maximum lengths
Changed
variable.Stringnow implements the newLengthLimitedinterface- Rename the
variable.[Min|Max]LengthError.StringtoViolatedSchemaand change its type toLengthLimited
Removed
- Removed "platform" examples from generated documentation. These are too opinionated and organization-specific to be included in every project's documentation. Instead, we will provide different export modes that can be used to generate Docker/Kubernetes/etc configurations, similar to the existing
export/dotenvmode.