Skip to content

Latest commit

 

History

History
119 lines (81 loc) · 4.07 KB

README.md

File metadata and controls

119 lines (81 loc) · 4.07 KB

generator-leviathan Build Status

Yeoman generator that scaffolds out a full stack Javascript web app using angularjs, Grunt and Bower, Node and Express, MongoDB and Redis.

Getting Started

Using this generator:

If you're not familiar with Yeoman and want to learn more If you want to build your own generator

Install Yeoman:

$ npm install -g yo

To install generator-leviathan from npm, run:

$ npm install -g generator-leviathan

Finally, initiate the generator:

$ yo leviathan optionalAppName

Recommended github and heroku setup:

run $ yo leviathan:deploy to setup both github and heroku automatically.

The command uses the following to setup Github:

$ hub init
$ hub add . && hub commit -m "initial commit"
$ hub create optional_org_name/repo_name -d "description of repo"
$ hub push origin master

And to setup Heroku, it runs grunt build, copies over the Procfile, initializes the dist/ dir as a separate repository, and runs:

$ heroku apps:create herokuAppName && heroku config:set NODE_ENV=production
$ git add -A && git commit -m "Initial commit"
$ git push heroku master

all of which you can of course do at the command line, provided you have both hub and the heroku toolbelt installed.

More info on working with node in Heroku

The deploy generator also uses a plugin called heroku-config to push your local .env file to heroku. Install it with:

$ heroku plugins:install git://github.com/ddollar/heroku-config.git

Deployment requires that you have a remote mongo database to connect to. You can use heroku addons to create one:

 heroku addons:add mongolab

or you can [setup a mongolab account] and create one online. If you do this, just make sure to set the MONGOLAB_URI on heroku to the URI for accessing that db.

Versioning and releases

This project uses semantic versioning and github for releases. Releases can be created automatically using the grunt bump task, which will create a conventional changelog as well as a release. For more, see:

grunt-release github on creating releases grunt-conventional-changelog commit conventions node-semver

To create new releases with changelogs using the autorelease as it currently stands:

  1. $ grunt bump:releaseType
  2. $ grunt autorelease:releaseType

Release type should be one of patch, minor, major, or prerelease

running grunt bump simply bumps the version, which enables conventional changelog to use the correct latest version when generating its changelog. grunt autorelease then does the following:

  1. runs the "changelog" task
  • Generates changelog from previous version to HEAD...
  • Parses commits since last version
  • updates CHANGELOG.md updated
  1. runs the "addchangelog" task:
  • stages CHANGELOG.md
  • committs CHANGELOG.md
  1. runs the "release:patch" (release) task:
  • stages package.json
  • commits package.json
  • creates new git tag: v0.2.8
  • pushes to remote git repo
  • pushes new tag 0.2.8 to remote git repo

To then test the production version: $ grunt build $ grunt serve:prod

To then commit and push the production version to heroku: $ cd dist $ git status $ git add --all

And normally we include a message like: $ git commit -m "feat(v0.2.3): dist build for v0.2.3" $ git push heroku master

Inspirations: Inspired by https://github.com/DaftMonk/generator-angular-fullstack