Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency @effect/schema to ^0.75.0 #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 1, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@effect/schema (source) ^0.72.3 -> ^0.75.0 age adoption passing confidence

Release Notes

Effect-TS/effect (@​effect/schema)

v0.75.5

Compare Source

Patch Changes
  • #​3792 382556f Thanks @​gcanti! - resolve parse error when using pick with union of class schemas, closes #​3751

  • #​3790 97cb014 Thanks @​gcanti! - Equivalence: Fixed a bug related to discriminated tuples.

    Example:

    The following equivalence check was incorrectly returning false:

    import * as E from "@​effect/schema/Equivalence"
    import * as S from "@​effect/schema/Schema"
    
    // Union of discriminated tuples
    const schema = S.Union(
      S.Tuple(S.Literal("a"), S.String),
      S.Tuple(S.Literal("b"), S.Number)
    )
    
    const equivalence = E.make(schema)
    
    console.log(equivalence(["a", "x"], ["a", "x"]))
    // false

v0.75.4

Compare Source

Patch Changes
  • Updated dependencies [61a99b2]:
    • effect@3.9.2

v0.75.3

Compare Source

Patch Changes
  • #​3761 360ec14 Thanks @​gcanti! - Allow Schema.Either to support Schema.Never without type errors, closes #​3755.

    • Updated the type parameters of format to extend Schema.All instead of Schema<A, I, R>.
    • Updated the type parameters of Schema.EitherFromSelf to extend Schema.All instead of Schema.Any.
    • Updated the type parameters of Schema.Either to extend Schema.All instead of Schema.Any.
    • Updated the type parameters of Schema.EitherFromUnion to extend Schema.All instead of Schema.Any.

v0.75.2

Compare Source

Patch Changes
  • #​3753 f02b354 Thanks @​gcanti! - Enhanced Error Reporting for Discriminated Union Tuple Schemas, closes #​3752

    Previously, irrelevant error messages were generated for each member of the union. Now, when a discriminator is present in the input, only the relevant member will trigger an error.

    Before

    import * as Schema from "@&#8203;effect/schema/Schema"
    
    const schema = Schema.Union(
      Schema.Tuple(Schema.Literal("a"), Schema.String),
      Schema.Tuple(Schema.Literal("b"), Schema.Number)
    ).annotations({ identifier: "MyUnion" })
    
    console.log(Schema.decodeUnknownSync(schema)(["a", 0]))
    /*
    throws:
    ParseError: MyUnion
    ├─ readonly ["a", string]
    │  └─ [1]
    │     └─ Expected string, actual 0
    └─ readonly ["b", number]
       └─ [0]
          └─ Expected "b", actual "a"
    */

    After

    import * as Schema from "@&#8203;effect/schema/Schema"
    
    const schema = Schema.Union(
      Schema.Tuple(Schema.Literal("a"), Schema.String),
      Schema.Tuple(Schema.Literal("b"), Schema.Number)
    ).annotations({ identifier: "MyUnion" })
    
    console.log(Schema.decodeUnknownSync(schema)(["a", 0]))
    /*
    throws:
    ParseError: MyUnion
    └─ readonly ["a", string]
       └─ [1]
          └─ Expected string, actual 0
    */

v0.75.1

Compare Source

Patch Changes

v0.75.0

Compare Source

Minor Changes
Patch Changes

v0.74.2

Compare Source

Patch Changes

v0.74.1

Compare Source

