Yarn: Make package.json saving optional during upgrade

Created on 27 Oct 2016  路  2Comments  路  Source: yarnpkg/yarn

Do you want to request a _feature_ or report a _bug_?
Feature

What is the current behavior?
When updating packages with yarn upgrade, it overwrites the package.json file and messes up all my custom formatting.

What is the expected behavior?
yarn upgrade should work like npm update where it updates the packages based on the current package.json file with an optional command to save those changes back. It gets very hard to maintain a project with a lot of dependencies when the package.json file is all messed up. Please give me the option to manually maintain my package.json files.

Please mention your node.js, yarn and operating system version.
Node 6.9.1 LTS with Yarn 0.16.1 on OSX 10.11.4

Most helpful comment

@wyze: It's not really the same though, that issue is referring to adding packages which would understandably have to modify the package.json file. Why should upgrade overwrite it though. It doesn't change anything in the file apart from the formatting.

All 2 comments

This is along the same lines as #1743 and you can see why we wont do this here: https://github.com/yarnpkg/yarn/issues/1743#issuecomment-259689586

@wyze: It's not really the same though, that issue is referring to adding packages which would understandably have to modify the package.json file. Why should upgrade overwrite it though. It doesn't change anything in the file apart from the formatting.

Was this page helpful?
0 / 5 - 0 ratings