felte icon indicating copy to clipboard operation
felte copied to clipboard

validator-yup - Add beta version of yup to peer dependencies?

Open dlebech opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe.

When installing yup 1.0.0-beta.4 alongside @felte/validator-yup, npm complains about peer dependency versions, and I have to use npm install --force.

Yup has been in v1.0.0 beta (currently beta-4) since December 2021, but it is stable for my use case, and it had a feature I needed for a project, so I have been using it for a while.

Describe the solution you'd like

Either remove yup as a peer dependency or do something like:

  "peerDependencies": {
    "yup": "^0.32.9 || ^1.0.0-beta"
  },

I understand if this smells a bit weird, but since it's unclear when yup will hit 1.0.0, and the beta works fine with the validator, I thought I would at least ask how you feel about such a change.

Describe alternatives you've considered

The fix for now is to use npm i --force.

Also could consider:

  • Downgrading yup to 0.32.
  • Forking and/or copying the felte validator code to my project.

Additional information

Full npm error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @felte/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/yup
npm ERR!   yup@"^1.0.0-beta.4" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer yup@"^0.32.9" from @felte/[email protected]
npm ERR! node_modules/@felte/validator-yup
npm ERR!   @felte/validator-yup@"^1.0.8" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/yup
npm ERR!   peer yup@"^0.32.9" from @felte/[email protected]
npm ERR!   node_modules/@felte/validator-yup
npm ERR!     @felte/validator-yup@"^1.0.8" from the root project

dlebech avatar Jun 16 '22 16:06 dlebech

Hey! I personally haven't used the beta version of yup. As long as the validate API will not have any breaking changes it should be no issue to add these. What are the plans for 1.0.0?

pablo-abc avatar Jun 17 '22 22:06 pablo-abc

@pablo-abc Thanks for your quick response and sorry for my lack of response!

There is no official roadmap for 1.0.0 that I can find, but the documentation in the repository is already showing 1.0.0 documentation and there haven't been any updates to the 0.X branch since last year.

I've asked a question on yup.

dlebech avatar Jul 16 '22 08:07 dlebech

@pablo-abc Since the yup-validator is just a single file with a very short piece of code, I have now included the validateSchema directly in my project (with a copyright notice of course).

Feel free to close this issue, if you want to wait until yup 1.0.0 is officially released.

dlebech avatar Jul 16 '22 08:07 dlebech

Hi @pablo-abc I'm closing this as Yup has been released in version 1.0.0 and this is no longer relevant. Cheers.

dlebech avatar Feb 24 '23 10:02 dlebech