napalm icon indicating copy to clipboard operation
napalm copied to clipboard

Support for `yarn.lock`

Open terlar opened this issue 5 years ago • 3 comments

I have worked on some projects where yarn.lock is used and teams seem to be quite attached to yarn so it seems unlikely that they would switch away from it completely. Does it make sense to support yarn.lock as well for source of dependencies?

terlar avatar Oct 21 '20 11:10 terlar

I remember reading up on both npm and yarn when I was developing napalm. I seem to recall that all the innovations that yarn brought had been integrated into npm over time, so I decided to simply support npm-style builds. Also, the yarn.lock format can't be parsed natively (with builtins.X) by Nix, which means pre-downloading the dependencies can get quite tricky! Does this help?

nmattia avatar Oct 22 '20 08:10 nmattia

I see, because it is a YAML file right? I guess it could be possible to write a parser for the yarn.lock file in Nix, but might be some work. It makes sense, but still seems yarn is most popular among the people developing nodejs/typescript.

I guess the dirty way would be to do something like this: https://github.com/serokell/nix-npm-buildpackage/blob/master/default.nix#L222-L230

But I guess that is in the murky Nix practices.

terlar avatar Oct 22 '20 16:10 terlar

I see, because it is a YAML file right?

I was under the impression that it was a custom format but maybe this changed? I encounter yarn in the wild rarely these days (though I don't work much with javascript), I assumed it was slowly dying...

nmattia avatar Oct 23 '20 08:10 nmattia