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

Support $ in overrides instead of specific version #5703

Closed
1 task done
ufec opened this issue Nov 27, 2022 · 4 comments
Closed
1 task done

Support $ in overrides instead of specific version #5703

ufec opened this issue Nov 27, 2022 · 4 comments
Milestone

Comments

@ufec
Copy link
Contributor

ufec commented Nov 27, 2022

Describe the user story

I want to use a new version of the dependency, but it is dependent on another dependency package, I have to overwrite the version that the existing dependency package depends on

Describe the solution you'd like

Using the $ method of npm will not make the user feel unfamiliar, he can directly refer to the version of the existing dependent package like a variable

without breaking the original way

Describe the drawbacks of your solution

When taking out overrides, iterate through all the keys to see if the value starts with $, if so, find out whether the version of the key exists in the existing dependencies or devDependencies, and replace the reference if it exists, and dependencies take precedence

Describe alternatives you've considered

I can’t think of a better alternative at the moment, if possible, I’ll check out npm or yarn

@ufec
Copy link
Contributor Author

ufec commented Nov 27, 2022

@zkochan

@zkochan
Copy link
Member

zkochan commented Nov 27, 2022

How would this work in a workspace? In a workspace you may only describe overrides in the root package.json. And they influence all projects in the workspace. So, in this references you will only be able to use the direct dependencies that are in the root package.json.

@ufec
Copy link
Contributor Author

ufec commented Nov 27, 2022

How would this work in a workspace? In a workspace you may only describe overrides in the root package.json. And they influence all projects in the workspace. So, in this references you will only be able to use the direct dependencies that are in the root package.json.

Do you mean apply overrides in subprojects?

@zkochan
Copy link
Member

zkochan commented Nov 27, 2022

No, I am just afraid that people will expect it.

zkochan added a commit that referenced this issue Nov 29, 2022
Co-authored-by: Zoltan Kochan <z@kochan.io>
@ufec ufec closed this as completed Nov 29, 2022
@zkochan zkochan added this to the v7.18 milestone Dec 3, 2022
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