"Let's Code: Test-Driven Javascript" is a screencast series focusing on rigorous, professional web development. For more information, visit http://letscodejavascript.com .
This repository contains the source code for WeeWikiPaint, the application being developed in the series.
(Wondering why we check in things like node_modules
or IDE settings? See "The Reliable Build".)
- Install Node.js
- Install Git
- Clone source repository:
git clone https://github.com/jamesshore/lets_code_javascript.git
- All commands must run from root of repository:
cd lets_code_javascript
Note: If you update the repository (with git pull
or similar), be sure to erase generated files with git clean -fdx
afterwards. (Note that this will erase any files you've added, so be sure to check in what you want to keep first.)
Some episodes' source code was written for old versions of Node. You can check which version of Node the code expects by running ./jake.sh nodeVersion
, or jake nodeVersion
on Windows. The build will fail if you're using a different version than expected. (Episodes 1-16 didn't support that command. They expected v0.6.17 or v0.8.4; either should work.)
If you're having trouble getting the code to work properly, especially if the code expects Node 0.8 or earlier, try installing the exact version of Node the code expects. Convenient tools for changing Node versions include nvm and n on Mac/Linux, and nvmw and nodist on Windows.
- Run
./jake.sh karma
(Unix/Mac) orjake karma
(Windows) - Navigate at least one browser to http://localhost:9876
- Run
./jake.sh loose=true
(Unix/Mac) orjake loose=true
(Windows)
Note: The master branch is not guaranteed to build successfully. For a known-good build (tested on Mac and Windows, and assumed to work on Linux), use the integration branch:
- Change to the integration branch:
git checkout integration
- Erase generated files:
git clean -fdx
(Note that this will erase all new files, so be sure to check in anything you want to keep.) - Stop Karma, if it's running
- Build using the steps above
- To change back to the development branch, follow these steps again using
git checkout master
- Run
./jake.sh run
(Unix/Mac) orjake run
(Windows) - Navigate a browser to http://localhost:5000
Note: The master branch is not guaranteed to run successfully. For a known-good build, use the integration branch as described above.
- Make sure code is in Git repository (clone GitHub repo, or 'git init' yours)
- Install Heroku Toolbelt
- # for a Heroku account
- Run
heroku create <app_name>
(requires git repository and Heroku account) - Search codebase for
weewikipaint.herokuapp.com
URLs and change them to refer to<app_name>
- Push known-good deploy to Heroku:
git push heroku episode200:master
- Run
./jake.sh deploy
(Unix/Mac) orjake deploy
(Windows) for instructions
Note: The master and integration branches are not guaranteed to deploy successfully. The last known-good deploy was commit 85c35e5ce5387d2814ceeb849e39eee8e5c1847e. We'll establish better deployment practices in a future chapter of the screencast.