Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Feb 19, 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

@traversable/json@0.0.1

Patch Changes

@traversable/registry@0.0.1

Patch Changes

  • #6 951abe1 Thanks @ahrjarrett! - ### new features

    Added for interop with JSON Schema's const keyword. Adapter to/from zod should be working, but still
    experimental as I haven't written property tests for it yet.

    When adapting to/from zod, the passed value is converted into a zod schema. For example:

    t.object({ root: t.eq({ a: 1, b: [2, 3] }) });

    becomes:

    z.object({
      root: z.object({
        a: z.literal(1),
        b: z.tuple([z.literal(2), z.literal(3)]),
      }),
    });

    Example usage:

    import { t } from "@traversable/schema";
    
    const isZero = t.eq(0);
    //     ^? const isZero: t.eq<0>
    
    console.log(isZero(0)); // true
    console.log(isZero([1, 2, 3])); // false
    
    const isJanet = t.eq({ firstName: "Janet" });
    //     ^? const isJanet: t.eq<{ firstName: 'Janet' }>
    
    console.log(isJanet({ firstName: "Bill" })); // => false
    console.log(isJanet({ firstName: "Janet" })); // => true
    console.log(isJanet([1, 2, 3])); // => false
  • #4 0955462 Thanks @ahrjarrett! - feat: adds package schema-zod-adapter

@traversable/schema@0.0.2

Patch Changes

  • #6 951abe1 Thanks @ahrjarrett! - ### new features

    Added for interop with JSON Schema's const keyword. Adapter to/from zod should be working, but still
    experimental as I haven't written property tests for it yet.

    When adapting to/from zod, the passed value is converted into a zod schema. For example:

    t.object({ root: t.eq({ a: 1, b: [2, 3] }) });

    becomes:

    z.object({
      root: z.object({
        a: z.literal(1),
        b: z.tuple([z.literal(2), z.literal(3)]),
      }),
    });

    Example usage:

    import { t } from "@traversable/schema";
    
    const isZero = t.eq(0);
    //     ^? const isZero: t.eq<0>
    
    console.log(isZero(0)); // true
    console.log(isZero([1, 2, 3])); // false
    
    const isJanet = t.eq({ firstName: "Janet" });
    //     ^? const isJanet: t.eq<{ firstName: 'Janet' }>
    
    console.log(isJanet({ firstName: "Bill" })); // => false
    console.log(isJanet({ firstName: "Janet" })); // => true
    console.log(isJanet([1, 2, 3])); // => false
  • #10 30fa8da Thanks @ahrjarrett! - feat(schema): adds Seed.fromSchema

  • #8 b95cfef Thanks @ahrjarrett! - chore(schema,zod): prep work for breaking out schema-core

  • #4 0955462 Thanks @ahrjarrett! - feat: adds package schema-zod-adapter

  • Updated dependencies [951abe1, 0955462]:

    • @traversable/registry@0.0.1
    • @traversable/json@0.0.1
    • @traversable/schema-core@0.0.1

@traversable/schema-core@0.0.1

Patch Changes

  • Updated dependencies [951abe1, 0955462]:
    • @traversable/registry@0.0.1
    • @traversable/json@0.0.1

@traversable/schema-zod-adapter@0.0.1

Patch Changes

  • #6 951abe1 Thanks @ahrjarrett! - ### new features

    Added for interop with JSON Schema's const keyword. Adapter to/from zod should be working, but still
    experimental as I haven't written property tests for it yet.

    When adapting to/from zod, the passed value is converted into a zod schema. For example:

    t.object({ root: t.eq({ a: 1, b: [2, 3] }) });

    becomes:

    z.object({
      root: z.object({
        a: z.literal(1),
        b: z.tuple([z.literal(2), z.literal(3)]),
      }),
    });

    Example usage:

    import { t } from "@traversable/schema";
    
    const isZero = t.eq(0);
    //     ^? const isZero: t.eq<0>
    
    console.log(isZero(0)); // true
    console.log(isZero([1, 2, 3])); // false
    
    const isJanet = t.eq({ firstName: "Janet" });
    //     ^? const isJanet: t.eq<{ firstName: 'Janet' }>
    
    console.log(isJanet({ firstName: "Bill" })); // => false
    console.log(isJanet({ firstName: "Janet" })); // => true
    console.log(isJanet([1, 2, 3])); // => false
  • #8 b95cfef Thanks @ahrjarrett! - chore(schema,zod): prep work for breaking out schema-core

  • #4 0955462 Thanks @ahrjarrett! - feat: adds package schema-zod-adapter

  • Updated dependencies [951abe1, 0955462]:

    • @traversable/registry@0.0.1

@github-actions github-actions bot requested a review from ahrjarrett as a code owner February 19, 2025 19:43
@github-actions github-actions bot force-pushed the changeset-release/main branch 3 times, most recently from 5e53ea7 to b79e73f Compare February 23, 2025 10:44
@github-actions github-actions bot force-pushed the changeset-release/main branch from b79e73f to 9c51792 Compare February 23, 2025 14:03
@ahrjarrett ahrjarrett merged commit a2a6ddc into main Feb 23, 2025
Copy link
Member

@ahrjarrett ahrjarrett left a comment

Choose a reason for hiding this comment

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

lgtm

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