-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Persist unchanged dependencies #13
Comments
I don't understand what you're asking. Can you provide an example or elaborate? |
@sindresorhus sure thing. Consider the example below. {
"name": "project",
"dependencies": {
"a": "1.0.0"
}
} I would only like to add/override a dependency. Currently, to my understanding, it's only possible to construct an object of all dependencies and add/modify existing ones before committing changes to the If I remember correctly, this was important to me because otherwise, I have to construct an abstraction myself which firstly reads the dependency then updates it and only later commits changes which, as a consequence, increases the number of tests on developers end. |
Yeah, we could expose some utility methods for common package.json modification needs, like |
@sindresorhus should consecutive calls be able to preserve arbitrary fields in a await writePackage({name: 'foo', version: '1.0.0'}); {
"name": "foo",
"version": "1.0.0"
} await writePackage({version: '2.0.0', license: "MIT"}); {
"name": "foo",
"version": "2.0.0",
"license": "MIT"
} Currently, {
"version": "2.0.0",
"license": "MIT"
} I had been trying to use
Maybe the current behavior could be moved to an |
No, I would expect |
Thinking it over more, |
I stil think |
|
Yep
Makes sense to have the inverse of adding, yes. |
Is it possible to only override the selected dependencies without removing unlisted ones?
The text was updated successfully, but these errors were encountered: