-
-
Notifications
You must be signed in to change notification settings - Fork 798
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 toValidSemver utility function #4113
Conversation
🦋 Changeset detectedLatest commit: 75661d8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
LGTM!
23593b7
to
81ba77a
Compare
Added @vitaliemiron contributions for doc and code |
This PR introduces the toValidSemver utility function, ensuring that a given version string complies with the SemVer specification. The function adds a .0 patch version if the input string only consists of a major and minor version (e.g., "1.2" becomes "1.2.0").
I added this function to handle cases where the package version is provided in a shortened format, which might cause issues with SemVer-compliant tools or libraries, such as semver.satisfies. Using toValidSemver ensures that version strings are always in a valid format, preventing potential problems and improving compatibility across our codebase.
Closes: #4112
What are the changes and their implications?
Bug Checklist
pnpm changeset
in the root directory)Feature Checklist
pnpm changeset
in the root directory)main
branch)