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: explicitly allow multiple versions #83

Closed
bitttttten opened this issue Jul 25, 2024 · 4 comments · Fixed by #84
Closed

feat: explicitly allow multiple versions #83

bitttttten opened this issue Jul 25, 2024 · 4 comments · Fixed by #84
Labels
enhancement New feature or request

Comments

@bitttttten
Copy link

We have different apps on different versions of next and react. We use peer dependencies to ensure that a package can be installed on an app, which works well for us. That means that maybe package-b is using react 18, but doesn't support react 17. so app-a on react 17 can't use package-b yet.

We'd love to allow specific versions of react, or set allow max 2 different versions.

Based on clarity and common conventions, I propose using --allow for specifying allowed versions and --max for specifying the maximum number of versions allowed.

npx sherif --allow react@17.0.2 react@18.0.2 --allow next@14.3.0 next@13.2.4

and

npx sherif --max react 2 --max next 2

To be honest, the second idea I don't really like. I favour the first, "allow", option. Although I just had to spitball the idea of having a "max" flag too.

@bitttttten bitttttten changed the title feat: multiple-dependency-versions max 2 feat: explicitly allow multiple versions Jul 25, 2024
@QuiiBz QuiiBz added the enhancement New feature or request label Jul 27, 2024
@QuiiBz
Copy link
Owner

QuiiBz commented Jul 27, 2024

I quite like --allow, it makes sense to add this feature instead of completely ignoring a dependency (as currently recommended)

@bitttttten
Copy link
Author

I tried to fork the repo and give it a go although I have never written Rust so I didn't get very far 😂

If it ever gets picked up I am happy to help with testing or anything like that!

@QuiiBz
Copy link
Owner

QuiiBz commented Jul 30, 2024

Same idea but updated a bit to avoid creating a new option by re-using the --ignore-dependency option to also accepts dependency@version: #84

Let me know if that looks good to you!

@bitttttten
Copy link
Author

It looks good, shall we close this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants