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

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		jshint: {
			// You get to make the name
			// The paths tell JSHint which files to validate
			dev: ['Gruntfile.js', 'src/**/*.js', 'tests/**/*.js'],
			options: {
				curly: false,
				eqeqeq: true,
				eqnull: true,
				browser: true,
				forin: true,
				undef: true,
				unused: true,
				expr: true,
				globals: {
					define: false,
					require: false,
					module: true,
					expect: true,
					mocha: true,
					describe: true,
					it: true,
					beforeEach: true
				},
				reporter: require('jshint-stylish')
			},
			build: ['dist/**/*.js']
		},
		mocha: {
			dev: {
				src: ['tests/**/dev.html'],
			},
			dist: {
				src: ['tests/**/dist.html'],
			},
			options: {
				log: true,
				run: true,
				reporter: 'Spec'
			}
		},
		uglify: {
			options: {
				banner: [
					'/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
					'/*! <%= pkg.description %> */'
				].join(''),
				compress: true
			},
			dist: {
				src: 'src/<%= pkg.name %>.js',
				dest: 'dist/<%= pkg.name %>.min.js'
			}
		}
	});

	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-mocha');

	grunt.registerTask('default', [
		'jshint:dev',
		'mocha:dev'
	]);

	grunt.registerTask('dist', [
		'uglify',
		'mocha:dist'
	]);
};<commit_msg>cleanup<commit_after>module.exports = function(grunt) {

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		jshint: {
			// You get to make the name
			// The paths tell JSHint which files to validate
			dev: ['Gruntfile.js', 'src/**/*.js', 'tests/**/*.js'],
			options: {
				curly: false,
				eqeqeq: true,
				eqnull: true,
				browser: true,
				forin: true,
				undef: true,
				unused: true,
				expr: true,
				globals: {
					define: false,
					require: false,
					module: true,
					expect: true,
					mocha: true,
					describe: true,
					it: true,
					beforeEach: true
				},
				reporter: require('jshint-stylish')
			},
			build: ['dist/**/*.js']
		},
		mocha: {
			dev: {
				src: ['tests/**/dev.html'],
			},
			dist: {
				src: ['tests/**/dist.html'],
			},
			options: {
				log: true,
				run: true,
				reporter: 'Spec'
			}
		},
		uglify: {
			options: {
				banner: [
					'/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
					'/*! <%= pkg.description %> */\n'
				].join(''),
				compress: true
			},
			dist: {
				src: 'src/<%= pkg.name %>.js',
				dest: 'dist/<%= pkg.name %>.min.js'
			}
		}
	});

	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-mocha');

	grunt.registerTask('default', [
		'jshint:dev',
		'mocha:dev'
	]);

	grunt.registerTask('dist', [
		'uglify',
		'mocha:dist'
	]);
};<|endoftext|>


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

    var BUILD_DEST = './dist/data_structures.js',
        MIN_DEST = './dist/data_structures.min.js',
        SOURCE_MAP_DEST = './dist/data_structures.js.map',
        COMPRESSED_DEST = './dist/data_structures.min.js.gz';

    var gruntConfig = {};

    gruntConfig.pkg = grunt.file.readJSON("package.json");

    gruntConfig.concat = {
        options: {
            separator: ';\n',

            stripBanners: {
                block: true,
                line: true
            }
        },

        dist: {
            src: [
                "./build/begin.js",

                "./src/core.js",
                "./src/object.js",

                "./src/red_black_tree_util.js",
                "./src/red_black_tree_node.js",
                "./src/red_black_tree.js",

                "./src/map.js",
                "./src/orderedmap.js",
                "./src/sortedmap.js",
                "./src/set.js",
                "./src/orderedset.js",
                "./src/sortedset.js",

                "./src/export.js",

                "./build/end.js"
            ],

            nonull: true,

            dest: BUILD_DEST
        }

    };

    gruntConfig.watch = {
        scripts: {
            files: [
                "./src/**/*"
            ],
            tasks: ['concat'],
            options: {
              interrupt: true,
              debounceDelay: 2500
            }
        }
    };

    gruntConfig.jshint = {
        all: {
            options: {
                jshintrc: "./jshint.json"
            },

            files: {
                src: [
                    './src/**/*.js',
                    './test/**/*.js'
                ]
            }
        }
    };

    gruntConfig.qunit = {
        all: [ './test/*.html']
    };

    gruntConfig["closure-compiler"] = {
        frontend: {
            closurePath: '../closure_compiler',
            js: BUILD_DEST,
            jsOutputFile: MIN_DEST,
            maxBuffer: 8192,
            options: {
                compilation_level: 'SIMPLE_OPTIMIZATIONS',
                language_in: 'ECMASCRIPT5',
                charset: "UTF-8",
                create_source_map: SOURCE_MAP_DEST,
                source_map_format: "V3",
                debug: false
            },
            noreport: true
        }
    };

    gruntConfig.compress = {
        dist: {
            options: {
                mode: "gzip"
            },

            files: [{
                src: MIN_DEST,
                dest: COMPRESSED_DEST
            }]
        }
    };

    grunt.initConfig(gruntConfig);

    grunt.registerTask( "default", ["concat"] );
    grunt.registerTask( "test", ["jshint", "concat", "qunit"] );
    grunt.registerTask( "production", ["test", "closure-compiler", "compress"] );

    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-closure-compiler');
    grunt.loadNpmTasks('grunt-contrib-compress');

};<commit_msg>source map url<commit_after>module.exports = function( grunt ) {

    var BUILD_DEST = './dist/data_structures.js',
        MIN_DEST = './dist/data_structures.min.js',
        SOURCE_MAP_DEST = './dist/data_structures.js.map',
        SOURCE_MAP_URL = 'data_structures.js.map',
        COMPRESSED_DEST = './dist/data_structures.min.js.gz';

    var gruntConfig = {};

    gruntConfig.pkg = grunt.file.readJSON("package.json");

    gruntConfig.concat = {
        options: {
            separator: ';\n',

            stripBanners: {
                block: true,
                line: true
            }
        },

        dist: {
            src: [
                "./build/begin.js",

                "./src/core.js",
                "./src/object.js",

                "./src/red_black_tree_util.js",
                "./src/red_black_tree_node.js",
                "./src/red_black_tree.js",

                "./src/map.js",
                "./src/orderedmap.js",
                "./src/sortedmap.js",
                "./src/set.js",
                "./src/orderedset.js",
                "./src/sortedset.js",

                "./src/export.js",

                "./build/end.js"
            ],

            nonull: true,

            dest: BUILD_DEST
        }

    };

    gruntConfig.watch = {
        scripts: {
            files: [
                "./src/**/*"
            ],
            tasks: ['concat'],
            options: {
              interrupt: true,
              debounceDelay: 2500
            }
        }
    };

    gruntConfig.jshint = {
        all: {
            options: {
                jshintrc: "./jshint.json"
            },

            files: {
                src: [
                    './src/**/*.js',
                    './test/**/*.js'
                ]
            }
        }
    };

    gruntConfig.qunit = {
        all: [ './test/*.html']
    };

    gruntConfig["closure-compiler"] = {
        frontend: {
            closurePath: '../closure_compiler',
            js: BUILD_DEST,
            jsOutputFile: MIN_DEST,
            maxBuffer: 8192,
            options: {
                compilation_level: 'SIMPLE_OPTIMIZATIONS',
                language_in: 'ECMASCRIPT5',
                charset: "UTF-8",
                create_source_map: SOURCE_MAP_DEST,
                source_map_format: "V3",
                debug: false
            },
            noreport: true
        }
    };

    gruntConfig.compress = {
        dist: {
            options: {
                mode: "gzip"
            },

            files: [{
                src: MIN_DEST,
                dest: COMPRESSED_DEST
            }]
        }
    };

    grunt.registerTask( "sourcemap", function() {
        var fs = require("fs");

        var min = fs.readFileSync( MIN_DEST ),
            map = fs.readFileSync( SOURCE_MAP_DEST );

        min += "//@ sourceMappingURL="+SOURCE_MAP_URL+"\n";
        map = ")]}\n" + map;

        fs.writeFileSync( MIN_DEST, min );
        fs.writeFileSync( SOURCE_MAP_DEST, map );
    });

    grunt.initConfig(gruntConfig);

    grunt.registerTask( "default", ["concat"] );
    grunt.registerTask( "test", ["jshint", "concat", "qunit"] );
    grunt.registerTask( "production", ["test", "closure-compiler", "compress", "sourcemap"] );

    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-closure-compiler');
    grunt.loadNpmTasks('grunt-contrib-compress');

};<|endoftext|>


