<commit_before>'use strict';

module.exports = function( grunt ) {

	// Project configuration.
	grunt.initConfig({
		// Metadata.
		pkg: grunt.file.readJSON( 'package.json' ),
		title: '<%= pkg.title || pkg.name %> - v<%= pkg.version %>',
		banner: '/*! <%= title %> - ' +
			'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
			'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
			'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
			' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',

		browsers: [
			// { browserName: 'Internet Explorer', version: '11' },
			{ browserName: 'Internet Explorer', version:  '9' },
			// { browserName: 'Internet Explorer', version:  '8' },
			{ browserName: 'Firefox' },
			// { browserName: 'Chrome' },
			// { browserName: 'Chrome', version: "4" }, // old, like Google Earth
			// { browserName: 'Opera' }
		],

		// Task configuration.
		clean: {
			files: [ 'sc_*.log' ]
		},
		connect: {
			server: {
				options: {
					port: 8000,
					base: '.'
				}
			}
		},
		// production pipeline tasks
		concat: {
			options: {
				banner: '<%= banner %>',
				stripBanners: true
			},
			dist: {
				src: [ 'src/<%= pkg.name %>.js' ],
				dest: 'dist/<%= pkg.name %>.js'
			}
		},
		uglify: {
			options: {
				banner: '<%= banner %>'
			},
			dist: {
				src: 'dist/<%= pkg.name %>.js',
				dest: 'dist/<%= pkg.name %>.min.js'
			},
		},
		// code quality tasks
		qunit: {
			unit: [
				'test/*.html',
				'!test/google-earth.html'
			],
			// test other jquery versions
			jquery: {
				options: {
					timeout: 12000,
					urls: [
						'http://127.0.0.1:8000/test/change.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/checkValidity.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/custom.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/disabled.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/email.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/invalid.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/novalidate.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/pattern.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/required.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/submit.html?jquery=1.4.4',
						// 1.7.2
						'http://127.0.0.1:8000/test/change.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/checkValidity.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/custom.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/disabled.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/email.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/invalid.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/novalidate.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/pattern.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/required.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/submit.html?jquery=1.7.2',
						// latest
						'http://127.0.0.1:8000/test/change.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/checkValidity.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/custom.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/disabled.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/email.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/invalid.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/novalidate.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/pattern.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/required.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/submit.html?jquery=2.1.0',
					]
				}
			}
		},
		'saucelabs-qunit': {
			required: {
				options: {
					testname: 'Required fields (<%= title %>)',
					url: 'http://127.0.0.1:8000/test/required.html?jquery=1.7.2',
					browsers: '<%= browsers %>',
				}
			}
		},
		jshint: {
			gruntfile: {
				options: {
					jshintrc: '.jshintrc'
				},
				src: [
					'Gruntfile.js',
					'src/.jshintrc',
					'test/.jshintrc',
					'.jshintrc'
				]
			},
			src: {
				options: {
					jshintrc: 'src/.jshintrc'
				},
				src: [ 'src/**/*.js' ]
			},
			test: {
				options: {
					jshintrc: 'test/.jshintrc'
				},
				src: [ 'test/*.js' ]
			},
		},
		watch: {
			gruntfile: {
				files: '<%= jshint.gruntfile.src %>',
				tasks: [ 'jshint:gruntfile' ]
			},
			src: {
				files: '<%= jshint.src.src %>',
				tasks: [ 'jshint:src', 'qunit:unit' ]
			},
			test: {
				files: '<%= jshint.test.src %>',
				tasks: [ 'jshint:test', 'qunit:unit' ]
			},
		}
	});

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks( 'grunt-contrib-clean' );
	grunt.loadNpmTasks( 'grunt-contrib-concat' );
	grunt.loadNpmTasks( 'grunt-contrib-uglify' );
	grunt.loadNpmTasks( 'grunt-contrib-connect' );
	grunt.loadNpmTasks( 'grunt-contrib-qunit' );
	grunt.loadNpmTasks( 'grunt-saucelabs' );
	grunt.loadNpmTasks( 'grunt-contrib-jshint' );
	grunt.loadNpmTasks( 'grunt-contrib-watch' );

	// Default task.
	grunt.registerTask( 'test', [ 'jshint', 'connect', 'qunit' ]);
	grunt.registerTask( 'sauce', [ 'jshint', 'connect', 'saucelabs-qunit' ]);
	grunt.registerTask( 'produce', [ 'clean', 'concat', 'uglify' ]);
	grunt.registerTask( 'default', [ 'test', 'produce' ]);

};
<commit_msg>fix browser versions and urls parameter<commit_after>'use strict';

module.exports = function( grunt ) {

	// Project configuration.
	grunt.initConfig({
		// Metadata.
		pkg: grunt.file.readJSON( 'package.json' ),
		title: '<%= pkg.title || pkg.name %> - v<%= pkg.version %>',
		banner: '/*! <%= title %> - ' +
			'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
			'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
			'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
			' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',

		browsers: [
			{ browserName: 'Internet Explorer', version: '11' },
			{ browserName: 'Internet Explorer', version:  '9' },
			{ browserName: 'Internet Explorer', version:  '8' },
			{ browserName: 'Firefox' },
			{ browserName: 'Chrome' },
			// { browserName: 'Samsung Galaxy S2' }, // old, like Google Earth
			// { browserName: 'Opera' }
		],

		// Task configuration.
		clean: {
			files: [ 'sc_*.log' ]
		},
		connect: {
			server: {
				options: {
					port: 8000,
					base: '.'
				}
			}
		},
		// production pipeline tasks
		concat: {
			options: {
				banner: '<%= banner %>',
				stripBanners: true
			},
			dist: {
				src: [ 'src/<%= pkg.name %>.js' ],
				dest: 'dist/<%= pkg.name %>.js'
			}
		},
		uglify: {
			options: {
				banner: '<%= banner %>'
			},
			dist: {
				src: 'dist/<%= pkg.name %>.js',
				dest: 'dist/<%= pkg.name %>.min.js'
			},
		},
		// code quality tasks
		qunit: {
			unit: [
				'test/*.html',
				'!test/google-earth.html'
			],
			// test other jquery versions
			jquery: {
				options: {
					timeout: 12000,
					urls: [
						'http://127.0.0.1:8000/test/change.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/checkValidity.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/custom.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/disabled.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/email.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/invalid.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/novalidate.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/pattern.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/required.html?jquery=1.4.4',
						'http://127.0.0.1:8000/test/submit.html?jquery=1.4.4',
						// 1.7.2
						'http://127.0.0.1:8000/test/change.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/checkValidity.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/custom.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/disabled.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/email.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/invalid.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/novalidate.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/pattern.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/required.html?jquery=1.7.2',
						'http://127.0.0.1:8000/test/submit.html?jquery=1.7.2',
						// latest
						'http://127.0.0.1:8000/test/change.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/checkValidity.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/custom.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/disabled.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/email.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/invalid.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/novalidate.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/pattern.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/required.html?jquery=2.1.0',
						'http://127.0.0.1:8000/test/submit.html?jquery=2.1.0',
					]
				}
			}
		},
		'saucelabs-qunit': {
			required: {
				options: {
					testname: 'Required fields (<%= title %>)',
					urls: [ 'http://127.0.0.1:8000/test/required.html?jquery=1.7.2' ],
					browsers: '<%= browsers %>',
				}
			}
		},
		jshint: {
			gruntfile: {
				options: {
					jshintrc: '.jshintrc'
				},
				src: [
					'Gruntfile.js',
					'src/.jshintrc',
					'test/.jshintrc',
					'.jshintrc'
				]
			},
			src: {
				options: {
					jshintrc: 'src/.jshintrc'
				},
				src: [ 'src/**/*.js' ]
			},
			test: {
				options: {
					jshintrc: 'test/.jshintrc'
				},
				src: [ 'test/*.js' ]
			},
		},
		watch: {
			gruntfile: {
				files: '<%= jshint.gruntfile.src %>',
				tasks: [ 'jshint:gruntfile' ]
			},
			src: {
				files: '<%= jshint.src.src %>',
				tasks: [ 'jshint:src', 'qunit:unit' ]
			},
			test: {
				files: '<%= jshint.test.src %>',
				tasks: [ 'jshint:test', 'qunit:unit' ]
			},
		}
	});

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks( 'grunt-contrib-clean' );
	grunt.loadNpmTasks( 'grunt-contrib-concat' );
	grunt.loadNpmTasks( 'grunt-contrib-uglify' );
	grunt.loadNpmTasks( 'grunt-contrib-connect' );
	grunt.loadNpmTasks( 'grunt-contrib-qunit' );
	grunt.loadNpmTasks( 'grunt-saucelabs' );
	grunt.loadNpmTasks( 'grunt-contrib-jshint' );
	grunt.loadNpmTasks( 'grunt-contrib-watch' );

	// Default task.
	grunt.registerTask( 'test', [ 'jshint', 'connect', 'qunit' ]);
	grunt.registerTask( 'sauce', [ 'jshint', 'connect', 'saucelabs-qunit' ]);
	grunt.registerTask( 'produce', [ 'clean', 'concat', 'uglify' ]);
	grunt.registerTask( 'default', [ 'test', 'produce' ]);

};
<|endoftext|>


