There are a lot of tools we leverage but they're virtually all assimilated in with Git and Grunt.
git pull origin master
grunt
- Make changes, run
grunt q
, and test (manually & automated). Repeat until done. grunt
git add -A
git commit -m '[descriptive message here]'
git pull origin master
git push origin master
- Get any changes that OTHER developers made
- Type
git pull origin master
to re-sync your code with any changes other developers may have made.- This assumes your remote repository is named
origin
and your branch ismaster
, replace accordingly if not. Usegit remote -v
to list/view your remotes andgit branch -v
to list/view your branches. In general the command isgit pull <remote> <branch>
.
- This assumes your remote repository is named
- Run
grunt
to rebuild the code with these new changes and ensure it's good code. This will also check and alert you if core files changed (i.e. new dependencies introduced or updated configuration) that will require a manual update or two by you.- As with almost all commands, run this from the root folder of the site (the folder that has
Gruntfile.js
in it) - If
package.json
orbower.json
changed, first runnpm install && bower update && bower install
(again run from root folder) THEN (re-)rungrunt
. - If a
config*.json
file changed, first update/confirm any local/custom config-*.json files are up to date THEN (re-)rungrunt
.
- As with almost all commands, run this from the root folder of the site (the folder that has
- Type
- Make and test your changes
- Make some code changes (locally on your own computer).
- Make sure to also write automated tests for your new changes! Use
grunt test
to run just tests.
- Make sure to also write automated tests for your new changes! Use
- Run
grunt q
to rebuild the code with your new changes. - Manually test/view the changes in a browser to ensure your changes are good.
- Make sure MongoDB & node are running first (see running.md for more info)
- Run
grunt
to run automated tests and quality control checks to ensure your code is good and bug free.- NEVER PUSH CODE THAT FAILS A GRUNT BUILD! This is our quality control check and any code that doesn't pass will be auto-rejected by the Continuous Integration server anyway and break the build and halt updates for EVERYONE until the build is fixed - don't do it!
- Make some code changes (locally on your own computer).
- Use Git to add, commit, and push your changes
git add -A
to add your files- the
-A
will 'stage' deleted and new files as well as just modified ones - this will ensure ALL changed files are added.
- the
git commit -m '[descriptive message here]'
to commit your changes- Follow Git Commit Message Conventions (see below)
- Run
git pull origin master
again in case any new changes were introduced by other developers while you were making changes- If there were changes, re-run
grunt
, etc. (repeat Step 1)
- If there were changes, re-run
git push origin master
to push (this re-syncs the central repo by adding your changes in so other developers can 'pull' them down later)
** Make sure to run grunt before any code push to ensure all code is high quality (i.e. LINTED, TESTED, DOCUMENTED) before submitting ANY code!! **
These are to auto build/run tests/reload as you're working to avoid having to type things like grunt q
all the time.
For each separate (grunt) command, you'll need another command window open to run it. A typical workflow would be as following:
node run.js
in command window 1 (this runs the actual server so you can view the site)- open a browser (i.e. Firefox, Chrome) to
http://localhost:3000
(or whatever domain/port you've set inconfig.json
) to see the site- turn on the LiveReload browser extension [see below]
grunt dev
in command window 2 (this will auto build, test, and reload your app in the browser for you)- [optional]
grunt dev-karma-cov
to write frontend unit test coverage reports
See running.md and Gruntfile.js
for more info.
Live Reload auto-refreshes your browser for you when files change so you don't have to constantly press reload (or F5
or Ctrl+F5
to clear cache and reload the page to see your changes).
Grunt (with the grunt dev
tasks) is set up to use live reload with the browser extensions so you just need to install them and activate them - then grunt will do the rest!
- to "activate" the browser extension, just click it (just like Firebug) each time you open a new browser window.
- commit, pull, and push often. At least once a day, often more. Each time you make changes and have a stable, bug free, complete version of the code, push/sync it - usually only a few or even just one file change(s) at a time. This will reduce frequeny of manual merge conflicts.
- Full details here but basically:
- ():
- where:
- is one of:
- feat (feature)
- fix (bug fix)
- docs (documentation)
- style (formatting, missing semi colons, etc.)
- refactor
- test (when adding missing tests)
- chore (maintain)
- specifies the place / code area (potentially a file if just one file) that was changed
- is the short description of what was changed
- is one of:
- I.e.
feat(event date): Add timezone support