<commit_before>'use strict';
module.exports = function(grunt) {
  // Load all tasks
  require('load-grunt-tasks')(grunt);
  // Show elapsed time
  require('time-grunt')(grunt);

  var jsFileList = [
    'assets/vendor/bootstrap/js/transition.js',
    'assets/vendor/bootstrap/js/alert.js',
    'assets/vendor/bootstrap/js/button.js',
    'assets/vendor/bootstrap/js/carousel.js',
    'assets/vendor/bootstrap/js/collapse.js',
    'assets/vendor/bootstrap/js/dropdown.js',
    'assets/vendor/bootstrap/js/modal.js',
    'assets/vendor/bootstrap/js/tooltip.js',
    'assets/vendor/bootstrap/js/popover.js',
    'assets/vendor/bootstrap/js/scrollspy.js',
    'assets/vendor/bootstrap/js/tab.js',
    'assets/vendor/bootstrap/js/affix.js',
    'assets/js/plugins/*.js',
    'assets/js/_*.js'
  ];

  grunt.initConfig({
    jshint: {
      options: {
        jshintrc: '.jshintrc'
      },
      all: [
        'Gruntfile.js',
        'assets/js/*.js',
        '!assets/js/scripts.js',
        '!assets/*/*.min.*'
      ]
    },
    less: {
      dev: {
        files: {
          'assets/css/main.css': [
            'assets/less/main.less'
          ]
        },
        options: {
          compress: false,
          // LESS source map
          // To enable, set sourceMap to true and update sourceMapRootpath based on your install
          sourceMap: true,
          sourceMapFilename: 'assets/css/main.css.map',
          sourceMapRootpath: '/app/themes/roots/'
        }
      },
      build: {
        files: {
          'assets/css/main.min.css': [
            'assets/less/main.less'
          ]
        },
        options: {
          compress: true
        }
      }
    },
    concat: {
      options: {
        separator: ';',
      },
      dist: {
        src: [jsFileList],
        dest: 'assets/js/scripts.js',
      },
    },
    uglify: {
      dist: {
        files: {
          'assets/js/scripts.min.js': [jsFileList]
        }
      }
    },
    autoprefixer: {
      options: {
        browsers: ['last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4', 'opera 12']
      },
      dev: {
        options: {
          map: {
            prev: 'assets/css/'
          }
        },
        src: 'assets/css/main.css'
      },
      build: {
        src: 'assets/css/main.min.css'
      }
    },
    modernizr: {
      build: {
        devFile: 'assets/vendor/modernizr/modernizr.js',
        outputFile: 'assets/js/vendor/modernizr.min.js',
        files: {
          'src': [
            ['assets/js/scripts.min.js'],
            ['assets/css/main.min.css']
          ]
        },
        extra: {
          shiv: false
        },
        uglify: true,
        parseFiles: true
      }
    },
    version: {
      default: {
        options: {
          format: true,
          length: 32,
          manifest: 'assets/manifest.json',
          querystring: {
            style: 'roots_css',
            script: 'roots_js'
          }
        },
        files: {
          'lib/scripts.php': 'assets/{css,js}/{main,scripts}.min.{css,js}'
        }
      }
    },
    watch: {
      less: {
        files: [
          'assets/less/*.less',
          'assets/less/**/*.less'
        ],
        tasks: ['less:dev', 'autoprefixer:dev']
      },
      js: {
        files: [
          jsFileList,
          '<%= jshint.all %>'
        ],
        tasks: ['jshint', 'concat']
      },
      livereload: {
        // Browser live reloading
        // https://github.com/gruntjs/grunt-contrib-watch#live-reloading
        options: {
          livereload: false
        },
        files: [
          'assets/css/main.css',
          'assets/js/scripts.js',
          'templates/*.php',
          '*.php'
        ]
      }
    }
  });

  // Register tasks
  grunt.registerTask('default', [
    'dev'
  ]);
  grunt.registerTask('dev', [
    'jshint',
    'less:dev',
    'autoprefixer:dev',
    'concat'
  ]);
  grunt.registerTask('build', [
    'jshint',
    'less:build',
    'autoprefixer:build',
    'uglify',
    'modernizr',
    'version'
  ]);
};
<commit_msg>updated gruntfile?<commit_after>'use strict';
module.exports = function(grunt) {
  // Load all tasks
  require('load-grunt-tasks')(grunt);
  // Show elapsed time
  require('time-grunt')(grunt);

  var jsFileList = [
    'assets/vendor/bootstrap/js/transition.js',
    'assets/vendor/bootstrap/js/alert.js',
    'assets/vendor/bootstrap/js/button.js',
    'assets/vendor/bootstrap/js/carousel.js',
    'assets/vendor/bootstrap/js/collapse.js',
    'assets/vendor/bootstrap/js/dropdown.js',
    'assets/vendor/bootstrap/js/modal.js',
    'assets/vendor/bootstrap/js/tooltip.js',
    'assets/vendor/bootstrap/js/popover.js',
    'assets/vendor/bootstrap/js/scrollspy.js',
    'assets/vendor/bootstrap/js/tab.js',
    'assets/vendor/bootstrap/js/affix.js',
    'assets/vendor/sciserver/js/*.js',
    'assets/js/plugins/*.js',
    'assets/js/_*.js'
  ];

  grunt.initConfig({
    jshint: {
      options: {
        jshintrc: '.jshintrc'
      },
      all: [
        'Gruntfile.js',
        'assets/js/*.js',
        '!assets/js/scripts.js',
        '!assets/*/*.min.*'
      ]
    },
    less: {
      dev: {
        files: {
          'assets/css/main.css': [
            'assets/less/main.less'
          ]
        },
        options: {
          compress: false,
          // LESS source map
          // To enable, set sourceMap to true and update sourceMapRootpath based on your install
          sourceMap: true,
          sourceMapFilename: 'assets/css/main.css.map',
          sourceMapRootpath: '/app/themes/roots/'
        }
      },
      build: {
        files: {
          'assets/css/main.min.css': [
            'assets/less/main.less'
          ]
        },
        options: {
          compress: true
        }
      }
    },
    concat: {
      options: {
        separator: ';',
      },
      dist: {
        src: [jsFileList],
        dest: 'assets/js/scripts.js',
      },
    },
    uglify: {
      dist: {
        files: {
          'assets/js/scripts.min.js': [jsFileList]
        }
      }
    },
    autoprefixer: {
      options: {
        browsers: ['last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4', 'opera 12']
      },
      dev: {
        options: {
          map: {
            prev: 'assets/css/'
          }
        },
        src: 'assets/css/main.css'
      },
      build: {
        src: 'assets/css/main.min.css'
      }
    },
    modernizr: {
      build: {
        devFile: 'assets/vendor/modernizr/modernizr.js',
        outputFile: 'assets/js/vendor/modernizr.min.js',
        files: {
          'src': [
            ['assets/js/scripts.min.js'],
            ['assets/css/main.min.css']
          ]
        },
        extra: {
          shiv: false
        },
        uglify: true,
        parseFiles: true
      }
    },
    version: {
      default: {
        options: {
          format: true,
          length: 32,
          manifest: 'assets/manifest.json',
          querystring: {
            style: 'roots_css',
            script: 'roots_js'
          }
        },
        files: {
          'lib/scripts.php': 'assets/{css,js}/{main,scripts}.min.{css,js}'
        }
      }
    },
    watch: {
      less: {
        files: [
          'assets/less/*.less',
          'assets/less/**/*.less'
        ],
        tasks: ['less:dev', 'autoprefixer:dev']
      },
      js: {
        files: [
          jsFileList,
          '<%= jshint.all %>'
        ],
        tasks: ['jshint', 'concat']
      },
      livereload: {
        // Browser live reloading
        // https://github.com/gruntjs/grunt-contrib-watch#live-reloading
        options: {
          livereload: false
        },
        files: [
          'assets/css/main.css',
          'assets/js/scripts.js',
          'templates/*.php',
          '*.php'
        ]
      }
    }
  });

  // Register tasks
  grunt.registerTask('default', [
    'dev'
  ]);
  grunt.registerTask('dev', [
    'jshint',
    'less:dev',
    'autoprefixer:dev',
    'concat'
  ]);
  grunt.registerTask('build', [
    'jshint',
    'less:build',
    'autoprefixer:build',
    'uglify',
    'modernizr',
    'version'
  ]);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
    // Configuration.
    grunt.initConfig({
        jscs: {
            options: {
                config: '.jscsrc'
            },
            grunt: 'Gruntfile.js',
            tasks: 'tasks/**/*.js',
            test: 'test/**/*.js'
        },
        jshint: {
            options: {
                jshintrc: true
            },
            grunt: 'Gruntfile.js',
            tasks: 'tasks/**/*.js',
            test: 'test/**/*.js'
        },
        jsonlint: {
            jscs: '.jscsrc',
            jshint: '.jshintrc',
            npm: 'package.json',
            test: 'test/**/*.json'
        },
        nodeunit: {
            all: 'test/**/*.js'
        },
        'npm-validate': {
            options: {
                strict: true
            }
        }
    });

    // Load tasks.
    grunt.loadTasks('./tasks');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-nodeunit');
    grunt.loadNpmTasks('grunt-jscs-checker');
    grunt.loadNpmTasks('grunt-jsonlint');
    grunt.loadNpmTasks('grunt-release');

    // Register tasks.
    grunt.renameTask('release', 'bump');
    grunt.registerTask('lint', ['jsonlint', 'jshint', 'jscs']);
    grunt.registerTask('release', function() {
        var bump = Array.prototype.concat.apply('bump', arguments).join(':');
        grunt.task.run('lint', 'test', 'validate', bump);
    });
    grunt.registerTask('test', ['nodeunit']);
    grunt.registerTask('validate', ['npm-validate']);
    grunt.registerTask('default', ['lint', 'test', 'validate']);
};
<commit_msg>Add a comment.<commit_after>'use strict';

