On Wednesday, 24 July 2013 02:32:52 UTC+10, Nathan Rajlich wrote:
>
> This is pretty cool Rod! I'm sure TJ will have some pointers. Also, 
> related, but I know you're aiming for something a little simpler: have you 
> seen: https://github.com/tjfontaine/node-addon-layer?
>

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.
   

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to