Please Read this when starting work on this project.
Change the FTP folder in Gruntfile.js before you begin. Modify "dest" property in this section of code:
ftp_push: {
build: {
options: {
host: 'staging.blueraster.com',
dest: 'html/wri/gfw-commodities/v20/',
authKey: 'staging'
},
files: [{
expand: true,
cwd: 'build',
src: ['**']
}]
}
},
All necesary bower components are already installed, no need to run bower install.
The project is configured already with grunt. If you need grunt, run npm install -g grunt-cli
. Just run npm install
in the root directory to install all of grunt's dependencies.
All css is written in stylus and then compiled by grunt into a single css file called app.css. Typing grunt develop
will start the watch task and compile all .styl files in the css directory. (This may change later when trying to optimize loading to load a smaller css file which contains only the necessary css to load the homepage and then a larger one with all the rest, but probably wont)
The bootload.js file loads the classes differently when running locally vs on a server. Change the "deps" and "callback" as needed. (Also see comments around line 34 in bootloader.js.)
deps includes main/Main
. callback runs Main.init();
and comments out loadScript('app/js/app.min.js');
deps comments out main/Main
. callback comments out Main.init();
and runs loadScript('app/js/app.min.js');
Their will be two grunt tasks, grunt build
and grunt minify
. The build task and minify task are the same except that the build task will automatically deploy the code after its built to staging whereas the minify will do nothing after building, which can be good for testing before deploying.
The task grunt build
needs a .ftpauth file located in the same directory as the Gruntfile.js which contains credentials for the task to log into ftp. You can skip creating that file and specify them manually but DO NOT COMMIT YOUR CREDENTIALS TO ANY REPO. If you really want to, you can get instructions on how to do that at my github page https://github.com/Robert-W/grunt-ftp-push. The Recommended way is as follows: (NOTE: .ftpauth is added to .gitignore already so it wont be committed to the repo)
{
"staging": {
"username": "yourusername",
"password": "yourpassword"
}
}
The "staging" keyword is the key the plugin is configured to use, if you change tht you will need to modify the task in the Gruntfile, just leave it as is.