<commit_before>module.exports = function(grunt){
  var filename = "leap-<%= pkg.version %>"
  var banner = "/*!                                                              \
\n * LeapJS v<%= pkg.version %>                                                  \
\n * http://github.com/leapmotion/leapjs/                                        \
\n *                                                                             \
\n * Copyright 2013 LeapMotion, Inc. and other contributors                      \
\n * Released under the BSD-2-Clause license                                     \
\n * http://github.com/leapmotion/leapjs/blob/master/LICENSE.txt                 \
\n */"

  grunt.initConfig({
    pkg: grunt.file.readJSON("package.json"),
    // This updates the version.js to match pkg.version
    'string-replace': {
      build: {
        files: {
          'lib/': 'lib/version.js',
          './': 'bower.json',
          'examples/': 'examples/*',
          'test/': 'test/helpers/browser.html'
        },
        options:{
          replacements: [
            // version.js
            {
              pattern: /(full:\s)'.*'/,
              replacement: "$1'<%= pkg.version %>'"
            },
            {
              pattern: /(major:\s)\d/,
              replacement: "$1<%= pkg.version.split('.')[0] %>"
            },
            {
              pattern: /(minor:\s)\d/,
              replacement: "$1<%= pkg.version.split('.')[1] %>"
            },
            {
              pattern: /(dot:\s)\d.*/,
              replacement: "$1<%= pkg.version.split('.')[2][0] %>"
            },
            // bower.json
            {
              pattern: /"version": ".*"/,
              replacement: '"version": "<%= pkg.version %>"'
            },
            // examples
            {
              pattern: /leap.*\.js/,
              replacement: filename + '.js'
            }
          ]
        }
      }
    },
    clean: {
      build: {
        src: ['./leap-*.js']
      }
    },
    browserify: {
      build: {
        options: {
          ignore: ['lib/connection/node.js']
        },
        src: 'template/entry.js',
        dest: filename + '.js'
      }
    },
    uglify: {
      build: {
        src: filename  + '.js',
        dest: filename + '.min.js'
      }
    },
    usebanner: {
      build: {
        options: {
          banner: banner
        },
        src: [filename + '.js', filename + '.min.js']
      }
    },
    // run with `grunt watch` or `grunt test watch`
    watch: {
      files: 'lib/*',
      tasks: ['default'],
      test: {
        files: ['lib/*', 'test/*'],
        tasks: ['test']
      }

    },
    exec: {
      'test-browser': './node_modules/.bin/mocha-phantomjs -R dot test/helpers/browser.html',
      'test-node': './node_modules/.bin/mocha lib/index.js test/helpers/node.js test/*.js -R dot',
      'test-integration': 'node integration_test/reconnection.js && node integration_test/protocol_versions.js'
    }
  });

  require('load-grunt-tasks')(grunt);

  grunt.registerTask('default', [
    'string-replace',
    'clean',
    'browserify',
    'uglify',
    'usebanner'
  ]);

  grunt.registerTask('test', [
    'default',
    'exec:test-browser',
    'exec:test-node',
    'exec:test-integration'
  ]);
}<commit_msg>Speed up test failure by running node tests first<commit_after>module.exports = function(grunt){
  var filename = "leap-<%= pkg.version %>"
  var banner = "/*!                                                              \
\n * LeapJS v<%= pkg.version %>                                                  \
\n * http://github.com/leapmotion/leapjs/                                        \
\n *                                                                             \
\n * Copyright 2013 LeapMotion, Inc. and other contributors                      \
\n * Released under the BSD-2-Clause license                                     \
\n * http://github.com/leapmotion/leapjs/blob/master/LICENSE.txt                 \
\n */"

  grunt.initConfig({
    pkg: grunt.file.readJSON("package.json"),
    // This updates the version.js to match pkg.version
    'string-replace': {
      build: {
        files: {
          'lib/': 'lib/version.js',
          './': 'bower.json',
          'examples/': 'examples/*',
          'test/': 'test/helpers/browser.html'
        },
        options:{
          replacements: [
            // version.js
            {
              pattern: /(full:\s)'.*'/,
              replacement: "$1'<%= pkg.version %>'"
            },
            {
              pattern: /(major:\s)\d/,
              replacement: "$1<%= pkg.version.split('.')[0] %>"
            },
            {
              pattern: /(minor:\s)\d/,
              replacement: "$1<%= pkg.version.split('.')[1] %>"
            },
            {
              pattern: /(dot:\s)\d.*/,
              replacement: "$1<%= pkg.version.split('.')[2][0] %>"
            },
            // bower.json
            {
              pattern: /"version": ".*"/,
              replacement: '"version": "<%= pkg.version %>"'
            },
            // examples
            {
              pattern: /leap.*\.js/,
              replacement: filename + '.js'
            }
          ]
        }
      }
    },
    clean: {
      build: {
        src: ['./leap-*.js']
      }
    },
    browserify: {
      build: {
        options: {
          ignore: ['lib/connection/node.js']
        },
        src: 'template/entry.js',
        dest: filename + '.js'
      }
    },
    uglify: {
      build: {
        src: filename  + '.js',
        dest: filename + '.min.js'
      }
    },
    usebanner: {
      build: {
        options: {
          banner: banner
        },
        src: [filename + '.js', filename + '.min.js']
      }
    },
    // run with `grunt watch` or `grunt test watch`
    watch: {
      files: 'lib/*',
      tasks: ['default'],
      test: {
        files: ['lib/*', 'test/*'],
        tasks: ['test']
      }

    },
    exec: {
      'test-browser': './node_modules/.bin/mocha-phantomjs -R dot test/helpers/browser.html',
      'test-node': './node_modules/.bin/mocha lib/index.js test/helpers/node.js test/*.js -R dot',
      'test-integration': 'node integration_test/reconnection.js && node integration_test/protocol_versions.js'
    }
  });

  require('load-grunt-tasks')(grunt);

  grunt.registerTask('default', [
    'string-replace',
    'clean',
    'browserify',
    'uglify',
    'usebanner'
  ]);

  grunt.registerTask('test', [
    'default',
    'exec:test-node',
    'exec:test-browser',
    'exec:test-integration'
  ]);
}<|endoftext|>


<commit_before>var os = require('os');
var grunt = require('grunt');
var path = require('path');
var pkg = require('./package.json');

require('load-grunt-tasks')(grunt);

module.exports = function(grunt) {
    var files = ['./index.js', './Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'];
    var buildOutputFile = os.platform() !== 'win32' ? 'logdna' : 'logdna.exe';

    grunt.initConfig({
        lineremover: {
            nukebrowser: {
                files: {
                    'node_modules/ws/package.json': path.join('node_modules', 'ws', 'package.json')
                }
                , options: {
                    exclusionPattern: /browser/
                }
            }
        }, exec: {
            nexe: {
                cmd: 'nexe -i index.js -o ' + buildOutputFile + ' -f -t ~/tmp -r 8.11.3'
                , maxBuffer: 20000 * 1024
            }, save_version: 'echo ' + pkg.version + ' > version'
            , nexe_win: {
                cmd: 'nexe -i index.js -o logdna.exe -f -t ~/tmp -r 8.11.3'
                , maxBuffer: 20000 * 1024
            }, fpm_osxpkg: 'fpm -s dir -t osxpkg --osxpkg-identifier-prefix com.logdna -n logdna-cli -v ' + pkg.version + ' --post-install ./scripts/post-install -f ./logdna=/usr/local/logdna/bin/logdna'
            , sign_pkg: 'productsign --sign "Developer ID Installer: Answerbook, Inc. (TT7664HMU3)" logdna-cli-' + pkg.version + '.pkg logdna-cli.pkg'
            , verify_pkg: 'spctl -a -t install -vv logdna-cli.pkg'
            , rm_unsignedpkg: 'rm logdna-cli-' + pkg.version + '.pkg'
            , install_pkg: 'sudo installer -verbose -pkg logdna-cli.pkg -target /'
            , gzip_macbin: 'gzip -kf ./logdna'
            , upload_macbin: 'aws s3 cp ./logdna.gz s3://repo.logdna.com/mac/logdna.gz'
            , upload_macver: 'aws s3 cp ./version s3://repo.logdna.com/mac/version'
            , upload_pkg: 'aws s3 cp ./logdna-cli.pkg s3://repo.logdna.com/mac/logdna-cli.pkg'
            , fpm_rpm: 'fpm -s dir -t rpm -n logdna-cli -v ' + pkg.version + ' --license MIT --vendor "Answerbook, Inc." --description "LogDNA CLI for Linux" --url http://logdna.com/ -m "<help@logdna.com>" --post-install ./scripts/post-install -f ./logdna=/usr/local/logdna/bin/logdna'
            , fpm_deb: 'fpm -s dir -t deb -n logdna-cli -v ' + pkg.version + ' --license MIT --vendor "Answerbook, Inc." --description "LogDNA CLI for Linux" --url http://logdna.com/ -m "<help@logdna.com>" --post-install ./scripts/post-install -f --deb-no-default-config-files ./logdna=/usr/local/logdna/bin/logdna'
            , cp_rpm: 'cp -f logdna-cli-' + pkg.version + '-1.x86_64.rpm logdna-cli.rpm'
            , cp_deb: 'cp -f logdna-cli_' + pkg.version + '_amd64.deb logdna-cli.deb'
            , gzip_linuxbin: 'gzip -f ./logdna'
            , upload_linuxbin: 'aws s3 cp ./logdna.gz s3://repo.logdna.com/linux/logdna.gz'
            , upload_linuxver: 'aws s3 cp ./version s3://repo.logdna.com/linux/version'
            , upload_rpm: 'aws s3 cp ./logdna-cli.rpm s3://repo.logdna.com/linux/logdna-cli.rpm'
            , upload_deb: 'aws s3 cp ./logdna-cli.deb s3://repo.logdna.com/linux/logdna-cli.deb'
            , choco: 'pushd .\\.builds\\windows & cpack'
            , choco_deb: 'cp logdna.nuspec .builds/windows && cp logdna.exe .builds/windows/tools && cd .builds/windows && ls . && choco pack --allow-unofficial'
        }, copy: {
            nuspec: {
                files: [{
                    src: './logdna.nuspec'
                    , dest: './.builds/windows/'
                }]
            }, winexe: {
                files: [{
                    src: './logdna.exe'
                    , dest: './.builds/windows/tools/'
                }]
            }
        }, eslint: {
            target: files
            , options: {
                configFile: '.eslintrc'
                , fix: true
            }
        }
    });
    grunt.registerTask('test', ['eslint']);
    grunt.registerTask('build', ['lineremover', 'exec:nexe_win', 'exec:save_version']);
    grunt.registerTask('linux', ['build', 'exec:fpm_rpm', 'exec:fpm_deb', 'exec:cp_rpm', 'exec:cp_deb', 'exec:gzip_linuxbin', 'exec:upload_linuxbin', 'exec:upload_linuxver', 'exec:upload_rpm', 'exec:upload_deb']);
    grunt.registerTask('mac', ['build', 'exec:fpm_osxpkg', 'exec:sign_pkg', 'exec:rm_unsignedpkg', 'exec:gzip_macbin', 'exec:upload_macbin', 'exec:upload_macver', 'exec:upload_pkg']); // 'exec:verify_pkg', 'exec:install_pkg'
    grunt.registerTask('windows', ['build', 'copy:nuspec', 'copy:winexe', 'exec:choco_deb']);
};
<commit_msg>Let's Say 'hi' to Mono<commit_after>var os = require('os');
var grunt = require('grunt');
var path = require('path');
var pkg = require('./package.json');

