Nope, I hadn't seen that, good to know that there's work in progress here.
On this topic, there's probably some blockers to distributing something like this in npm, particularly given that there's a compiled component. I've played a little with having native plugins to leveldown, where you `npm install X` and X depends on leveldown existing so it can compile against it. Although in my case the dependency works the opposite way to what TJ's addon-layer will work in that you have one leveldown and multiple addons compiling against it. Here's some hackery I had to do to make it work:
https://github.com/rvagg/node-downer-rangedel/blob/master/common.gypi - basically executing a node process to use require.resolve in a .gypi to work out where the installed version is.
The real problem for me though is that you can't determine compile order with an `npm install`, so if you `npm install leveldown downer-rangedel` then it'll likely fail because a leveldown compile will take longer than a downer-rangedel compile and they happen in parallel, so you have to `npm install leveldown; npm install downer-rangedel`. Which kind of sucks.
Ideally we'd be able to do these things with npm and node-gyp:
- Easily determine the path to a dependency/peerDependency or some other dependency that you don't want to list in package.json (e.g. in my case I don't want leveldown as a dependency of downer-rangedel because I only want one instance of leveldown installed & compiled per application). It'd be nice to be able to do something like "<@(node_dependency_path:addon_layer)" in your .gyp and have node-gyp take care of it for you.
- Specify build order in some way, perhaps a package.json property that says that this package shouldn't be compiled until some other package has been compiled.