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

fix(deps): update dependency effect to v3.12.7 - autoclosed #1210

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 23, 2025

This PR contains the following updates:

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

Release Notes

Effect-TS/effect (effect)

v3.12.7

Compare Source

Patch Changes

v3.12.6

Compare Source

Patch Changes
  • #​4307 289c13b Thanks @​gcanti! - Schema: Enhance error messages for discriminated unions.

    Before

    import { Schema } from "effect"
    
    const schema = Schema.Union(
      Schema.Tuple(Schema.Literal(-1), Schema.Literal(0)).annotations({
        identifier: "A"
      }),
      Schema.Tuple(Schema.NonNegativeInt, Schema.NonNegativeInt).annotations({
        identifier: "B"
      })
    ).annotations({ identifier: "AB" })
    
    Schema.decodeUnknownSync(schema)([-500, 0])
    /*
    throws:
    ParseError: AB
    ├─ { readonly 0: -1 }
    │  └─ ["0"]
    │     └─ Expected -1, actual -500
    └─ B
       └─ [0]
          └─ NonNegativeInt
             └─ From side refinement failure
                └─ NonNegative
                   └─ Predicate refinement failure
                      └─ Expected a non-negative number, actual -500
    */

    After

    import { Schema } from "effect"
    
    const schema = Schema.Union(
      Schema.Tuple(Schema.Literal(-1), Schema.Literal(0)).annotations({
        identifier: "A"
      }),
      Schema.Tuple(Schema.NonNegativeInt, Schema.NonNegativeInt).annotations({
        identifier: "B"
      })
    ).annotations({ identifier: "AB" })
    
    Schema.decodeUnknownSync(schema)([-500, 0])
    /*
    throws:
    ParseError: AB
    -├─ { readonly 0: -1 }
    +├─ A
    │  └─ ["0"]
    │     └─ Expected -1, actual -500
    └─ B
       └─ [0]
          └─ NonNegativeInt
             └─ From side refinement failure
                └─ NonNegative
                   └─ Predicate refinement failure
                      └─ Expected a non-negative number, actual -500
    */
  • #​4298 8b4e75d Thanks @​KhraksMamtsov! - Added type-level validation for the Effect.Service function to ensure the Self generic parameter is provided. If the generic is missing, the MissingSelfGeneric type will be returned, indicating that the generic parameter must be specified. This improves type safety and prevents misuse of the Effect.Service function.

    type MissingSelfGeneric =
      `Missing \`Self\` generic - use \`class Self extends Service<Self>()...\``
  • #​4292 fc5e0f0 Thanks @​gcanti! - Improve UnknownException error messages

    UnknownException error messages now include the name of the Effect api that
    created the error.

    import { Effect } from "effect"
    
    Effect.tryPromise(() =>
      Promise.reject(new Error("The operation failed"))
    ).pipe(Effect.catchAllCause(Effect.logError), Effect.runFork)
    
    // timestamp=2025-01-21T00:41:03.403Z level=ERROR fiber=#&#8203;0 cause="UnknownException: An unknown error occurred in Effect.tryPromise
    //     at fail (.../effect/packages/effect/src/internal/core-effect.ts:1654:19)
    //     at <anonymous> (.../effect/packages/effect/src/internal/core-effect.ts:1674:26) {
    //   [cause]: Error: The operation failed
    //       at <anonymous> (.../effect/scratchpad/error.ts:4:24)
    //       at .../effect/packages/effect/src/internal/core-effect.ts:1671:7
    // }"
  • #​4309 004fd2b Thanks @​gcanti! - Schema: Enforce Finite Durations in DurationFromNanos.

    This update ensures that DurationFromNanos only accepts finite durations. Previously, the schema did not explicitly enforce this constraint.

    A filter has been added to validate that the duration is finite.

    DurationFromSelf
    +.pipe(
    +  filter((duration) => duration_.isFinite(duration), {
    +    description: "a finite duration"
    +  })
    )
  • #​4314 b2a31be Thanks @​gcanti! - Duration: make DurationValue properties readonly.

  • #​4287 5514d05 Thanks @​gcanti! - Array: Fix Either import and correct partition example.

  • #​4301 bf5f0ae Thanks @​gcanti! - Schema: Fix BigIntFromNumber to enforce upper and lower bounds.

    This update ensures the BigIntFromNumber schema adheres to safe integer limits by applying the following bounds:

    BigIntFromSelf
    +  .pipe(
    +    betweenBigInt(
    +      BigInt(Number.MIN_SAFE_INTEGER),
    +      BigInt(Number.MAX_SAFE_INTEGER)
    +    )
    +  )
  • #​4228 3b19bcf Thanks @​fubhy! - Fixed conflicting ParseError tags between Cron and Schema

  • #​4294 b064b3b Thanks @​tim-smart! - ensure cause is rendered in FiberFailure

  • #​4307 289c13b Thanks @​gcanti! - Schema: Add Support for Infinity in Duration.

    This update adds support for encoding Duration.infinity in Schema.Duration.

    Before

    Attempting to encode Duration.infinity resulted in a ParseError due to the lack of support for Infinity in Schema.Duration:

    import { Duration, Schema } from "effect"
    
    console.log(Schema.encodeUnknownSync(Schema.Duration)(Duration.infinity))
    /*
    throws:
    ParseError: Duration
    └─ Encoded side transformation failure
       └─ HRTime
          └─ [0]
             └─ NonNegativeInt
                └─ Predicate refinement failure
                   └─ Expected an integer, actual Infinity
    */

    After

    The updated behavior successfully encodes Duration.infinity as [ -1, 0 ]:

    import { Duration, Schema } from "effect"
    
    console.log(Schema.encodeUnknownSync(Schema.Duration)(Duration.infinity))
    // Output: [ -1, 0 ]
  • #​4300 f474678 Thanks @​gcanti! - Schema: update pluck type signature to respect optional fields.

    Before

    import { Schema } from "effect"
    
    const schema1 = Schema.Struct({ a: Schema.optional(Schema.String) })
    
    /*
    const schema2: Schema.Schema<string | undefined, {
        readonly a: string | undefined;
    }, never>
    */
    const schema2 = Schema.pluck(schema1, "a")

    After

    import { Schema } from "effect"
    
    const schema1 = Schema.Struct({ a: Schema.optional(Schema.String) })
    
    /*
    const schema2: Schema.Schema<string | undefined, {
        readonly a?: string | undefined;
    }, never>
    */
    const schema2 = Schema.pluck(schema1, "a")
  • #​4296 ee187d0 Thanks @​gcanti! - fix: update Cause.isCause type from 'never' to 'unknown'

v3.12.5

Compare Source

Patch Changes
  • #​4273 a8b0ddb Thanks @​gcanti! - Arbitrary: Fix bug adjusting array constraints for schemas with fixed and rest elements

    This fix ensures that when a schema includes both fixed elements and a rest element, the constraints for the array are correctly adjusted. The adjustment now subtracts the number of values generated by the fixed elements from the overall constraints.

  • #​4259 507d546 Thanks @​gcanti! - Schema: improve error messages for invalid transformations

    Before

    import { Schema } from "effect"
    
    Schema.decodeUnknownSync(Schema.NumberFromString)("a")
    /*
    throws:
    ParseError: NumberFromString
    └─ Transformation process failure
       └─ Expected NumberFromString, actual "a"
    */

    After

    import { Schema } from "effect"
    
    Schema.decodeUnknownSync(Schema.NumberFromString)("a")
    /*
    throws:
    ParseError: NumberFromString
    └─ Transformation process failure
       └─ Unable to decode "a" into a number
    */
  • #​4273 a8b0ddb Thanks @​gcanti! - Schema: Extend Support for Array filters, closes #​4269.

    Added support for minItems, maxItems, and itemsCount to all schemas where A extends ReadonlyArray, including NonEmptyArray.

    Example

    import { Schema } from "effect"
    
    // Previously, this would have caused an error
    const schema = Schema.NonEmptyArray(Schema.String).pipe(Schema.maxItems(2))
  • #​4257 8db239b Thanks @​gcanti! - Schema: Correct BigInt and BigIntFromNumber identifier annotations to follow naming conventions

  • #​4276 84a0911 Thanks @​tim-smart! - fix formatting of time zone offsets that round to 60 minutes

  • #​4276 84a0911 Thanks @​tim-smart! - ensure DateTimeZonedFromSelf arbitrary generates in the range supported by the time zone database

  • #​4267 3179a9f Thanks @​tim-smart! - ensure DateTime.Zoned produces valid dates

  • #​4264 6cb9b76 Thanks @​gcanti! - Relocate the Issue definition from platform/HttpApiError to Schema (renamed as ArrayFormatterIssue).

  • #​4266 1fcbe55 Thanks @​gcanti! - Schema: Replace the TimeZoneFromSelf interface with a class definition and fix the arbitraries for DateTimeUtcFromSelf and DateTimeZonedFromSelf (fc.date({ noInvalidDate: true })).

  • #​4279 d9a63d9 Thanks @​tim-smart! - improve performance of Effect.forkIn


Configuration

📅 Schedule: Branch creation - "* 0-3 * * 1" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, 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 added the dependencies Pull requests that update a dependency file label Jan 23, 2025
Copy link

changeset-bot bot commented Jan 23, 2025

⚠️ No Changeset found

Latest commit: ba13f5c

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.

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

Copy link

socket-security bot commented Jan 23, 2025

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/effect@3.12.7 🔁 npm/effect@3.12.4 None +2 26.3 MB michael.arnaldi

View full report↗︎

@renovate renovate bot force-pushed the renovate/effect-packages branch from 119150f to 0b6c800 Compare January 23, 2025 13:35
@renovate renovate bot force-pushed the renovate/effect-packages branch from 0b6c800 to 952d657 Compare January 23, 2025 14:36
@renovate renovate bot force-pushed the renovate/effect-packages branch from 952d657 to c75cf42 Compare January 23, 2025 14:40
@renovate renovate bot force-pushed the renovate/effect-packages branch from c75cf42 to 813e04d Compare January 23, 2025 17:34
@renovate renovate bot force-pushed the renovate/effect-packages branch from 813e04d to b2b3903 Compare January 23, 2025 17:41
@renovate renovate bot force-pushed the renovate/effect-packages branch from b2b3903 to e74844f Compare January 24, 2025 14:46
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

'@babel/helper-optimise-call-expression@7.25.9':

@renovate renovate bot force-pushed the renovate/effect-packages branch from e74844f to 6d77a79 Compare January 24, 2025 18:22
@renovate renovate bot force-pushed the renovate/effect-packages branch from 6d77a79 to f03edec Compare January 24, 2025 19:01
@renovate renovate bot force-pushed the renovate/effect-packages branch from f03edec to e5c941d Compare January 24, 2025 19:11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

'@babel/helper-optimise-call-expression': 7.25.9

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

'@babel/helper-optimise-call-expression@7.25.9':

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"optimise" is a misspelling of "optimize"

'@babel/helper-optimise-call-expression': 7.25.9

@renovate renovate bot changed the title fix(deps): update dependency effect to v3.12.7 fix(deps): update dependency effect to v3.12.7 - autoclosed Jan 25, 2025
@renovate renovate bot closed this Jan 25, 2025
@renovate renovate bot deleted the renovate/effect-packages branch January 25, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants