Build system #108

merged 10 commits into from Jul 31, 2011


None yet
2 participants

mixonic commented Jul 29, 2011

Hey @pfiller.

I've generated a build system here, and started splitting out shared logic to make maintenance of this beast a little easier.

First npm -g install coffee-script uglify-js, then make sure echo $NODE_PATH prints out the correct path for your node modules. Now you can use the cake command to build Chosen.

cake build                # build Chosen from source
cake watch                # watch coffee/ for changes and build Chosen

Cakefile contains the juicy parts. Note that I split the select parser out into it's own file (, we can do that with other logic so you don't need to change code in two places. If you do add a new file and want it included in the build, just add it to the Cakefile here:

This has the potential to create some ugly merge conflicts on the javascript files, but luckily it's a build system so you can just generate the correct files without trouble :-)


mixonic commented Jul 29, 2011

Given enough time, everything grows. There is now a cake release task that will create a tag and push tags to github.

The build also looks in VERSION for a version number (I set it at 0.9 to start, meh?), and adds that version to the generated javascript files with some other header info. Header info is at:

write_chosen_javascript = (filename, body) ->

This, coupled with an inaugural release, should satisfy #72


pfiller commented Jul 31, 2011

This is great, Matt. Thanks for throwing it together. Does 'cake release' need to be used with every minor version change -- or just for major versions?

pfiller added a commit that referenced this pull request Jul 31, 2011

@pfiller pfiller merged commit dd04343 into master Jul 31, 2011


mixonic commented Jul 31, 2011

@pfiller we can talk about release strategy quickly tomorrow- but basically just update the VERSION file whenever you want to release. Commit, then cake release. The doc aziz linked to: is a good but very wordy summary of best practices for versioning. Versions will show up under the "tags" menu on the source tab of Github.

We can extend the release script to update the gh-pages branch as well if we want to link to a "stable" version from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment