Only update project packages as much as necessary? #12341
-
As a Drupal developer I have done some pretty juicy major version upgrades. The way I prefer to approach major version upgrades is understanding which Drupal core version I want to upgrade to, and only upgrade or downgrade everything else (relative to their currently locked versions) as much as needed so it is compatible with the new core version. In other words, give me the version of Drupal core that I want and then minimally change what is necessary to be compatible with the new core version. For example: composer.json {
"require": {
"drupal/core": "^10",
"drupal/module-a": "^2.1"
"drupal/module-b": "^4"
}
} composer.lock (for the listed composer.json packages): {
"require": {
"drupal/core": "10.2.1",
"drupal/module-a": "2.2"
"drupal/module-b": "4.3"
}
} Given the following:
So what I'd like to do is give an update command that says "upgrade drupal/core to 11.1.4, and upgrade or downgrade everything else only as much as necessary (relative to a package's currently locked version)". So, the constraint effectively becomes:
Assume preferring stable and minimum stability of dev. So, say some command exists to accomplish this, the result of that command should result in new installed versions:
I thought Is there a singular command that works here? Are there any modifications you would make to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
the behavior of |
Beta Was this translation helpful? Give feedback.
Good point, I will consider this.
Understood this is complex, I guess I was just imagining if there was an option available to accommodate this need then it might be an appropriate name for that. I think the process I've outlined above, combining
--minimal-changes
and--prefer-lowest
gets me to where I need to go for now.I'll mark this as answered. Thanks @stof this has been a good back and forth conversation, appreciate your time.