module.exports = function(grunt) {
    // Configuration.
    grunt.initConfig({
        jscs: {
            options: {
                config: '.jscsrc'
            },
            grunt: 'Gruntfile.js',
            tasks: 'tasks/**/*.js',
            test: 'test/**/*.js'
        },
        jshint: {
            options: {
                jshintrc: true
            },
            grunt: 'Gruntfile.js',
            tasks: 'tasks/**/*.js',
            test: 'test/**/*.js'
        },
        jsonlint: {
            jscs: '.jscsrc',
            jshint: '.jshintrc',
            npm: 'package.json',
            test: 'test/**/*.json'
        },
        nodeunit: {
            all: 'test/**/*.js'
        },
        'npm-validate': {
            options: {
                strict: true
            }
        }
    });

    // Load tasks.
    grunt.loadTasks('./tasks');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-nodeunit');
    grunt.loadNpmTasks('grunt-jscs-checker');
    grunt.loadNpmTasks('grunt-jsonlint');
    grunt.loadNpmTasks('grunt-release');

    // Register tasks.
    grunt.renameTask('release', 'bump');
    grunt.registerTask('lint', ['jsonlint', 'jshint', 'jscs']);
    grunt.registerTask('release', function() {
        // Pass targets to the `grunt-release` task.
        var bump = Array.prototype.concat.apply('bump', arguments).join(':');
        grunt.task.run('lint', 'test', 'validate', bump);
    });
    grunt.registerTask('test', ['nodeunit']);
    grunt.registerTask('validate', ['npm-validate']);
    grunt.registerTask('default', ['lint', 'test', 'validate']);
};
<|endoftext|>


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

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

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

    config: {
      sources: 'lib',
      tests: 'test',
      dist: 'dist',
      fonts: 'bower_components/font-awesome',
      samples: 'example'
    },

    release: {
      options: {
        tagName: 'v<%= version %>',
        commitMessage: 'chore(project): release v<%= version %>',
        tagMessage: 'chore(project): tag v<%= version %>'
      }
    },

    eslint: {
      check: {
        src: [
          '{lib,test}/**/*.js'
        ]
      },
      fix: {
        src: [
          '{lib,test}/**/*.js'
        ],
        options: {
          fix: true
        }
      }
    },

    karma: {
      options: {
        configFile: '<%= config.tests %>/config/karma.unit.js'
      },
      single: {
        singleRun: true,
        autoWatch: false
      },
      unit: { }
    }
  });

  // tasks

  grunt.registerTask('test', [ 'karma:single' ]);

  grunt.registerTask('auto-test', [ 'karma:unit' ]);

  grunt.registerTask('default', [ 'eslint:check', 'test' ]);
};
<commit_msg>chore(grunt): remove unused config<commit_after>module.exports = function(grunt) {

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

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

    release: {
      options: {
        tagName: 'v<%= version %>',
        commitMessage: 'chore(project): release v<%= version %>',
        tagMessage: 'chore(project): tag v<%= version %>'
      }
    },

    eslint: {
      check: {
        src: [
          '{lib,test}/**/*.js'
        ]
      },
      fix: {
        src: [
          '{lib,test}/**/*.js'
        ],
        options: {
          fix: true
        }
      }
    },

    karma: {
      options: {
        configFile: 'test/config/karma.unit.js'
      },
      single: {
        singleRun: true,
        autoWatch: false
      },
      unit: { }
    }
  });

  // tasks

  grunt.registerTask('test', [ 'karma:single' ]);

  grunt.registerTask('auto-test', [ 'karma:unit' ]);

  grunt.registerTask('default', [ 'eslint:check', 'test' ]);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt);

    grunt.initConfig({
        concat: {
            all: {
                src: [
                    'src/module.js',
                    'src/*/**/*.js'
                ],
                dest: 'build/ng-drag.js'
            }
        },
        uglify: {
            drag: {
                files: {
                    'build/ng-drag.min.js': ['build/ng-drag.js']
                }
            }
        },
        ngAnnotate: {
            survey: {
                files: { 'build/ng-drag.js': ['build/ng-drag.js'] }
            }
        },
        watch: {
            all: {
                files: ['src/**/*.js'],
                tasks: ['build'],
                options: { spawn: false }
            }
        },
        ngdocs: {
          options: {
            dest: 'docs'
          },
          ngdrag: {
            src: ['src/**/*.js'],
            title: 'ngDrag'
          }
        }
    });

    grunt.registerTask('build', [
        'concat',
        'ngAnnotate',
        'uglify',
    ]);

    grunt.registerTask('default', 'build');
};
<commit_msg>Update tasks to generate docs on watch<commit_after>module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt);

    grunt.initConfig({
        concat: {
            all: {
                src: [
                    'src/module.js',
                    'src/*/**/*.js'
                ],
                dest: 'build/ng-drag.js'
            }
        },
        uglify: {
            drag: {
                files: {
                    'build/ng-drag.min.js': ['build/ng-drag.js']
                }
            }
        },
        ngAnnotate: {
            survey: {
                files: { 'build/ng-drag.js': ['build/ng-drag.js'] }
            }
        },
        watch: {
            all: {
                files: ['src/**/*.js'],
                tasks: [
                  'build',
                  'docs'
                ],
                options: { spawn: false }
            }
        },
        ngdocs: {
          options: {
            dest: 'docs'
          },
          ngdrag: {
            src: ['src/**/*.js'],
            title: 'ngDrag'
          }
        }
    });

    grunt.registerTask('build', [
        'concat',
        'ngAnnotate',
        'uglify',
    ]);

    grunt.registerTask('default', 'build');

    grunt.registerTask('docs', [
      'ngdocs'
    ]);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
    var pkg = grunt.file.readJSON('package.json');

    require('jit-grunt')(grunt);

    grunt.initConfig({
        pkg: pkg,
        bower: {
            all: {
                rjsConfig: 'test/rjsconfig.js',
                options: {
                    baseUrl: 'test'
                }
            }
        },
        bump: {
            options: {
                files: ['package.json', 'bower.json'],
                updateConfigs: ['pkg'],
                commit: true,
                commitMessage: '%VERSION%',
                commitFiles: ['package.json', 'bower.json'], // '-a' for all files
                createTag: true,
                tagName: 'v%VERSION%',
                tagMessage: '%VERSION%',
                push: false,
                pushTo: 'upstream',
                gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
            }
        },
        connect: {
            server: {
                options: {
                    port: 9001,
                    base: '.',
                    keepalive: true
                }
            }
        },
        jshint: {
            files: [
                'lib/**/*.js'
            ],
            options: {
                jshintrc: '.jshintrc'
            }
        },
        mocha: {
            browser: {
                src: ['test/test-browser.html'],
                options: {
                    run: true
                }
            },
            amd: {
                src: ['test/test-amd.html'],
                options: {
                    run: false
                }
            }
        },
        mochaTest: {
            unit: {
                options: {
                    ui: 'tdd',
                    reporter: 'dot'
                },
                src: ['test/**/*_test.js']
            },
            coverage: {
                options: {
                    ui: 'tdd',
                    reporter: 'mocha-lcov-reporter',
                    require: 'coverage/blanket',
                    quiet: true,
                    captureFile: 'coverage.lcov'
                },
                src: ['test/**/*_test.js']
            }
        },
        watch: {
            unit: {
                files: ['test/**/*.js', 'lib/**/*.js'],
                tasks: ['unit']
            }
        }
    });

    grunt.registerTask('unit', ['jshint', 'mochaTest:unit']);
    grunt.registerTask('test', ['jshint', 'mochaTest:unit', 'mocha:browser', 'mocha:amd']);
    grunt.registerTask('coverage', ['mochaTest:coverage']);
};
<commit_msg>Add grunt-bower-requirejs mapping to jit-grunt<commit_after>module.exports = function(grunt) {
    var pkg = grunt.file.readJSON('package.json');

    require('jit-grunt')(grunt, {
        bower: 'grunt-bower-requirejs'
    });

    grunt.initConfig({
        pkg: pkg,
        bower: {
            all: {
                rjsConfig: 'test/rjsconfig.js',
                options: {
                    baseUrl: 'test'
                }
            }
        },
        bump: {
            options: {
                files: ['package.json', 'bower.json'],
                updateConfigs: ['pkg'],
                commit: true,
                commitMessage: '%VERSION%',
                commitFiles: ['package.json', 'bower.json'], // '-a' for all files
                createTag: true,
                tagName: 'v%VERSION%',
                tagMessage: '%VERSION%',
                push: false,
                pushTo: 'upstream',
                gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
            }
        },
        connect: {
            server: {
                options: {
                    port: 9001,
                    base: '.',
                    keepalive: true
                }
            }
        },
        jshint: {
            files: [
                'lib/**/*.js'
            ],
            options: {
                jshintrc: '.jshintrc'
            }
        },
        mocha: {
            browser: {
                src: ['test/test-browser.html'],
                options: {
                    run: true
                }
            },
            amd: {
                src: ['test/test-amd.html'],
                options: {
                    run: false
                }
            }
        },
        mochaTest: {
            unit: {
                options: {
                    ui: 'tdd',
                    reporter: 'dot'
                },
                src: ['test/**/*_test.js']
            },
            coverage: {
                options: {
                    ui: 'tdd',
                    reporter: 'mocha-lcov-reporter',
                    require: 'coverage/blanket',
                    quiet: true,
                    captureFile: 'coverage.lcov'
                },
                src: ['test/**/*_test.js']
            }
        },
        watch: {
            unit: {
                files: ['test/**/*.js', 'lib/**/*.js'],
                tasks: ['unit']
            }
        }
    });

    grunt.registerTask('unit', ['jshint', 'mochaTest:unit']);
    grunt.registerTask('test', ['jshint', 'mochaTest:unit', 'mocha:browser', 'mocha:amd']);
    grunt.registerTask('coverage', ['mochaTest:coverage']);
};
<|endoftext|>


<commit_before>(function() {
	'use strict';

	module.exports = function(grunt) {
		require('jit-grunt')(grunt);
		require('time-grunt')(grunt);

		// Project settings
		var options = {
			config: {
				src: "grunt/configs/*.js"
			},
			paths: {
				src: 'sources',
				dev: 'dev',
				dist: 'dist',
				tmp: 'tmp',
				helper: 'grunt/configs'
			},
			ports: {
				app: '8000',
				test: '9001',
				livereload: 35730
			}
		};

		grunt._rbOptions = options;

		var configs = require('load-grunt-configs')(grunt, options);
		grunt.initConfig(configs);

		grunt.task.loadTasks('grunt/tasks');

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

		grunt.registerTask('svg', [
			'svgmin:svgLogo',
			'svgstore:svgLogo'
		]);

		// Build task
		grunt.registerTask('build', [
			'dev',
			'connect:livereload',
			'watch'
		]);

		grunt.registerTask('dev', [
			'clean:dev',
			//'svg',
			'generate-tmp-styles-scss',
			'concurrent:dev2',
			'handlebars:dev',
			'browserify',
			'autoprefixer:dev',
			'sync',
			'prettify:dev',
			'clean:tmp',
		]);

		grunt.registerTask('dist', [
			'clean:dist',
			'generate-tmp-styles-scss',
			'sass:dist',
			'assemble:dist',
			'autoprefixer:dist',
			'cssmin',
			'copy:favicon',
			'handlebars:dist',
			'browserify',
			'copy:fonts',
			'prettify:dist',
			'clean:tmp'
		]);

	};

})();
<commit_msg>updated gruntfile<commit_after>(function() {
	'use strict';

	module.exports = function(grunt) {
		require('jit-grunt')(grunt);
		require('time-grunt')(grunt);

		// Project settings
		var options = {
			config: {
				src: "grunt/configs/*.js"
			},
			paths: {
				src: 'sources',
				dev: 'dev',
				dist: 'dist',
				tmp: 'tmp',
				helper: 'grunt/configs'
			},
			ports: {
				app: '8000',
				test: '9001',
				livereload: 35730
			}
		};

		grunt._rbOptions = options;

		var configs = require('load-grunt-configs')(grunt, options);
		grunt.initConfig(configs);

		grunt.task.loadTasks('grunt/tasks');

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

		grunt.registerTask('svg', [
			'svgmin:svgLogo',
			'svgstore:svgLogo'
		]);

		// Build task
		grunt.registerTask('build', [
			'dev',
			'connect:livereload',
			'watch'
		]);

		grunt.registerTask('dev', [
			'clean:dev',
			'clean:tmp',
			//'svg',
			'generate-tmp-styles-scss',
			'concurrent:dev2',
			'handlebars:dev',
			'browserify',
			'autoprefixer:dev',
			'sync',
			'prettify:dev',
		]);

		grunt.registerTask('dist', [
			'clean:dist',
			'clean:tmp',
			'generate-tmp-styles-scss',
			'sass:dist',
			'assemble:dist',
			'autoprefixer:dist',
			'cssmin',
			'copy:favicon',
			'handlebars:dist',
			'browserify',
			'copy:fonts',
			'prettify:dist',

		]);

	};

})();
<|endoftext|>