Patch Changes
  • #​3669 734eae6 Thanks @​gcanti! - Add description annotation to the encoded part of NumberFromString.

    Before

    import { JSONSchema, Schema } from "@&#8203;effect/schema"
    
    const schema = Schema.NumberFromString
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string"
    }
    */

    After

    import { JSONSchema, Schema } from "@&#8203;effect/schema"
    
    const schema = Schema.NumberFromString
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "description": "a string that will be parsed into a number"
    }
    */
  • #​3667 fd83d0e Thanks @​gcanti! - Remove default json schema annotations from string, number and boolean.

    Before

    import { JSONSchema, Schema } from "@&#8203;effect/schema"
    
    const schema = Schema.String.annotations({ examples: ["a", "b"] })
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "description": "a string",
      "title": "string",
      "examples": [
        "a",
        "b"
      ]
    }
    */

    After

    import { JSONSchema, Schema } from "@&#8203;effect/schema"
    
    const schema = Schema.String.annotations({ examples: ["a", "b"] })
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "examples": [
        "a",
        "b"
      ]
    }
    */
  • #​3673 ad7e1de Thanks @​gcanti! - Add more description annotations.

  • #​3672 090e41c Thanks @​gcanti! - JSON Schema: handle refinements where the 'from' part includes a transformation, closes #​3662

    Before

    import { JSONSchema, Schema } from "@&#8203;effect/schema"
    
    const schema = Schema.Date
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    throws
    Error: Missing annotation
    details: Generating a JSON Schema for this schema requires a "jsonSchema" annotation
    schema (Refinement): Date
    */

    After

    import { JSONSchema, Schema } from "@&#8203;effect/schema"
    
    const schema = Schema.Date
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "description": "a string that will be parsed into a Date"
    }
    */
  • #​3672 090e41c Thanks @​gcanti! - Add description annotation to the encoded part of DateFromString.

    Before

    import { JSONSchema, Schema } from "@&#8203;effect/schema"
    
    const schema = Schema.DateFromString
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string"
    }
    */

    After

    import { JSONSchema, Schema } from "@&#8203;effect/schema"
    
    const schema = Schema.DateFromString
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string",
      "description": "a string that will be parsed into a Date"
    }
    */
  • Updated dependencies [4509656]:

    • effect@3.8.4

v0.74.0

Compare Source

Minor Changes

v0.73.4

Compare Source

Patch Changes
  • Updated dependencies [bb5ec6b]:
    • effect@3.8.3

v0.73.3

Compare Source

Patch Changes
  • #​3635 e6440a7 Thanks @​gcanti! - Stable filters such as minItems, maxItems, and itemsCount now generate multiple errors when the 'errors' option is set to 'all', closes #​3633

    Example:

    import { ArrayFormatter, Schema } from "@&#8203;effect/schema"
    
    const schema = Schema.Struct({
      tags: Schema.Array(Schema.String.pipe(Schema.minLength(2))).pipe(
        Schema.minItems(3)
      )
    })
    
    const invalidData = { tags: ["AB", "B"] }
    
    const either = Schema.decodeUnknownEither(schema, { errors: "all" })(
      invalidData
    )
    if (either._tag === "Left") {
      console.log(ArrayFormatter.formatErrorSync(either.left))
      /*
      Output:
      [
        {
          _tag: 'Type',
          path: [ 'tags', 1 ],
          message: 'Expected a string at least 2 character(s) long, actual "B"'
        },
        {
          _tag: 'Type',
          path: [ 'tags' ],
          message: 'Expected an array of at least 3 items, actual ["AB","B"]'
        }
      ]
      */
    }

    Previously, only the issue related to the [ 'tags', 1 ] path was reported.

v0.73.2

Compare Source

Patch Changes
  • Updated dependencies [f0d8ef1]:
    • effect@3.8.2

v0.73.1

Compare Source

Patch Changes

v0.73.0

Compare Source

Minor Changes
  • #​3589 7fdf9d9 Thanks @​gcanti! - Updates the constraints for members within a union from the more restrictive Schema.Any to the more inclusive Schema.All, closes #​3587.

    Affected APIs include:

    • Schema.Union
    • Schema.UndefinedOr
    • Schema.NullOr
    • Schema.NullishOr
    • Schema.optional
    • AST.Union.make now retains duplicate members and no longer eliminates the neverKeyword.
Patch Changes

Configuration

📅 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link

vercel bot commented Oct 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
giderim-pwa ✅ Ready (Inspect) Visit Preview Oct 7, 2024 4:59am

Copy link

changeset-bot bot commented Oct 1, 2024

⚠️ No Changeset found

Latest commit: 3d48b2f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@renovate renovate bot changed the title fix(deps): update dependency @effect/schema to ^0.74.0 fix(deps): update dependency @effect/schema to ^0.75.0 Oct 7, 2024
@renovate renovate bot force-pushed the renovate/effect-schema-0.x branch from 6c2deb0 to 3d48b2f Compare October 7, 2024 04:58
@renovate renovate bot changed the title fix(deps): update dependency @effect/schema to ^0.75.0 Update dependency @effect/schema to ^0.75.0 Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

0 participants