boltjs/bolt — pull request #38 by markhibberd (2013-07-05 13:14:25+00:00)
Title: This is a massive restructure to clean-up initialization

of bolt and its general api.

Importantly, this:
- Converts internals of bolt to actual modules.
- Lift ALL bolt implementation out of the global namepsace.
- Only public api will be accessible.
- Move public api from bolt.module.api to just bolt. This means
`bolt.require` and `bolt.define` are the qualified versions of the API.
- Make bolt work out of the box on node.
- Make the compiler a common js module that can just be pulled in.
- Tidy up the hacky shit around the tests. A lot of it is tacked on
the outside when we rushed to get this done. Use a public API for
spinning up bolt in a more controlled fashion.
- Consistency around naming. Prefer node to commonjs.
- An actual api for test module.
- Testing can work transparently on node and browser.
- Add (conditional) karma scenario.
- Use karma scenario for coverage.
- Documentation notes.

Extra nice things.

- There is now a scenario that runs karma to test the runtime. A
side effect of this is that the scenario tests can provide a
coverage report, see test/scenarios/karma/coverage after a run.
Note that this only runs if you have karma set up, otherwise
it just skips the test.
- doc/api.markdown is a start at formalising the api for all the
bits and pieces. It is a "where we are at", not really a "where
we want to be". Longer term some of the apis will go away I
hope.
- doc/initialization.markdown is a description of the design used
for this refactoring of the bolt start up process. It is not
ideal, but it is in a lot better shape then when I started.

Fixes #26.

@marlimox For review. Good luck. There are probably a few sloppy bits left in there, I have attempted to tidy up as much as possible, but after 3 nights of this I need to tie it off, because I can't think about it clearly anymore. Yell at me where required. Also note that I have gone with bolt.runtime as top level namespace. I don't care that much, if you really want bolt.bolt I am ok with it. But you have to change it.