Great package but can have destructive results on your package.json
Closed this issue · 2 comments
This is a great package but can have a destructive result if you accidentally control c the running application or it errors out on a cryptic error in node itself.
The package.json will inherit its modified state, which may be incomplete or missing packages. While easy to restore from a version control system it would be beneficial to add some testing case.
One should be to store the original package.json in a .yarn-upgrade-all tmp directory in case an issue was present. If the program was cancelled early by mistake this version could be reverted too.
Either restore the original package.json OR attempt a merge operation. Obviously if you were between a remove and add section the package goes missing. If there was an original backup when rerunning yarn-upgrade-all
the program could check to see if it was interrupted and attempt to merge previous tasks.'
Goal is to have a safer outcome.
I am not sure I am going to do that.
First of all, as you said, most projects have version control, you can git stash
to revert the breaking change.
Secondly, to me, control c and cryptic error in node are “force majeure”. This package (and most other utility packages) is not responsible for that.
Lastly, even you restore/merge the temp package.json
file there are still issues: node_modules/
is not in a ready state because package missing or version mis-matching with package.json
.
Another case is when there is a bad network connection or package compatibility issue, a package cannot be installed.
In such cases the recommended solution is to install that package manually. Because in such case there is unlikely a reliable and automatic way to fix the issue. You'd have to fix the issue manually whatever.