Mochabot log - CommonJS IRC channel: #commonjs on irc.freenode.net

2010-08-10:

[14:05] <nrstott> kriszyp, do you have some static file middleware for JSGI 0.3?
[14:05] <nrstott> static file serving*
[14:07] <kriszyp> nrstott: yes, http://github.com/kriszyp/pintura/blob/master/lib/jsgi/static.js
[14:08] <nrstott> thanks
[14:08] <nrstott> hm dependent on jack?
[14:08] <nrstott> is jack running on node now?
[14:08] <kriszyp> I have only been testing that on node though, because I just have been using jack's static module for jack
[14:08] <nrstott> it looks like you use jcak in this file
[14:08] <nrstott> at least jack/mime
[14:08] <kriszyp> yeah, just for mime types
[14:09] <kriszyp> it doesn't have any deep deps on jack infrastructure though
[14:09] <kriszyp> and I suppose I could just copy the list of mime types into static or another file in pintura to remove that dep
[14:09] <nrstott> ive got some nodules issues / questions btw
[14:09] <nrstott> the documents suggest that i will get free modules 'system' and 'process'
[14:10] <nrstott> however require('system') and require('process') dont work and i dont have a system or process variable auto either
[14:10] <nrstott> so what does that mean exactly?
[14:11] <nrstott> am i just reading the "Nodules provided top levle modules" wrong and it really means i have to map "system" and "process" just like anything else?
[14:12] <kriszyp> hmm, I thought that should work
[14:13] <nrstott> also im finding myself having trouble with resolution inside of dependent packages for things like require("./base64")
[14:13] <nrstott> im having to change those to require('base64") and provide an actual mapping
[14:13] <nrstott> that wasnt the intention if i read it ocrrectly
[14:13] <nrstott> or is it for the cases wehn I map directly to a .js file instead of to a /lib/ dir?
[14:14] <kriszyp> you are using require("./base64") for a module from a different package?
[14:14] <kriszyp> or from the same package?
[14:14] <kriszyp> it should definitely work from the same package, and it definitely should not work from a different package
[14:15] <nrstott> same package
[14:15] <nrstott> this is in my couchdb package, i required it as a dependency and my mapping was to the /lib/couchdb file
[14:16] <nrstott> inside of it i had a require("./base64") which is in the couchdb package in the lib dir as wel
[14:16] <nrstott> it said it couldn't find it
[14:16] <kriszyp> hmm, I've been using relative references a lot and haven't seen any problems
[14:16] <nrstott> ill see if i can get a reproduction later. i think it should be easy to repo
[14:17] <nrstott> now strangely, my require("./promise") in the same module worked fine
[14:17] <nrstott> but i dont think it wsa realy getting the 'promise.js' in my couchdb package i think it was getting a different one
[14:17] <nrstott> id have to test to make sure though
[14:17] <nrstott> ill do some more research about it later when i hav esome free time
[14:47] <nrstott> kriszyp, another question for you. What is the proper equivalent of nodes __dirname when using nodules? When using nodules __dirname turns out to be a path in downloaded-modules
[14:52] <kriszyp> that isn't right?
[14:53] <nrstott> no
[14:53] <nrstott> i have a 'fixtures' dir under my test dir
[14:53] <nrstott> i set my view path to __dirname + '/fixtures' which works fine if i run with just node, it finds my fixtures dir
[14:53] <nrstott> when i use nodules, the fixtures dont seem to be copied to the downloaded-modules dir
[14:53] <nrstott> they aren't present in there... so i get file not found when trying to load my templates
[14:54] <kriszyp> I don't understand, __dirname is the name of the directory with the current module isn't it?
[14:54] <nrstott> kriszyp, here is the problem: No such file or directory 'downloaded-modules/home/nathan/working/bogart/test/fixtures/index.mustache'
[14:54] <nrstott> now the path is perfectly correct except downloaded-modules shoudlnt be on the front of it :)
[14:55] <nrstott> either that or static files should be copied by nodules as well into the downloaded-modules
[14:55] <nrstott> and yes, __dirname is the directoyr wiht the current module
[14:55] <kriszyp> static files aren't being copied?
[14:55] <nrstott> wait... that path is just wrong
[14:55] <kriszyp> that's strange, they copy for me
[14:55] <nrstott> im running "nodules test/view.test.js"
[14:55] <nrstott> my fixtures are in /home/nathan/working/bogart/test/fixtures
[14:55] <nrstott> __dirname is turning out to be what i pasted above
[14:56] <kriszyp> is __filename correct?
[14:56] <nrstott> __dirname + "/fixtures" that is
[14:56] <nrstott> also downloaded-modules/home/..... doesn't exist at all
[14:56] <nrstott> downloaded-modules does have my other deps in it though
[14:56] <nrstott> like promised-io
[14:56] <nrstott> i think that's correct... i think the problem is __dirname is for some reason adding the downloaded-modules onto the front
[14:57] <nrstott> __filename is not correct eitehr
[14:57] <nrstott> it resolves to downloaded-modules//home/nathan/working/bogart/test/view.test.js
[14:57] <nrstott> i am in /home/nathan/working/bogart when i run 'nodules test/view.test.js'
[15:02] <nrstott> kriszyp, anything I can do further to diagnose?

 

 

Logs by date :