jaredhanson/deamdify — pull request #3 by airportyh (2013-11-02 05:01:21+00:00)
Title: Rewrite Using Falafel; Added UMD/WebAMD support

Hello,

First off, I want to apologize for rewriting the entire implementation. This has happened to me once, and it can evoke a WTF? But I did it anyway. Sorry! Pretty much all of `index.js` was rewritten, but all the tests mostly stayed in tact - with tweaks. It was a bit of not-invented-here on my part, but I felt the code was hard to work with and that I could improve it. I made use of falafel and I think it turned out pretty well, you can be the judge. I really appreciate that you have a well rounded test suite, it was immensely helpful for me.

The main feature added was support for [UMD/awdWeb](https://github.com/umdjs/umd/blob/master/amdWeb.js). 2 new tests were added for those, one with no deps, and one with deps.

Other improvements are

1. I have taken time and some thought into refactoring the code, and I think the code is easier to work with now than before
2. now it only rewrites the parts of the source file it needs to, while keeping the other parts in tact. So things comments and the author's formatting stay they way it is.

I have integration tested with 2 libraries in the wild. [Masonry](https://github.com/desandro/masonry) and [Flight](https://github.com/flightjs/flight). Masonry almost works, but is tripped up by [this issue](https://github.com/substack/browser-pack/issues/25) in browserify. It can be made to work by either tweaking [doc-ready](https://github.com/desandro/doc-ready) to not reference `window` instead of `this`, or to fix browser-pack. Flight works perfectly.