Skip to content

fix(deps): update dependency effect to v3.13.12#18

Merged
jpb06 merged 1 commit intomainfrom
renovate/effect-3.x
Mar 20, 2025
Merged

fix(deps): update dependency effect to v3.13.12#18
jpb06 merged 1 commit intomainfrom
renovate/effect-3.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Mar 11, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
effect (source) 3.13.8 -> 3.13.12 age adoption passing confidence

Release Notes

Effect-TS/effect (effect)

v3.13.12

Compare Source

Patch Changes
  • #​4610 0c4803f Thanks @​gcanti! - Preserve specific annotations (e.g., arbitrary) when using Schema.typeSchema, closes #​4609.

    Previously, annotations such as arbitrary were lost when calling Schema.typeSchema on a transformation. This update ensures that certain annotations, which depend only on the "to" side of the transformation, are preserved.

    Annotations that are now retained:

    • examples
    • default
    • jsonSchema
    • arbitrary
    • pretty
    • equivalence

    Example

    Before

    import { Arbitrary, FastCheck, Schema } from "effect"
    
    const schema = Schema.NumberFromString.annotations({
      arbitrary: () => (fc) => fc.constant(1)
    })
    
    const to = Schema.typeSchema(schema) // ❌ Annotation is lost
    
    console.log(FastCheck.sample(Arbitrary.make(to), 5))
    /*
    [
      2.5223372357846707e-44,
      -2.145443957806771e+25,
      -3.4028179901346956e+38,
      5.278086259208735e+29,
      1.8216880036222622e-44
    ]
    */

    After

    import { Arbitrary, FastCheck, Schema } from "effect"
    
    const schema = Schema.NumberFromString.annotations({
      arbitrary: () => (fc) => fc.constant(1)
    })
    
    const to = Schema.typeSchema(schema) // ✅ Annotation is now preserved
    
    console.log(FastCheck.sample(Arbitrary.make(to), 5))
    /*
    [ 1, 1, 1, 1, 1 ]
    */
  • #​4607 6f65ac4 Thanks @​gcanti! - Add support for jsonSchema annotations on SymbolFromSelf index signatures.

    Before

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.Record({
      key: Schema.SymbolFromSelf.annotations({ jsonSchema: { type: "string" } }),
      value: Schema.Number
    })
    
    JSONSchema.make(schema)
    /*
    throws:
    Error: Unsupported index signature parameter
    schema (SymbolKeyword): symbol
    */

    After

    import { JSONSchema, Schema } from "effect"
    
    const schema = Schema.Record({
      key: Schema.SymbolFromSelf.annotations({ jsonSchema: { type: "string" } }),
      value: Schema.Number
    })
    
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    Output:
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "required": [],
      "properties": {},
      "additionalProperties": {
        "type": "number"
      },
      "propertyNames": {
        "type": "string"
      }
    }
    */

v3.13.11

Compare Source

