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

[Snyk] Upgrade zod from 3.22.3 to 3.23.8 #1

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

OKEAMAH
Copy link
Member

@OKEAMAH OKEAMAH commented Aug 16, 2024

snyk-top-banner

Snyk has created this PR to upgrade zod from 3.22.3 to 3.23.8.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


  • The recommended version is 66 versions ahead of your current version.

  • The recommended version was released on 3 months ago.

Release notes
Package name: zod
  • 3.23.8 - 2024-05-08

    Commits:

  • 3.23.7 - 2024-05-07

    Commits:

  • 3.23.6 - 2024-05-03

    Commits:

  • 3.23.5 - 2024-04-29

    Commits:

  • 3.23.4 - 2024-04-23

    Commits:

  • 3.23.3 - 2024-04-22

    Commits:

  • 3.23.2 - 2024-04-22

    Commits:

  • 3.23.1 - 2024-04-22

    This changes the default generics back to any to prevent breakages with common packager like @ hookform/resolvers:

    - class ZodType<Output = unknown, Def extends ZodTypeDef = ZodTypeDef, Input = unknown> {}
    + class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = any> {}

    Commits:

  • 3.23.0 - 2024-04-21

    Zod 3.23 is now available. This is the final 3.x release before Zod 4.0. To try it out:

    npm install zod

    Features

    z.string().date()

    Zod can now validate ISO 8601 date strings. Thanks @ igalklebanov! #1766

    const schema = z.string().date();
    schema.parse("2022-01-01"); // OK

    z.string().time()

    Zod can now validate ISO 8601 time strings. Thanks @ igalklebanov! #1766

    const schema = z.string().time();
    schema.parse("12:00:00"); // OK

    You can specify sub-second precision using the precision option:

    const schema = z.string().time({ precision: 3 });
    schema.parse("12:00:00.123"); // OK
    schema.parse("12:00:00.123456"); // Error
    schema.parse("12:00:00"); // Error

    z.string().duration()

    Zod can now validate ISO 8601 duration strings. Thanks @ mastermatt! #3265

    const schema = z.string().duration();
    schema.parse("P3Y6M4DT12H30M5S"); // OK

    Improvements to z.string().datetime()

    Thanks @ bchrobot #2522

    You can now allow unqualified (timezone-less) datetimes using the local: true flag.

    const schema = z.string().datetime({ local: true });
    schema.parse("2022-01-01T12:00:00"); // OK

    Plus, Zod now validates the day-of-month correctly to ensure no invalid dates (e.g. February 30th) pass validation. Thanks @ szamanr! #3391

    z.string().base64()

    Zod can now validate base64 strings. Thanks @ StefanTerdell! #3047

    const schema = z.string().base64();
    schema.parse("SGVsbG8gV29ybGQ="); // OK

    Improved discriminated unions

    The following can now be used as discriminator keys in z.discriminatedUnion():

    • ZodOptional
    • ZodNullable
    • ZodReadonly
    • ZodBranded
    • ZodCatch
    const schema = z.discriminatedUnion("type", [
      z.object({ type: z.literal("A").optional(), value: z.number() }),
      z.object({ type: z.literal("B").nullable(), value: z.string() }),
      z.object({ type: z.literal("C").readonly(), value: z.boolean() }),
      z.object({ type: z.literal("D").brand<"D">(), value: z.boolean() }),
      z.object({ type: z.literal("E").catch("E"), value: z.unknown() }),
    ]);

    Misc

    Breaking changes

    There are no breaking changes to the public API of Zod. However some changes can impact ecosystem tools that rely on Zod internals.

    ZodFirstPartySchemaTypes

    Three new types have been added to the ZodFirstPartySchemaTypes union. This may impact some codegen libraries. #3247

    +  | ZodPipeline<any, any>
    +  | ZodReadonly<any>
    +  | ZodSymbol;

    Unrecognized keys in .pick() and .omit()

    This version fixes a bug where unknown keys were accidentally accepted in .pick() and omit(). This has been fixed, which could cause compiler errors in some user code. #3255

    z.object({ 
      name: z.string() 
    }).pick({
      notAKey: true // no longer allowed
    })

    Bugfixes and performance

    Docs and ecosystem

    New Contributors

Snyk has created this PR to upgrade zod from 3.22.3 to 3.23.8.

See this package in npm:
zod

See this project in Snyk:
https://app.snyk.io/org/okeamah/project/a1c7a855-090c-4196-80f6-b42cc4e5c774?utm_source=github&utm_medium=referral&page=upgrade-pr
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. Here's why:

  • It seems to have been created by a bot ('[Snyk]' found in title). We assume it knows what it's doing!
  • We don't review packaging changes - Let us know if you'd like us to change this.

Copy link

github-actions bot commented Aug 16, 2024

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • 🔴 Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • 🔴 Add testing instructions.
  • 🔴 Specify whether this PR includes any changes to data or privacy.
  • 🔴 Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so:

## Testing instructions:

* Go to '..'
*

🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so:

## Does this pull request change what data or activity we track or use?

My PR adds *x* and *y*.

🔴 Action required: Please add missing changelog entries for the following projects: projects/js-packages/boost-score-api

Use the Jetpack CLI tool to generate changelog entries by running the following command: jetpack changelog add.
Guidelines: /docs/writing-a-good-changelog-entry.md


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? Reach out in #jetpack-developers for guidance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSDoc hints are lost after using .extend Prisma XOR with Zod > 3.21.1 not working
2 participants