<commit_before>/* eslint-env node */

var path = require( "path" );
var fs = require( "fs-extra" );
var semver = require( "semver" );

var instrumentedDir = "build/instrumented";
var reportDir = "build/report";

var HAS_ASYNC_FUNCTIONS = semver.satisfies( process.version, ">= 7.10" );

// Detect Travis CI or Jenkins.
var isCI = process.env.CI || process.env.JENKINS_HOME;

module.exports = function( grunt ) {
	var livereloadPort = grunt.option( "livereload-port" ) || 35729;

	// Load grunt tasks from NPM packages
	require( "load-grunt-tasks" )( grunt );

	function preprocess( code ) {
		return code

		// Embed version
			.replace( /@VERSION/g, grunt.config( "pkg" ).version )

		// Embed date (yyyy-mm-ddThh:mmZ)
			.replace( /@DATE/g, ( new Date() ).toISOString().replace( /:\d+\.\d+Z$/, "Z" ) );
	}

	grunt.initConfig( {
		pkg: grunt.file.readJSON( "package.json" ),
		connect: {
			nolivereload: {
				options: {
					port: 8000,
					base: "."
				}
			},
			livereload: {
				options: {
					port: 8000,
					base: ".",
					livereload: livereloadPort
				}
			}
		},
		copy: {
			options: { process: preprocess },

			"src-js": {
				src: "dist/qunit.js",
				dest: "dist/qunit.js"
			},
			"src-css": {
				src: "src/qunit.css",
				dest: "dist/qunit.css"
			},

			// Moves files around during coverage runs
			"dist-to-tmp": {
				src: "dist/qunit.js",
				dest: "dist/qunit.tmp.js"
			},
			"instrumented-to-dist": {
				src: "build/instrumented/dist/qunit.js",
				dest: "dist/qunit.js"
			},
			"tmp-to-dist": {
				src: "dist/qunit.tmp.js",
				dest: "dist/qunit.js"
			}
		},
		rollup: {
			options: require( "./rollup.config" ),
			src: {
				src: "src/qunit.js",
				dest: "dist/qunit.js"
			}
		},
		eslint: {
			options: {
				config: ".eslintrc.json"
			},
			js: [
				"*.js",
				"bin/qunit",
				"bin/**/*.js",
				"reporter/**/*.js",
				"runner/**/*.js",
				"src/**/*.js",

				"test/**/*.js",
				"build/*.js",
				"build/tasks/**/*.js"
			],
			html: {
				options: {
					rules: {
						indent: "off"
					}
				},
				src: [

					// Linting HTML files via eslint-plugin-html
					"test/**/*.html"
				]
			}
		},
		search: {
			options: {

				// Ensure that the only HTML entities used are those with a special status in XHTML
				// and that any common singleton/empty HTML elements end with the XHTML-compliant
				// "/>"rather than ">"
				searchString: /(&(?!gt|lt|amp|quot)[A-Za-z0-9]+;|<(?:hr|HR|br|BR|input|INPUT)(?![^>]*\/>)(?:\s+[^>]*)?>)/g, // eslint-disable-line max-len
				logFormat: "console",
				failOnMatch: true
			},
			xhtml: [
				"src/**/*.js",
				"reporter/**/*.js"
			]
		},
		qunit: {
			all: {
				options: {
					timeout: 30000,
					puppeteer: !isCI ? {} : {
						args: [

							// https://docs.travis-ci.com/user/chrome#sandboxing
							"--no-sandbox"
						]
					},
					inject: [
						path.resolve( "./build/coverage-bridge.js" ),
						require.resolve( "grunt-contrib-qunit/chrome/bridge" )
					],
					urls: [
						"test/sandboxed-iframe.html",
						"test/index.html",
						"test/autostart.html",
						"test/startError.html",
						"test/reorder.html",
						"test/reorderError1.html",
						"test/reorderError2.html",
						"test/callbacks.html",
						"test/callbacks-promises.html",
						"test/events.html",
						"test/events-in-test.html",
						"test/logs.html",
						"test/setTimeout.html",
						"test/amd.html",
						"test/reporter-html/legacy-markup.html",
						"test/reporter-html/no-qunit-element.html",
						"test/reporter-html/single-testid.html",
						"test/reporter-html/window-onerror.html",
						"test/reporter-html/window-onerror-preexisting-handler.html",
						"test/reporter-html/xhtml-single-testid.xhtml",
						"test/reporter-urlparams.html",
						"test/moduleId.html",
						"test/onerror/inside-test.html",
						"test/onerror/outside-test.html",
						"test/only.html",
						"test/seed.html",
						"test/overload.html",
						"test/preconfigured.html",
						"test/regex-filter.html",
						"test/regex-exclude-filter.html",
						"test/string-filter.html",
						"test/module-only.html",
						"test/module-skip.html",
						"test/module-todo.html"
					].map( file => `http://localhost:8000/${file}` )
				}
			}
		},
		"test-on-node": {
			files: [
				"test/logs",
				"test/main/test",
				"test/main/assert",
				"test/main/assert/step",
				"test/main/assert/timeout",
				"test/main/async",
				"test/main/promise",
				"test/main/modules",
				"test/main/deepEqual",
				"test/main/stack",
				"test/main/utilities",
				"test/events",
				"test/events-in-test",
				"test/onerror/inside-test",
				"test/onerror/outside-test",
				"test/only",
				"test/setTimeout",
				"test/main/dump",
				"test/node/storage-1",
				"test/node/storage-2",
				"test/module-only",
				"test/module-skip",
				"test/module-todo",
				HAS_ASYNC_FUNCTIONS ? "test/es2017/async-functions" : null
			].filter( Boolean )
		},
		"watch-repeatable": {
			options: {
				atBegin: true,
				spawn: false,
				interrupt: true
			},
			files: [
				".eslintrc.json",
				"*.js",
				"build/*.js",
				"{src,test,reporter}/**/*.js",
				"src/qunit.css",
				"test/*.{html,js}",
				"test/**/*.html"
			],
			tasks: [ "build", "livereload", "test-in-watch" ]
		},

		livereload: {
			options: {
				port: livereloadPort
			}
		},

		instrument: {
			files: "dist/qunit.js",
			options: {
				lazy: false,
				basePath: instrumentedDir
			}
		},

		storeCoverage: {
			options: {
				dir: reportDir
			}
		},

		makeReport: {
			src: reportDir + "/**/*.json",
			options: {
				type: [ "lcov" ],
				dir: reportDir,
				print: "detail"
			}
		},

		coveralls: {
			options: {
				force: true
			},
			all: {

				// LCOV coverage file relevant to every target
				src: "build/report/lcov.info"
			}
		}
	} );

	grunt.event.on( "qunit.coverage", function( file, coverage ) {
		var testName = file.split( "/test/" ).pop().replace( ".html", "" );
		var reportPath = path.join( "build/report/phantom", testName + ".json" );

		fs.ensureFileSync( reportPath );
		fs.writeJsonSync( reportPath, coverage, { spaces: 0 } );
	} );

	grunt.loadTasks( "build/tasks" );
	grunt.registerTask( "build", [ "rollup:src", "copy:src-js", "copy:src-css" ] );
	grunt.registerTask( "test-base", [ "eslint", "search", "test-on-node" ] );
	grunt.registerTask( "test", [ "test-base", "connect:nolivereload", "qunit" ] );
	grunt.registerTask( "test-in-watch", [ "test-base", "qunit" ] );
	grunt.registerTask( "coverage", [
		"build",
		"instrument",
		"copy:dist-to-tmp",
		"copy:instrumented-to-dist",
		"test",
		"copy:tmp-to-dist",
		"storeCoverage",
		"makeReport",
		"coveralls"
	] );

	// Start the web server in a watch pre-task
	// https://github.com/gruntjs/grunt-contrib-watch/issues/50
	grunt.renameTask( "watch", "watch-repeatable" );
	grunt.registerTask( "watch", [ "connect:livereload", "watch-repeatable" ] );

	grunt.registerTask( "default", [ "build", "test" ] );

};
<commit_msg>Build: Add --connect-port for Gruntfile to override 8000<commit_after>/* eslint-env node */

var path = require( "path" );
var fs = require( "fs-extra" );
var semver = require( "semver" );

var instrumentedDir = "build/instrumented";
var reportDir = "build/report";

var HAS_ASYNC_FUNCTIONS = semver.satisfies( process.version, ">= 7.10" );

// Detect Travis CI or Jenkins.
var isCI = process.env.CI || process.env.JENKINS_HOME;

