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

Update dependency zod-validation-error to v3 #105

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 19, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
zod-validation-error ^2.0.0 -> ^3.0.0 age adoption passing confidence

Release Notes

causaly/zod-validation-error (zod-validation-error)

v3.4.0

Compare Source

Minor Changes
  • 3a7928c: Customize error messages using a MessageBuilder.

v3.3.1

Compare Source

Patch Changes
  • 42bc4fe: Test Version Packages fix

v3.3.0

Compare Source

Minor Changes
  • 66f5b5d: Match ZodError via heuristics instead of relying on instanceof.

    Why? Because we want to ensure that zod-validation-error works smoothly even when multiple versions of zod have been installed in the same project.

v3.2.0

Compare Source

Minor Changes
  • 6b4e8a0: Introduce fromError API which is a less strict version of fromZodError
  • 35a28c6: Add runtime check in fromZodError and throw dev-friendly TypeError suggesting usage of fromError instead

v3.1.0

Compare Source

Minor Changes
  • 3f5e391: Better error messages for zod.function() types

v3.0.3

Compare Source

Patch Changes
  • 2f1ef27: Bundle code as a single index.js (cjs) or index.mjs (esm) file. Restore exports configuration in package.json.

v3.0.2

Compare Source

Patch Changes
  • 24b773c: Revert package.json exports causing dependant projects to fail

v3.0.1

Compare Source

Patch Changes
  • 3382fbc: 1. Fix issue with ErrorOptions not being found in earlier to es2022 typescript configs. 2. Add exports definition to package.json to help bundlers (e.g. rollup) identify the right module to use.

v3.0.0

Compare Source

Major Changes
  • deb4639: BREAKING CHANGE: Refactor ValidationError to accept ErrorOptions as second parameter.

    What changed?

    Previously, ValidationError accepted Array<ZodIssue> as 2nd parameter. Now, it accepts ErrorOptions which contains a cause property. If cause is a ZodError then it will extract the attached issues and expose them over error.details.

    Why?

    This change allows us to use ValidationError like a native JavaScript Error. For example, we can now do:

    import { ValidationError } from 'zod-validation-error';
    
    try {
      // attempt to do something that might throw an error
    } catch (err) {
      throw new ValidationError('Something went deeply wrong', { cause: err });
    }

    How can you update your code?

    If you are using ValidationError directly, then you need to update your code to pass ErrorOptions as a 2nd parameter.

    import { ValidationError } from 'zod-validation-error';
    
    // before
    const err = new ValidationError('Something went wrong', zodError.issues);
    
    // after
    const err = new ValidationError('Something went wrong', { cause: zodError });

    If you were never using ValidationError directly, then you don't need to do anything.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

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 19, 2024
Copy link

codecov bot commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ad43bb3) 93.44% compared to head (0181bd4) 93.44%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #105   +/-   ##
=======================================
  Coverage   93.44%   93.44%           
=======================================
  Files          90       90           
  Lines        4880     4880           
  Branches      401      401           
=======================================
  Hits         4560     4560           
  Misses        319      319           
  Partials        1        1           
Flag Coverage Δ
create 71.90% <ø> (ø)
initialize 37.60% <ø> (ø)
migrate 70.76% <ø> (ø)
unit 68.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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