[Pkg-javascript-devel] Node app requiring "general" javascript library

Jérémy Lal jerry at edagames.com
Thu Oct 13 21:53:20 UTC 2011


On 13/10/2011 21:00, Jonas Smedegaard wrote:
> On 11-10-13 at 08:41pm, Jonas Smedegaard wrote:
>> On 11-10-13 at 08:22pm, David Paleino wrote:
>>> as you might have noticed, I'm packaging a bunch of NodeJS libraries 
>>> that I need for a specific package (tilemill). Some of these packages 
>>> require "underscore".
>>>
>>> I see that we have libjs-underscore, and 
>>> http://search.npmjs.org/#/underscore points to the same github 
>>> repository as that one.
>>>
>>> I'm testing the following snippet:
>>>
>>> /---
>>> | require('underscore')
>>> \---
>>>
>>> which works with other libraries I packaged, but gives an error with 
>>> this one. A symlink from 
>>> /usr/share/javascript/underscore/underscore.js to 
>>> /usr/lib/nodejs/underscore.js makes this work, but that would require 
>>> a new upload of libjs-underscore.
>>>
>>> I'm wondering whether there is an alternative approach I could use, 
>>> without uploading a new libjs-underscore?
>>
>> Hmm - seems to me that you've revealed a bug in my packaging.
>>
>> I don't think it is wise to circumvent it - please do fix 
>> libjs-underscore instead (or, if e.g. CDBS is too discouraging, wait for 
>> me to do it).
> 
> Hmm - looking closer at this issue, it seems more appropriate to provide 
> a separate binary package: When used with Node it should depend on 
> libnode, but used without it is bothersome to have libnode pulled in.
> 
> Same for backbone.  Which might solve that issue I raised in a separate 
> thread: Maybe best that packages usable both alone and with Node is 
> provided as two separate binary packages, not so much to save space 
> (these are all typically tiny packages) but to avoid dependency hell.
> 
> 
> 
> What do people think?

I started something there :
http://lists.alioth.debian.org/pipermail/pkg-javascript-devel/2011-September/001770.html

In the context of this discussion, it goes like this :
* libjs-xxx would provide the pure js part, and do not take care of nodejs in any way
* libnode-xxx would provide the pure node part, depend on libjs-xxx and symlinks to it.

This is because libjs packages mainly rely on being run inside some browser, so they have
nothing to do with node, most of the time. That won't change soon.

Jérémy



More information about the Pkg-javascript-devel mailing list