emeeks/d3-carto-map — pull request #1 by bollwyvl (2014-07-16 06:14:43+00:00)
Title: Chore Automation

Here is a fairly substantial stab at adding automation to library chores, like building, testing, code style, etc. Normally, I would have suggested a feature at a time as a series of pull requests, but I am going to be out of town, so figured I'd do everything i could think of, and let you take the parts you wanted.

- expects `node`, `make`, `bower` to be installed
- the documentation is there, but not great
- bower dependencies are not checked in
- there are some nice patterns for making a `dist` which includes all of the built assets, dependecies, etc... usually involving in creating a `gh-pages` branch and checking it out into `dist`, then copying lots of stuff into there... worth looking into, though probably avoid submodules
- `make` is... a little weird (tabs are important, etc.) but it works really well... grunt/gulp are nice as well, but make is a good place to start

- the library is broken up into multiple files in `src`
- `index.js` is the "namespace" object
- it should be easy to add new parts now: legend, etc. by following the pattern

- `make`
- browserify combines the source files
- could also be set up, for example, to bundle up all of the dependencies, but right now expects them still as globals
- haven't tested with requirejs yet, which is funny, as that was the first thing i tried to work with, in IPython Notebook
- uglify makes a minifed version
- `make test`
- loads all of the examples, lets them run for 5 seconds, and complains if there is a failure. Here is a [build on Travis-CI](https://travis-ci.org/bollwyvl/d3-carto-map/builds/30045578). You should look into setting this up for your repo: it will do nice things, like tell you when pull requests are broken.
- `make lint`
- runs some code metrics. .jhsintrc describes all of the options
- i've started fixing a few things, but not much

still to be done (because I haven't done it frequently before)
- `make release` release engineering stuff
- updating version number in package.json/bower.json
- rebuild
- publish to bower
- publish to npm
- build the site
- push to gh-pages

Hope this helps: i'll be out of touch for a few days, unfortunately, so hopefully this is a enough to get you started!