[Feature Request] git diff friendly format of lockfile
The story of users
-
yaml file is not friendly to git diff. Almost every time in git diff, each diff block will be confused by same content from different rows and different projects as shown in the images below. This kind of code diff is not easy to read.
-
In a larger repository, there are usually many people working together, but their projects may be irrelevant. The lockfile conflict causes them to have to merge manually.
the solution I think
Inspired by Go's lockfile called "Go.sum", new format of lockfile stores the meta data of each packages in only one line.
The format I designed is like this.
before
after
// new-format.lock
// Nodes
[email protected] sha512-xxxxxxxxxx= noDev
[email protected] sha-xxxxxxxxxx= hasBin noDev
[email protected] sha512-xxxxxxx= engines: {node: '>=0.10.0'} noDev
// Edges
[email protected] -> [email protected]
[email protected] -> [email protected]
Then, if I add a new version of loose-envify,code diff would become like this.
// new-format.lock
[email protected] sha512-xxxxxxxxxx= noDev
- [email protected] sha-xxxxxxxxxx= hasBin noDev
+ [email protected] sha-xxxxxxxxxx= hasBin noDev
[email protected] sha512-xxxxxxx= engines: {node: '>=0.10.0'} noDev
- [email protected] -> [email protected]
- [email protected] -> [email protected]
+ [email protected] -> [email protected]
+ [email protected] -> [email protected]
The reason why I open this issue is that I think the new package manager should have more opportunities to try experimental features