closure-boilerplate icon indicating copy to clipboard operation
closure-boilerplate copied to clipboard

Google Closure-based project boilerplate

Google Closure Boilerplate

This boilerplate should be able to work as the base of any Google Closure-based application.

The idea is that you clone this repository, modify the build settings and start working on your app.

Read this blog post to learn more about the resulting environment. The current stack is a bit different.

What's included

Dependencies

Installation

Do not fork this repository to use it. Fork only if you want to contribute. Thanks.

git clone -o boilerplate git://github.com/jankuca/closure-boilerplate.git project-name
cd project-name

./build/install.sh

Then, you have two options:

  1. You can reset the repository by running rm -rf .git && git init.
  2. You can keep the history and the remote to be able to merge future boilerplate commits to your application. The make.sh script makes sure the boilerplate remote points to this repository. When there are new commits to the boilerplate, you can merge them to your app by running
git fetch boilerplate
git merge boilerplate/master --no-ff -m 'update closure-boilerplate'

Usage

You will probably need to have a Terminal window open at all times (which is the way you should work anyway).

You can either take advantage of the prepared grunt.js tasks or run the scripts manually:

# Run these commands in the project root directory

# == Build the whole app ==
grunt

# == Compile CSS ==
grunt css
# (or)
./build/rework.js

# == Generate a deps file + compile JavaScript ==
grunt js
# (or)
./build/deps.sh
./build/compile.sh

# == Lint JavaScript ==
grunt lint
# (or)
./build/lint.sh

# == Compile templates ==
grunt soy
# (or)
./build/soy.sh