require('load-grunt-tasks')(grunt);

module.exports = function(grunt) {
    var files = ['./index.js', './Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'];
    var buildOutputFile = os.platform() !== 'win32' ? 'logdna' : 'logdna.exe';

    grunt.initConfig({
        lineremover: {
            nukebrowser: {
                files: {
                    'node_modules/ws/package.json': path.join('node_modules', 'ws', 'package.json')
                }
                , options: {
                    exclusionPattern: /browser/
                }
            }
        }, exec: {
            nexe: {
                cmd: 'nexe -i index.js -o ' + buildOutputFile + ' -f -t ~/tmp -r 8.11.3'
                , maxBuffer: 20000 * 1024
            }, save_version: 'echo ' + pkg.version + ' > version'
            , nexe_win: {
                cmd: 'nexe -i index.js -o logdna.exe -f -t ~/tmp -r 8.11.3'
                , maxBuffer: 20000 * 1024
            }, fpm_osxpkg: 'fpm -s dir -t osxpkg --osxpkg-identifier-prefix com.logdna -n logdna-cli -v ' + pkg.version + ' --post-install ./scripts/post-install -f ./logdna=/usr/local/logdna/bin/logdna'
            , sign_pkg: 'productsign --sign "Developer ID Installer: Answerbook, Inc. (TT7664HMU3)" logdna-cli-' + pkg.version + '.pkg logdna-cli.pkg'
            , verify_pkg: 'spctl -a -t install -vv logdna-cli.pkg'
            , rm_unsignedpkg: 'rm logdna-cli-' + pkg.version + '.pkg'
            , install_pkg: 'sudo installer -verbose -pkg logdna-cli.pkg -target /'
            , gzip_macbin: 'gzip -kf ./logdna'
            , upload_macbin: 'aws s3 cp ./logdna.gz s3://repo.logdna.com/mac/logdna.gz'
            , upload_macver: 'aws s3 cp ./version s3://repo.logdna.com/mac/version'
            , upload_pkg: 'aws s3 cp ./logdna-cli.pkg s3://repo.logdna.com/mac/logdna-cli.pkg'
            , fpm_rpm: 'fpm -s dir -t rpm -n logdna-cli -v ' + pkg.version + ' --license MIT --vendor "Answerbook, Inc." --description "LogDNA CLI for Linux" --url http://logdna.com/ -m "<help@logdna.com>" --post-install ./scripts/post-install -f ./logdna=/usr/local/logdna/bin/logdna'
            , fpm_deb: 'fpm -s dir -t deb -n logdna-cli -v ' + pkg.version + ' --license MIT --vendor "Answerbook, Inc." --description "LogDNA CLI for Linux" --url http://logdna.com/ -m "<help@logdna.com>" --post-install ./scripts/post-install -f --deb-no-default-config-files ./logdna=/usr/local/logdna/bin/logdna'
            , cp_rpm: 'cp -f logdna-cli-' + pkg.version + '-1.x86_64.rpm logdna-cli.rpm'
            , cp_deb: 'cp -f logdna-cli_' + pkg.version + '_amd64.deb logdna-cli.deb'
            , gzip_linuxbin: 'gzip -f ./logdna'
            , upload_linuxbin: 'aws s3 cp ./logdna.gz s3://repo.logdna.com/linux/logdna.gz'
            , upload_linuxver: 'aws s3 cp ./version s3://repo.logdna.com/linux/version'
            , upload_rpm: 'aws s3 cp ./logdna-cli.rpm s3://repo.logdna.com/linux/logdna-cli.rpm'
            , upload_deb: 'aws s3 cp ./logdna-cli.deb s3://repo.logdna.com/linux/logdna-cli.deb'
            , choco: 'pushd .\\.builds\\windows & cpack'
            , choco_deb: 'cp logdna.nuspec .builds/windows && cp logdna.exe .builds/windows/tools && cd .builds/windows && nuget pack'
        }, copy: {
            nuspec: {
                files: [{
                    src: './logdna.nuspec'
                    , dest: './.builds/windows/'
                }]
            }, winexe: {
                files: [{
                    src: './logdna.exe'
                    , dest: './.builds/windows/tools/'
                }]
            }
        }, eslint: {
            target: files
            , options: {
                configFile: '.eslintrc'
                , fix: true
            }
        }
    });
    grunt.registerTask('test', ['eslint']);
    grunt.registerTask('build', ['lineremover', 'exec:nexe_win', 'exec:save_version']);
    grunt.registerTask('linux', ['build', 'exec:fpm_rpm', 'exec:fpm_deb', 'exec:cp_rpm', 'exec:cp_deb', 'exec:gzip_linuxbin', 'exec:upload_linuxbin', 'exec:upload_linuxver', 'exec:upload_rpm', 'exec:upload_deb']);
    grunt.registerTask('mac', ['build', 'exec:fpm_osxpkg', 'exec:sign_pkg', 'exec:rm_unsignedpkg', 'exec:gzip_macbin', 'exec:upload_macbin', 'exec:upload_macver', 'exec:upload_pkg']); // 'exec:verify_pkg', 'exec:install_pkg'
    grunt.registerTask('windows', ['build', 'copy:nuspec', 'copy:winexe', 'exec:choco_deb']);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    sass: {
      options: {
        includePaths: ['bower_components/foundation/scss']
      },
      dist: {
        options: {
          outputStyle: 'compressed'
        },
        files: {
          'us_ignite/assets/css/app.css': 'scss/app.scss'
        }
      }
    },

    watch: {
      grunt: { files: ['Gruntfile.js'] },

      sass: {
        files: 'scss/**/*.scss',
        tasks: ['sass']
      }
    }
  });

  grunt.loadNpmTasks('grunt-sass');
  grunt.loadNpmTasks('grunt-contrib-watch');

  grunt.registerTask('build', ['sass']);
  grunt.registerTask('default', ['build','watch']);
}
<commit_msg>Bugfix: Make sure ``grunt`` can access ``bower_components``.<commit_after>module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    sass: {
      options: {
        includePaths: ['us_ignite/assets/bower_components/foundation/scss']
      },
      dist: {
        options: {
          outputStyle: 'compressed'
        },
        files: {
          'us_ignite/assets/css/app.css': 'scss/app.scss'
        }
      }
    },

    watch: {
      grunt: { files: ['Gruntfile.js'] },

      sass: {
        files: 'scss/**/*.scss',
        tasks: ['sass']
      }
    }
  });

  grunt.loadNpmTasks('grunt-sass');
  grunt.loadNpmTasks('grunt-contrib-watch');

  grunt.registerTask('build', ['sass']);
  grunt.registerTask('default', ['build','watch']);
}
<|endoftext|>


<commit_before>module.exports = function(grunt) {

  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    emblem: {
      compile: {
        files: {
          'app/js/templates.js': ['app/js/templates/*.emblem']
        },
        options: {
          root: 'app/js/templates/',
          dependencies: {
            jquery: 'static/js/vendor/jquery-1.9.1.min.js',
            emblem: 'static/js/vendor/emblem.min.js',
            ember: 'static/js/vendor/ember-1.0.0-rc.3.min.js',
            handlebars: 'static/js/vendor/handlebars-1.0.0-rc.3.js'
          }
        }
      }
    },
    concat: {
      dist: {
        src: [
          'app/js/app.js',
          'app/js/routes.js',
          'app/js/store.js',
          'app/js/routes/*.js',
          'app/js/models/*.js',
          'app/js/controllers/*.js',
          'app/js/views/*.js',
          'app/js/helpers/*.js',
          'app/js/lib/*.js',
          'app/js/templates.js'
        ],
        dest: 'static/js/app.js'
      }
    },
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      build: {
        src: 'static/js/app.js',
        dest: 'static/js/app.min.js'
      }
    },
    compass: {
      dist: {
        options: {
          config: 'app/config/compass.rb',
          force: true
        }
      }
    },
    webfont: {
      icons: {
        src: 'static/icons/*.svg',
        dest: 'fonts',
        options: {
            font: 'gwcicons'
        }
      }
    },
    regarde: {
      js: {
        files: ['app/js/**/*.js'],
        tasks: ['jshint:ember', 'concat', 'uglify']
      },
      gruntfile: {
        files: ['Gruntfile.js'],
        tasks: ['jshint:gruntfile']
      },
      css: {
        files: 'app/css/*.scss',
        tasks: ['compass'],
        events: true
      },
      emblem: {
        files: 'app/js/templates/*.emblem',
        tasks: ['emblem', 'concat', 'uglify']
      }
    },
    jshint: {
      options: {
        jshintrc: '.jshintrc',
         "force": true
      },
      ember: [ 'app/js/**/*.js', '!app/js/templates.js' ],
      gruntfile: ['Gruntfile.js']
    },
    deploy: {
      staging: {
        src: "./",
        dest: "~/www/gwc-corp",
        host: "dev@staging.golfwebclub.com",
        recursive: true,
        syncDest: true,
        exclude: [
          '.git*',
          'Gemfile*',
          'Rakefile',
          'stuff',
          'sfnt2woff',
          'scss',
          'scss-base',
          'components',
          'node_modules',
          '.sass-cache',
          'Gruntfile.js',
          'package.json',
          'README.md',
          'config.rb'
        ]
      },
      production: {
        src: "./",
        dest: "~/www/gwc-corp",
        host: "dev@live.golfwebclub.com",
        recursive: true,
        syncDest: true,
        exclude: '<%= rsync.staging.exclude %>'
      }
    }
  });

  grunt.registerTask('default', [
     'regarde'
  ]);

  grunt.renameTask('rsync', 'deploy');

};<commit_msg>tweaking gruntfile<commit_after>module.exports = function(grunt) {

  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    emblem: {
      compile: {
        files: {
          'app/js/templates.js': ['app/js/templates/*.emblem']
        },
        options: {
          root: 'app/js/templates/',
          dependencies: {
            jquery: 'static/js/vendor/jquery-1.9.1.min.js',
            emblem: 'static/js/vendor/emblem-0.2.9.js',
            ember: 'static/js/vendor/ember-1.0.0-rc.6.min.js',
            handlebars: 'static/js/vendor/handlebars-1.0.0-rc.4.js'
          }
        }
      }
    },
    concat: {
      dist: {
        src: [
          'app/js/app.js',
          'app/js/routes.js',
          'app/js/store.js',
          'app/js/routes/*.js',
          'app/js/models/*.js',
          'app/js/controllers/*.js',
          'app/js/views/*.js',
          'app/js/helpers/*.js',
          'app/js/lib/*.js',
          'app/js/templates.js'
        ],
        dest: 'static/js/app.js'
      }
    },
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      build: {
        src: 'static/js/app.js',
        dest: 'static/js/app.min.js'
      }
    },
    compass: {
      dist: {
        options: {
          config: 'app/config/compass.rb',
          force: true
        }
      }
    },
    webfont: {
      icons: {
        src: 'static/icons/*.svg',
        dest: 'fonts',
        options: {
            font: 'gwcicons'
        }
      }
    },
    regarde: {
      js: {
        files: ['app/js/**/*.js'],
        tasks: ['jshint:ember', 'concat', 'uglify']
      },
      gruntfile: {
        files: ['Gruntfile.js'],
        tasks: ['jshint:gruntfile']
      },
      css: {
        files: 'app/css/*.scss',
        tasks: ['compass'],
        events: true
      },
      emblem: {
        files: 'app/js/templates/*.emblem',
        tasks: ['emblem', 'concat', 'uglify']
      }
    },
    jshint: {
      options: {
        jshintrc: '.jshintrc',
         "force": true
      },
      ember: [ 'app/js/**/*.js', '!app/js/templates.js' ],
      gruntfile: ['Gruntfile.js']
    },
    deploy: {
      staging: {
        src: "./",
        dest: "~/www/gwc-corp",
        host: "dev@staging.golfwebclub.com",
        recursive: true,
        syncDest: true,
        exclude: [
          '.git*',
          'Gemfile*',
          'Rakefile',
          'stuff',
          'sfnt2woff',
          'scss',
          'scss-base',
          'components',
          'node_modules',
          '.sass-cache',
          'Gruntfile.js',
          'package.json',
          'README.md',
          'config.rb'
        ]
      },
      production: {
        src: "./",
        dest: "~/www/gwc-corp",
        host: "dev@live.golfwebclub.com",
        recursive: true,
        syncDest: true,
        exclude: '<%= rsync.staging.exclude %>'
      }
    }
  });

  grunt.registerTask('default', [
    'concat',
    'uglify',
    'compass',
    'regarde'
  ]);

  grunt.renameTask('rsync', 'deploy');

};<|endoftext|>


