Re: [Nix-dev] yet another npm2nix reengineering attempt

2016-03-07 Thread Wout Mertens
Great job Sander! Some thoughts: - Node 5 layout is Node 4 compatible, so why not use only that? - You can symlink the first level of modules instead of the modules themselves to avoid the commonjs derefence thing. So a combination of modules becomes a shallow copy. - npm2nix

Re: [Nix-dev] yet another npm2nix reengineering attempt

2016-03-02 Thread Thomas Hunger
Thanks Sander for trying again! As a data point: We've had too many issues with integrating NPM and nix more tightly so we've given up and run [1] in combination with shrink-wrap. I think there may be value in pushing the "resolved" fields from the npm-shrinkwrap.json file into nix but trying to

Re: [Nix-dev] yet another npm2nix reengineering attempt

2016-03-01 Thread Colin Putney
On Tue, Mar 1, 2016 at 6:42 AM, Sander van der Burg wrote: > So as you may see: it is all quite annoying and painful. :( > I'm starting to think that it's pointless to try to make it all work automatically. At some point it's so compatible with npm that it replicates all

Re: [Nix-dev] yet another npm2nix reengineering attempt

2016-03-01 Thread zimbatm
As long as it's more reliable than what we have right now I'm all for it. First we need reliable, then optimize closure size. On Tue, 1 Mar 2016 at 14:42 Sander van der Burg wrote: > Haha :) > > Well, I have been thinking about keeping the packages and all their >

Re: [Nix-dev] yet another npm2nix reengineering attempt

2016-03-01 Thread Sander van der Burg
Haha :) Well, I have been thinking about keeping the packages and all their dependencies in their own store directories as well, but I eventually came to the conclusion that it is impossible if you want to support the inclusion of dependencies residing in any of the parent node_modules/ folders.

Re: [Nix-dev] yet another npm2nix reengineering attempt

2016-03-01 Thread Shea Levy
Hmm, OK. I still don't see why each package shouldn't live in its own store dir (perhaps without dependencies linked in), but whatever, I don't use node anymore :D On 2016-03-01 09:12, Sander van der Burg wrote: > It's stateful because the packages that end up in a dependency's

Re: [Nix-dev] yet another npm2nix reengineering attempt

2016-03-01 Thread Sander van der Burg
It's stateful because the packages that end up in a dependency's node_modules/ folder depend on the packages that have been stored in any of the includer's (parent directory's) node_modules/ folders. When a dependency has been encountered a second time (that fits within a package's version range),

Re: [Nix-dev] yet another npm2nix reengineering attempt

2016-03-01 Thread Shea Levy
"including NPM dependencies is stateful" how so? Having separate derivations symlinked in would give you sharing, no? On 2016-03-01 08:15, Sander van der Burg wrote: > Hi, > > I don't know how many of you have noticed my latest blog post > >