samgomena / avanti

Website for the restaurant.
https://avantiwestlinn.com
3 stars 0 forks source link

chore(deps): Bump yup from 0.32.11 to 1.0.0 #353

Closed dependabot[bot] closed 1 year ago

dependabot[bot] commented 1 year ago

Bumps yup from 0.32.11 to 1.0.0.

Release notes

Sourced from yup's releases.

v1 Because I finally got around to it

jquense/yup#1906

v1.0.0-beta.7

Fixes published artifacts for the main field

v1.0.0-beta.5 - partial fixes and cast migration path

Beta 5 fixes partial and deepPartial making it work correctly with lazy schema. Specifically the optionality is added after lazy is evaluated but before any other when conditions are added. This makes it consistent with other conditional schema, where runtime conditions always supersede previous schema configuration. This allows for optional overrides if necessary.

const person = object({
  name: string().required(),
  age: number().required(),
  legalGuardian:  string().when('age', {
    is: (age) => age != null && age < 18,
    then: (schema) => schema.required(),
  }),
});

const optionalPerson = person.partial()

person.cast({name: 'James', age: 6 }) // => TypeError legalGuardian required

// age is still required b/c it's applied after the partial optionalPerson.cast({name: 'James', age: 6 }) // => TypeError legalGuardian required

This works slightly differently for lazy which have no schema to "start" with:

const config = object({
  nameOrIdNumber:  lazy((value) => {
     if (typeof value === 'number') return number().required()
     return string().required()
  }),
});

const opti = config.partial()

config.cast({}) // => TypeError nameOrIdNumber is required

config.partial().cast({}) // => {}

Cast optionality migration path

A larger breaking change in v1 is the assertion of optionality during cast, making previous patterns like string().nullable().required() no longer possible. Generally this pattern is used when deserialized data is not valid to start, but will become valid through user input such as with an HTML form. v1 no longer allows this, but in order to make migration easier we've added an option to cast that mimics the previous behavior (not exactly but closely).

const name = string().required()
</tr></table> 

... (truncated)

Changelog

Sourced from yup's changelog.

1.0.0 (2023-02-08)

1.0.0-beta.8 (2022-11-10)

Bug Fixes

Features

BREAKING CHANGES

  • previously oneOf required adding null explicitly to allowed values when using oneOf. Folks have found this confusing and unintuitive so I am deferring and adjusting the behavior
  • Use a simpler regex for email addresses that aligns with browsers, and add docs about how to override.

1.0.0-beta.7 (2022-08-20)

1.0.0-beta.6 (2022-08-20)

Bug Fixes

  • change mixed generic to unknown from any (5e8e8ef)
  • count stripping unknown fields as changes for object casts (2b4773c), closes #1620

... (truncated)

Commits
  • 33909e7 Publish v1.0.0
  • 0fc5abd chore: docs and type fix
  • 0a78e2a chore: fix typo (#1905)
  • 5b94eb1 chore(deps): update all non-major dependencies
  • 1a24359 chore(deps): update all non-major dependencies
  • b297fee chore(deps): update all non-major dependencies
  • 81b65ad Add getDefault results to the describe method (#1887)
  • fc07d1e chore(deps): update all non-major dependencies
  • f7a5401 chore(deps): update all non-major dependencies
  • ec0c59c chore(deps): update all non-major dependencies
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
avanti ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 19, 2023 at 4:15AM (UTC)
dependabot[bot] commented 1 year ago

Superseded by #364.