livereload/livereload-js — pull request #5 by dvdotsenko (2012-09-09 01:35:43+00:00)
Title: Build Tweaks: Now builds on Windows, running "rake test" does npm and compiles clever

I am adding some tweaks to python-livereload server and needed to insure I can reliably build/test livereload.js (on Windows) with extra logging built into it.

This is a set of patches geared for **building** and **testing** a bit easier (and now, finally, also allowing that on Windows.)

* rake now compiles only the files that changed (all the way though looking at version file)
* rake now tests (and also pulls needed modules through NPM) (and builds before testing)
* build's concatenation ordering logic is simplified to the bone, by:
- switching to Ruby's built-in TSort for Topological Sort (dependency ordering)
- replacing the Regex-based "replacement of require/exports" with "tiny fake require/exports" header. Modules now don't need to be changed during concatenation, just wrapped into self-exec function.

* !!!! tests changed from Expresso to Mocha !!!!!. Expresso does not install / work on Windows. I have no religious affiliation with either, and don't give an F which testing framework is there, as long as it works (on my, very major platform - Windows). I am sure there will be enough people over there who will like the switch.
* fixed a bug in test checking for wrong protocol string

Note, I did not commit the new `/dist/livereload.js` It's "almost" the same as the old one in structure and, per my tests (against python-livereload server), works the same. However, I don't know what extra functionality you have in Mac server/app, so did not want to push a commit replacing contents of `/dist/` folder, until you feel good about this all.