-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Allow specifying the desired version per dependency #63
Comments
Are Yarn resolutions or pnpm overrides a good fit for this use-case? I'm hesitant about syncpack potentially being a source of truth for version numbers, instead of package.json files. On your other comment, there's only one method of resolution in syncpack at the moment, versions are resolved by taking the newest valid server version. |
Yarn resolutions / pnpm overrides are good for certain use-cases, yet they don't actually modify the Regarding:
thanks for clarifying that - I think it's worth mentioning in the README, unless I've missed it. |
Thinking some more, the version information would be in addition to the package.json files, not instead of, and would only change them when you run syncpack. As an opt-in this could be OK actually. I'll mention the resolution strategy in the readme, good shout. |
Sounds great, I'll try submit a PR soon with a suggestion |
This should now be possible in 6.1.0, thanks for contributing. |
Description
In some cases, it's useful to align all the dependencies of a package to a pre-defined dependency, e.g. set all
lodash
versions across the monorepo to be~14.17.0
.The current process is unclear in regards to how the version to set is obtained - I see it can be either the latest version of the dependency, or some other version declared by one of the packages (which I assume if picked to be such that falls within all the semver ranges defined in all the monorepo packages).
Suggested Solution
Allow providing an
enforceVersions
property in thesyncpack
file (or as a standalonesyncpack-versions
file, for instance), that will hold the desired versions to set for each dependency. Based on a new flag or the mere existence of the file, the dependencies across the repo would be all set to the desired versions.For example:
The examples separates dev fro production dependencies, if for some reason they need to be set to different semver ranges, but this should probably be optional (by allowing to nest all the dependencies directly under the
enforceVersion
property).This will allow both an easy alignment of dependencies in an existing repo, and also provide a clearer process of version resolution that can be reasoned about.
Help Needed
@JamieMason If you found this proposal useful, I'll be glad to be pointed to the relevant parts in the code that needs to be changed and contribute a PR.
The text was updated successfully, but these errors were encountered: