<commit_before>Automatopia
===========

This repository contains build and test automation for JavaScript projects. It's intended as a starting point for your own JavaScript projects. It includes:

* Automated build (using Jake) with:
	* Linting (using JSHint)
	* Node.js tests (using Mocha)
	* Cross-browser tests (using Karma, Mocha, and expect.js)
* Automated continuous integration (using Git)
* Automated deployment (to Heroku)
* Example code (in the `src` directory):
	* Server-side integration test
	* Development smoke test
	* Release smoke test
	* Client-side DOM test

This code was developed for the "[Lessons Learned 8: Automatopia](http://www.letscodejavascript.com/v3/episodes/lessons_learned/8)" episode of James Shore's *Let's Code: Test-Driven JavaScript* screencast. For details, the video, and a transcript, see [letscodejavascript.com](http://www.letscodejavascript.com).

You may wonder why this repository includes dependencies (in `node_modules`) and IDE settings (in `.idea`). The reasoning is explained in my essay, "[The Reliable Build](http://www.letscodejavascript.com/v3/blog/2014/12/the_reliable_build)." If you prefer not to include these sorts of things in your repo, you can remove them.

__Change History:__

* *19 Jan 2015:* Added `watch` to automatically run jake when files change; improved documentation
* *29 Jul 2014:* Replaced NodeUnit with Mocha; updated npm dependencies to latest versions; documented process for installing npm packages; replaced JSHint runner with simplebuild-jshint module
* *22 Dec 2013:* Removed unneeded Karma plugins; cleaned up package.json; updated npm dependencies to latest versions
* *24 Sept 2013:* Upgraded to Karma 0.10 (also updated all other npm dependencies to latest versions)
* *30 Nov 2012:* Initial release


To Use
------

Start out by downloading the code as described in "Download and Setup," below. Then:

* If you're a solo developer using this repository as a starting point for a personal project, follow the steps under "Building and Testing."

* If you're part of a team and planning to use the continuous integration script, follow the steps under "Continuous Integration." (Otherwise, follow the steps under "Building and Testing" and supply your own CI tooling.)

* If you're part of a team and planning to use the Heroku deployment script, follow the steps under "Deploying to Heroku."

Once you have it working, delete anything you don't need and modify anything you like. Make it your own.


Finding Your Way Around
-----------------------

This repository consists of the following directories:

* `.idea`: WebStorm IDE settings. (Optional.)
* `build`: Build, CI, and deployment automation.
* `build/config`: Build configuration.
* `build/scripts`: Build scripts. Don't run them directly; they're used by the scripts in the root directory.
* `build/util`: Modules used by the build scripts.
* `node_modules`: npm dependencies.
* `src`: Example code.
* `src/client`: Front-end code.
* `src/server`: Node.js server code.

In the repository root, you'll find the following scripts. For each script, there's a `.sh` version for Unix and Mac and a `.bat` version for Windows:

* `ci`: Continuous integration automation.
* `deploy`: Automated deployment to Heroku.
* `jake`: Build and test automation.
* `watch`: Uses [nodemon](https://github.com/remy/nodemon) to automatically run `jake` when any files change.



Download and Setup
------------------

To download the project:

1. Install [Git](http://git-scm.com/downloads).
2. Clone the latest code only (to save time): `git clone --depth 1 https://github.com/jamesshore/automatopia.git`
3. Delete the `.git` directory so you start fresh
4. Run `git init`, `git add .`, and `git commit -am "Initial commit"` to initialize the git repository.
5. Follow the instructions under "Building and Testing" to make sure everything works.

(Note: You can also download [a zip file of the source code](https://github.com/jamesshore/automatopia/archive/master.zip), but that won't preserve permissions like Git does.)

To customize the project for your needs:

1. Modify `LICENSE.TXT` to contain your copyright and license. 
2. To cause the build to fail unless certain browsers are tested, edit `REQUIRED_BROWSERS` at the top of `Jakefile.js`. Otherwise, comment those lines out.
3. See `Jakefile.js` for build automation, `src/server` for example back-end code, and `src/client` for example front-end code.
<commit_msg>Documented Jake command-line arguments in readme<commit_after>Automatopia
===========

This repository contains build and test automation for JavaScript projects. It's intended as a starting point for your own JavaScript projects. It includes:

* Automated build (using Jake) with:
	* Linting (using JSHint)
	* Node.js tests (using Mocha)
	* Cross-browser tests (using Karma, Mocha, and expect.js)
* Automated continuous integration (using Git)
* Automated deployment (to Heroku)
* Example code (in the `src` directory):
	* Server-side integration test
	* Development smoke test
	* Release smoke test
	* Client-side DOM test

This code was developed for the "[Lessons Learned 8: Automatopia](http://www.letscodejavascript.com/v3/episodes/lessons_learned/8)" episode of James Shore's *Let's Code: Test-Driven JavaScript* screencast. For details, the video, and a transcript, see [letscodejavascript.com](http://www.letscodejavascript.com).

You may wonder why this repository includes dependencies (in `node_modules`) and IDE settings (in `.idea`). The reasoning is explained in my essay, "[The Reliable Build](http://www.letscodejavascript.com/v3/blog/2014/12/the_reliable_build)." If you prefer not to include these sorts of things in your repo, you can remove them.

__Change History:__

* *19 Jan 2015:* Added `watch` to automatically run jake when files change; improved documentation
* *29 Jul 2014:* Replaced NodeUnit with Mocha; updated npm dependencies to latest versions; documented process for installing npm packages; replaced JSHint runner with simplebuild-jshint module
* *22 Dec 2013:* Removed unneeded Karma plugins; cleaned up package.json; updated npm dependencies to latest versions
* *24 Sept 2013:* Upgraded to Karma 0.10 (also updated all other npm dependencies to latest versions)
* *30 Nov 2012:* Initial release


To Use
------

Start out by downloading the code as described in "Download and Setup," below. Then:

* If you're a solo developer using this repository as a starting point for a personal project, follow the steps under "Building and Testing."

* If you're part of a team and planning to use the continuous integration script, follow the steps under "Continuous Integration." (Otherwise, follow the steps under "Building and Testing" and supply your own CI tooling.)

* If you're part of a team and planning to use the Heroku deployment script, follow the steps under "Deploying to Heroku."

Once you have it working, delete anything you don't need and modify anything you like. Make it your own.


Finding Your Way Around
-----------------------

This repository consists of the following directories:

* `.idea`: WebStorm IDE settings. (Optional.)
* `build`: Build, CI, and deployment automation.
* `build/config`: Build configuration.
* `build/scripts`: Build scripts. Don't run them directly; they're used by the scripts in the root directory.
* `build/util`: Modules used by the build scripts.
* `node_modules`: npm dependencies.
* `src`: Example code.
* `src/client`: Front-end code.
* `src/server`: Node.js server code.

In the repository root, you'll find the following scripts. For each script, there's a `.sh` version for Unix and Mac and a `.bat` version for Windows:

* `ci`: Continuous integration automation.
* `deploy`: Automated deployment to Heroku.
* `jake`: Build and test automation.
* `watch`: Uses [nodemon](https://github.com/remy/nodemon) to automatically run `jake` when any files change.

For all these scripts, use `-T` to see the available build targets and their documentation. If no target is provided, the script will run `default`. Use `--help` for additional options.


Download and Setup
------------------

To download the project:

1. Install [Git](http://git-scm.com/downloads).
2. Clone the latest code only (to save time): `git clone --depth 1 https://github.com/jamesshore/automatopia.git`
3. Delete the `.git` directory so you start fresh
4. Run `git init`, `git add .`, and `git commit -am "Initial commit"` to initialize the git repository.
5. Follow the instructions under "Building and Testing" to make sure everything works.

(Note: You can also download [a zip file of the source code](https://github.com/jamesshore/automatopia/archive/master.zip), but that won't preserve permissions like Git does.)

To customize the project for your needs:

1. Modify `LICENSE.TXT` to contain your copyright and license. 
2. To cause the build to fail unless certain browsers are tested, edit `REQUIRED_BROWSERS` at the top of `Jakefile.js`. Otherwise, comment those lines out.
3. See `Jakefile.js` for build automation, `src/server` for example back-end code, and `src/client` for example front-end code.

{'fraction_non_alphanumeric': 0.09845580987843609, 'fraction_numerical': 0.011389771109407512, 'mean_word_length': 4.387610619469027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3886996', 'n_tokens_mistral': 2637, 'n_tokens_neox': 2411, 'n_words': 1201}