-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
question(config): how to pin versions to a range? #257
Comments
For this you could use the following as {
"versionGroups": [
{
"dependencies": ["react"],
"pinVersion": ">=16.1.1 <17",
}
]
} |
You would next need to run fix mismatches to set each of your react versions to use the new range specifier we added as the pinVersion in your config. |
Sorry, its may not be what i want。 i want synpack to check the react version should between 17-19 in my monorepo, which can help us manage our dependencies in a safe range. if i just use the range specifier in packages.json, how can I update any of them? For example: A packages.json B packages.json i can update B to 18.0.3 which still satisify the rule version should between the safe area 17-19 . But if I use range A packages.json B packages.json How can I update version ? ❌ |
Sorry @sissi144 I'm not completely sure what it is you need. If you need to constrain your dependency to a specific range, As far as updating packages goes, again your package manager would handle this and you would see the changes reflected in your lockfile when you run its update command. The closest thing syncpack has today is a same range group, but that ensures the versions all satisfy eachother, it doesn't apply a constraint to what that range should be. I think doing that is a step too far for syncpack and starts to encroach on the job package managers do already, but I'm open to being persuaded on this if I have a blind spot. |
I will close this as a duplicate of #244, I think they could be the same thing. |
Description
now we can add rules like
{ dependencies: [ 'react',], pinVersion: '^16.1.1', },
which means react should wirte as
'react': '^16.1.1''
in every packages.jsonbut we now need it to satisfy a scenario that we can also write react 16.1.9 or 16.6.6 in packages.json, which satisfy the semver rules that
^16.1.1
means version between16.1.1-16.X.X (not 17)
Suggested Solution
like top
Optional comments
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: