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

BREAKING CHANGE: Move Joi to peerDependencies #570

Merged
merged 8 commits into from
Oct 22, 2021
Merged

BREAKING CHANGE: Move Joi to peerDependencies #570

merged 8 commits into from
Oct 22, 2021

Conversation

koooge
Copy link
Collaborator

@koooge koooge commented May 22, 2021

Upgrade Joi v13 to v17.

fix #568

Signed-off-by: koooge <koooooge@gmail.com>
Signed-off-by: koooge <koooooge@gmail.com>
Signed-off-by: koooge <koooooge@gmail.com>
@koooge koooge self-assigned this May 22, 2021
@koooge koooge requested a review from vlucas May 22, 2021 20:49
@vlucas
Copy link
Owner

vlucas commented May 24, 2021

Upgrading Joi is fine internally, but I am more worried about externally, i.e. people using the exported Joi object provided by Frisby for convenince in their own tests. Were there any braking changes from Joi 13 to 17? The version alone implies there likely are. I don't want people to upgrade Frisby and then wind up with tons of broken tests just because Joi change something.

@koooge
Copy link
Collaborator Author

koooge commented May 24, 2021

Yes, Joi v17 has major changes absolutely. I was also wondering what to do about that. We can't upgrade Joi without breaking changes. Otherwise, frisby should not export Joi.
How about moving Joi to peerDependencies? It is also breaking changes tho.

const frisby = require('frisby');
// const Joi = frisby.Joi;
const Joi = require('joi');

@vlucas
Copy link
Owner

vlucas commented May 26, 2021

This is what SEMVer is for. We need to:

  1. Make the change
  2. Stop exporting Joi and make it a peerDependency (as you suggested) to prevent this problem in the future
  3. Bump frisby up to a new major version (3.x) since it will be a potentially breaking change for those using the exported Joi object

@koooge koooge mentioned this pull request Jun 7, 2021
Signed-off-by: koooge <koooooge@gmail.com>
Signed-off-by: koooge <koooooge@gmail.com>
@koooge koooge changed the title chore: Upgrade Joi BREAKING CHANGE: Move Joi to peerDependencies Oct 21, 2021
Comment on lines 34 to +42
"devDependencies": {
"eslint": "^7.32.0",
"jest": "^27.3.1",
"joi": "^17.4.2",
"nock": "^13.1.4"
},
"peerDependencies": {
"joi": "^17.4.2"
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

joi in devDepencencies is needed for npm@6 and lower.

@koooge
Copy link
Collaborator Author

koooge commented Oct 21, 2021

@vlucas I got it. Anyway updated this PR.

Signed-off-by: koooge <koooooge@gmail.com>
Signed-off-by: koooge <koooooge@gmail.com>
Copy link
Owner

@vlucas vlucas left a comment

Choose a reason for hiding this comment

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

Thanks @koooge

@vlucas vlucas merged commit d9bb1b8 into master Oct 22, 2021
@vlucas vlucas deleted the dep/joi branch October 22, 2021 00:16
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.

Upgrade Joi dependency to v17
2 participants