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
Add peerDependency warning if using < typescript 5 #359
base: main
Are you sure you want to change the base?
Add peerDependency warning if using < typescript 5 #359
Conversation
The idea is great, but there is one problem. If someone is not using TypeScript, this change will erroneously display a warning when installing Valibot. |
@fabian-hiller Good point. I think we can add: "peerDependenciesMeta": {
"typescript": {
"optional": true
}
} This should make it warn only users who are using typescript. I think this will be helpful because I still see a lot of projects on <5 typescript. |
…script-version-warning
Thank you! I will review this PR in the next few days. |
…script-version-warning
"peerDependencies": { | ||
"typescript": ">=5" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing to note about the TypeScript project is that it does not follow SemVer, and breaking changes can be introduced in minor versions.
You might want to be more explicit about versions that are compatible with the tilde syntax:
"peerDependencies": { | |
"typescript": ">=5" | |
}, | |
"peerDependencies": { | |
"typescript": "~5.0||~5.1||~5.2||~5.3" | |
}, |
Or even just a more specific range:
"peerDependencies": { | |
"typescript": ">=5" | |
}, | |
"peerDependencies": { | |
"typescript": "=5" | |
}, |
Sorry for not picking up this PR yet. Other things had a higher priority. I expect to review it this month. |
b997a0f
to
6d0cde4
Compare
I discovered this issue using nextjs when when using typescript < 5.
#352
This adds a peerDependency of typescript 5 so that anyone installing valibot will be warned if they don't have the appropriate version of TypeScript installed in their project.