module.exports = function( grunt ) {
	var livereloadPort = grunt.option( "livereload-port" ) || 35729;
	var connectPort = Number( grunt.option( "connect-port" ) ) || 8000;

	// Load grunt tasks from NPM packages
	require( "load-grunt-tasks" )( grunt );

	function preprocess( code ) {
		return code

		// Embed version
			.replace( /@VERSION/g, grunt.config( "pkg" ).version )

		// Embed date (yyyy-mm-ddThh:mmZ)
			.replace( /@DATE/g, ( new Date() ).toISOString().replace( /:\d+\.\d+Z$/, "Z" ) );
	}

	grunt.initConfig( {
		pkg: grunt.file.readJSON( "package.json" ),
		connect: {
			nolivereload: {
				options: {

					// grunt-contrib-connect supports 'useAvailablePort' which
					// automatically finds a suitable port, but we need to know
					// it ahead of time to feed grunt-controb-qunit options.
					port: connectPort,
					base: "."
				}
			},
			livereload: {
				options: {
					port: connectPort,
					base: ".",
					livereload: livereloadPort
				}
			}
		},
		copy: {
			options: { process: preprocess },

			"src-js": {
				src: "dist/qunit.js",
				dest: "dist/qunit.js"
			},
			"src-css": {
				src: "src/qunit.css",
				dest: "dist/qunit.css"
			},

			// Moves files around during coverage runs
			"dist-to-tmp": {
				src: "dist/qunit.js",
				dest: "dist/qunit.tmp.js"
			},
			"instrumented-to-dist": {
				src: "build/instrumented/dist/qunit.js",
				dest: "dist/qunit.js"
			},
			"tmp-to-dist": {
				src: "dist/qunit.tmp.js",
				dest: "dist/qunit.js"
			}
		},
		rollup: {
			options: require( "./rollup.config" ),
			src: {
				src: "src/qunit.js",
				dest: "dist/qunit.js"
			}
		},
		eslint: {
			options: {
				config: ".eslintrc.json"
			},
			js: [
				"*.js",
				"bin/qunit",
				"bin/**/*.js",
				"reporter/**/*.js",
				"runner/**/*.js",
				"src/**/*.js",

				"test/**/*.js",
				"build/*.js",
				"build/tasks/**/*.js"
			],
			html: {
				options: {
					rules: {
						indent: "off"
					}
				},
				src: [

					// Linting HTML files via eslint-plugin-html
					"test/**/*.html"
				]
			}
		},
		search: {
			options: {

				// Ensure that the only HTML entities used are those with a special status in XHTML
				// and that any common singleton/empty HTML elements end with the XHTML-compliant
				// "/>"rather than ">"
				searchString: /(&(?!gt|lt|amp|quot)[A-Za-z0-9]+;|<(?:hr|HR|br|BR|input|INPUT)(?![^>]*\/>)(?:\s+[^>]*)?>)/g, // eslint-disable-line max-len
				logFormat: "console",
				failOnMatch: true
			},
			xhtml: [
				"src/**/*.js",
				"reporter/**/*.js"
			]
		},
		qunit: {
			all: {
				options: {
					timeout: 30000,
					puppeteer: !isCI ? {} : {
						args: [

							// https://docs.travis-ci.com/user/chrome#sandboxing
							"--no-sandbox"
						]
					},
					inject: [
						path.resolve( "./build/coverage-bridge.js" ),
						require.resolve( "grunt-contrib-qunit/chrome/bridge" )
					],
					urls: [
						"test/sandboxed-iframe.html",
						"test/index.html",
						"test/autostart.html",
						"test/startError.html",
						"test/reorder.html",
						"test/reorderError1.html",
						"test/reorderError2.html",
						"test/callbacks.html",
						"test/callbacks-promises.html",
						"test/events.html",
						"test/events-in-test.html",
						"test/logs.html",
						"test/setTimeout.html",
						"test/amd.html",
						"test/reporter-html/legacy-markup.html",
						"test/reporter-html/no-qunit-element.html",
						"test/reporter-html/single-testid.html",
						"test/reporter-html/window-onerror.html",
						"test/reporter-html/window-onerror-preexisting-handler.html",
						"test/reporter-html/xhtml-single-testid.xhtml",
						"test/reporter-urlparams.html",
						"test/moduleId.html",
						"test/onerror/inside-test.html",
						"test/onerror/outside-test.html",
						"test/only.html",
						"test/seed.html",
						"test/overload.html",
						"test/preconfigured.html",
						"test/regex-filter.html",
						"test/regex-exclude-filter.html",
						"test/string-filter.html",
						"test/module-only.html",
						"test/module-skip.html",
						"test/module-todo.html"
					].map( file => `http://localhost:${connectPort}/${file}` )
				}
			}
		},
		"test-on-node": {
			files: [
				"test/logs",
				"test/main/test",
				"test/main/assert",
				"test/main/assert/step",
				"test/main/assert/timeout",
				"test/main/async",
				"test/main/promise",
				"test/main/modules",
				"test/main/deepEqual",
				"test/main/stack",
				"test/main/utilities",
				"test/events",
				"test/events-in-test",
				"test/onerror/inside-test",
				"test/onerror/outside-test",
				"test/only",
				"test/setTimeout",
				"test/main/dump",
				"test/node/storage-1",
				"test/node/storage-2",
				"test/module-only",
				"test/module-skip",
				"test/module-todo",
				HAS_ASYNC_FUNCTIONS ? "test/es2017/async-functions" : null
			].filter( Boolean )
		},
		"watch-repeatable": {
			options: {
				atBegin: true,
				spawn: false,
				interrupt: true
			},
			files: [
				".eslintrc.json",
				"*.js",
				"build/*.js",
				"{src,test,reporter}/**/*.js",
				"src/qunit.css",
				"test/*.{html,js}",
				"test/**/*.html"
			],
			tasks: [ "build", "livereload", "test-in-watch" ]
		},

		livereload: {
			options: {
				port: livereloadPort
			}
		},

		instrument: {
			files: "dist/qunit.js",
			options: {
				lazy: false,
				basePath: instrumentedDir
			}
		},

		storeCoverage: {
			options: {
				dir: reportDir
			}
		},

		makeReport: {
			src: reportDir + "/**/*.json",
			options: {
				type: [ "lcov" ],
				dir: reportDir,
				print: "detail"
			}
		},

		coveralls: {
			options: {
				force: true
			},
			all: {

				// LCOV coverage file relevant to every target
				src: "build/report/lcov.info"
			}
		}
	} );

	grunt.event.on( "qunit.coverage", function( file, coverage ) {
		var testName = file.split( "/test/" ).pop().replace( ".html", "" );
		var reportPath = path.join( "build/report/phantom", testName + ".json" );

		fs.ensureFileSync( reportPath );
		fs.writeJsonSync( reportPath, coverage, { spaces: 0 } );
	} );

	grunt.loadTasks( "build/tasks" );
	grunt.registerTask( "build", [ "rollup:src", "copy:src-js", "copy:src-css" ] );
	grunt.registerTask( "test-base", [ "eslint", "search", "test-on-node" ] );
	grunt.registerTask( "test", [ "test-base", "connect:nolivereload", "qunit" ] );
	grunt.registerTask( "test-in-watch", [ "test-base", "qunit" ] );
	grunt.registerTask( "coverage", [
		"build",
		"instrument",
		"copy:dist-to-tmp",
		"copy:instrumented-to-dist",
		"test",
		"copy:tmp-to-dist",
		"storeCoverage",
		"makeReport",
		"coveralls"
	] );

	// Start the web server in a watch pre-task
	// https://github.com/gruntjs/grunt-contrib-watch/issues/50
	grunt.renameTask( "watch", "watch-repeatable" );
	grunt.registerTask( "watch", [ "connect:livereload", "watch-repeatable" ] );

	grunt.registerTask( "default", [ "build", "test" ] );

};
<|endoftext|>