<commit_before>module.exports = function ( grunt ) {

    /**
     * Load required Grunt tasks. These are installed based on the versions listed
     * in `package.json` when you do `npm install` in this directory.
     */
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-conventional-changelog');
    grunt.loadNpmTasks('grunt-bump');
    grunt.loadNpmTasks('grunt-recess');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-ngmin');
    grunt.loadNpmTasks('grunt-html2js');

    /**
     * Load in our build configuration file.
     */
    var userConfig = require( './build.config.js' );

    /**
     * This is the configuration object Grunt uses to give each plugin its
     * instructions.
     */
    var taskConfig = {
        /**
         * We read in our `package.json` file so we can access the package name and
         * version. It's already there, so we don't repeat ourselves here.
         */
        pkg: grunt.file.readJSON("package.json"),

        /**
         * The banner is the comment that is placed at the top of our compiled
         * source files. It is first processed as a Grunt template, where the `<%=`
         * pairs are evaluated based on this very configuration object.
         */
        meta: {
            banner:
                '/**\n' +
                    ' * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
                    ' * <%= pkg.homepage %>\n' +
                    ' *\n' +
                    ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
                    ' * Licensed <%= pkg.licenses.type %> <<%= pkg.licenses.url %>>\n' +
                    ' */\n'
        },

        /**
         * Creates a changelog on a new version.
         */
        changelog: {
            options: {
                dest: 'CHANGELOG.md',
                template: 'changelog.tpl'
            }
        },

        /**
         * Increments the version number, etc.
         */
        bump: {
            options: {
                files: [
                    "package.json",
                    "bower.json"
                ],
                commit: false,
                commitMessage: 'chore(release): v%VERSION%',
                commitFiles: [
                    "package.json",
                    "client/bower.json"
                ],
                createTag: false,
                tagName: 'v%VERSION%',
                tagMessage: 'Version %VERSION%',
                push: false,
                pushTo: 'origin'
            }
        },

        /**
         * The directories to delete when `grunt clean` is executed.
         */
        clean: [
            '<%= build_dir %>',
            '<%= compile_dir %>'
        ],

        /**
         * The `copy` task just copies files from A to B. We use it here to copy
         * our project assets (images, fonts, etc.) and javascripts into
         * `build_dir`, and then to copy the assets to `compile_dir`.
         */
        copy: {
            build_assets: {
                files: [
                    {
                        src: [ '**' ],
                        dest: '<%= build_dir %>/assets/',
                        cwd: 'src/assets',
                        expand: true
                    }
                ]
            },
            build_appjs: {
                files: [
                    {
                        src: [ '<%= app_files.js %>' ],
                        dest: '<%= build_dir %>/',
                        cwd: '.',
                        expand: true
                    }
                ]
            },
            build_vendorjs: {
                files: [
                    {
                        src: [ '<%= vendor_files.js %>' ],
                        dest: '<%= build_dir %>/',
                        cwd: '.',
                        expand: true
                    }
                ]
            },
            compile_assets: {
                files: [
                    {
                        src: [ '**' ],
                        dest: '<%= compile_dir %>/assets',
                        cwd: '<%= build_dir %>/assets',
                        expand: true
                    }
                ]
            }
        },

        /**
         * `grunt concat` concatenates multiple source files into a single file.
         */
        concat: {
            /**
             * The `compile_js` target is the concatenation of our application source
             * code and all specified vendor source code into a single file.
             */
            compile_js: {
                options: {
                    banner: '<%= meta.banner %>'
                },
                src: [
                    '<%= vendor_files.js %>',
                    'module.prefix',
                    '<%= build_dir %>/src/**/*.js',
                    '<%= html2js.app.dest %>',
                    '<%= html2js.common.dest %>',
                    '<%= vendor_files.js %>',
                    'module.suffix'
                ],
                dest: '<%= compile_dir %>/assets/<%= pkg.name %>.js'
            }
        },

        /**
         * `ng-min` annotates the sources before minifying. That is, it allows us
         * to code without the array syntax.
         */
        ngmin: {
            compile: {
                files: [
                    {
                        src: [ '<%= app_files.js %>' ],
                        cwd: '<%= build_dir %>',
                        dest: '<%= build_dir %>',
                        expand: true
                    }
                ]
            }
        },

        /**
         * Minify the sources!
         */
        uglify: {
            compile: {
                options: {
                    banner: '<%= meta.banner %>'
                },
                files: {
                    '<%= concat.compile_js.dest %>': '<%= concat.compile_js.dest %>'
                }
            }
        },

        /**
         * `recess` handles our LESS compilation and uglification automatically.
         * Only our `main.less` file is included in compilation; all other files
         * must be imported from this file.
         */
        recess: {
            build: {
                src: [ '<%= app_files.less %>' ],
                dest: '<%= build_dir %>/assets/<%= pkg.name %>.css',
                options: {
                    compile: true,
                    compress: false,
                    noUnderscores: false,
                    noIDs: false,
                    zeroUnits: false
                }
            },
            compile: {
                src: [ '<%= recess.build.dest %>' ],
                dest: '<%= recess.build.dest %>',
                options: {
                    compile: true,
                    compress: true,
                    noUnderscores: false,
                    noIDs: false,
                    zeroUnits: false
                }
            }
        },

        /**
         * `jshint` defines the rules of our linter as well as which files we
         * should check. This file, all javascript sources, and all our unit tests
         * are linted based on the policies listed in `options`. But we can also
         * specify exclusionary patterns by prefixing them with an exclamation
         * point (!); this is useful when code comes from a third party but is
         * nonetheless inside `src/`.
         */
        jshint: {
            src: [
                '<%= app_files.js %>'
            ],
            test: [
                '<%= app_files.jsunit %>'
            ],
            gruntfile: [
                'Gruntfile.js'
            ],
            options: {
                curly: true,
                immed: true,
                newcap: true,
                noarg: true,
                sub: true,
                boss: true,
                eqnull: true
            },
            globals: {}
        },

        /**
         * HTML2JS is a Grunt plugin that takes all of your template files and
         * places them into JavaScript files as strings that are added to
         * AngularJS's template cache. This means that the templates too become
         * part of the initial payload as one JavaScript file. Neat!
         */
        html2js: {
            /**
             * These are the templates from `src/app`.
             */
            app: {
                options: {
                    base: 'src/app'
                },
                src: [ '<%= app_files.atpl %>' ],
                dest: '<%= build_dir %>/templates-app.js'
            },

            /**
             * These are the templates from `src/common`.
             */
            common: {
                options: {
                    base: 'src/common'
                },
                src: [ '<%= app_files.ctpl %>' ],
                dest: '<%= build_dir %>/templates-common.js'
            }
        },

        /**
         * The Karma configurations.
         */
        karma: {
            options: {
                configFile: '<%= build_dir %>/karma-unit.js'
            },
            unit: {
                runnerPort: 9101,
                background: true
            },
            continuous: {
                singleRun: true
            }
        },

        /**
         * The `index` task compiles the `index.html` file as a Grunt template. CSS
         * and JS files co-exist here but they get split apart later.
         */
        index: {

            /**
             * During development, we don't want to have wait for compilation,
             * concatenation, minification, etc. So to avoid these steps, we simply
             * add all script files directly to the `<head>` of `index.html`. The
             * `src` property contains the list of included files.
             */
            build: {
                dir: '<%= build_dir %>',
                src: [
                    '<%= vendor_files.js %>',
                    '<%= build_dir %>/src/**/*.js',
                    '<%= html2js.common.dest %>',
                    '<%= html2js.app.dest %>',
                    '<%= vendor_files.css %>',
                    '<%= recess.build.dest %>'
                ]
            },

            /**
             * When it is time to have a completely compiled application, we can
             * alter the above to include only a single JavaScript and a single CSS
             * file. Now we're back!
             */
            compile: {
                dir: '<%= compile_dir %>',
                src: [
                    '<%= concat.compile_js.dest %>',
                    '<%= vendor_files.css %>',
                    '<%= recess.compile.dest %>'
                ]
            }
        },

        /**
         * This task compiles the karma template so that changes to its file array
         * don't have to be managed manually.
         */
        karmaconfig: {
            unit: {
                dir: '<%= build_dir %>',
                src: [
                    '<%= vendor_files.js %>',
                    '<%= html2js.app.dest %>',
                    '<%= html2js.common.dest %>',
                    'vendor/angular-mocks/angular-mocks.js'
                ]
            }
        },

        /**
         * And for rapid development, we have a watch set up that checks to see if
         * any of the files listed below change, and then to execute the listed
         * tasks when they do. This just saves us from having to type "grunt" into
         * the command-line every time we want to see what we're working on; we can
         * instead just leave "grunt watch" running in a background terminal. Set it
         * and forget it, as Ron Popeil used to tell us.
         *
         * But we don't need the same thing to happen for all the files.
         */
        delta: {
            /**
             * By default, we want the Live Reload to work for all tasks; this is
             * overridden in some tasks (like this file) where browser resources are
             * unaffected. It runs by default on port 35729, which your browser
             * plugin should auto-detect.
             */
            options: {
                livereload: true
            },

            /**
             * When the Gruntfile changes, we just want to lint it. In fact, when
             * your Gruntfile changes, it will automatically be reloaded!
             */
            gruntfile: {
                files: 'Gruntfile.js',
                tasks: [ 'jshint:gruntfile' ],
                options: {
                    livereload: false
                }
            },

            /**
             * When our JavaScript source files change, we want to run lint them and
             * run our unit tests.
             */
            jssrc: {
                files: [
                    '<%= app_files.js %>'
                ],
                tasks: [ 'jshint:src', 'karma:unit:run', 'copy:build_appjs' ]
            },

            /**
             * When assets are changed, copy them. Note that this will *not* copy new
             * files, so this is probably not very useful.
             */
            assets: {
                files: [
                    'src/assets/**/*'
                ],
                tasks: [ 'copy:build_assets' ]
            },

            /**
             * When index.html changes, we need to compile it.
             */
            html: {
                files: [ '<%= app_files.html %>' ],
                tasks: [ 'index:build' ]
            },

            /**
             * When our templates change, we only rewrite the template cache.
             */
            tpls: {
                files: [
                    '<%= app_files.atpl %>',
                    '<%= app_files.ctpl %>'
                ],
                tasks: [ 'html2js' ]
            },

            /**
             * When the CSS files change, we need to compile and minify them.
             */
            less: {
                files: [ 'src/**/*.less' ],
                tasks: [ 'recess:build' ]
            },

            /**
             * When a JavaScript unit test file changes, we only want to lint it and
             * run the unit tests. We don't want to do any live reloading.
             */
            jsunit: {
                files: [
                    '<%= app_files.jsunit %>'
                ],
                tasks: [ 'jshint:test', 'karma:unit:run' ],
                options: {
                    livereload: false
                }
            }
        }
    };

    grunt.initConfig( grunt.util._.extend( taskConfig, userConfig ) );

    /**
     * In order to make it safe to just compile or copy *only* what was changed,
     * we need to ensure we are starting from a clean, fresh build. So we rename
     * the `watch` task to `delta` (that's why the configuration var above is
     * `delta`) and then add a new task called `watch` that does a clean build
     * before watching for changes.
     */
    grunt.renameTask( 'watch', 'delta' );
    grunt.registerTask( 'watch', [ 'build', 'karma:unit', 'delta' ] );

    /**
     * The default task is to build and compile.
     */
    grunt.registerTask( 'default', [ 'build', 'compile' ] );

    /**
     * The `build` task gets your app ready to run for development and testing.
     */
    grunt.registerTask( 'build', [
        'clean', 'html2js', 'jshint', 'recess:build',
        'copy:build_assets', 'copy:build_appjs', 'copy:build_vendorjs',
        'index:build', 'karmaconfig', 'karma:continuous'
    ]);

    /**
     * The `compile` task gets your app ready for deployment by concatenating and
     * minifying your code.
     */
    grunt.registerTask( 'compile', [
        'recess:compile', 'copy:compile_assets', 'ngmin', 'concat', 'uglify', 'index:compile'
    ]);

    /**
     * A utility function to get all app JavaScript sources.
     */
    function filterForJS ( files ) {
        return files.filter( function ( file ) {
            return file.match( /\.js$/ );
        });
    }

    /**
     * A utility function to get all app CSS sources.
     */
    function filterForCSS ( files ) {
        return files.filter( function ( file ) {
            return file.match( /\.css$/ );
        });
    }

    /**
     * The index.html template includes the stylesheet and javascript sources
     * based on dynamic names calculated in this Gruntfile. This task assembles
     * the list into variables for the template to use and then runs the
     * compilation.
     */
    grunt.registerMultiTask( 'index', 'Process index.html template', function () {
        var dirRE = new RegExp( '^('+grunt.config('build_dir')+'|'+grunt.config('compile_dir')+')\/', 'g' );
        var jsFiles = filterForJS( this.filesSrc ).map( function ( file ) {
            return file.replace( dirRE, '' );
        });
        var cssFiles = filterForCSS( this.filesSrc ).map( function ( file ) {
            return file.replace( dirRE, '' );
        });

        grunt.file.copy('src/index.html', this.data.dir + '/index.html', {
            process: function ( contents, path ) {
                return grunt.template.process( contents, {
                    data: {
                        scripts: jsFiles,
                        styles: cssFiles,
                        version: grunt.config( 'pkg.version' )
                    }
                });
            }
        });
    });

    /**
     * In order to avoid having to specify manually the files needed for karma to
     * run, we use grunt to manage the list for us. The `karma/*` files are
     * compiled as grunt templates for use by Karma. Yay!
     */
    grunt.registerMultiTask( 'karmaconfig', 'Process karma config templates', function () {
        var jsFiles = filterForJS( this.filesSrc );

        grunt.file.copy( 'karma/karma-unit.tpl.js', grunt.config( 'build_dir' ) + '/karma-unit.js', {
            process: function ( contents, path ) {
                return grunt.template.process( contents, {
                    data: {
                        scripts: jsFiles
                    }
                });
            }
        });
    });

};
<commit_msg>some tidying of grunt file<commit_after>module.exports = function (grunt) {
    'use strict';

    /**
     * Load required Grunt tasks. These are installed based on the versions listed
     * in `package.json` when you do `npm install` in this directory.
     */
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-conventional-changelog');
    grunt.loadNpmTasks('grunt-bump');
    grunt.loadNpmTasks('grunt-recess');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-ngmin');
    grunt.loadNpmTasks('grunt-html2js');

    /**
     * Load in our build configuration file.
     */
    var userConfig = require('./build.config.js');

    /**
     * This is the configuration object Grunt uses to give each plugin its
     * instructions.
     */
    var taskConfig = {
        /**
         * We read in our `package.json` file so we can access the package name and
         * version. It's already there, so we don't repeat ourselves here.
         */
        pkg: grunt.file.readJSON("package.json"),

        /**
         * The banner is the comment that is placed at the top of our compiled
         * source files. It is first processed as a Grunt template, where the `<%=`
         * pairs are evaluated based on this very configuration object.
         */
        meta: {
            banner:
                '/**\n' +
                    ' * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
                    ' * <%= pkg.homepage %>\n' +
                    ' *\n' +
                    ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
                    ' * Licensed <%= pkg.licenses.type %> <<%= pkg.licenses.url %>>\n' +
                    ' */\n'
        },

        /**
         * Creates a changelog on a new version.
         */
        changelog: {
            options: {
                dest: 'CHANGELOG.md',
                template: 'changelog.tpl'
            }
        },

        /**
         * Increments the version number, etc.
         */
        bump: {
            options: {
                files: [
                    "package.json",
                    "bower.json"
                ],
                commit: false,
                commitMessage: 'chore(release): v%VERSION%',
                commitFiles: [
                    "package.json",
                    "client/bower.json"
                ],
                createTag: false,
                tagName: 'v%VERSION%',
                tagMessage: 'Version %VERSION%',
                push: false,
                pushTo: 'origin'
            }
        },

        /**
         * The directories to delete when `grunt clean` is executed.
         */
        clean: [
            '<%= build_dir %>',
            '<%= compile_dir %>'
        ],

        /**
         * The `copy` task just copies files from A to B. We use it here to copy
         * our project assets (images, fonts, etc.) and javascripts into
         * `build_dir`, and then to copy the assets to `compile_dir`.
         */
        copy: {
            build_assets: {
                files: [
                    {
                        src: [ '**' ],
                        dest: '<%= build_dir %>/assets/',
                        cwd: 'src/assets',
                        expand: true
                    }
                ]
            },
            build_appjs: {
                files: [
                    {
                        src: [ '<%= app_files.js %>' ],
                        dest: '<%= build_dir %>/',
                        cwd: '.',
                        expand: true
                    }
                ]
            },
            build_vendorjs: {
                files: [
                    {
                        src: [ '<%= vendor_files.js %>' ],
                        dest: '<%= build_dir %>/',
                        cwd: '.',
                        expand: true
                    }
                ]
            },
            compile_assets: {
                files: [
                    {
                        src: [ '**' ],
                        dest: '<%= compile_dir %>/assets',
                        cwd: '<%= build_dir %>/assets',
                        expand: true
                    }
                ]
            }
        },

        /**
         * `grunt concat` concatenates multiple source files into a single file.
         */
        concat: {
            /**
             * The `compile_js` target is the concatenation of our application source
             * code and all specified vendor source code into a single file.
             */
            compile_js: {
                options: {
                    banner: '<%= meta.banner %>'
                },
                src: [
                    '<%= vendor_files.js %>',
                    'module.prefix',
                    '<%= build_dir %>/src/**/*.js',
                    '<%= html2js.app.dest %>',
                    '<%= html2js.common.dest %>',
                    '<%= vendor_files.js %>',
                    'module.suffix'
                ],
                dest: '<%= compile_dir %>/assets/<%= pkg.name %>.js'
            }
        },

        /**
         * `ng-min` annotates the sources before minifying. That is, it allows us
         * to code without the array syntax.
         */
        ngmin: {
            compile: {
                files: [
                    {
                        src: [ '<%= app_files.js %>' ],
                        cwd: '<%= build_dir %>',
                        dest: '<%= build_dir %>',
                        expand: true
                    }
                ]
            }
        },

        /**
         * Minify the sources!
         */
        uglify: {
            compile: {
                options: {
                    banner: '<%= meta.banner %>'
                },
                files: {
                    '<%= concat.compile_js.dest %>': '<%= concat.compile_js.dest %>'
                }
            }
        },

        /**
         * `recess` handles our LESS compilation and uglification automatically.
         * Only our `main.less` file is included in compilation; all other files
         * must be imported from this file.
         */
        recess: {
            build: {
                src: [ '<%= app_files.less %>' ],
                dest: '<%= build_dir %>/assets/<%= pkg.name %>.css',
                options: {
                    compile: true,
                    compress: false,
                    noUnderscores: false,
                    noIDs: false,
                    zeroUnits: false
                }
            },
            compile: {
                src: [ '<%= recess.build.dest %>' ],
                dest: '<%= recess.build.dest %>',
                options: {
                    compile: true,
                    compress: true,
                    noUnderscores: false,
                    noIDs: false,
                    zeroUnits: false
                }
            }
        },

        /**
         * `jshint` defines the rules of our linter as well as which files we
         * should check. This file, all javascript sources, and all our unit tests
         * are linted based on the policies listed in `options`. But we can also
         * specify exclusionary patterns by prefixing them with an exclamation
         * point (!); this is useful when code comes from a third party but is
         * nonetheless inside `src/`.
         */
        jshint: {
            src: [
                '<%= app_files.js %>'
            ],
            test: [
                '<%= app_files.jsunit %>'
            ],
            gruntfile: [
                'Gruntfile.js'
            ],
            options: {
                curly: true,
                immed: true,
                newcap: true,
                noarg: true,
                sub: true,
                boss: true,
                eqnull: true
            },
            globals: {}
        },

        /**
         * HTML2JS is a Grunt plugin that takes all of your template files and
         * places them into JavaScript files as strings that are added to
         * AngularJS's template cache. This means that the templates too become
         * part of the initial payload as one JavaScript file. Neat!
         */
        html2js: {
            /**
             * These are the templates from `src/app`.
             */
            app: {
                options: {
                    base: 'src/app'
                },
                src: [ '<%= app_files.atpl %>' ],
                dest: '<%= build_dir %>/templates-app.js'
            },

            /**
             * These are the templates from `src/common`.
             */
            common: {
                options: {
                    base: 'src/common'
                },
                src: [ '<%= app_files.ctpl %>' ],
                dest: '<%= build_dir %>/templates-common.js'
            }
        },

        /**
         * The Karma configurations.
         */
        karma: {
            options: {
                configFile: '<%= build_dir %>/karma-unit.js'
            },
            unit: {
                runnerPort: 9101,
                background: true
            },
            continuous: {
                singleRun: true
            }
        },

        /**
         * The `index` task compiles the `index.html` file as a Grunt template. CSS
         * and JS files co-exist here but they get split apart later.
         */
        index: {

            /**
             * During development, we don't want to have wait for compilation,
             * concatenation, minification, etc. So to avoid these steps, we simply
             * add all script files directly to the `<head>` of `index.html`. The
             * `src` property contains the list of included files.
             */
            build: {
                dir: '<%= build_dir %>',
                src: [
                    '<%= vendor_files.js %>',
                    '<%= build_dir %>/src/**/*.js',
                    '<%= html2js.common.dest %>',
                    '<%= html2js.app.dest %>',
                    '<%= vendor_files.css %>',
                    '<%= recess.build.dest %>'
                ]
            },

            /**
             * When it is time to have a completely compiled application, we can
             * alter the above to include only a single JavaScript and a single CSS
             * file. Now we're back!
             */
            compile: {
                dir: '<%= compile_dir %>',
                src: [
                    '<%= concat.compile_js.dest %>',
                    '<%= vendor_files.css %>',
                    '<%= recess.compile.dest %>'
                ]
            }
        },

        /**
         * This task compiles the karma template so that changes to its file array
         * don't have to be managed manually.
         */
        karmaconfig: {
            unit: {
                dir: '<%= build_dir %>',
                src: [
                    '<%= vendor_files.js %>',
                    '<%= html2js.app.dest %>',
                    '<%= html2js.common.dest %>',
                    'vendor/angular-mocks/angular-mocks.js'
                ]
            }
        },

        /**
         * And for rapid development, we have a watch set up that checks to see if
         * any of the files listed below change, and then to execute the listed
         * tasks when they do. This just saves us from having to type "grunt" into
         * the command-line every time we want to see what we're working on; we can
         * instead just leave "grunt watch" running in a background terminal. Set it
         * and forget it, as Ron Popeil used to tell us.
         *
         * But we don't need the same thing to happen for all the files.
         */
        delta: {
            /**
             * By default, we want the Live Reload to work for all tasks; this is
             * overridden in some tasks (like this file) where browser resources are
             * unaffected. It runs by default on port 35729, which your browser
             * plugin should auto-detect.
             */
            options: {
                livereload: true
            },

            /**
             * When the Gruntfile changes, we just want to lint it. In fact, when
             * your Gruntfile changes, it will automatically be reloaded!
             */
            gruntfile: {
                files: 'Gruntfile.js',
                tasks: [ 'jshint:gruntfile' ],
                options: {
                    livereload: false
                }
            },

            /**
             * When our JavaScript source files change, we want to run lint them and
             * run our unit tests.
             */
            jssrc: {
                files: [
                    '<%= app_files.js %>'
                ],
                tasks: [ 'jshint:src', 'karma:unit:run', 'copy:build_appjs' ]
            },

            /**
             * When assets are changed, copy them. Note that this will *not* copy new
             * files, so this is probably not very useful.
             */
            assets: {
                files: [
                    'src/assets/**/*'
                ],
                tasks: [ 'copy:build_assets' ]
            },

            /**
             * When index.html changes, we need to compile it.
             */
            html: {
                files: [ '<%= app_files.html %>' ],
                tasks: [ 'index:build' ]
            },

            /**
             * When our templates change, we only rewrite the template cache.
             */
            tpls: {
                files: [
                    '<%= app_files.atpl %>',
                    '<%= app_files.ctpl %>'
                ],
                tasks: [ 'html2js' ]
            },

            /**
             * When the CSS files change, we need to compile and minify them.
             */
            less: {
                files: [ 'src/**/*.less' ],
                tasks: [ 'recess:build' ]
            },

            /**
             * When a JavaScript unit test file changes, we only want to lint it and
             * run the unit tests. We don't want to do any live reloading.
             */
            jsunit: {
                files: [
                    '<%= app_files.jsunit %>'
                ],
                tasks: [ 'jshint:test', 'karma:unit:run' ],
                options: {
                    livereload: false
                }
            }
        }
    };

    grunt.initConfig(grunt.util._.extend(taskConfig, userConfig));

    /**
     * In order to make it safe to just compile or copy *only* what was changed,
     * we need to ensure we are starting from a clean, fresh build. So we rename
     * the `watch` task to `delta` (that's why the configuration var above is
     * `delta`) and then add a new task called `watch` that does a clean build
     * before watching for changes.
     */
    grunt.renameTask('watch', 'delta');
    grunt.registerTask('watch', [ 'build', 'karma:unit', 'delta' ]);

    /**
     * The default task is to build and compile.
     */
    grunt.registerTask('default', [ 'build', 'compile' ]);

    /**
     * The `build` task gets your app ready to run for development and testing.
     */
    grunt.registerTask('build', [
        'clean', 'html2js', 'jshint', 'recess:build',
        'copy:build_assets', 'copy:build_appjs', 'copy:build_vendorjs',
        'index:build', 'karmaconfig', 'karma:continuous'
    ]);

    /**
     * The `compile` task gets your app ready for deployment by concatenating and
     * minifying your code.
     */
    grunt.registerTask('compile', [
        'recess:compile', 'copy:compile_assets', 'ngmin', 'concat', 'uglify', 'index:compile'
    ]);

    /**
     * A utility function to get all app JavaScript sources.
     */
    function filterForJS(files) {
        return files.filter(function (file) {
            return file.match(/\.js$/);
        });
    }

    /**
     * A utility function to get all app CSS sources.
     */
    function filterForCSS(files) {
        return files.filter(function (file) {
            return file.match(/\.css$/);
        });
    }

    /**
     * The index.html template includes the stylesheet and javascript sources
     * based on dynamic names calculated in this Gruntfile. This task assembles
     * the list into variables for the template to use and then runs the
     * compilation.
     */
    grunt.registerMultiTask('index', 'Process index.html template', function () {
        var dirRE = new RegExp('^(' + grunt.config('build_dir') + '|' + grunt.config('compile_dir') + ')\/', 'g');
        var jsFiles = filterForJS(this.filesSrc).map(function (file) {
            return file.replace(dirRE, '');
        });
        var cssFiles = filterForCSS(this.filesSrc).map(function (file) {
            return file.replace(dirRE, '');
        });

        grunt.file.copy('src/index.html', this.data.dir + '/index.html', {
            process: function (contents, path) {
                return grunt.template.process(contents, {
                    data: {
                        scripts: jsFiles,
                        styles: cssFiles,
                        version: grunt.config('pkg.version')
                    }
                });
            }
        });
    });

    /**
     * In order to avoid having to specify manually the files needed for karma to
     * run, we use grunt to manage the list for us. The `karma/*` files are
     * compiled as grunt templates for use by Karma. Yay!
     */
    grunt.registerMultiTask('karmaconfig', 'Process karma config templates', function() {
        var jsFiles = filterForJS(this.filesSrc);

        grunt.file.copy('karma/karma-unit.tpl.js', grunt.config('build_dir') + '/karma-unit.js', {
            process: function(contents, path) {
                return grunt.template.process(contents, {
                    data: {
                        scripts: jsFiles
                    }
                });
            }
        });
    });

};
<|endoftext|>


