Skip to content
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

Add yarn.lock file support #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moretea
Copy link

@moretea moretea commented Dec 17, 2016

Yarn is a new package manager for Javascript.
It's yarn.lock file functions like a Gemfile.lock (used by Ruby) and Cargo.lock file (used by Rust).

The advantage of adding yarn.lock support to node2nix is that when the ecosystem starts adapting this tool -and I believe that it is already doing this- we can easily package programs with the exact versions of packages as intended by the developers.


Status

  • Parse yarn.lock file using the parser provided in yarn
  • Handle npm registry packages
  • Handle git
  • Handle http
  • Handle local
  • Investigate if/how the dev dependencies are installed correctly (only when requested)

I could use some help with testing the changes and extending the yarn package fetcher to handle other sources than the npm registry.

@moretea moretea mentioned this pull request Dec 17, 2016
2 tasks
@offlinehacker
Copy link

offlinehacker commented Jan 14, 2017

I do not agree with yarn2nix being depreated. I think node2nix is overly complex solution. As far as i can see yarn2nix works by creating offline binary cache, that yarn later uses for package install. This is really good solution as it works. I will work on implementation of buildYarnPackage, that does exactly that. Similar solutions we have for go and ruby and they work really well. Having one large json file with all package definitions is not that good, as having a package is not only about having definitions that can build it, but also about metadata, and other things that cannot be automatically generated.

@the-spyke
Copy link

I will be nice to have npm's lock file support too.

@Mic92
Copy link
Contributor

Mic92 commented Feb 18, 2020

node2nix is the only sane way to cope with the big amount of generated node expressions in nixpkgs and ensure some sharing of common dependencies. Every yarn.nix adds another 0.5 mb file. This is unacceptable.

@Mic92
Copy link
Contributor

Mic92 commented Mar 10, 2020

I would be interested in having yarn support for node2nix. I currently created a community fork of node2nix, which I will propose for inclusion in nixpkgs, since this repository seems unmaintained.

@Mic92
Copy link
Contributor

Mic92 commented Feb 12, 2021

npm 7 also supports yarn.lock files itself now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants