cjohansen/Sinon.JS — pull request #358 by mantoni (2013-11-27 22:52:10+00:00)
Title: WIP: Use Browserify to bundle Sinon.JS

## Use [Browserify](https://github.com/substack/node-browserify) to bundle Sinon.JS.

- This allows us to write the modules with pure node-style modules.
- All the AMD / CommonJS / Require logic is handled by browserify.
- No test cases have been changed (with a single one which I had to comment out).
- A new `test/server.js` has been added which uses `node-static` and replaces the `http-server`.
- To run tests in node: `npm test`
- To run tests in the browser: `npm start`, then open `http://localhost:8080/test/sinon.html`
- Ships the generated `sinon-bundle.js` with source maps.

__This will hopefully fix these issues__: #356 because the affected code is removed entirely, #301 and #347.

### Current status

- The build process is not yet done. It would be similar to the browserify call that is currently made in `test/server.js`.
- There are quite some hacks in there to get the dependencies between the files straight. But this only shows how unclear the module dependencies where. Maybe it helps with cleaning the dependency tree in the future.
- In other cases I had to inject the global sinon object into the modules to get the test cases working without modifications.
- I had to skip the `buster-format` dependency for the time being, because browserify complains about `bfrs` not being available. That usually means that it tries to read from the file system. Formatting is currently only done via the node `util` package. There are some failing test cases due to this. Maybe someone has a good idea how to solve this.
- Unfortunately this change will make other open pull requests difficult to merge.

There are still some failing test cases, but I already spend an unhealthy amount of time on this.

I hope you like the direction in which this is going. However, please let me know your opinion. Since this is probably the most dramatic change in the recent history of the project, I guess you are going to add a few points.

I would apprechiate some help with getting this done!