-
Notifications
You must be signed in to change notification settings - Fork 19
Information for Developers
grunt.js is used to build releases and to install rg2 on the routegadget.co.uk sites. It would make sense to install node.js first so that you can install things via npm. Then install Grunt.
Run npm install
from a shell in the top-level directory. This should install all the necessary packages to allow you to build rg2.
Grunt tasks are defined in Gruntfile.js in the top-level directory. If you look at the end of the file you will find the various tasks required to build rg2. The earlier part of the file defines and configures the various tasks.
Runs csshint, jslint and jshint to find code problems. Then generates minified css and js files, plus the associated maps for debugging. The end result is rg2-x.y.z.min.js, rg2manager-x.y.z.min.js and rg2-x.y.x.min.css which are the core files loaded by index.php.
Used to increment the version number in package.json (or this can be done manually). Only really relevant when building a new release for the master branch. This version number is reported on the information dialog.
Used to create a formal release (for Github) and to copy the relevant to temporary release directories locally for upload to the routegadget.co.uk site.
Adding a debug query (?debug) to the call to rg2 will download the uncompressed .js files rather than rg2-x-y-z.min.js. This originally made debugging easier on live sites, but the maps now sort that out. It is retained to avoid having to build everything after every change in the local test environment. Yes, I know Webpack would do that, and one day it will get closer to the top of the list of things to do.
The debug setting is also activated if you are using an rg2-override-config.php file.
example: http://www.happyherts.routegadget.co.uk/rg2?debug
After testing a number of possible touch interface solutions it turned out that a simple home-grown solution worked best. Therefore the touch interface does not include any libraries. This might change when jquery-ui adds support for touch, which is meant to happen somewhen.
See the RG2 Protractor test set-up