$ git clone --depth 1 -o template git@github.com:TheGlobalMail/frontend-project-template.git new-project
This will clone the template into./new-project
without history and the remote is namedtemplated
(isntead oforigin
)- Optional. Immediately checkout master to a template branch (
$ git checkout -b _template template/master
)... this will serve as a middleman for integrating changes back-and-forth between the project and the template. Switch back to master. - Update
name
incomponent.json
andpackage.json
. Update thisREADME.md
stripping out this info, updating the title, etc. Update<title/>
inapp/index.html
. - Commit the name changes
- Create a new repo on GitHub/whatever for the project and do
$ git remote add origin git@somerepo.git
- Now you can
$ git push origin master -u
to push the project and set master to push/fetch from the project repo - Running
git remote -v
should give you something like this:origin git@github.com:TheGlobalMail/RockArt.git (fetch) origin git@github.com:TheGlobalMail/RockArt.git (push) template git@github.com:TheGlobalMail/frontend-project-template.git (fetch) template git@github.com:TheGlobalMail/frontend-project-template.git (push)
- Make awesome shiz...
{A short description about the project.}
- Staging URL: http://cool-project.herokuapp.com/
- Production URL: http://cool-project.theglobalmail.org/
Assuming you have grunt-cli
and bower
installed globally:
- Clone the repo
- Run
npm install
- Run
./bower-install
(this script will install a nested bootstrap in tgm-bootstrap so the LESS can compile properly).
The build system is made on Grunt v0.4+
$ grunt
will build the whole project for production into a./dist
folder$ grunt build:staging
Build for staging (different CDN url)$ grunt server
will start a dev server (default port 9000) with livereload, etc. LESS is compiled automatically.
The dist/
folder isn't ignored by Git, so be careful not run it on a development branch and then accidentally commit it.
For staging, use a free Heroku instance so we don't have to worry about caching. For production, push directly to the CDN. Deployment is done on a throw-away branch.
$ git checkout -b deploy
grunt
$ git add dist/
$ git commit -m "Build" dist/
$ ./cdn-deploy.js [staging|production] {RACKSPACE_API_KEY}
- Staging only
$ git push heroku deploy:master --force
$ git checkout master
$ git branch -D deploy
Most libraries are available through Bower, check using bower search
. When doing bower install
remember to add the --save
flag so the component gets added to component.json
. Components are installed into app/components
which is ignored by Git.