<commit_before>/*
 * lintel-contrib-alerts
 * https://github.com/lintelio/lintel-contrib-alerts
 *
 * Copyright (c) 2014 Marius Craciunoiu
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function (grunt) {
  var lintel = {
    test: 'test',
    dist: 'dist'
  };

  // Load all npm grunt tasks
  require('load-grunt-tasks')(grunt);

  // Project configuration.
  grunt.initConfig({
    lintel: lintel,

    // Compile sass
    sass: {
      options: {
        sourceMap: true,
        includePaths: [
          'bower_components/lintel/sass',
          'bower_components',
          'sass'
        ]
      },
      dist: {
        files: {
          '<%= lintel.dist %>/alerts.css': 'sass/lintel-core-loader.scss'
        }
      }
    },

    // Autoprefix sass
    autoprefixer: {
      dist: {
        src: '<%= lintel.dist %>/alerts.css'
      }
    },

    // Minify css
    cssmin: {
      // TODO: sourcemap
      dist: {
        src: '<%= lintel.dist %>/alerts.css',
        dest: '<%= lintel.dist %>/alerts.min.css'
      }
    },

    // Lint css
    csslint: {
      options: {
        csslintrc: '.csslintrc'
      },
      dist: {
        src: ['<%= lintel.dist %>/alerts.css']
      }
    },

    // Start test server
    connect: {
      test: {
        options: {
          base: [
            './',
            '<%= lintel.dist %>',
            '<%= lintel.test %>/fixtures'
          ],
          livereload: true,
          port: 4554
        }
      }
    },

    // Remove previous screenshots
    clean: {
      tests: ['<%= lintel.test %>/tmp']
    },

    // Take new screenshots
    webshot: {
      xs: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/xs.png',
          windowSize: {
              width: 320,
              height: 568
          },
          shotSize: {
              width: 320,
              height: 'all'
          }
        }
      },
      sm: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/sm.png',
          windowSize: {
              width: 480,
              height: 568
          },
          shotSize: {
              width: 480,
              height: 'all'
          }
        }
      },
      md: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/md.png',
          windowSize: {
              width: 768,
              height: 1024
          },
          shotSize: {
              width: 768,
              height: 'all'
          }
        }
      },
      lg: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/lg.png',
          windowSize: {
              width: 1024,
              height: 768
          },
          shotSize: {
              width: 1024,
              height: 'all'
          }
        }
      },
      xl: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/xl.png',
          windowSize: {
              width: 1280,
              height: 800
          },
          shotSize: {
              width: 1280,
              height: 'all'
          }
        }
      },
      "2xl": {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/2xl.png',
          windowSize: {
              width: 1440,
              height: 900
          },
          shotSize: {
              width: 1440,
              height: 'all'
          }
        }
      },
      "3xl": {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/3xl.png',
          windowSize: {
              width: 1680,
              height: 1050
          },
          shotSize: {
              width: 1680,
              height: 'all'
          }
        }
      },
      max: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/max.png',
          windowSize: {
              width: 1920,
              height: 1080
          },
          shotSize: {
              width: 1920,
              height: 'all'
          }
        }
      }
    },

    // Lint js
    jshint: {
      options: {
        jshintrc: '.jshintrc'
      },
      files: {
        src: ['js/**/*.js']
      }
    },

    // Minify js
    uglify: {
      options: {
        mangle: true,
        compress: true,
        sourceMap: true,
      },
      individual: {
        files: [{
          expand: true,
          cwd: 'js',
          src: '**/*.js',
          dest: 'dist/'
        }]
      },
      concat: {
        files: {
          'dist/alerts.min.js': ['js/**/*.js']
        }
      }
    },

    // Run tests
    nodeunit: {
      tests: ['<%= lintel.test %>/*_test.js']
    },

    // Watch for changes
    watch: {
      sass: {
        files: [
          'sass/**/*.scss'
        ],
        tasks: ['test-watch']
      },
      livereload: {
        files: [
          '<%= lintel.dist %>/**/*.css'
        ],
        options: {
          livereload: true
        }
      },
    },

    // Notify of changes
    notify: {
      compile: {
        options: {
          title: 'lintel-contrib-alerts',
          message: 'Done Compiling'
        }
      }
    }

  });

  grunt.registerTask('compile', ['sass:dist', 'autoprefixer:dist', 'cssmin:dist', 'uglify', 'notify:compile']);

  grunt.registerTask('test-watch', ['compile', 'csslint', 'jshint']);

  grunt.registerTask('test', ['test-watch', 'connect', 'clean:tests', 'webshot', 'nodeunit']);

  // By default, lint and run all tests.
  grunt.registerTask('default', ['test', 'watch']);

};
<commit_msg>Watch js for changes.<commit_after>/*
 * lintel-contrib-alerts
 * https://github.com/lintelio/lintel-contrib-alerts
 *
 * Copyright (c) 2014 Marius Craciunoiu
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function (grunt) {
  var lintel = {
    test: 'test',
    dist: 'dist'
  };

  // Load all npm grunt tasks
  require('load-grunt-tasks')(grunt);

  // Project configuration.
  grunt.initConfig({
    lintel: lintel,

    // Compile sass
    sass: {
      options: {
        sourceMap: true,
        includePaths: [
          'bower_components/lintel/sass',
          'bower_components',
          'sass'
        ]
      },
      dist: {
        files: {
          '<%= lintel.dist %>/alerts.css': 'sass/lintel-core-loader.scss'
        }
      }
    },

    // Autoprefix sass
    autoprefixer: {
      dist: {
        src: '<%= lintel.dist %>/alerts.css'
      }
    },

    // Minify css
    cssmin: {
      // TODO: sourcemap
      dist: {
        src: '<%= lintel.dist %>/alerts.css',
        dest: '<%= lintel.dist %>/alerts.min.css'
      }
    },

    // Lint css
    csslint: {
      options: {
        csslintrc: '.csslintrc'
      },
      dist: {
        src: ['<%= lintel.dist %>/alerts.css']
      }
    },

    // Start test server
    connect: {
      test: {
        options: {
          base: [
            './',
            '<%= lintel.dist %>',
            '<%= lintel.test %>/fixtures'
          ],
          livereload: true,
          port: 4554
        }
      }
    },

    // Remove previous screenshots
    clean: {
      tests: ['<%= lintel.test %>/tmp']
    },

    // Take new screenshots
    webshot: {
      xs: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/xs.png',
          windowSize: {
              width: 320,
              height: 568
          },
          shotSize: {
              width: 320,
              height: 'all'
          }
        }
      },
      sm: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/sm.png',
          windowSize: {
              width: 480,
              height: 568
          },
          shotSize: {
              width: 480,
              height: 'all'
          }
        }
      },
      md: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/md.png',
          windowSize: {
              width: 768,
              height: 1024
          },
          shotSize: {
              width: 768,
              height: 'all'
          }
        }
      },
      lg: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/lg.png',
          windowSize: {
              width: 1024,
              height: 768
          },
          shotSize: {
              width: 1024,
              height: 'all'
          }
        }
      },
      xl: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/xl.png',
          windowSize: {
              width: 1280,
              height: 800
          },
          shotSize: {
              width: 1280,
              height: 'all'
          }
        }
      },
      "2xl": {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/2xl.png',
          windowSize: {
              width: 1440,
              height: 900
          },
          shotSize: {
              width: 1440,
              height: 'all'
          }
        }
      },
      "3xl": {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/3xl.png',
          windowSize: {
              width: 1680,
              height: 1050
          },
          shotSize: {
              width: 1680,
              height: 'all'
          }
        }
      },
      max: {
        options: {
          siteType: 'url',
          site: 'http://localhost:4554/alerts.html',
          savePath: '<%= lintel.test %>/tmp/max.png',
          windowSize: {
              width: 1920,
              height: 1080
          },
          shotSize: {
              width: 1920,
              height: 'all'
          }
        }
      }
    },

    // Lint js
    jshint: {
      options: {
        jshintrc: '.jshintrc'
      },
      files: {
        src: ['js/**/*.js']
      }
    },

    // Minify js
    uglify: {
      options: {
        mangle: true,
        compress: true,
        sourceMap: true,
      },
      individual: {
        files: [{
          expand: true,
          cwd: 'js',
          src: '**/*.js',
          dest: 'dist/'
        }]
      },
      concat: {
        files: {
          'dist/alerts.min.js': ['js/**/*.js']
        }
      }
    },

    // Copy files
    copy: {
      js: {
        files: [{
          expand: true,
          cwd: 'js/',
          src: ['**/*.js'],
          dest: 'dist/'
        }]
      }
    },

    // Run tests
    nodeunit: {
      tests: ['<%= lintel.test %>/*_test.js']
    },

    // Watch for changes
    watch: {
      sass: {
        files: [
          'sass/**/*.scss'
        ],
        tasks: ['sass-compile']
      },
      js: {
        files: [
          'js/**/*.js'
        ],
        tasks: ['js-compile']
      },
      livereload: {
        files: [
          '<%= lintel.dist %>/**/*.css'
        ],
        options: {
          livereload: true
        }
      },
    },

    // Notify of changes
    notify: {
      sass: {
        options: {
          title: 'lintel-contrib-alerts',
          message: 'SASS Compiled'
        }
      },
      js: {
        options: {
          title: 'lintel-contrib-alerts',
          message: 'JS Compiled'
        }
      }
    }

  });

  grunt.registerTask('sass-compile', ['sass:dist', 'autoprefixer:dist', 'cssmin:dist', 'csslint', 'notify:sass']);

  grunt.registerTask('js-compile', ['copy:js', 'uglify:concat', 'jshint', 'notify:js']);

  grunt.registerTask('test', ['sass-compile', 'js-compile', 'connect', 'clean:tests', 'webshot', 'nodeunit']);

  // By default, lint and run all tests.
  grunt.registerTask('default', ['test', 'watch']);

};
<|endoftext|>


