These are chat archives for jescalan/roots

30th
Mar 2015
Jeff Escalante
@jescalan
Mar 30 2015 03:29
hey @kendall -- nametoolong errors are from the filesystem, not roots
i've only seen this with people using bower
which installs dependencies using long overly complex and overly nested paths
really the only fix for this is to override at a filesystem level or not use bower (latter recommended)
Jeff Escalante
@jescalan
Mar 30 2015 03:35
Would love to add complexible, and congrats on the launch!
Would you mind submitting a pull request to add it yourself? Roots website source can be found here: https://github.com/carrot/roots-www
Andy Shora
@andyshora
Mar 30 2015 15:27
Hello guys. Can anyone help me out with a little problem?
I'm trying to read a list of files in the public dir, and pass this into roots config.
I'm returning a promise from the function, and passing in to the 'before' option in roots.
However, when running roots watch, the reading happens correctly, but the browser fails to open. I also don't see the compile 'done!' logging.
Here's a gist of my app.coffee file:
https://gist.github.com/andyshora/ecff3916c706d288b4d9
@jenius any ideas?
I'm quite new to coffeescript so I'm hoping it's some small syntax error!
Jeff Escalante
@jescalan
Mar 30 2015 16:37
hey @andyshora!
So I think this type of use case would be better fitted to an extension rather than trying to hack it into the app.coffee file
:point_up: Docs on extensions can be found here
I would try using When.js for the promise as well
rather than Q
that might help, roots uses when internally
it's very similar to Q, just a slight bit quicker and more advanced
Also for the promises, you want to return the deferred.resolve rather than true
actually you dont want to return anything
you already return your promise there at the bottom
when the data comes through, resolve or reject
and that's it
Jeff Escalante
@jescalan
Mar 30 2015 16:44
Here, I made a couple small edits see how this works: https://gist.github.com/jenius/257117527c898f1f84e1
Andy Shora
@andyshora
Mar 30 2015 16:45
thanks so much! trying it now...
same problem im afraid:
~/Dev/patternlab-roots (master)> roots watch
compiling... generateFileList
finished. 20 files found
~/Dev/patternlab-roots (master)>
yer, the reason I added the returns was because coffeescript was adding them by default before the deferred.resolve/reject calls. i'll find how to remove them and will give that a go. but i dont think it should affect the execution here
do you know of any examples which make use of promises being returned from a function in the before options? ive done a lot of searching, cant find any examples...
Andy Shora
@andyshora
Mar 30 2015 16:56
I added undefined blocks as the last line in those functions to no avail. as far as I can see the function is returning and resolving the promise correctly, but the returned promise is somehow affecting the compilation
I added debug: true to the options, but nothing changed in the output
Andy Shora
@andyshora
Mar 30 2015 17:01
Is the compiling... output above anything to be wary of? the before hooks should run before the compilation
Jeff Escalante
@jescalan
Mar 30 2015 18:14
hmm yeah it should run normally for sure
it seems like the before hook isnt resolving, for some reason
I might try a simpler promise resolution to see if it goes through
Jeff Escalante
@jescalan
Mar 30 2015 18:19
like maybe just resolve immediately?
this miight be a bug
Andy Shora
@andyshora
Mar 30 2015 21:03
I'll have a look at https://github.com/jenius/roots/blob/master/lib/api/compile.coffee, the exec function, first tomorrow morning. Adding some error handlers to the .then calls should tell me what's going on because it looks like the error event is only emitted if the very last call fails.