Skip to content
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

feat: apply constraints to versions used when fixing mismatches #53

Closed
vjpr opened this issue May 10, 2021 · 3 comments
Closed

feat: apply constraints to versions used when fixing mismatches #53

vjpr opened this issue May 10, 2021 · 3 comments

Comments

@vjpr
Copy link

vjpr commented May 10, 2021

I have a bunch of packages using webpack@4 and webpack@5. I basically want all packages to pin to the same version of either 4 or 5 depending on what they currently depend on.

Some packages depend on webpack@5.0.0-beta.18 for example. This is because it was the only package available at the time, but now I want them all to use the latest.

I guess its similar to versionGroups, but instead of listing packages, I want to list the semver range for the group.

Something like:

{
  "versionGroups": [
    {
      "dependencies": ["webpack"],
      "versions": ["webpack@4<5"],
    },
    {
      "dependencies": ["webpack"],
      "versions": ["webpack@>5"],
    }
  ]
}
@vjpr vjpr changed the title Q: How to pin the packages based on major version number Q: How to pin the packages based on existing major version number of dependency May 10, 2021
@JamieMason
Copy link
Owner

It's been a long time getting around to this, but how does this sound @vjpr?

  • @old-stuff/* must have the same versions of webpack, lodash, and react
  • @new-stuff/* must have the same versions of webpack, lodash, and react
  • @old-stuff/* and @new-stuff/* can have different versions of webpack, lodash, and react to each other
  • lodash and react mismatches will always be synced to the newest version found
  • webpack within @old-stuff/* will be synced to to the newest version which matches the constraint webpack@<5
  • webpack within @new-stuff/* will be synced to to the newest version which matches the constraint webpack@>5
  • If no version matches the constraint, throw an error and quit
{
  "versionGroups": [
    {
      "dependencies": ["webpack", "lodash", "react"],
      "packages": ["@old-stuff/server","@old-stuff/ui"],
      "constraints": ["webpack@<5"]
    },
    {
      "dependencies": ["webpack", "lodash", "react"],
      "packages": ["@new-stuff/server","@new-stuff/ui"],
      "constraints": ["webpack@>5"]
    }
  ]
}

@JamieMason JamieMason changed the title Q: How to pin the packages based on existing major version number of dependency feat: apply constraints to versions used when fixing mismatches Aug 6, 2021
@JamieMason
Copy link
Owner

Shall I close this one @vjpr?

@JamieMason
Copy link
Owner

This should now be possible in 6.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants