fix(deps): update dependency @effect/schema to ^0.70.0 #92
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 contains the following updates:
^0.63.0
->^0.70.0
Release Notes
Effect-TS/effect (@effect/schema)
v0.70.0
Compare Source
Patch Changes
#3380
8135294
Thanks @tim-smart! - add schemas for working with the DateTime moduleUpdated dependencies [
1e0fe80
,8135294
,cd255a4
,3845646
,2d09078
,4bce5a0
,4ddbff0
,e74cc38
,bb069b4
,cd255a4
,7d02174
]:v0.69.3
Compare Source
Patch Changes
#3359
7c0da50
Thanks @gcanti! - AddContext
field toSchema
interface, closes #3356#3363
2fc0ff4
Thanks @gcanti! - exportisPropertySignature
guard#3357
f262665
Thanks @gcanti! - Improve annotation retrieval fromClass
APIs, closes #3348.Previously, accessing annotations such as
identifier
andtitle
required explicit casting of theast
field toAST.Transformation
.This update refines the type definitions to reflect that
ast
is always anAST.Transformation
, eliminating the need for casting and simplifying client code.#3343
9bbe7a6
Thanks @gcanti! - - addNonEmptyTrimmedString
Example
add
OptionFromNonEmptyTrimmedString
, closes #3335Example
Updated dependencies [
6359644
,7f41e42
,f566fd1
]:v0.69.2
Compare Source
Patch Changes
1ba640c
,c8c71bd
,a26ce58
]:v0.69.1
Compare Source
Patch Changes
f241154
Thanks @gcanti! - Expose success and failure schemas onTaggedRequestClass
interface, closes #3331v0.69.0
Compare Source
Minor Changes
#3227
20807a4
Thanks @gcanti! - ## CodemodFor some of the breking changes, a code-mod has been released to make migration as easy as possible.
You can run it by executing:
It might not be perfect - if you encounter issues, let us know! Also make sure you commit any changes before running it, in case you need to revert anything.
v0.68.27
Compare Source
Patch Changes
#3310
99bddcf
Thanks @fubhy! - Added additional pure annotations to improve tree-shakeability#3311
6921c4f
Thanks @gcanti! - Remove incorrect static override type annotations in class definitions.This will also improve tree-shakeability.
Updated dependencies [
3afcc93
,99bddcf
]:v0.68.26
Compare Source
Patch Changes
#3287
f0285d3
Thanks @gcanti! - JSON Schema: change default behavior for property signatures containingundefined
Changed the default behavior when encountering a required property signature whose type contains
undefined
. Instead of raising an exception,undefined
is now pruned and the field is set as optional.Before
Now
#3291
8ec4955
Thanks @gcanti! - remove type-level error message fromoptional
signature, closes #3290This fix eliminates the type-level error message from the
optional
function signature, which was causing issues in generic contexts.#3284
3ac2d76
Thanks @gcanti! - Fix: Correct Handling of JSON Schema Annotations in RefinementsFixes an issue where the JSON schema annotation set by a refinement after a transformation was mistakenly interpreted as an override annotation. This caused the output to be incorrect, as the annotations were not applied as intended.
Before
Now
Updated dependencies [
cc327a1
,4bfe4fb
,2b14d18
]:v0.68.25
Compare Source
Patch Changes
a9d7800
]:v0.68.24
Compare Source
Patch Changes
#3253
ed0dde4
Thanks @tim-smart! - update dependenciesUpdated dependencies [
ed0dde4
,ca775ce
,5be9cc0
,203658f
,eb1c4d4
]:v0.68.23
Compare Source
Patch Changes
#3234
edb0da3
Thanks @tim-smart! - ensure Schema.TaggedError renders a .cause correctlyUpdated dependencies [
edb0da3
,c8d3fb0
,dabd028
,786b2ab
,fc57354
]:v0.68.22
Compare Source
Patch Changes
639208e
,6684b4c
,6684b4c
,6684b4c
]:v0.68.21
Compare Source
Patch Changes
55fdd76
]:v0.68.20
Compare Source
Patch Changes
a1f5b83
,a1f5b83
,a1f5b83
,60bc3d0
,5ab348f
,60bc3d0
,3e04bf8
,e7fc45f
,a1f5b83
,4626de5
,f01e7db
,60bc3d0
,79d2d91
,ac71f37
,8432360
,e4bf1bf
,13cb861
,79d2d91
,e7fc45f
,9f66825
]:v0.68.19
Compare Source
Patch Changes
7af137c
,ee4b3dc
,097d25c
]:v0.68.18
Compare Source
Patch Changes
#3192
5d5cc6c
Thanks @KhraksMamtsov! - SupportCapitalize
Uncapitalize
filters and schemas#3148
359ff8a
Thanks @gcanti! - addSerializable.Serializable.Type
andSerializable.Serializable.Encoded
#3198
f7534b9
Thanks @gcanti! - AddtoString
toAST.PropertySignature
andAST.IndexSignature
and fix type display for IndexSignature.Before the Change
Previously, when a type mismatch occurred in
Schema.decodeUnknownSync
, the error message displayed forIndexSignature
was not accurately representing the type used. For example:This output incorrectly indicated
[x: string]
when the actual index type wasChar
.After the Change
The
toString
implementation now correctly reflects the type used inIndexSignature
, providing more accurate and informative error messages:The updated output now correctly displays
{ readonly [x: Char]: string }
, aligning the error messages with the actual data types used in the schema.Updated dependencies [
a435e0f
,b5554db
,a9c4fb3
]:v0.68.17
Compare Source
Patch Changes
#3166
15967cf
Thanks @gcanti! - AddfilterEffect
API, closes #3165The
filterEffect
function enhances thefilter
functionality by allowing the integration of effects, thus enabling asynchronous or dynamic validation scenarios. This is particularly useful when validations need to perform operations that require side effects, such as network requests or database queries.Example: Validating Usernames Asynchronously
#3163
2328e17
Thanks @gcanti! - Addpick
andomit
static functions toStruct
interface, closes #3152.pick
The
pick
static function available in each struct schema can be used to create a newStruct
by selecting particular properties from an existingStruct
.omit
The
omit
static function available in each struct schema can be used to create a newStruct
by excluding particular properties from an existingStruct
.Updated dependencies [
a5737d6
]:v0.68.16
Compare Source
Patch Changes
#3143
d006cec
Thanks @gcanti! - Enhance JSON Schema Support for Refinements in Record Parameters.Enhanced
JSONSchema.make
to properly support refinements as record parameters. Previously, using refinements withSchema.Record
resulted in errors when generating JSON schemas.Before
Now
#3149
cb22726
Thanks @tim-smart! - add Serializable.WithResult.Success/Error inference helpers#3139
e911cfd
Thanks @gcanti! - Optimize JSON Schema output for homogeneous tuples (such as non empty arrays).This change corrects the JSON Schema generation for
S.NonEmptyArray
to eliminate redundant schema definitions. Previously, the element schema was unnecessarily duplicated under bothitems
andadditionalItems
.v0.68.15
Compare Source
Patch Changes
#3130
34faeb6
Thanks @gcanti! - AddReadonlyMapFromRecord
andMapFromRecord
, closes #3119{ readonly [x: string]: VI }
->ReadonlyMap<KA, VA>
ReadonlyMap<KA, VA>
->{ readonly [x: string]: VI }
Updated dependencies [
5c0ceb0
,5c0ceb0
,33735b1
,5c0ceb0
,139d4b3
]:v0.68.14
Compare Source
Patch Changes
61e5964
Thanks @gcanti! - Add support for Union, Suspend, and Refinement as the second argument of extend, closes #3124v0.68.13
Compare Source
Patch Changes
#3117
cb76bcb
Thanks @gcanti! - ModifiedJSONSchema.make
to selectively ignore thetitle
anddescription
fields in schema types such asSchema.String
,Schema.Number
, andSchema.Boolean
, closes #3116Before
Now
v0.68.12
Compare Source
Patch Changes
#3101
d990544
Thanks @gcanti! - Generate JSON Schemas correctly for a schema created by extending two refinements using theextend
API, ensuring their JSON Schema annotations are preserved.Example
Updated dependencies [
a047af9
]:v0.68.11
Compare Source
Patch Changes
#3087
d71c192
Thanks @gcanti! - Special caseS.parseJson
to generate JSON Schemas by targeting the "to" side of transformations, closes #3086Resolved an issue where
JSONSchema.make
improperly generated JSON Schemas for schemas defined withS.parseJson(<real schema>)
. Previously, invokingJSONSchema.make
on these transformed schemas produced a JSON Schema corresponding to a string type rather than the underlying real schema.Before
Now
Updated dependencies [
72638e3
,d7dde2b
,9b2fc3b
]:v0.68.10
Patch Changes
#3079
bbdd365
Thanks @tim-smart! - update dependencies#3079
bbdd365
Thanks @tim-smart! - update to typescript 5.5Updated dependencies [
c342739
,8898e5e
,ff78636
,c86bd4e
,bbdd365
]:v0.68.9
Patch Changes
0b47fdf
Thanks @gcanti! - Revert the 0.67.22 patch as it is causing issues with other array filters, closes #3073v0.68.8
Compare Source
Patch Changes
#3070
192261b
Thanks @gcanti! - AddrefineTypeId
unique symbol to therefine
interface to ensure correct inference ofFields
in the Class APIs, closes #3063Updated dependencies [
3da1497
]:v0.68.7
Compare Source
Patch Changes
66a1910
]:v0.68.6
Compare Source
Patch Changes
#3046
530fa9e
Thanks @gcanti! - Fix error message display for composite errors whenoverwrite = false
This commit resolves an issue where the custom message for a struct (or tuple or union) was displayed regardless of whether the validation error was related to the entire struct or just a specific part of it. Previously, users would see the custom error message even when the error only concerned a particular field within the struct and the flag
overwrite
was not set totrue
.v0.68.5
Compare Source
Patch Changes
#3043
1d62815
Thanks @gcanti! - Addmake
constructor toClass
-based APIs, closes #3042Introduced a
make
constructor to class-based APIs to facilitate easier instantiation of classes. This method allows developers to create instances of a class without directly using thenew
keyword.Example
v0.68.4
Compare Source
Patch Changes
c0ce180
,61707b6
,9c1b5b3
,a35faf8
,ff73c0c
,984d516
,8c3b8a2
,017e2f9
,91bf8a2
,c6a4a26
]:v0.68.3
Compare Source
Patch Changes
#3028
d473800
Thanks @gcanti! - Introducing Customizable Parsing Behavior at the Schema Level, closes #3027With this latest update, developers can now set specific parse options for each schema using the
parseOptions
annotation. This flexibility allows for precise parsing behaviors across different levels of your schema hierarchy, giving you the ability to override settings in parent schemas and propagate settings to nested schemas as needed.Here's how you can leverage this new feature:
Detailed Output Explanation:
In this example:
d
field (since it's missing) and any errors from thea
subschema.a
) is set to display only the first error. Although bothb
andc
fields are missing, only the first missing field (b
) is reported.v0.68.2
Compare Source
Patch Changes
#3310
99bddcf
Thanks @fubhy! - Added additional pure annotations to improve tree-shakeability#3311
6921c4f
Thanks @gcanti! - Remove incorrect static override type annotations in class definitions.This will also improve tree-shakeability.
Updated dependencies [
3afcc93
,99bddcf
]:v0.68.1
Compare Source
Patch Changes
7af137c
,ee4b3dc
,097d25c
]:v0.68.0
Compare Source
Minor Changes
#2906
f6c7977
Thanks @gcanti! - ## Refactoring of theParseIssue
ModelThe
ParseIssue
model in the@effect/schema/ParseResult
module has undergone a comprehensive redesign and simplification that enhances its expressiveness without compromising functionality. This section explores the motivation and details of this refactoring.Enhanced
Schema.filter
APIThe
Schema.filter
API has been improved to support more complex filtering that can involve multiple properties of a struct. This is especially useful for validations that compare two fields, such as ensuring that apassword
field matches aconfirm_password
field, a common requirement in form validations.Previous Limitations:
Previously, while it was possible to implement a filter that compared two fields, there was no straightforward way to attach validation messages to a specific field. This posed challenges, especially in form validations where precise error reporting is crucial.
Example of Previous Implementation:
In this scenario, while the filter functionally works, the lack of a specific error path (
path: []
) means errors are not as descriptive or helpful as they could be.Specifying Error Paths
With the new improvements, it's now possible to specify an error path along with the message, which enhances error specificity and is particularly beneficial for integration with tools like
react-hook-form
.Updated Implementation Example:
This modification allows the error to be directly associated with the
confirm_password
field, improving clarity for the end-user.Multiple Error Reporting
The refactored API also supports reporting multiple issues at once, which is useful in forms where several validation checks might fail simultaneously.
Example of Multiple Issues Reporting:
The new
ParseIssue
ModelThe
ParseIssue
type has undergone a significant restructuring to improve its expressiveness and simplicity. This new model categorizes issues into leaf and composite types, enhancing clarity and making error handling more systematic.Structure of
ParseIsssue
Type:Key Changes in the Model:
New Members:
Composite
: A new class that aggregates multipleParseIssue
instances.Missing
: Identifies when a required element or value is absent.Unexpected
: Flags unexpected elements or values in the input.Pointer
: Points to the part of the data structure where an issue occurs.Removed Members:
Declaration
,TupleType
,TypeLiteral
,Union
,Member
,Key
, andIndex
have been consolidated under theComposite
type for a more streamlined approach.Definition of
Composite
:v0.67.24
Compare Source
Patch Changes
#2997
3b15e1b
Thanks @gcanti! - Improve error handling (type-level) for improper usage ofoptional
, closes #2995This commit addresses concerns raised by users about the confusing behavior when 'optional' is misused in a schema definition. Previously, users experienced unexpected results, such as a schema returning 'Schema.All' when 'optional' was used incorrectly, without clear guidance on the correct usage or error messages.
Changes:
Schema.optional()
implementation to check its context within a pipeline and ensure it is being used correctly.#2994
3a750b2
Thanks @gcanti! - Exposeexact
option for strict decoding on missing properties, closes #2993This commit addresses an issue where users encountered unexpected decoding behaviors, specifically regarding how undefined values and missing properties are handled. The default behavior of the
@effect/schema
library treats missing properties asundefined
during decoding, which can lead to confusion when stricter validation is expected.Changes:
exțact
(default:false
), which when set totrue
, enforces strict decoding that will error on missing properties instead of treating them asundefined
.Updated dependencies [
06ede85
,7204ca5
]:v0.67.23
Compare Source
Patch Changes
#2991
2ee4f2b
Thanks @gcanti! - RemoveSimplify
fromextend
,pick
,omit
,pluck
APIs, closes #2989, #2990#2971
9b3b4ac
Thanks @gcanti! - AddSchema.NonEmptyChunkFromSelf
andSchema.NonEmptyChunk
, closes #2961Updated dependencies [
3572646
,1aed347
,df4bf4b
,f085f92
]:v0.67.22
Compare Source
Patch Changes
#2955
d79ca17
Thanks @gcanti! - TheminItems
filter now checks for an invalid argument (n < 1
) and, when valid, refines the type toNonEmptyReadonlyArray<A>
.Updated dependencies [
eb98c5b
, [184fed8
](https://togithub.com/EffecConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.