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 #3285

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Version Packages #3285

merged 1 commit into from
Jul 18, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jul 17, 2024

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]

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

@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

  • #3287 f0285d3 Thanks @gcanti! - JSON Schema: change default behavior for property signatures containing undefined

    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

    import { JSONSchema, Schema } from "@effect/schema";
    
    const schema = Schema.Struct({
      a: Schema.NullishOr(Schema.Number),
    });
    
    const jsonSchema = JSONSchema.make(schema);
    console.log(JSON.stringify(jsonSchema, null, 2));
    /*
    throws
    Error: Missing annotation
    at path: ["a"]
    details: Generating a JSON Schema for this schema requires a "jsonSchema" annotation
    schema (UndefinedKeyword): undefined
    */

    Now

    import { JSONSchema, Schema } from "@effect/schema";
    
    const schema = Schema.Struct({
      a: Schema.NullishOr(Schema.Number),
    });
    
    const jsonSchema = JSONSchema.make(schema);
    console.log(JSON.stringify(jsonSchema, null, 2));
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "required": [], // <=== empty
      "properties": {
        "a": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "$defs": {
        "null": {
          "const": null
        }
      }
    }
    */
  • #3291 8ec4955 Thanks @gcanti! - remove type-level error message from optional signature, closes From Discord: TypeScript Type Incompatibility Issue with Generic Schema and Optional Values #3290

    This 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 Refinements

    Fixes 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

    import { JSONSchema, Schema } from "@effect/schema";
    
    const schema = Schema.Trim.pipe(Schema.nonEmpty());
    
    const jsonSchema = JSONSchema.make(schema);
    console.log(JSON.stringify(jsonSchema, null, 2));
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "minLength": 1
    }
    */

    Now

    import { JSONSchema, Schema } from "@effect/schema";
    
    const schema = Schema.Trim.pipe(Schema.nonEmpty());
    
    const jsonSchema = JSONSchema.make(schema);
    console.log(JSON.stringify(jsonSchema, null, 2));
    /*
    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "string"
    }
    */
  • Updated dependencies [cc327a1, 4bfe4fb, 2b14d18]:

@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

@gcanti gcanti merged commit f34f6a7 into main Jul 18, 2024
@gcanti gcanti deleted the changeset-release/main branch July 18, 2024 07:50
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
Development

Successfully merging this pull request may close these issues.

From Discord: TypeScript Type Incompatibility Issue with Generic Schema and Optional Values
1 participant