<commit_before>module.exports = function (grunt) {

    // 1. All configuration goes here
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        concat: {
            igv: {
                src: [
                    'js/**/*.js',
                    'vendor/inflate.js',
                    'vendor/zlib_and_gzip.min.js'
                ],
                dest: 'dist/igv-all.js'
            }
        },

        uglify: {
            options: {
                mangle: false,
                sourceMap: true
            },

            igv: {
                src: 'dist/igv-all.js',
                dest: 'dist/igv-all.min.js'
            }
        },

        md2html: {
            options: {
                layout: 'docs/api_layout.html'
            },
            igv: {
                src: ['docs/api.md'],
                dest: 'docs/api.html'
            }
        }

    });

    // 3. Where we tell Grunt we plan to use this plug-in.
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-md2html');

    // 4. Where we tell Grunt what to do when we type "grunt" into the terminal.
    //grunt.registerTask('default', ['concat:igvexp', 'uglify:igvexp']);
    grunt.registerTask('default', ['concat:igv', 'uglify:igv', 'md2html:igv']);

};

<commit_msg>grunt file tweak<commit_after>module.exports = function (grunt) {

    // 1. All configuration goes here
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        concat: {
            igv: {
                src: [
                    'js/**/*.js',
                    'vendor/inflate.js',
                    'vendor/zlib_and_gzip.min.js'
                ],
                dest: 'dist/igv-all.js'
            }
        },

        uglify: {
            options: {
                mangle: false,
                sourceMap: true
            },

            igv: {
                src: 'dist/igv-all.js',
                dest: 'dist/igv-all.min.js'
            }
        },

        md2html: {
            options: {
                layout: 'docs/api_layout.html'
            },
            igv: {
                src: ['docs/api.md'],
                dest: 'dist/api.html'
            }
        }

    });

    // 3. Where we tell Grunt we plan to use this plug-in.
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-md2html');

    // 4. Where we tell Grunt what to do when we type "grunt" into the terminal.
    //grunt.registerTask('default', ['concat:igvexp', 'uglify:igvexp']);
    grunt.registerTask('default', ['concat:igv', 'uglify:igv', 'md2html:igv']);

};