Patch Changes
  • #​4601 fad8cca Thanks @​gcanti! - Schema: enhance the internal formatUnknown function to handle various types including iterables, classes, and additional edge cases.

    Before

    import { Schema } from "effect"
    
    const schema = Schema.Array(Schema.Number)
    
    Schema.decodeUnknownSync(schema)(new Set([1, 2]))
    // throws Expected ReadonlyArray<number>, actual {}
    
    class A {
      constructor(readonly a: number) {}
    }
    
    Schema.decodeUnknownSync(schema)(new A(1))
    // throws Expected ReadonlyArray<number>, actual {"a":1}

    After

    import { Schema } from "effect"
    
    const schema = Schema.Array(Schema.Number)
    
    Schema.decodeUnknownSync(schema)(new Set([1, 2]))
    // throws Expected ReadonlyArray<number>, actual Set([1,2])
    
    class A {
      constructor(readonly a: number) {}
    }
    
    Schema.decodeUnknownSync(schema)(new A(1))
    // throws Expected ReadonlyArray<number>, actual A({"a":1})
  • #​4606 4296293 Thanks @​gcanti! - Fix issue with generic filters when generating arbitraries, closes #​4605.

    Previously, applying a filter to a schema when generating arbitraries could cause a TypeError due to missing properties. This fix ensures that arbitraries are generated correctly when filters are used.

    Before

    import { Arbitrary, Schema } from "effect"
    
    const schema = Schema.BigIntFromSelf.pipe(Schema.filter(() => true))
    
    Arbitrary.make(schema)
    // TypeError: Cannot read properties of undefined (reading 'min')

    After

    import { Arbitrary, Schema } from "effect"
    
    const schema = Schema.BigIntFromSelf.pipe(Schema.filter(() => true))
    
    const result = Arbitrary.make(schema) // Works correctly
  • #​4587 9c241ab Thanks @​gcanti! - Schema: simplify Struct and Record return types.

  • #​4591 082b0c1 Thanks @​IMax153! - Improve clarity of the TimeoutException error message

  • #​4604 be12983 Thanks @​gcanti! - Add support for refinements to Schema.omit, closes #​4603.

    Before

    import { Schema } from "effect"
    
    const schema = Schema.Struct({
      a: Schema.String,
      b: Schema.String
    })
    
    const omitted = schema.pipe(
      Schema.filter(() => true),
      Schema.omit("a")
    )
    
    console.log(String(omitted.ast))
    // {} ❌

    After

    import { Schema } from "effect"
    
    const schema = Schema.Struct({
      a: Schema.String,
      b: Schema.String
    })
    
    const omitted = schema.pipe(
      Schema.filter(() => true),
      Schema.omit("a")
    )
    
    console.log(String(omitted.ast))
    // { readonly b: string }
  • #​4593 de88127 Thanks @​gcanti! - Schema: export Field type.

    Useful for creating a type that can be used to add custom constraints to the fields of a struct.

    import { Schema } from "effect"
    
    const f = <Fields extends Record<"a" | "b", Schema.Struct.Field>>(
      schema: Schema.Struct<Fields>
    ) => {
      return schema.omit("a")
    }
    
    //      ┌─── Schema.Struct<{ b: typeof Schema.Number; }>
    //      ▼
    const result = f(Schema.Struct({ a: Schema.String, b: Schema.Number }))

v3.13.10

Compare Source

Patch Changes
  • #​4578 527c964 Thanks @​gcanti! - Allow toString Method to Be Overridden in Schema Classes, closes #​4577.

    Previously, attempting to override the toString method in schema classes caused a TypeError in the browser because the property was set as read-only (writable: false). This fix makes toString writable, allowing developers to override it when needed.

v3.13.9

Compare Source

Patch Changes

Configuration

📅 Schedule: Branch creation - "before 4am" (UTC), 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.

@renovate renovate bot changed the title chore(deps): update dependency effect to v3.13.9 chore(deps): update dependency effect to v3.13.10 Mar 11, 2025
@renovate renovate bot force-pushed the renovate/effect-3.x branch from 0730c9a to 406f1eb Compare March 11, 2025 10:39
@renovate renovate bot changed the title chore(deps): update dependency effect to v3.13.10 chore(deps): update dependency effect to v3.13.11 Mar 15, 2025
@renovate renovate bot force-pushed the renovate/effect-3.x branch from 406f1eb to c7165a7 Compare March 15, 2025 17:34
@renovate renovate bot changed the title chore(deps): update dependency effect to v3.13.11 chore(deps): update dependency effect to v3.13.12 Mar 17, 2025
@renovate renovate bot force-pushed the renovate/effect-3.x branch from c7165a7 to 59246db Compare March 17, 2025 23:13
@sonarqubecloud
Copy link
Copy Markdown

@jpb06 jpb06 changed the title chore(deps): update dependency effect to v3.13.12 fix(deps): update dependency effect to v3.13.12 Mar 20, 2025
@jpb06 jpb06 merged commit 05c25b1 into main Mar 20, 2025
5 checks passed
@jpb06 jpb06 deleted the renovate/effect-3.x branch March 20, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant