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

Version Packages #4238

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Version Packages #4238

merged 1 commit into from
Jan 14, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 13, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@effect/[email protected]

Minor Changes

  • #4245 c110032 Thanks @gcanti! - Update HttpApi to remove wildcard support for better OpenAPI compatibility.

    The HttpApi* modules previously reused the following type from HttpRouter:

    type PathInput = `/${string}` | "*"

    However, the "*" wildcard value was not handled correctly, as OpenAPI does not support wildcards.

    This has been updated to use a more specific type:

    type PathSegment = `/${string}`

    This change ensures better alignment with OpenAPI specifications and eliminates potential issues related to unsupported wildcard paths.

  • #4237 23ac740 Thanks @gcanti! - Make OpenApiSpec mutable to make handling it more convenient.

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

[email protected]

Patch Changes

  • #4244 d7dac48 Thanks @gcanti! - Improve pattern handling by merging multiple patterns into a union, closes From Discord: Potential bug in effect/scheam and fast-check integration causing infinite loop with `Lowerca... #4243.

    Previously, the algorithm always prioritized the first pattern when multiple patterns were encountered.

    This fix introduces a merging strategy that combines patterns into a union (e.g., (?:${pattern1})|(?:${pattern2})). By doing so, all patterns have an equal chance to generate values when using FastCheck.stringMatching.

    Example

    import { Arbitrary, FastCheck, Schema } from "effect"
    
    // /^[^A-Z]*$/ (given by Lowercase) + /^0x[0-9a-f]{40}$/
    const schema = Schema.Lowercase.pipe(Schema.pattern(/^0x[0-9a-f]{40}$/))
    
    const arb = Arbitrary.make(schema)
    
    // Before this fix, the first pattern would always dominate,
    // making it impossible to generate values
    const sample = FastCheck.sample(arb, { numRuns: 100 })
    
    console.log(sample)
  • #4252 1d7fd2b Thanks @gcanti! - Fix: Correct Arbitrary.make to support nested TemplateLiterals.

    Previously, Arbitrary.make did not properly handle nested TemplateLiteral schemas, resulting in incorrect or empty outputs. This fix ensures that nested template literals are processed correctly, producing valid arbitrary values.

    Before

    import { Arbitrary, FastCheck, Schema as S } from "effect"
    
    const schema = S.TemplateLiteral(
      "<",
      S.TemplateLiteral("h", S.Literal(1, 2)),
      ">"
    )
    
    const arb = Arbitrary.make(schema)
    
    console.log(FastCheck.sample(arb, { numRuns: 10 }))
    /*
    Output:
    [
      '<>', '<>', '<>',
      '<>', '<>', '<>',
      '<>', '<>', '<>',
      '<>'
    ]
    */

    After

    import { Arbitrary, FastCheck, Schema as S } from "effect"
    
    const schema = S.TemplateLiteral(
      "<",
      S.TemplateLiteral("h", S.Literal(1, 2)),
      ">"
    )
    
    const arb = Arbitrary.make(schema)
    
    console.log(FastCheck.sample(arb, { numRuns: 10 }))
    /*
    Output:
    [
      '<h2>', '<h2>',
      '<h2>', '<h2>',
      '<h2>', '<h1>',
      '<h2>', '<h1>',
      '<h1>', '<h1>'
    ]
    */
  • #4252 1d7fd2b Thanks @gcanti! - Fix: Allow Schema.TemplateLiteral to handle strings with linebreaks, closes From Discord: Issue with Schema.TemplateLiteral and Linebreak Characters in Strings #4251.

    Before

    import { Schema } from "effect"
    
    const schema = Schema.TemplateLiteral("a: ", Schema.String)
    
    console.log(Schema.decodeSync(schema)("a: b \n c"))
    // throws: ParseError: Expected `a: ${string}`, actual "a: b \n c"

    After

    import { Schema } from "effect"
    
    const schema = Schema.TemplateLiteral("a: ", Schema.String)
    
    console.log(Schema.decodeSync(schema)("a: b \n c"))
    /*
    Output:
    a: b
     c
    */

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@effect/[email protected]

Patch Changes

@github-actions github-actions bot force-pushed the changeset-release/main branch 4 times, most recently from 4a919cf to 2fbfb2c Compare January 13, 2025 21:42
@github-actions github-actions bot requested a review from mikearnaldi as a code owner January 13, 2025 21:42
@github-actions github-actions bot force-pushed the changeset-release/main branch from 2fbfb2c to eed77dd Compare January 14, 2025 05:39
@github-actions github-actions bot requested a review from gcanti as a code owner January 14, 2025 05:39
@github-actions github-actions bot force-pushed the changeset-release/main branch 4 times, most recently from e3fb007 to b30bb0f Compare January 14, 2025 13:00
@github-actions github-actions bot force-pushed the changeset-release/main branch from b30bb0f to 51507eb Compare January 14, 2025 18:03
@gcanti gcanti merged commit ff7c07d into main Jan 14, 2025
@gcanti gcanti deleted the changeset-release/main branch January 14, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
1 participant