[Nix-dev] Reengineered npm2nix: call for feedback

Sander van der Burg svanderburg at gmail.com
Tue Sep 30 12:13:39 CEST 2014


Hi everybody,

Since the sprint in Ljubljana until now, I've been working on npm2nix's
issues. I basically reengineered most of it (e.g. rewritten it to
JavaScript and modularized it a bit further) and I think the implementation
is fairly complete now. I've incorporated as much of Shea's functionaility
into the reengineered version as I could.

The new implementation handles dependencies in such a way that its behavior
is closer to what NPM does. Moreover, it should also properly cope with
cyclic dependencies. The way dependencies are resolved is actually much
more advanced than the original npm2nix implementation. For example, it
uses semver to make matches between version ranges.

In theory, also cyclic dependencies that match on version ranges should be
handled properly, although I haven't encountered them yet.

Using the reengineered version is straight forward. You can obtain it from
my private Git fork:

https://github.com/svanderburg/npm2nix/tree/reengineering

I have updated the README.md file of npm2nix to elaborate a bit more about
the possible use cases of npm2nix. So I think it wouldn't be a bad idea to
read it first.

Installation can be done by opening the git checkout, and running:

$ nix-env -f default.nix -iA build

Moreover, you don't need to update Nixpkgs. The new build function is
actually part of npm2nix.

I've used the reengineered npm2nix on a private project for the company I
work for, as well as some other utilities and it seems to work fine for me.

Hopefully, you can also try npm2nix on your projects to find out whether
there any additional issues. :)

Furthermore, I'm still working a blog post to rationalize all the stuff,
which should give you better insights in the problem, details and the
choices I made.

Let me know what you think!

Regards,

Sander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140930/90f0afea/attachment.html 


More information about the nix-dev mailing list