<commit_before>// Generated on 2013-03-05 using generator-webapp 0.1.5
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {
    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var yeomanConfig = {
        app: 'app',
        dist: 'dist'
    };

    grunt.initConfig({
        yeoman: yeomanConfig,
        watch: {
            coffee: {
                files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
                tasks: ['coffee:dist']
            },
            coffeeTest: {
                files: ['test/spec/{,*/}*.coffee'],
                tasks: ['coffee:test']
            },
            compass: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass']
            },
            livereload: {
                files: [
                    '<%= yeoman.app %>/*.html',
                    '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
                    '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,webp}'
                ],
                tasks: ['livereload']
            }
        },
        connect: {
            options: {
                port: 9000,
                // change this to '0.0.0.0' to access the server from outside
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            lrSnippet,
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'app')
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            },
            dist: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, 'dist')
                        ];
                    }
                }
            }
        },
        open: {
            server: {
                path: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: ['.tmp', '<%= yeoman.dist %>/*'],
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= yeoman.app %>/scripts/{,*/}*.js',
                '!<%= yeoman.app %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://localhost:<%= connect.options.port %>/index.html']
                }
            }
        },
        coffee: {
            dist: {
                files: [{
                    // rather than compiling multiple files here you should
                    // require them into your main .coffee file
                    expand: true,
                    cwd: '<%= yeoman.app %>/scripts',
                    src: '*.coffee',
                    dest: '.tmp/scripts',
                    ext: '.js'
                }]
            },
            test: {
                files: [{
                    expand: true,
                    cwd: '.tmp/spec',
                    src: '*.coffee',
                    dest: 'test/spec'
                }]
            }
        },
        compass: {
            options: {
                sassDir: '<%= yeoman.app %>/styles',
                cssDir: '.tmp/styles',
                imagesDir: '<%= yeoman.app %>/images',
                javascriptsDir: '<%= yeoman.app %>/scripts',
                fontsDir: '<%= yeoman.app %>/styles/fonts',
                importPath: 'app/components',
                relativeAssets: true
            },
            dist: {},
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        concat: {
            dist: {
                files: {
                    'app/components/qTip2/dist/jquery.qtip.js': [
                        'app/components/qTip2/src/intro.js',
                        'app/components/qTip2/src/core.js',
                        'app/components/qTip2/src/tips/tips.js',
                        'app/components/qTip2/src/viewport/viewport.js',
                        'app/components/qTip2/src/outro.js'
                    ],
                    'app/components/qTip2/src/_core.scss': 'app/components/qTip2/src/core.css',
                    'app/components/qTip2/src/_css3.scss': 'app/components/qTip2/src/css3.css',
                    'app/components/qTip2/src/tips/_tips.scss': 'app/components/qTip2/src/tips/tips.css',
                    'app/components/select2/_select2.scss': 'app/components/select2/select2.css'
                }
            }
        },
        requirejs: {
            dist: {
                // Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js
                options: {
                    // `name` and `out` is set by grunt-usemin
                    baseUrl: 'app/scripts',
                    optimize: 'none',
                    // TODO: Figure out how to make sourcemaps work with grunt-usemin
                    // https://github.com/yeoman/grunt-usemin/issues/30
                    //generateSourceMaps: true,
                    // required to support SourceMaps
                    // http://requirejs.org/docs/errors.html#sourcemapcomments
                    preserveLicenseComments: false,
                    useStrict: true,
                    wrap: true,
                    //uglify2: {} // https://github.com/mishoo/UglifyJS2
                    paths: {
                        timetable_data: "empty:"
                    }
                }
            }
        },
        useminPrepare: {
            html: '<%= yeoman.app %>/index.html',
            options: {
                dest: '<%= yeoman.dist %>'
            }
        },
        usemin: {
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
            options: {
                dirs: ['<%= yeoman.dist %>']
            }
        },
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/exports.css': '.tmp/styles/exports.css',
                    '<%= yeoman.dist %>/styles/main.css': '.tmp/styles/main.css'
                }
            }
        },
        htmlmin: {
            dist: {
                options: {
                    /*removeCommentsFromCDATA: true,
                    // https://github.com/yeoman/grunt-usemin/issues/44
                    //collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeAttributeQuotes: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: '*.html',
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.*',
                        '.htaccess',
                        'font/*',
                        'media/*',
                        'json/*',
                        'scripts/nus_timetable_data.js',
                        'snappy/**',
                        'styles/*.{gif,png}'
                    ]
                }]
            }
        },
        bower: {
            all: {
                rjsConfig: '<%= yeoman.app %>/scripts/main.js'
            }
        },
        crawlNTU: {
            academicYear: 2012,
            cachePath: 'cache',
            dest: 'app/json/ntu_module_info.json',
            maxCacheAge: 24 * 60 * 60, // in seconds
            maxConcurrentFiles: 64,
            maxConcurrentSockets: 8,
            refresh: false,
            semester: 2
        },
        crawlNUS: {
            academicYear: 2012,
            cachePath: 'cache',
            dest: 'app/json/nus_module_info.json',
            maxCacheAge: 24 * 60 * 60, // in seconds
            maxConcurrentFiles: 64,
            maxConcurrentSockets: 8,
            refresh: false,
            semester: 2
        },
        download: {
            ntu: {
                options: {
                    dest: 'app/json/ntu_module_info.json',
                    src: 'http://nusmods.com/json/ntu_module_info.json'
                }
            },
            nus: {
                options: {
                    dest: 'app/json/nus_module_info.json',
                    src: 'http://nusmods.com/json/nus_module_info.json'
                }
            }
        },
        jsifyNTU: {
            destModuleFinder: 'app/scripts/ntu_module_data.js',
            destTimetable: 'app/scripts/ntu_timetable_data.js',
            src: 'app/json/ntu_module_info.json'
        },
        jsifyNUS: {
            destModuleFinder: 'app/scripts/nus_module_data.js',
            destTimetable: 'app/scripts/nus_timetable_data.js',
            src: 'app/json/nus_module_info.json'
        }
    });

    grunt.loadTasks('tasks');

    grunt.renameTask('regarde', 'watch');

    grunt.registerTask('server', function (target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'open', 'connect:dist:keepalive']);
        }

        grunt.task.run([
            'clean:server',
            'coffee:dist',
            'concat',
            'compass:server',
            'livereload-start',
            'connect:livereload',
            'open',
            'watch'
        ]);
    });

    grunt.registerTask('test', [
        'clean:server',
        'coffee',
        'concat',
        'compass',
        'connect:test',
        'mocha'
    ]);

    grunt.registerTask('build', [
        'clean:dist',
        'coffee',
        'concat',
        'compass:dist',
        'useminPrepare',
        'requirejs',
        'imagemin',
        'htmlmin',
        'concat',
        'cssmin',
        'uglify',
        'copy',
        'usemin'
    ]);

    grunt.registerTask('default', [
        // 'jshint',
        // 'test',
        'build'
    ]);
};
<commit_msg>Update concat task for generating jquery.qtip.js<commit_after>// Generated on 2013-03-05 using generator-webapp 0.1.5
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
    return connect.static(require('path').resolve(dir));
};

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {
    // load all grunt tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    // configurable paths
    var yeomanConfig = {
        app: 'app',
        dist: 'dist'
    };

    grunt.initConfig({
        yeoman: yeomanConfig,
        watch: {
            coffee: {
                files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
                tasks: ['coffee:dist']
            },
            coffeeTest: {
                files: ['test/spec/{,*/}*.coffee'],
                tasks: ['coffee:test']
            },
            compass: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass']
            },
            livereload: {
                files: [
                    '<%= yeoman.app %>/*.html',
                    '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
                    '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,webp}'
                ],
                tasks: ['livereload']
            }
        },
        connect: {
            options: {
                port: 9000,
                // change this to '0.0.0.0' to access the server from outside
                hostname: 'localhost'
            },
            livereload: {
                options: {
                    middleware: function (connect) {
                        return [
                            lrSnippet,
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'app')
                        ];
                    }
                }
            },
            test: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '.tmp'),
                            mountFolder(connect, 'test')
                        ];
                    }
                }
            },
            dist: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, 'dist')
                        ];
                    }
                }
            }
        },
        open: {
            server: {
                path: 'http://localhost:<%= connect.options.port %>'
            }
        },
        clean: {
            dist: ['.tmp', '<%= yeoman.dist %>/*'],
            server: '.tmp'
        },
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                '<%= yeoman.app %>/scripts/{,*/}*.js',
                '!<%= yeoman.app %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://localhost:<%= connect.options.port %>/index.html']
                }
            }
        },
        coffee: {
            dist: {
                files: [{
                    // rather than compiling multiple files here you should
                    // require them into your main .coffee file
                    expand: true,
                    cwd: '<%= yeoman.app %>/scripts',
                    src: '*.coffee',
                    dest: '.tmp/scripts',
                    ext: '.js'
                }]
            },
            test: {
                files: [{
                    expand: true,
                    cwd: '.tmp/spec',
                    src: '*.coffee',
                    dest: 'test/spec'
                }]
            }
        },
        compass: {
            options: {
                sassDir: '<%= yeoman.app %>/styles',
                cssDir: '.tmp/styles',
                imagesDir: '<%= yeoman.app %>/images',
                javascriptsDir: '<%= yeoman.app %>/scripts',
                fontsDir: '<%= yeoman.app %>/styles/fonts',
                importPath: 'app/components',
                relativeAssets: true
            },
            dist: {},
            server: {
                options: {
                    debugInfo: true
                }
            }
        },
        concat: {
            dist: {
                files: {
                    'app/components/qTip2/dist/jquery.qtip.js': [
                        'app/components/qTip2/src/core/intro.js',
                        'app/components/qTip2/src/core/constants.js',
                        'app/components/qTip2/src/core/class.js',

                        'app/components/qTip2/src/core/options.js',
                        'app/components/qTip2/src/core/content.js',
                        'app/components/qTip2/src/core/position.js',
                        'app/components/qTip2/src/core/toggle.js',
                        'app/components/qTip2/src/core/focus.js',
                        'app/components/qTip2/src/core/disable.js',
                        'app/components/qTip2/src/core/button.js',
                        'app/components/qTip2/src/core/style.js',
                        'app/components/qTip2/src/core/events.js',

                        'app/components/qTip2/src/core/jquery_methods.js',
                        'app/components/qTip2/src/core/jquery_overrides.js',

                        'app/components/qTip2/src/core/defaults.js',

                        'app/components/qTip2/src/tips/tips.js',
                        'app/components/qTip2/src/viewport/viewport.js',

                        'app/components/qTip2/src/core/outro.js',

                        'app/components/imagesloaded/jquery.imagesloaded.js'
                    ],
                    'app/components/qTip2/src/_core.scss': 'app/components/qTip2/src/core.css',
                    'app/components/qTip2/src/_css3.scss': 'app/components/qTip2/src/css3.css',
                    'app/components/qTip2/src/tips/_tips.scss': 'app/components/qTip2/src/tips/tips.css',
                    'app/components/select2/_select2.scss': 'app/components/select2/select2.css'
                }
            }
        },
        requirejs: {
            dist: {
                // Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js
                options: {
                    // `name` and `out` is set by grunt-usemin
                    baseUrl: 'app/scripts',
                    optimize: 'none',
                    // TODO: Figure out how to make sourcemaps work with grunt-usemin
                    // https://github.com/yeoman/grunt-usemin/issues/30
                    //generateSourceMaps: true,
                    // required to support SourceMaps
                    // http://requirejs.org/docs/errors.html#sourcemapcomments
                    preserveLicenseComments: false,
                    useStrict: true,
                    wrap: true,
                    //uglify2: {} // https://github.com/mishoo/UglifyJS2
                    paths: {
                        timetable_data: "empty:"
                    }
                }
            }
        },
        useminPrepare: {
            html: '<%= yeoman.app %>/index.html',
            options: {
                dest: '<%= yeoman.dist %>'
            }
        },
        usemin: {
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
            options: {
                dirs: ['<%= yeoman.dist %>']
            }
        },
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/exports.css': '.tmp/styles/exports.css',
                    '<%= yeoman.dist %>/styles/main.css': '.tmp/styles/main.css'
                }
            }
        },
        htmlmin: {
            dist: {
                options: {
                    /*removeCommentsFromCDATA: true,
                    // https://github.com/yeoman/grunt-usemin/issues/44
                    //collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeAttributeQuotes: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: '*.html',
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.*',
                        '.htaccess',
                        'font/*',
                        'media/*',
                        'json/*',
                        'scripts/nus_timetable_data.js',
                        'snappy/**',
                        'styles/*.{gif,png}'
                    ]
                }]
            }
        },
        bower: {
            all: {
                rjsConfig: '<%= yeoman.app %>/scripts/main.js'
            }
        },
        crawlNTU: {
            academicYear: 2012,
            cachePath: 'cache',
            dest: 'app/json/ntu_module_info.json',
            maxCacheAge: 24 * 60 * 60, // in seconds
            maxConcurrentFiles: 64,
            maxConcurrentSockets: 8,
            refresh: false,
            semester: 2
        },
        crawlNUS: {
            academicYear: 2012,
            cachePath: 'cache',
            dest: 'app/json/nus_module_info.json',
            maxCacheAge: 24 * 60 * 60, // in seconds
            maxConcurrentFiles: 64,
            maxConcurrentSockets: 8,
            refresh: false,
            semester: 2
        },
        download: {
            ntu: {
                options: {
                    dest: 'app/json/ntu_module_info.json',
                    src: 'http://nusmods.com/json/ntu_module_info.json'
                }
            },
            nus: {
                options: {
                    dest: 'app/json/nus_module_info.json',
                    src: 'http://nusmods.com/json/nus_module_info.json'
                }
            }
        },
        jsifyNTU: {
            destModuleFinder: 'app/scripts/ntu_module_data.js',
            destTimetable: 'app/scripts/ntu_timetable_data.js',
            src: 'app/json/ntu_module_info.json'
        },
        jsifyNUS: {
            destModuleFinder: 'app/scripts/nus_module_data.js',
            destTimetable: 'app/scripts/nus_timetable_data.js',
            src: 'app/json/nus_module_info.json'
        }
    });

    grunt.loadTasks('tasks');

    grunt.renameTask('regarde', 'watch');

    grunt.registerTask('server', function (target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'open', 'connect:dist:keepalive']);
        }

        grunt.task.run([
            'clean:server',
            'coffee:dist',
            'concat',
            'compass:server',
            'livereload-start',
            'connect:livereload',
            'open',
            'watch'
        ]);
    });

    grunt.registerTask('test', [
        'clean:server',
        'coffee',
        'concat',
        'compass',
        'connect:test',
        'mocha'
    ]);

    grunt.registerTask('build', [
        'clean:dist',
        'coffee',
        'concat',
        'compass:dist',
        'useminPrepare',
        'requirejs',
        'imagemin',
        'htmlmin',
        'concat',
        'cssmin',
        'uglify',
        'copy',
        'usemin'
    ]);

    grunt.registerTask('default', [
        // 'jshint',
        // 'test',
        'build'
    ]);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
  // Project configuration
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    aws: grunt.file.readJSON('config/aws.json'),
    copy: {
      target: {
        files: [
          {
            expand: true,
            src: ['bower/jquery/dist/jquery.min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('.min','');
            }
          },
          {
            expand: true,
            src: ['bower/underscore/underscore-min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('-min','');
            }
          },
          {
            expand: true,
            src: ['bower/backbone/backbone-min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('-min','');
            }
          },
          {
            expand: true,
            src: ['bower/marionette/lib/backbone.marionette.min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('.min','');
            }
          },
          {
            expand: true,
            src: ['bower/d3/d3.min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('.min','');
            }
          },
          {
            expand: true,
            src: ['bower/d3bb/build/d3bb.min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('.min','');
            }
          },
          {
            expand: true,
            src: ['bower/foundation/js/foundation.min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('.min','');
            }
          },
          {
            expand: true,
            flatten: true,
            src: [
              'src/assets/js/vendor/chroma.js',
              'src/assets/js/vendor/json2.js',
              'src/assets/js/vendor/flatpage_stubs.js',
              'src/assets/js/vendor/modernizr.js',
              'src/assets/js/vendor/fastclick.js',
              'src/assets/js/vendor/backbone.localstorage.js',
              'src/assets/js/vendor/jquery.spin.js',
              'src/assets/js/vendor/spin.js'
            ],
            dest: 'build/assets/js/vendor/'
          },
          { expand: true, flatten: true, src: ['src/assets/data/*'], dest: 'build/assets/data/' },
          { expand: true, flatten: true, src: ['src/assets/img/*'], dest: 'build/assets/img/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomer/*'], dest: 'build/assets/css/fonts/boomer/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomer_cond/*'], dest: 'build/assets/css/fonts/boomer_cond/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomer_extracond/*'], dest: 'build/assets/css/fonts/boomer_extracond/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomerslab/*'], dest: 'build/assets/css/fonts/boomerslab/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomerslab_cond*'], dest: 'build/assets/css/fonts/boomerslab_cond' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomerslab_extracond/*'], dest: 'build/assets/css/fonts/boomerslab_extracond/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/publico/*'], dest: 'build/assets/css/fonts/publico/' },
          { expand: true, flatten: true, src: ['src/robots.txt'], dest: 'build/' }
        ]
      }
    },

    jshint: {
      files: [
        'src/assets/js/*.js'
      ],
      options: {
        browser: true,
        curly: true,
        eqeqeq: true,
        latedef: true,
        undef: true,
        unused: true,
        trailing: true,
        smarttabs: true,
        indent: 2,
        globals: {
          jQuery: true,
          $: true,
          _: true
        }
      }
    },

    uglify: {
      options: {
        mangle: { except: ['d3', '_','$'] },
        compress: true,
        report: 'gzip'
      },
      my_target: {
        files: {
          'build/assets/js/app.js'    : ['src/assets/js/app.js'],
          'build/assets/js/apps/config/storage/localstorage.js': ['src/assets/js/apps/config/storage/localstorage.js'],
          'build/assets/js/entities/infection.js': ['src/assets/js/entities/infection.js'],
          'build/assets/js/apps/infections/list/list_view.js': ['src/assets/js/apps/infections/list/list_view.js'],
          'build/assets/js/apps/infections/list/list_controller.js': ['src/assets/js/apps/infections/list/list_controller.js'],
          'build/assets/js/apps/infections/show/show_controller.js': ['src/assets/js/apps/infections/show/show_controller.js'],
          'build/assets/js/apps/infections/show/show_view.js': ['src/assets/js/apps/infections/show/show_view.js'],
          'build/assets/js/apps/infections/infections_app.js': ['src/assets/js/apps/infections/infections_app.js'],
          'build/assets/js/apps/home/home_app.js': ['src/assets/js/apps/home/home_app.js'],
          'build/assets/js/apps/home/home_controller.js': ['src/assets/js/apps/home/home_controller.js'],
          'build/assets/js/apps/home/home_view.js': ['src/assets/js/apps/home/home_view.js'],
          'build/assets/js/common/views.js': ['src/assets/js/common/views.js'],
          'build/assets/js/entities/common.js': ['src/assets/js/entities/common.js']
        }
      }
    },

    processhtml: {
      options: {
        process: true,
        strip: true
      },
      build: {
        files: {
          'tmp/index.html': ['src/index.html']
        }
      }
    },

    htmlmin: {
      build: {
        options: {
          removeComments: true,
          collapsWhitespace: true,
          useShortDoctype: true
        },
        files: {
          'build/index.html'    : 'src/index.html' /*TODO change this back to tmp/ but right now processhtml is breaking my build*/
        }
      }
    },

    cssmin: {
      compress: {
        options: {
          report: 'gzip'
        },
        files: {
          'build/assets/css/app.css'       : ['src/assets/css/app.css'],
          'build/assets/css/fonts.css'     : ['src/assets/css/fonts.css'],
          'build/assets/css/vendor/normalize.css' : ['src/assets/css/vendor/normalize.css'],
          'build/assets/css/vendor/foundation.css': ['src/assets/css/vendor/foundation.css']
        }
      }
    },

    imagemin: {
      jpg: {
        options: { progressive: true },
        files: [{
          expand: true,
          cwd: "src/assets/img",
          src: ["*.jpg"],
          dest: "build/assets/img"
        }]
      },
      png: {
        options: { optimizationLevel: 3 },
        files: [{
          expand: true,
          cwd: "src/assets/img",
          src: ["*.png"],
          dest: "build/assets/img"
        }]
      },
      gif: {
        options: { interlaced: true },
        files: [{
          expand: true,
          cwd: "src/assets/img",
          src: ["*.gif"],
          dest: "build/assets/img"
        }]
      },
      svg: {
        options: {
          removeViewBox: false,
          removeEmptyAttrs: false
        },
        files: [{
          expand: true,
          cwd: "src/assets/img",
          src: ["*.svg"],
          dest: "build/assets/img"
        }]
      }
    },

    s3: {
      options: {
        accessKeyId: "<%= aws.key %>",
        secretAccessKey: "<%= aws.secret %>",
        bucket: "<%= aws.bucket %>",
        access: "public-read",
        gzip: true,
        cache: false
      },
      build: {
        cwd: "build/",
        src: "**"
      }
    },

    bowercopy: {
      options: {
        // clean: true,
        runBower: true,
        report: true
      },
      test: {
        options: {
          destPrefix: 'test'
        },
        files: {
          "boot.js": "jasmine/lib/jasmine-core/boot.js",
          "console.js": "jasmine/lib/console/console.js",
          "jasmine-html.js": "jasmine/lib/jasmine-core/jasmine-html.js",
          "jasmine.css": "jasmine/lib/jasmine-core/jasmine.css",
          "jasmine.js": "jasmine/lib/jasmine-core/jasmine.js",
          "jasmine_favicon.png": "jasmine/images/jasmine_favicon.png",
          "sinon.js": "sinon/lib/sinon.js"
        }
      },
      lib_scripts: {
        options: {
          destPrefix: 'src/assets/js/vendor'
        },
        files: {
          "jquery.js": "jquery/dist/jquery.js",
          "chroma.js": "chroma-js/chroma.min.js",
          "underscore.js": "underscore/underscore.js",
          "json2.js": "json2/json2.js",
          "backbone.js": "backbone/backbone.js",
          "backbone.marionette.js": "marionette/lib/backbone.marionette.js",
          "d3.js": "d3/d3.js",
          "d3bb.js": "d3bb/build/d3bb.js",
          "modernizr.js": "foundation/js/vendor/modernizr.js",
          "fastclick.js": "foundation/js/vendor/fastclick.js",
          "foundation.js": "foundation/js/foundation.js",
          "backbone.localstorage.js": "backbone.localstorage/backbone.localstorage.js",
          "spin.js": "spin.js/spin.js",
          "jquery.spin.js": "spin.js/jquery.spin.js"
        }
      },
      lib_styles: {
        options: {
          destPrefix: 'src/assets/css/vendor'
        },
        files: {
          "normalize.css": "normalize-css/normalize.css",
          "foundation.css": "foundation/css/foundation.min.css"
        }
      },

    },

    express: {
      dev: {
        options: {
          hostname: '*',
          port: 8000,
          bases: 'src',
          livereload: true,
          showStack: true
        }
      },
      test: {
        options: {
          hostname: '*',
          port: 8080,
          bases: '.',
          livereload: true
        }
      }
    },

    open: {
      dev: {
        path: 'http://localhost:<%= express.dev.options.port %>',
        app: "Google Chrome"
      },
      test: {
        path: 'http://localhost:<%= express.test.options.port %>/SpecRunner.html'
      }
    },

    watch: {
      dev: {
        files: ['src/index.html','src/assets/js/*.js','src/assets/css/**/*.css'],
        options: {
          livereload: true
        }
      },
      test: {
        files: ['src/index.html','src/assets/js/*.js','spec/*.js'],
        options: {
          livereload: true
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-htmlmin');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-imagemin');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-processhtml');
  grunt.loadNpmTasks('grunt-aws');
  grunt.loadNpmTasks('grunt-contrib-imagemin');
  grunt.loadNpmTasks('grunt-bowercopy');
  grunt.loadNpmTasks('grunt-express');
  grunt.loadNpmTasks('grunt-open');

  grunt.registerTask('default', ['bowercopy','copy','uglify','cssmin', 'htmlmin','s3']);/*TODO add back processhtml*/
  grunt.registerTask('build', ['bowercopy','copy','uglify','cssmin', 'htmlmin']);/*TODO add back processhtml*/
  grunt.registerTask('deploy', ['s3']);
  grunt.registerTask('lint', ['jshint']);
  grunt.registerTask('server', ['express:dev','open:dev','watch:dev','express-keepalive']);
  grunt.registerTask('server:test', ['express:test','open:test','watch:test','express-keepalive']);
};
<commit_msg>Gruntfile comments<commit_after>module.exports = function(grunt) {
  // Project configuration
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    aws: grunt.file.readJSON('config/aws.json'),
    copy: {
      target: {
        files: [
          {
            expand: true,
            src: ['bower/jquery/dist/jquery.min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('.min','');
            }
          },
          {
            expand: true,
            src: ['bower/underscore/underscore-min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('-min','');
            }
          },
          {
            expand: true,
            src: ['bower/backbone/backbone-min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('-min','');
            }
          },
          {
            expand: true,
            src: ['bower/marionette/lib/backbone.marionette.min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('.min','');
            }
          },
          {
            expand: true,
            src: ['bower/d3/d3.min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('.min','');
            }
          },
          {
            expand: true,
            src: ['bower/d3bb/build/d3bb.min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('.min','');
            }
          },
          {
            expand: true,
            src: ['bower/foundation/js/foundation.min.js'],
            dest: 'build/assets/js/vendor/',
            rename: function (dest, src) {
              return dest + src.substring(src.lastIndexOf('/')).replace('.min','');
            }
          },
          {
            expand: true,
            flatten: true,
            src: [
              'src/assets/js/vendor/chroma.js',
              'src/assets/js/vendor/json2.js',
              'src/assets/js/vendor/flatpage_stubs.js',
              'src/assets/js/vendor/modernizr.js',
              'src/assets/js/vendor/fastclick.js',
              'src/assets/js/vendor/backbone.localstorage.js',
              'src/assets/js/vendor/jquery.spin.js',
              'src/assets/js/vendor/spin.js'
            ],
            dest: 'build/assets/js/vendor/'
          },
          { expand: true, flatten: true, src: ['src/assets/data/*'], dest: 'build/assets/data/' },
          { expand: true, flatten: true, src: ['src/assets/img/*'], dest: 'build/assets/img/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomer/*'], dest: 'build/assets/css/fonts/boomer/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomer_cond/*'], dest: 'build/assets/css/fonts/boomer_cond/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomer_extracond/*'], dest: 'build/assets/css/fonts/boomer_extracond/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomerslab/*'], dest: 'build/assets/css/fonts/boomerslab/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomerslab_cond*'], dest: 'build/assets/css/fonts/boomerslab_cond' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/boomerslab_extracond/*'], dest: 'build/assets/css/fonts/boomerslab_extracond/' },
          { expand: true, flatten: true, src: ['src/assets/css/fonts/publico/*'], dest: 'build/assets/css/fonts/publico/' },
          { expand: true, flatten: true, src: ['src/robots.txt'], dest: 'build/' }
        ]
      }
    },

    jshint: {
      files: [
        'src/assets/js/*.js'
      ],
      options: {
        browser: true,
        curly: true,
        eqeqeq: true,
        latedef: true,
        undef: true,
        unused: true,
        trailing: true,
        smarttabs: true,
        indent: 2,
        globals: {
          jQuery: true,
          $: true,
          _: true
        }
      }
    },

    uglify: {
      options: {
        mangle: { except: ['d3', '_','$'] },
        compress: true,
        report: 'gzip'
      },
      my_target: {
        files: {
          'build/assets/js/app.js'    : ['src/assets/js/app.js'],
          'build/assets/js/apps/config/storage/localstorage.js': ['src/assets/js/apps/config/storage/localstorage.js'],
          'build/assets/js/entities/infection.js': ['src/assets/js/entities/infection.js'],
          'build/assets/js/apps/infections/list/list_view.js': ['src/assets/js/apps/infections/list/list_view.js'],
          'build/assets/js/apps/infections/list/list_controller.js': ['src/assets/js/apps/infections/list/list_controller.js'],
          'build/assets/js/apps/infections/show/show_controller.js': ['src/assets/js/apps/infections/show/show_controller.js'],
          'build/assets/js/apps/infections/show/show_view.js': ['src/assets/js/apps/infections/show/show_view.js'],
          'build/assets/js/apps/infections/infections_app.js': ['src/assets/js/apps/infections/infections_app.js'],
          'build/assets/js/apps/home/home_app.js': ['src/assets/js/apps/home/home_app.js'],
          'build/assets/js/apps/home/home_controller.js': ['src/assets/js/apps/home/home_controller.js'],
          'build/assets/js/apps/home/home_view.js': ['src/assets/js/apps/home/home_view.js'],
          'build/assets/js/common/views.js': ['src/assets/js/common/views.js'],
          'build/assets/js/entities/common.js': ['src/assets/js/entities/common.js']
        }
      }
    },

    processhtml: {
      options: {
        process: true,
        strip: true
      },
      build: {
        files: {
          'tmp/index.html': ['src/index.html']
        }
      }
    },

    htmlmin: {
      build: {
        options: {
          removeComments: true,
          collapsWhitespace: true,
          useShortDoctype: true
        },
        files: {
          'build/index.html'    : 'src/index.html' /*TODO change this back to tmp/ but right now processhtml is breaking my build*/
        }
      }
    },

    cssmin: {
      compress: {
        options: {
          report: 'gzip'
        },
        files: {
          'build/assets/css/app.css'       : ['src/assets/css/app.css'],
          'build/assets/css/fonts.css'     : ['src/assets/css/fonts.css'],
          'build/assets/css/vendor/normalize.css' : ['src/assets/css/vendor/normalize.css'],
          'build/assets/css/vendor/foundation.css': ['src/assets/css/vendor/foundation.css']
        }
      }
    },

    imagemin: {
      jpg: {
        options: { progressive: true },
        files: [{
          expand: true,
          cwd: "src/assets/img",
          src: ["*.jpg"],
          dest: "build/assets/img"
        }]
      },
      png: {
        options: { optimizationLevel: 3 },
        files: [{
          expand: true,
          cwd: "src/assets/img",
          src: ["*.png"],
          dest: "build/assets/img"
        }]
      },
      gif: {
        options: { interlaced: true },
        files: [{
          expand: true,
          cwd: "src/assets/img",
          src: ["*.gif"],
          dest: "build/assets/img"
        }]
      },
      svg: {
        options: {
          removeViewBox: false,
          removeEmptyAttrs: false
        },
        files: [{
          expand: true,
          cwd: "src/assets/img",
          src: ["*.svg"],
          dest: "build/assets/img"
        }]
      }
    },

    s3: {
      options: {
        accessKeyId: "<%= aws.key %>",
        secretAccessKey: "<%= aws.secret %>",
        bucket: "<%= aws.bucket %>",
        access: "public-read",
        gzip: true,
        cache: false
      },
      build: {
        cwd: "build/",
        src: "**"
      }
    },

    bowercopy: {
      options: {
        // clean: true,
        runBower: true,
        report: true
      },
      test: {
        options: {
          destPrefix: 'test'
        },
        files: {
          "boot.js": "jasmine/lib/jasmine-core/boot.js",
          "console.js": "jasmine/lib/console/console.js",
          "jasmine-html.js": "jasmine/lib/jasmine-core/jasmine-html.js",
          "jasmine.css": "jasmine/lib/jasmine-core/jasmine.css",
          "jasmine.js": "jasmine/lib/jasmine-core/jasmine.js",
          "jasmine_favicon.png": "jasmine/images/jasmine_favicon.png",
          "sinon.js": "sinon/lib/sinon.js"
        }
      },
      lib_scripts: {
        options: {
          destPrefix: 'src/assets/js/vendor'
        },
        files: {
          "jquery.js": "jquery/dist/jquery.js",
          "chroma.js": "chroma-js/chroma.min.js", //colors
          "underscore.js": "underscore/underscore.js",
          "json2.js": "json2/json2.js",
          "backbone.js": "backbone/backbone.js",
          "backbone.marionette.js": "marionette/lib/backbone.marionette.js",
          "d3.js": "d3/d3.js",
          "d3bb.js": "d3bb/build/d3bb.js", //John Perry's backbone wrapper for d3
          "modernizr.js": "foundation/js/vendor/modernizr.js",
          "fastclick.js": "foundation/js/vendor/fastclick.js",
          "foundation.js": "foundation/js/foundation.js",
          "backbone.localstorage.js": "backbone.localstorage/backbone.localstorage.js", //local storage adapter
          "spin.js": "spin.js/spin.js", //for page loading spinner
          "jquery.spin.js": "spin.js/jquery.spin.js" //for using ^ with jquery
        }
      },
      lib_styles: {
        options: {
          destPrefix: 'src/assets/css/vendor'
        },
        files: {
          "normalize.css": "normalize-css/normalize.css",
          "foundation.css": "foundation/css/foundation.min.css"
        }
      },

    },

    express: {
      dev: {
        options: {
          hostname: '*',
          port: 8000,
          bases: 'src',
          livereload: true,
          showStack: true
        }
      },
      test: {
        options: {
          hostname: '*',
          port: 8080,
          bases: '.',
          livereload: true
        }
      }
    },

    open: {
      dev: {
        path: 'http://localhost:<%= express.dev.options.port %>',
        app: "Google Chrome"
      },
      test: {
        path: 'http://localhost:<%= express.test.options.port %>/SpecRunner.html'
      }
    },

    watch: {
      dev: {
        files: ['src/index.html','src/assets/js/*.js','src/assets/css/**/*.css'],
        options: {
          livereload: true
        }
      },
      test: {
        files: ['src/index.html','src/assets/js/*.js','spec/*.js'],
        options: {
          livereload: true
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-htmlmin');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-imagemin');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-processhtml');
  grunt.loadNpmTasks('grunt-aws');
  grunt.loadNpmTasks('grunt-contrib-imagemin');
  grunt.loadNpmTasks('grunt-bowercopy');
  grunt.loadNpmTasks('grunt-express');
  grunt.loadNpmTasks('grunt-open');

  grunt.registerTask('default', ['bowercopy','copy','uglify','cssmin', 'htmlmin','s3']);/*TODO add back processhtml*/
  grunt.registerTask('build', ['bowercopy','copy','uglify','cssmin', 'htmlmin']);/*TODO add back processhtml*/
  grunt.registerTask('deploy', ['s3']);
  grunt.registerTask('lint', ['jshint']);
  grunt.registerTask('server', ['express:dev','open:dev','watch:dev','express-keepalive']);
  grunt.registerTask('server:test', ['express:test','open:test','watch:test','express-keepalive']);
};
<|endoftext|>