<|endoftext|>


<commit_before>module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        concat: {
            options: {
                separator: '\n\n'
            },
            libs: {
                src: [
                    'public/assets/js/libs/jquery.min.js',
                    'public/assets/js/libs/velocity.min.js',
                    'public/assets/js/libs/bootstrap.min.js',
                    'public/assets/js/libs/select2.min.js',
                    'public/assets/js/libs/autosize.min.js',
                    'public/assets/js/libs/spin.min.js',
                    'public/assets/js/libs/jquery.cropit.js',
                    'public/assets/js/libs/add-to-any.min.js'
                ],
                dest: 'public/assets/dist/js/libs.js'
            },
            linken: {
                src: [
                    'public/assets/js/common.js',
                    'public/assets/js/add-pane.js',
                    'public/assets/js/control-pane.js',
                    'public/assets/js/item-pane.js',
                    'public/assets/js/discover.js',
                    'public/assets/js/welcome.js'
                ],
                dest: 'public/assets/dist/js/linken.js'
            },
            dist: {
                src: ['public/assets/dist/js/libs.js', 'public/assets/dist/js/linken.js'],
                dest: 'public/assets/dist/js/linken-dist.js'
            }
        },
        uglify: {
            options: {
                banner: '/*! Linken <%= grunt.template.today("yyyy-mm-dd") %> */\n'
            },
            build: {
                src: [
                    'public/assets/dist/js/linken-dist.js'
                ],
                dest: 'public/assets/dist/js/linken.min.js'
            }
        },
        watch: {
            scripts: {
                files: ['resources/assets/sass/*.scss'],
                tasks: ['sass'],
                options: {
                    spawn: false,
                    interval: 3007
                }
            }
        },
        sass: {
            options: {
                sourceMap: false
            },
            dist: {
                files: {
                    'public/assets/css/base.css': 'resources/assets/sass/base.scss'
                }
            }
        },
        processhtml: {
            options: {},
            dist: {
                files: {
                    'resources/views/layouts/layoutDist.blade.php': ['resources/views/layouts/layout.blade.php']
                }
            }
        },
        replace: {
            dist: {
                src: ['public/assets/dist/css/linken.min.css'],
                overwrite: true,
                replacements: [
                    {
                        from: '../images',
                        to: '../../images'
                    },
                    {
                        from: '../fonts',
                        to: '../../fonts'
                    }
                ]
            }
        },
        cssmin: {
            options: {
                shorthandCompacting: false,
                roundingPrecision: -1
            },
            target: {
                files: {
                    'public/assets/dist/css/linken.min.css': [
                        'public/assets/css/google-fonts-Montserrat.css',
                        'public/assets/css/bootstrap.min.css',
                        'public/assets/css/select2.min.css',
                        'public/assets/css/base.css'
                    ]
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-sass');
    grunt.loadNpmTasks('grunt-processhtml');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-text-replace');

    grunt.registerTask('default', ['sass']);
    grunt.registerTask('dist', ['concat:libs', 'concat:linken', 'concat:dist', 'uglify', 'sass', 'processhtml', 'cssmin', 'replace']);

};
<commit_msg>updating grunt file<commit_after>module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        concat: {
            options: {
                separator: '\n\n'
            },
            libs: {
                src: [
                    'public/assets/js/libs/jquery.min.js',
                    'public/assets/js/libs/velocity.min.js',
                    'public/assets/js/libs/bootstrap.min.js',
                    'public/assets/js/libs/select2.min.js',
                    'public/assets/js/libs/autosize.min.js',
                    'public/assets/js/libs/spin.min.js',
                    'public/assets/js/libs/jquery.cropit.js',
                    'public/assets/js/libs/add-to-any.min.js'
                ],
                dest: 'public/assets/dist/js/libs.js'
            },
            linken: {
                src: [
                    'public/assets/js/common.js',
                    'public/assets/js/add-pane.js',
                    'public/assets/js/control-pane.js',
                    'public/assets/js/item-pane.js',
                    'public/assets/js/discover.js',
                    'public/assets/js/welcome.js'
                ],
                dest: 'public/assets/dist/js/linken.js'
            },
            dist: {
                src: ['public/assets/dist/js/libs.js', 'public/assets/dist/js/linken.js'],
                dest: 'public/assets/dist/js/linken-dist.js'
            }
        },
        uglify: {
            options: {
                banner: '/*! Linken <%= grunt.template.today("yyyy-mm-dd") %> */\n'
            },
            build: {
                src: [
                    'public/assets/dist/js/linken-dist.js'
                ],
                dest: 'public/assets/dist/js/linken.min.js'
            }
        },
        watch: {
            scripts: {
                files: ['resources/assets/sass/*.scss'],
                tasks: ['sass'],
                options: {
                    spawn: false,
                    interval: 3007
                }
            }
        },
        sass: {
            options: {
                sourceMap: false
            },
            dist: {
                files: {
                    'public/assets/css/base.css': 'resources/assets/sass/base.scss'
                }
            }
        },
        processhtml: {
            options: {},
            dist: {
                files: {
                    'resources/views/layouts/layoutDist.blade.php': ['resources/views/layouts/layout.blade.php']
                }
            }
        },
        replace: {
            dist: {
                src: ['public/assets/dist/css/linken.min.css'],
                overwrite: true,
                replacements: [
                    {
                        from: '../images',
                        to: '../../images'
                    },
                    {
                        from: '../fonts',
                        to: '../../fonts'
                    }
                ]
            }
        },
        cssmin: {
            options: {
                shorthandCompacting: false,
                roundingPrecision: -1
            },
            target: {
                files: {
                    'public/assets/dist/css/linken.min.css': [
                        'public/assets/css/google-fonts-Montserrat.css',
                        'public/assets/css/bootstrap.min.css',
                        'public/assets/css/select2.min.css',
                        'public/assets/css/font-awesome.css',
                        'public/assets/css/bootstrap-social.css',
                        'public/assets/css/base.css'
                    ]
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-sass');
    grunt.loadNpmTasks('grunt-processhtml');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-text-replace');

    grunt.registerTask('default', ['sass']);
    grunt.registerTask('dist', ['concat:libs', 'concat:linken', 'concat:dist', 'uglify', 'sass', 'processhtml', 'cssmin', 'replace']);

};
<|endoftext|>