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(groups): allow many dependencies to be interpreted as one #204

Open
moltar opened this issue Apr 4, 2024 · 5 comments
Open

feat(groups): allow many dependencies to be interpreted as one #204

moltar opened this issue Apr 4, 2024 · 5 comments

Comments

@moltar
Copy link

moltar commented Apr 4, 2024

For example, it is possible to force all @aws-sdk/* packages to use the same version?

I know there is this example: https://jamiemason.github.io/syncpack/examples/fix-aws-sdk-version-mismatch/

But it enforces a specific version via pinVersion.

I don't want to enforce a specific version, but rather ensure that all of them are using the same one.

Thanks!

@moltar
Copy link
Author

moltar commented Apr 4, 2024

In addition to that, is there a way to enforce the same version, but for alpha packages?

E.g. in the cdk-land, there's this convention for alpha packages:

2.114.1-alpha.0

Where 2.114.1 is the version of the aws-cdk-lib package.

They are always released together, so versions always go together, just appending -alpha.0 to the end.

I'd like to lint (and possibly fix) this to be always the same.

Thanks!

@JamieMason
Copy link
Owner

Hey @moltar,
I think for this there needs to be some kind of merging/aliasing config along these lines.

{
  "versionGroups": [
    {
      "label": "Ensure AWS SDK dependencies always use the same version",
      "packages": ["**"],
      "dependencies": [{ "@aws-sdk/core": ["@aws-sdk/**"] }]
    }
  ]
}

Where the key is the dependency whose version should be the source of truth, and the array contains the patterns for which dependencies should be 1) included in this group and 2) treated as actually being @aws-sdk/core instead.

So in summary, dependencies would be extended to not only contain an array of pattern strings, but a combination of those and/or these objects as well.

We could use the same approach for packages.

@JamieMason JamieMason changed the title How to force the same version across packages? feat(groups): allow many dependencies to be interpreted as one Apr 5, 2024
@moltar
Copy link
Author

moltar commented Apr 5, 2024

Why can't it be some policy or some such that basically says:

"packages in this group shall all have the same version"


EDIT:

{
  "versionGroups": [
    {
      "dependencies": ["@aws-sdk/**"],
      "policy": "sameVersion",
      "label": "AWS SDK dependencies should all have the same version"
    }
  ]
}

@JamieMason
Copy link
Owner

JamieMason commented Apr 5, 2024

Ahh, I see what you mean. Yeah that could work really well, let me think it through but yeah that does sound better.

Repository owner deleted a comment from moltar Apr 5, 2024
@moimael
Copy link

moimael commented Jul 9, 2024

This feature would be incredibly useful to not have to update the config file for pinned version on dep update.

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

3 participants