<commit_before>var fs = require("fs");

module.exports = function(grunt) {
	"use strict";

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

				compare_size : {
					files : [ "dist/classify.js", "dist/classify.min.map", "dist/classify.min.js" ]
				},

				concat : {
					dist : {
						src : [ "srcwrap/intro.js",
								"src/core.js",
								"src/create.js",
								"src/mutator.static.js",
								"src/mutator.nowrap.js",
								"src/mutator.alias.js",
								"src/mutator.bind.js",
								"src/observer.js",
								"src/mutator.observable.js",
								"src/namespace.js",
								"src/export.js",
								"srcwrap/outro.js" ],
						dest : "dist/classify.js"
					},
					options : {
						banner : fs.readFileSync("srcwrap/copyright.js", "utf8")
					}
				},

				jshint : {
					dist : {
						src : [ "dist/classify.js" ],
						options : {
							latedef : true,
							noempty : true,
							undef : true,
							strict : true,
							node : true,
							browser : true,
							quotmark : "double",
							maxcomplexity : 7,
							predef : []
						}
					},
					/*
					 * test : { src : [ "test/*.js" ], options : { latedef :
					 * true, noempty : true, undef : true, strict : true, node :
					 * true, browser : true, quotmark : "double", maxcomplexity :
					 * 7, predef : [ "QUnit" ] } },
					 */
					build : {
						src : [ "Gruntfile.js", "test/bridge/qunit-node-bridge.js" ],
						options : {
							latedef : true,
							noempty : true,
							undef : true,
							strict : true,
							node : true,
							browser : true,
							quotmark : "double",
							maxcomplexity : 15,
							predef : []
						}
					}
				},

				uglify : {
					all : {
						files : {
							"dist/classify.min.js" : [ "dist/classify.js" ]
						},
						options : {
							banner : "/*! ClassifyJs v<%= pkg.version %> | (c) 2011-<%= grunt.template.today(\"yyyy\") %>, Wei Kin Huang | <%= pkg.homepage %> | MIT license | <%= grunt.template.today(\"yyyy-mm-dd\") %> */;",
							sourceMap : "dist/classify.min.map",
							sourceMappingURL : "classify.min.map",
							sourceMapPrefix : 1,
							beautify : {
								ascii_only : true
							},
							mangle : true
						}
					}
				},

				qunit : {
					all : {
						options : {
							urls : [ "http://localhost:8080/test/index.html" ]
						}
					}
				},

				"qunit-node" : {
					all : {
						code : [ "src/core.js",
								"src/create.js",
								"src/mutator.static.js",
								"src/mutator.nowrap.js",
								"src/mutator.alias.js",
								"src/mutator.bind.js",
								"src/observer.js",
								"src/mutator.observable.js",
								"src/namespace.js",
								"src/export.js" ],
						tests : [ "test/core.js",
								"test/create.js",
								"test/mutator.static.js",
								"test/mutator.nowrap.js",
								"test/mutator.alias.js",
								"test/mutator.bind.js",
								"test/observer.js",
								"test/mutator.observable.js",
								"test/namespace.js",
								"test/export.js" ],
						setUp : function() {
							this.root = this;
						}
					}
				},

				"saucelabs-qunit" : {
					all : {
						// username: "",
						// key: "",
						urls : [ "http://127.0.0.1:8080/test/index.html" ],
						tunnelTimeout : 5,
						build : process.env.TRAVIS_JOB_ID,
						concurrency : 3,
						browsers : [ {
							browserName : "firefox",
							version : "19",
							platform : "XP"
						} ]
					}
				},

				connect : {
					server : {
						options : {
							base : ".",
							port : 8080
						}
					}
				},

				"qunit-cov" : {
					test : {
						minimum : 0.95,
						srcDir : "src",
						depDirs : [ "test" ],
						outDir : "coverage",
						testFiles : [ "test/*.html" ]
					}
				},

				yuidoc : {
					compile : {
						name : "<%= pkg.name %>",
						description : "<%= pkg.description %>",
						version : "<%= pkg.version %>",
						url : "<%= pkg.homepage %>",
						options : {
							paths : "src/",
							outdir : "docs/yuidoc/"
						}
					}
				}
			});

	grunt.loadNpmTasks("grunt-compare-size");
	grunt.loadNpmTasks("grunt-contrib-concat");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("grunt-contrib-qunit");
	grunt.loadNpmTasks("grunt-contrib-connect");
	grunt.loadNpmTasks("grunt-contrib-yuidoc");
	grunt.loadNpmTasks("grunt-saucelabs");
	grunt.loadNpmTasks("grunt-qunit-cov");

	grunt.registerMultiTask("qunit-node", "Run QUnit unit tests in node sandbox.", function() {
		// Nodejs libs.
		var path = require("path"),
		// This task is asynchronous.
		done = this.async(),
		// Reset status.
		status = {
			failed : 0,
			passed : 0,
			total : 0,
			duration : 0
		},
		// other vars
		child;

		// Allow an error message to retain its color when split across multiple
		// lines.
		var formatMessage = function(str) {
			return String(str).split("\n").map(function(s) {
				return s.magenta;
			}).join("\n");
		};

		// Keep track of failed assertions for pretty-printing.
		var failedAssertions = [];
		var logFailedAssertions = function() {
			var assertion;
			// Print each assertion error.
			while ((assertion = failedAssertions.shift())) {
				grunt.verbose.or.error(assertion.testName);
				grunt.log.error("Message: " + formatMessage(assertion.message));
				if (assertion.actual !== assertion.expected) {
					grunt.log.error("Actual: " + formatMessage(assertion.actual));
					grunt.log.error("Expected: " + formatMessage(assertion.expected));
				}
				if (assertion.source) {
					grunt.log.error(assertion.source.replace(/ {4}(at)/g, "  $1"));
				}
				grunt.log.writeln();
			}
		};

		child = require("child_process").fork(path.join(__dirname, "test/bridge/qunit-node-bridge.js"), [ JSON.stringify({
			data : this.data,
			dir : __dirname,
			setUp : (this.data.setUp || "").toString()
		}) ], {
			env : process.env
		});

		child.on("message", function(message) {
			var data = message.data || {};
			switch (message.event) {
			case "assertionDone":
				if (data.result === false) {
					failedAssertions.push({
						actual : data.actual,
						expected : data.expected,
						message : data.message,
						source : data.source,
						testName : (data.module ? data.module + " - " : "") + data.name
					});
				}
				break;
			case "testStart":
				grunt.verbose.write((data.module ? data.module + " - " : "") + data.name + "...");
				break;
			case "testDone":
				// Log errors if necessary, otherwise success.
				if (data.failed > 0) {
					// list assertions
					if (grunt.option("verbose")) {
						grunt.log.error();
						logFailedAssertions();
					} else {
						grunt.log.write("F".red);
					}
				} else {
					grunt.verbose.ok().or.write(".");
				}
				break;
			case "moduleStart":
				break;
			case "moduleDone":
				break;
			case "done":
				status.failed += data.failed;
				status.passed += data.passed;
				status.total += data.total;
				status.duration += data.runtime;
				// Print assertion errors here, if verbose mode is disabled.
				if (!grunt.option("verbose")) {
					if (data.failed > 0) {
						grunt.log.writeln();
						logFailedAssertions();
					} else {
						grunt.log.ok();
					}
				}
				// Log results.
				if (status.failed > 0) {
					grunt.warn(status.failed + "/" + status.total + " assertions failed (" + status.duration + "ms)");
					done(false);
				} else if (status.total === 0) {
					grunt.warn("0/0 assertions ran (" + status.duration + "ms)");
				} else {
					grunt.verbose.writeln();
					grunt.log.ok(status.total + " assertions passed (" + status.duration + "ms)");
				}
				break;
			}
			if (message.event === "done") {
				child.kill();
				done();
			}
		});
	});

	// Default grunt
	grunt.registerTask("default", [ "concat", "jshint", "uglify" ]);

	// Other tasks
	grunt.registerTask("all", [ "connect", "concat", "jshint", "qunit", "qunit-node", "saucelabs-qunit", "uglify", "compare_size" ]);
	grunt.registerTask("travis", [ "connect", "concat", "jshint", "qunit", "qunit-node", "saucelabs-qunit", "uglify" ]);
	grunt.registerTask("lint", [ "concat", "jshint" ]);
	grunt.registerTask("test:local", [ "connect", "qunit", "qunit-node" ]);
	grunt.registerTask("test", [ "connect", "qunit", "qunit-node", "saucelabs-qunit" ]);
	grunt.registerTask("doc", [ "yuidoc" ]);
	grunt.registerTask("coverage", [ "qunit", "qunit-cov" ]);
};
<commit_msg>Updating grunt-saucelabs timeout<commit_after>var fs = require("fs");

module.exports = function(grunt) {
	"use strict";

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

				compare_size : {
					files : [ "dist/classify.js", "dist/classify.min.map", "dist/classify.min.js" ]
				},

				concat : {
					dist : {
						src : [ "srcwrap/intro.js",
								"src/core.js",
								"src/create.js",
								"src/mutator.static.js",
								"src/mutator.nowrap.js",
								"src/mutator.alias.js",
								"src/mutator.bind.js",
								"src/observer.js",
								"src/mutator.observable.js",
								"src/namespace.js",
								"src/export.js",
								"srcwrap/outro.js" ],
						dest : "dist/classify.js"
					},
					options : {
						banner : fs.readFileSync("srcwrap/copyright.js", "utf8")
					}
				},

				jshint : {
					dist : {
						src : [ "dist/classify.js" ],
						options : {
							latedef : true,
							noempty : true,
							undef : true,
							strict : true,
							node : true,
							browser : true,
							quotmark : "double",
							maxcomplexity : 7,
							predef : []
						}
					},
					/*
					 * test : { src : [ "test/*.js" ], options : { latedef :
					 * true, noempty : true, undef : true, strict : true, node :
					 * true, browser : true, quotmark : "double", maxcomplexity :
					 * 7, predef : [ "QUnit" ] } },
					 */
					build : {
						src : [ "Gruntfile.js", "test/bridge/qunit-node-bridge.js" ],
						options : {
							latedef : true,
							noempty : true,
							undef : true,
							strict : true,
							node : true,
							browser : true,
							quotmark : "double",
							maxcomplexity : 15,
							predef : []
						}
					}
				},

				uglify : {
					all : {
						files : {
							"dist/classify.min.js" : [ "dist/classify.js" ]
						},
						options : {
							banner : "/*! ClassifyJs v<%= pkg.version %> | (c) 2011-<%= grunt.template.today(\"yyyy\") %>, Wei Kin Huang | <%= pkg.homepage %> | MIT license | <%= grunt.template.today(\"yyyy-mm-dd\") %> */;",
							sourceMap : "dist/classify.min.map",
							sourceMappingURL : "classify.min.map",
							sourceMapPrefix : 1,
							beautify : {
								ascii_only : true
							},
							mangle : true
						}
					}
				},

				qunit : {
					all : {
						options : {
							urls : [ "http://localhost:8080/test/index.html" ]
						}
					}
				},

				"qunit-node" : {
					all : {
						code : [ "src/core.js",
								"src/create.js",
								"src/mutator.static.js",
								"src/mutator.nowrap.js",
								"src/mutator.alias.js",
								"src/mutator.bind.js",
								"src/observer.js",
								"src/mutator.observable.js",
								"src/namespace.js",
								"src/export.js" ],
						tests : [ "test/core.js",
								"test/create.js",
								"test/mutator.static.js",
								"test/mutator.nowrap.js",
								"test/mutator.alias.js",
								"test/mutator.bind.js",
								"test/observer.js",
								"test/mutator.observable.js",
								"test/namespace.js",
								"test/export.js" ],
						setUp : function() {
							this.root = this;
						}
					}
				},

				"saucelabs-qunit" : {
					all : {
						// username: "",
						// key: "",
						urls : [ "http://127.0.0.1:8080/test/index.html" ],
						tunnelTimeout : 120,
						testTimeout : 300000,
						build : process.env.TRAVIS_JOB_ID,
						concurrency : 3,
						browsers : [ {
							browserName : "firefox",
							version : "19",
							platform : "XP"
						} ]
					}
				},

				connect : {
					server : {
						options : {
							base : ".",
							port : 8080
						}
					}
				},

				"qunit-cov" : {
					test : {
						minimum : 0.95,
						srcDir : "src",
						depDirs : [ "test" ],
						outDir : "coverage",
						testFiles : [ "test/*.html" ]
					}
				},

				yuidoc : {
					compile : {
						name : "<%= pkg.name %>",
						description : "<%= pkg.description %>",
						version : "<%= pkg.version %>",
						url : "<%= pkg.homepage %>",
						options : {
							paths : "src/",
							outdir : "docs/yuidoc/"
						}
					}
				}
			});

	grunt.loadNpmTasks("grunt-compare-size");
	grunt.loadNpmTasks("grunt-contrib-concat");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("grunt-contrib-qunit");
	grunt.loadNpmTasks("grunt-contrib-connect");
	grunt.loadNpmTasks("grunt-contrib-yuidoc");
	grunt.loadNpmTasks("grunt-saucelabs");
	grunt.loadNpmTasks("grunt-qunit-cov");

	grunt.registerMultiTask("qunit-node", "Run QUnit unit tests in node sandbox.", function() {
		// Nodejs libs.
		var path = require("path"),
		// This task is asynchronous.
		done = this.async(),
		// Reset status.
		status = {
			failed : 0,
			passed : 0,
			total : 0,
			duration : 0
		},
		// other vars
		child;

		// Allow an error message to retain its color when split across multiple
		// lines.
		var formatMessage = function(str) {
			return String(str).split("\n").map(function(s) {
				return s.magenta;
			}).join("\n");
		};

		// Keep track of failed assertions for pretty-printing.
		var failedAssertions = [];
		var logFailedAssertions = function() {
			var assertion;
			// Print each assertion error.
			while ((assertion = failedAssertions.shift())) {
				grunt.verbose.or.error(assertion.testName);
				grunt.log.error("Message: " + formatMessage(assertion.message));
				if (assertion.actual !== assertion.expected) {
					grunt.log.error("Actual: " + formatMessage(assertion.actual));
					grunt.log.error("Expected: " + formatMessage(assertion.expected));
				}
				if (assertion.source) {
					grunt.log.error(assertion.source.replace(/ {4}(at)/g, "  $1"));
				}
				grunt.log.writeln();
			}
		};

		child = require("child_process").fork(path.join(__dirname, "test/bridge/qunit-node-bridge.js"), [ JSON.stringify({
			data : this.data,
			dir : __dirname,
			setUp : (this.data.setUp || "").toString()
		}) ], {
			env : process.env
		});

		child.on("message", function(message) {
			var data = message.data || {};
			switch (message.event) {
			case "assertionDone":
				if (data.result === false) {
					failedAssertions.push({
						actual : data.actual,
						expected : data.expected,
						message : data.message,
						source : data.source,
						testName : (data.module ? data.module + " - " : "") + data.name
					});
				}
				break;
			case "testStart":
				grunt.verbose.write((data.module ? data.module + " - " : "") + data.name + "...");
				break;
			case "testDone":
				// Log errors if necessary, otherwise success.
				if (data.failed > 0) {
					// list assertions
					if (grunt.option("verbose")) {
						grunt.log.error();
						logFailedAssertions();
					} else {
						grunt.log.write("F".red);
					}
				} else {
					grunt.verbose.ok().or.write(".");
				}
				break;
			case "moduleStart":
				break;
			case "moduleDone":
				break;
			case "done":
				status.failed += data.failed;
				status.passed += data.passed;
				status.total += data.total;
				status.duration += data.runtime;
				// Print assertion errors here, if verbose mode is disabled.
				if (!grunt.option("verbose")) {
					if (data.failed > 0) {
						grunt.log.writeln();
						logFailedAssertions();
					} else {
						grunt.log.ok();
					}
				}
				// Log results.
				if (status.failed > 0) {
					grunt.warn(status.failed + "/" + status.total + " assertions failed (" + status.duration + "ms)");
					done(false);
				} else if (status.total === 0) {
					grunt.warn("0/0 assertions ran (" + status.duration + "ms)");
				} else {
					grunt.verbose.writeln();
					grunt.log.ok(status.total + " assertions passed (" + status.duration + "ms)");
				}
				break;
			}
			if (message.event === "done") {
				child.kill();
				done();
			}
		});
	});

	// Default grunt
	grunt.registerTask("default", [ "concat", "jshint", "uglify" ]);

	// Other tasks
	grunt.registerTask("all", [ "connect", "concat", "jshint", "qunit", "qunit-node", "saucelabs-qunit", "uglify", "compare_size" ]);
	grunt.registerTask("travis", [ "connect", "concat", "jshint", "qunit", "qunit-node", "saucelabs-qunit", "uglify" ]);
	grunt.registerTask("lint", [ "concat", "jshint" ]);
	grunt.registerTask("test:local", [ "connect", "qunit", "qunit-node" ]);
	grunt.registerTask("test", [ "connect", "qunit", "qunit-node", "saucelabs-qunit" ]);
	grunt.registerTask("doc", [ "yuidoc" ]);
	grunt.registerTask("coverage", [ "qunit", "qunit-cov" ]);
};
<|endoftext|>


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

  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-usemin');
  grunt.loadNpmTasks('grunt-rev');
  grunt.loadNpmTasks('grunt-manifest');
  grunt.loadNpmTasks('grunt-sed');
  grunt.loadNpmTasks('grunt-docco');
  grunt.loadNpmTasks('grunt-growl');
  grunt.loadNpmTasks('grunt-strip');

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

    watch: {
      less: {
        options: {
          debounceDelay: 250
        },
        files: 'src/less/*.less',
        tasks: ['growl:less', 'less']
      },
      manifest: {
        options: {
          debounceDelay: 250
        },
        files: ['src/index.html', 'src/css/**', 'src/js/**', 'src/img/**', 'src/sounds/**'],
        tasks: ['growl:manifest', 'manifest:src']
      }
    },

    growl: {
      less: {
        message : "LESS compilation…",
        title : "Grunt watcher"
      },
      manifest: {
        message : "Updating manifest.appcache…",
        title : "Grunt watcher"
      }
    },

    less: {
      src: {
        files: {
          "src/css/styles.css": "src/less/styles.less"
        }
      }
    },

    clean: {
      dist: {
        src: 'dist/'
      }
    },

    copy: {
      dist: {
        files: [
          { expand: true, cwd: 'src/', src: ['.htaccess', 'esviji-icon.png', 'favicon.ico', 'index.html', 'manifest.webapp'], dest: 'dist/' },
          { expand: true, cwd: 'src/', src: ['css/font/*'], dest: 'dist/' },
          { expand: true, cwd: 'src/', src: ['img/favicon.png', 'img/firefox-os/*', 'img/ios/*', 'img/windows-8/*'], dest: 'dist/' },
          { expand: true, cwd: 'src/', src: ['sounds/sprite.{mp3,ogg}'], dest: 'dist/' }
        ]
      }
    },

    useminPrepare: {
      options: {
        dest: 'dist/'
      },
      html: 'src/index.html'
    },
    usemin: {
      html: 'dist/index.html'
    },

    concat: {
      options: {
        separator: ';'
      }
    },

    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> - Copyright (c) 1992-<%= grunt.template.today("yyyy") %> Nicolas Hoizey <nicolas@hoizey.com> */',
        report:'min',
        compress: {
          global_defs: {
            'DEBUG': false
          }
        }
      }
    },

    cssmin: {
      options: {
        banner: '/*! <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> - Copyright (c) 1992-<%= grunt.template.today("yyyy") %> Nicolas Hoizey <nicolas@hoizey.com> */'
      }
    },

    rev: {
      options: {
        encoding: 'utf8',
        algorithm: 'md5',
        length: 8
      },
      assets: {
        files: [{
          src: [
            'dist/css/styles.css',
            'dist/js/app.js'
          ]
        }]
      }
    },

    manifest: {
      src: {
        options: {
          basePath: 'src/',
          network: ['*'],
          verbose: true,
          timestamp: true
        },
        src: [
          'favicon.ico',
          'img/favicon.png',
          'js/**/*.js',
          'css/styles.css',
          'css/font/*',
          'sounds/*.{ogg,mp3}'
        ],
        dest: 'src/manifest.appcache'
      },
      dist: {
        options: {
          basePath: 'dist/',
          network: ['*'],
          verbose: true,
          timestamp: true
        },
        src: [
          'favicon.ico',
          'img/favicon.png',
          'js/app.js',
          'css/styles.css',
          'css/font/*',
          'sounds/*.{ogg,mp3}'
        ],
        dest: 'dist/manifest.appcache'
      }
    },

    sed: {
      version: {
        path: 'dist/',
        recursive: true,
        pattern: '%VERSION%',
        replacement: '<%= pkg.version %>'
      }
    },

    docco: {
      debug: {
        src: ['src/js/esviji.js'],
        options: {
          output: 'docs/'
        }
      }
    }
  });

  grunt.registerTask('default', ['less', 'manifest:src', 'watch']);
  grunt.registerTask('package', ['less', 'clean', 'copy', 'useminPrepare', 'concat', 'uglify', 'cssmin', 'rev', 'usemin', 'manifest:dist', 'sed', 'docco']);
};
<commit_msg>grunt-strip not used anymore<commit_after>module.exports = function(grunt) {

  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-usemin');
  grunt.loadNpmTasks('grunt-rev');
  grunt.loadNpmTasks('grunt-manifest');
  grunt.loadNpmTasks('grunt-sed');
  grunt.loadNpmTasks('grunt-docco');
  grunt.loadNpmTasks('grunt-growl');

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

    watch: {
      less: {
        options: {
          debounceDelay: 250
        },
        files: 'src/less/*.less',
        tasks: ['growl:less', 'less']
      },
      manifest: {
        options: {
          debounceDelay: 250
        },
        files: ['src/index.html', 'src/css/**', 'src/js/**', 'src/img/**', 'src/sounds/**'],
        tasks: ['growl:manifest', 'manifest:src']
      }
    },

    growl: {
      less: {
        message : "LESS compilation…",
        title : "Grunt watcher"
      },
      manifest: {
        message : "Updating manifest.appcache…",
        title : "Grunt watcher"
      }
    },

    less: {
      src: {
        files: {
          "src/css/styles.css": "src/less/styles.less"
        }
      }
    },

    clean: {
      dist: {
        src: 'dist/'
      }
    },

    copy: {
      dist: {
        files: [
          { expand: true, cwd: 'src/', src: ['.htaccess', 'esviji-icon.png', 'favicon.ico', 'index.html', 'manifest.webapp'], dest: 'dist/' },
          { expand: true, cwd: 'src/', src: ['css/font/*'], dest: 'dist/' },
          { expand: true, cwd: 'src/', src: ['img/favicon.png', 'img/firefox-os/*', 'img/ios/*', 'img/windows-8/*'], dest: 'dist/' },
          { expand: true, cwd: 'src/', src: ['sounds/sprite.{mp3,ogg}'], dest: 'dist/' }
        ]
      }
    },

    useminPrepare: {
      options: {
        dest: 'dist/'
      },
      html: 'src/index.html'
    },
    usemin: {
      html: 'dist/index.html'
    },

    concat: {
      options: {
        separator: ';'
      }
    },

    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> - Copyright (c) 1992-<%= grunt.template.today("yyyy") %> Nicolas Hoizey <nicolas@hoizey.com> */',
        report:'min',
        compress: {
          global_defs: {
            'DEBUG': false
          }
        }
      }
    },

    cssmin: {
      options: {
        banner: '/*! <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> - Copyright (c) 1992-<%= grunt.template.today("yyyy") %> Nicolas Hoizey <nicolas@hoizey.com> */'
      }
    },

    rev: {
      options: {
        encoding: 'utf8',
        algorithm: 'md5',
        length: 8
      },
      assets: {
        files: [{
          src: [
            'dist/css/styles.css',
            'dist/js/app.js'
          ]
        }]
      }
    },

    manifest: {
      src: {
        options: {
          basePath: 'src/',
          network: ['*'],
          verbose: true,
          timestamp: true
        },
        src: [
          'favicon.ico',
          'img/favicon.png',
          'js/**/*.js',
          'css/styles.css',
          'css/font/*',
          'sounds/*.{ogg,mp3}'
        ],
        dest: 'src/manifest.appcache'
      },
      dist: {
        options: {
          basePath: 'dist/',
          network: ['*'],
          verbose: true,
          timestamp: true
        },
        src: [
          'favicon.ico',
          'img/favicon.png',
          'js/app.js',
          'css/styles.css',
          'css/font/*',
          'sounds/*.{ogg,mp3}'
        ],
        dest: 'dist/manifest.appcache'
      }
    },

    sed: {
      version: {
        path: 'dist/',
        recursive: true,
        pattern: '%VERSION%',
        replacement: '<%= pkg.version %>'
      }
    },

    docco: {
      debug: {
        src: ['src/js/esviji.js'],
        options: {
          output: 'docs/'
        }
      }
    }
  });

  grunt.registerTask('default', ['less', 'manifest:src', 'watch']);
  grunt.registerTask('package', ['less', 'clean', 'copy', 'useminPrepare', 'concat', 'uglify', 'cssmin', 'rev', 'usemin', 'manifest:dist', 'sed', 'docco']);
};
<|endoftext|>


<commit_before>'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: {
            compass: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:server']
            },
            livereload: {
                files: [
                    '<%= yeoman.app %>/*.html',
                    '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
                    '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ],
                tasks: ['livereload']
            }
        },
        connect: {
            options: {
                port: 9000,
                hostname: '0.0.0.0'
            },
            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: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            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']
                }
            }
        },
        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
                }
            }
        },
        // not used since Uglify task does concat,
        // but still available if needed
        /*concat: {
            dist: {}
        },*/
        // not enabled since usemin task does concat and uglify
        // check index.html to edit your build targets
        // enable this task if you prefer defining your build targets here
        /*uglify: {
            dist: {}
        },*/
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}',
                        '<%= yeoman.dist %>/styles/fonts/*'
                    ]
                }
            }
        },
        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: {
                options: {
                    optimizationLevel: 2
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },
        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/main.css': [
                        '.tmp/styles/{,*/}*.css',
                        '<%= yeoman.app %>/styles/{,*/}*.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 %>'
                }]
            }
        },
        // Put files not handled in other tasks here
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{ico,txt,html}',
                        '.htaccess',
                        'images/{,*/}*.{webp,gif}',
                        'styles/fonts/*',
                        '.nojekyll',
                        '*.webapp',
                        'media/*.ogg'
                    ]
                }]
            }
        },
        concurrent: {
            server: [
                'compass:server'
            ],
            test: [
                'compass'
            ],
            dist: [
                'compass:dist',
                'imagemin',
                'svgmin'
                // 'htmlmin'
            ]
        },
        manifest: {
            generate: {
                options: {
                    basePath: '<%= yeoman.dist %>',
                    network: ['http://*', 'https://*'],
                    verbose: false,
                    timestamp: true
                },
                src: [
                    '*.html',
                    'scripts/*.js',
                    'styles/*.css',
                    'media/*.ogg'
                ],
                dest: '<%= yeoman.dist %>/manifest.appcache'
            }
        },
        githubPages: {
            target: {
                options: {
                    commitMessage: 'New deployment to github pages'
                },
                src: 'dist'
            }
        }
    });

    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',
            'concurrent:server',
            'livereload-start',
            'connect:livereload',
            'open',
            'watch'
        ]);
    });

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

    grunt.registerTask('build', [
        'clean:dist',
        'useminPrepare',
        'concurrent:dist',
        'cssmin',
        'concat',
        'uglify',
        'copy',
        'rev',
        'usemin'
    ]);

    grunt.registerTask('deploy', [
        'manifest',
        'githubPages:target'
    ]);

    grunt.registerTask('default', [
        'jshint',
        'test',
        'build'
    ]);
};
<commit_msg>Add images to appcache manifest<commit_after>'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: {
            compass: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:server']
            },
            livereload: {
                files: [
                    '<%= yeoman.app %>/*.html',
                    '{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
                    '{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
                    '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ],
                tasks: ['livereload']
            }
        },
        connect: {
            options: {
                port: 9000,
                hostname: '0.0.0.0'
            },
            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: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            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']
                }
            }
        },
        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
                }
            }
        },
        // not used since Uglify task does concat,
        // but still available if needed
        /*concat: {
            dist: {}
        },*/
        // not enabled since usemin task does concat and uglify
        // check index.html to edit your build targets
        // enable this task if you prefer defining your build targets here
        /*uglify: {
            dist: {}
        },*/
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}',
                        '<%= yeoman.dist %>/styles/fonts/*'
                    ]
                }
            }
        },
        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: {
                options: {
                    optimizationLevel: 2
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>',
                    src: '{,*/}*.{png,jpg,jpeg}',
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },
        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/main.css': [
                        '.tmp/styles/{,*/}*.css',
                        '<%= yeoman.app %>/styles/{,*/}*.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 %>'
                }]
            }
        },
        // Put files not handled in other tasks here
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{ico,txt,html}',
                        '.htaccess',
                        'images/{,*/}*.{webp,gif}',
                        'styles/fonts/*',
                        '.nojekyll',
                        '*.webapp',
                        'media/*.ogg'
                    ]
                }]
            }
        },
        concurrent: {
            server: [
                'compass:server'
            ],
            test: [
                'compass'
            ],
            dist: [
                'compass:dist',
                'imagemin',
                'svgmin'
                // 'htmlmin'
            ]
        },
        manifest: {
            generate: {
                options: {
                    basePath: '<%= yeoman.dist %>',
                    network: ['http://*', 'https://*'],
                    verbose: false,
                    timestamp: true
                },
                src: [
                    '*.html',
                    'scripts/*.js',
                    'styles/*.css',
                    'images/*.{png,jpg,jpeg,gif,webp,svg}',
                    'media/*.ogg'
                ],
                dest: '<%= yeoman.dist %>/manifest.appcache'
            }
        },
        githubPages: {
            target: {
                options: {
                    commitMessage: 'New deployment to github pages'
                },
                src: 'dist'
            }
        }
    });

    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',
            'concurrent:server',
            'livereload-start',
            'connect:livereload',
            'open',
            'watch'
        ]);
    });

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

    grunt.registerTask('build', [
        'clean:dist',
        'useminPrepare',
        'concurrent:dist',
        'cssmin',
        'concat',
        'uglify',
        'copy',
        'rev',
        'usemin'
    ]);

    grunt.registerTask('deploy', [
        'manifest',
        'githubPages:target'
    ]);

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


<commit_before>// Foundation Default -- Marián Hlaváč
// Generated on 2014-12-10 using generator-foundationdefault 1.0.2
'use strict';

module.exports = function (grunt) {

	// Project configuration
	grunt.initConfig({

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

		// Empties folders to start fresh
		clean: {
			dist: {
				files: [{
					dot: true,
					src: [
						'.tmp',
						'dist/*',
						'!dist/.git*'
					]
				}]
			},
			dev: {
				files: [{
					dot: true,
					src: [
						'.tmp',
						'index.html',
						'fittable.js',
						'fittable.css',
						'react.js'
					]
				}]
			}
		},

		// Compiles Sass to CSS and generates necessary files if requested
		compass: {
			dev: {
				options: {
					sassDir: 'src/scss',
					cssDir: './',
					noLineComments: true
				}
			},
			dist: {
				options: {
					sassDir: 'src/scss',
					cssDir: 'dist/',
					noLineComments: true,
					outputStyle: 'compressed'
				}
			}
		},

		// Watches files for changes and runs tasks based on the changed files
		watch: {
			compass: {
				files: ['src/scss/**/*.scss'],
				tasks: ['compass:dev', 'autoprefixer:dev']
			},
			browserify: {
				files: ['src/js/**/*.js'],
				tasks: ['browserify:dev']
			},
			copy: {
				files: ['src/*.html'],
				tasks: ['copy:dev']
			}
		},

		// Add vendor prefixed styles
		autoprefixer: {
			options: {
				browsers: ['last 2 version', 'ie >= 8', 'Android 3'] // add Android 3 for Android 4.3- gradients
			},
			dev: {
				files: [{
					src: '*.css'
				}]
			},
			dist: {
				files: [{
					src: 'dist/*.css'
				}]
			}
		},

		// Copies remaining files to places other tasks can use
		copy: {
			dist: {
				files: [{
					expand: true,
					dot: true,
					cwd: '.',
					dest: 'dist',
					flatten: true,
					src: [
						'src/*.html',
						'bower_components/react/react.js',
						'node_modules/babel/browser-polyfill.js'
					]
				}]
			},
			dev: {
				files: [{
					expand: true,
					dot: true,
					cwd: '.',
					dest: './',
					flatten: true,
					src: [
						'src/index.html',
						'bower_components/react/react.js',
                        'node_modules/babel/browser-polyfill.js'
					]
				}]
			}
		},

		// Browserify
		browserify: {
			dev: {
				files: {
					'./fittable.js': 'src/js/app.js'
				}
			},
			dist: {
				files: {
					'dist/fittable.js': 'src/js/app.js'
				}
			},
			options: {
				transform: [ 'babelify' ],
				browserifyOptions: {
					debug: true
				}
			}
		},

		// Uglify
		uglify: {
			dist: {
				'dist/fittable.min.js': ['./dist/fittable.js', './dist/react.js']
			}
		}

	});

	// Load grunt tasks automaticly
	require('load-grunt-tasks')(grunt);

	grunt.registerTask('default', [
		'clean:dev',
		'compass:dev',
		'autoprefixer:dev',
		'browserify:dev',
		'copy:dev',
		'watch'
	]);

	grunt.registerTask('build', [
		'clean:dist',
		'compass:dist',
		'autoprefixer:dist',
		'browserify:dist',
		'uglify:dist',
		'copy:dist'
	]);
};
<commit_msg>Fix Gruntfile indentation<commit_after>'use strict';

module.exports = function (grunt) {

  // Project configuration
  grunt.initConfig({

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

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            'dist/*',
            '!dist/.git*'
          ]
        }]
      },
      dev: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            'index.html',
            'fittable.js',
            'fittable.css',
            'react.js'
          ]
        }]
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      dev: {
        options: {
          sassDir: 'src/scss',
          cssDir: './',
          noLineComments: true
        }
      },
      dist: {
        options: {
          sassDir: 'src/scss',
          cssDir: 'dist/',
          noLineComments: true,
          outputStyle: 'compressed'
        }
      }
    },

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      compass: {
        files: ['src/scss/**/*.scss'],
        tasks: ['compass:dev', 'autoprefixer:dev']
      },
      browserify: {
        files: ['src/js/**/*.js'],
        tasks: ['browserify:dev']
      },
      copy: {
        files: ['src/*.html'],
        tasks: ['copy:dev']
      }
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 2 version', 'ie >= 8', 'Android 3'] // add Android 3 for Android 4.3- gradients
      },
      dev: {
        files: [{
          src: '*.css'
        }]
      },
      dist: {
        files: [{
          src: 'dist/*.css'
        }]
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '.',
          dest: 'dist',
          flatten: true,
          src: [
            'src/*.html',
            'bower_components/react/react.js',
            'node_modules/babel/browser-polyfill.js'
          ]
        }]
      },
      dev: {
        files: [{
          expand: true,
          dot: true,
          cwd: '.',
          dest: './',
          flatten: true,
          src: [
            'src/index.html',
            'bower_components/react/react.js',
            'node_modules/babel/browser-polyfill.js'
          ]
        }]
      }
    },

    // Browserify
    browserify: {
      dev: {
        files: {
          './fittable.js': 'src/js/app.js'
        }
      },
      dist: {
        files: {
          'dist/fittable.js': 'src/js/app.js'
        }
      },
      options: {
        transform: [ 'babelify' ],
        browserifyOptions: {
          debug: true
        }
      }
    },

    // Uglify
    uglify: {
      dist: {
        files: {
          'dist/fittable.min.js': [ 'dist/react.js', 'dist/browser-polyfill.js', 'dist/fittable.js' ]
        }
      }
    }
  });

  // Load grunt tasks automaticly
  require('load-grunt-tasks')(grunt);

  grunt.registerTask('default', [
    'clean:dev',
    'compass:dev',
    'autoprefixer:dev',
    'browserify:dev',
    'copy:dev',
    'watch'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'compass:dist',
    'autoprefixer:dist',
    'browserify:dist',
    'uglify:dist',
    'copy:dist'
  ]);
};
<|endoftext|>


<commit_before>/*!
 * Figuration
 * Copyright 2013-2017 CAST, Inc.
 * Licensed under MIT (https://github.com/cast-org/figuration/blob/master/LICENSE)
 */

module.exports = function(grunt) {
    'use strict';

    // Force use of Unix newlines
    grunt.util.linefeed = '\n';

    RegExp.quote = function(string) {
        return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
    };

    var saucekey = null;
    if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined') {
        saucekey = process.env.SAUCE_ACCESS_KEY;
    }

    var autoprefixerSettings = require('./grunt/autoprefixer-settings.js');
    var autoprefixer = require('autoprefixer')(autoprefixerSettings);
    var flexbugs = require('postcss-flexbugs-fixes');

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        banner: '/*!\n' +
                ' * Figuration (v<%= pkg.version %>)\n' +
                ' * <%= pkg.homepage %>\n' +
                ' * Copyright 2013-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
                ' * Licensed under MIT (https://github.com/cast-org/figuration/blob/master/LICENSE)\n' +
                ' * -----\n' +
                ' * Portions Copyright 2011-<%= grunt.template.today("yyyy") %>  the Bootstrap Authors and Twitter, Inc.\n' +
                ' * Used under MIT License (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' +
                ' */\n',
        jqueryCheck: 'if (typeof jQuery === \'undefined\') {\n' +
                     '  throw new Error(\'CAST Figuration\\\'s JavaScript requires jQuery\');\n' +
                     '}\n',
        jqueryVersionCheck: '(function($) {\n' +
                            '  var version = $.fn.jquery.split(\' \')[0].split(\'.\');\n' +
                            '  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) {\n' +
                            '    throw new Error(\'CAST Figuration\\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0\');\n' +
                            '  }\n' +
                            '})(jQuery);\n\n',

        // File definitions
        // ==========
        jsCore: [
            'js/util.js',
            'js/drag.js',
            'js/collapse.js',
            'js/dropdown.js',
            'js/tab.js',
            'js/affix.js',
            'js/tooltip.js',
            'js/popover.js',
            'js/modal.js',
            'js/accordion.js',
            'js/tab-responsive.js',
            'js/slideshow.js',
            'js/scrollspy.js',
            'js/alert.js',
            'js/button.js',
            'js/lazy.js',
            'js/slider.js',
            'js/img-compare.js',
            'js/equalize.js',
            'js/player.js',
            'js/common.js'
        ],

        jsDocs: [
            'docs/assets/js/vendor/anchor.min.js',
            'docs/assets/js/vendor/clipboard.min.js',
            'docs/assets/js/vendor/holder.min.js',
            'docs/assets/js/src/docs.js'
        ],

        // Task configs
        // ==========
        clean: {
            dist: 'dist',
            docs: 'docs/dist'
        },

        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            grunt: {
                options: {
                    jshintrc: 'grunt/.jshintrc'
                },
                src: ['Gruntfile.js', 'grunt/*.js']
            },
            core: {
                src: '<%= jsCore %>'
            },
            test: {
                options: {
                    jshintrc: 'test/js/unit/.jshintrc'
                },
                src: 'test/js/unit/*.js'
            }
            /*,
            docs: {
                src: ['docs/assets/js/src/*.js', 'docs/assets/js/*.js', '!docs/assets/js/*.min.js']
            }
            */
        },

        jscs: {
            options: {
                config: '.jscsrc'
            },
            grunt: {
                src: '<%= jshint.grunt.src %>'
            },
            core: {
                src: '<%= jshint.core.src %>'
            },
            test: {
                src: '<%= jshint.test.src %>'
            },
            docs: {
                options: {
                    requireCamelCaseOrUpperCaseIdentifiers: null
                },
                src: ['docs/assets/js/src/*.js', 'docs/assets/js/*.js', '!docs/assets/js/*.min.js']
            }
        },

        qunit: {
            options: {
                inject: 'test/js/unit/phantom.js'
            },
            files: 'test/js/index.html'
        },

        concat: {
            options: {
                banner: '<%= banner %>\n<%= jqueryCheck %>\n<%= jqueryVersionCheck %>',
                stripBanners: false
            },
            core: {
                src: '<%= jsCore %>',
                dest: 'dist/js/<%= pkg.name %>.js'
            }
        },

        uglify: {
            options: {
                compress: {
                    warnings: false
                },
                mangle: true,
                output: {
                    comments: /^!|@preserve|@license|@cc_on/i
                }
            },
            core: {
                src: '<%= concat.core.dest %>',
                dest: 'dist/js/<%= pkg.name %>.min.js'
            },
            docs: {
                src: '<%= jsDocs %>',
                dest: 'docs/assets/js/docs.min.js'
            }
        },

        copy: {
            docs: {
                expand: true,
                cwd: 'dist/',
                src: ['**/*'],
                dest: 'docs/dist/'
            }
        },

        scsslint: {
            options: {
                configFile: '.scss-lint.yml'
            },
            core: {
                src: ['scss/*.scss', 'scss/**/*.scss', '!scss/base/_normalize.scss']
            },
            docs: {
                src: ['docs/assets/scss/*.scss']
            }
        },

        sass: {
            options: {
                includePaths: ['scss'],
                precision: 6,
                sourceComments: false,
                sourceMap: true,
                outputStyle: 'expanded'
            },
            core: {
                files: {
                    'dist/css/<%= pkg.name %>.css': 'scss/<%= pkg.name %>.scss'
                }
            },
            docs: {
                files: {
                    'docs/assets/css/docs.css': 'docs/assets/scss/docs.scss'
                }
            }
        },

        postcss: {
            core: {
                options: {
                    map: true,
                    processors: [flexbugs, autoprefixer]
                },
                src: ['dist/css/*.css', '!dist/css/*.min.css']
            },
            docs: {
                options: {
                    processors: [flexbugs, autoprefixer]
                },
                src: ['docs/assets/css/*.css', '!docs/assets/css/*.min.css']
            }
        },

        cssmin: {
            options: {
                specialComments: '*',
                sourceMap: true,
                advanced: false
            },
            core: {
                files: [
                    {
                        expand: true,
                        cwd: 'dist/css',
                        src: ['*.css', '!*.min.css'],
                        dest: 'dist/css',
                        ext: '.min.css'
                    }
                ]
            },
            docs: {
                files: [
                    {
                        expand: true,
                        cwd: 'docs/assets/css',
                        src: ['*.css', '!*.min.css'],
                        dest: 'docs/assets/css',
                        ext: '.min.css'
                    }
                ]
            }
        },

        jekyll: {
            options: {
                bundleExec: true,
                config: '_config.yml',
                incremental: false
            },
            docs: {},
            github: {
                options: {
                    raw: 'github: true'
                }
            }
        },

        /* jshint -W100 */
        htmllint: {
            options: {
                ignore: [
                    'Attribute "autocomplete" is only allowed when the input type is "color", "date", "datetime", "datetime-local", "email", "hidden", "month", "number", "password", "range", "search", "tel", "text", "time", "url", or "week".',
                    'Attribute "autocomplete" not allowed on element "button" at this point.',
                    'Consider using the "h1" element as a top-level heading only (all "h1" elements are treated as top-level headings by many screen readers and other tools).',
                    'Element "div" not allowed as child of element "progress" in this context. (Suppressing further errors from this subtree.)',
                    'Element "img" is missing required attribute "src".',
                    'The "color" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "date" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "datetime" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "datetime-local" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "month" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "time" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "week" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.'
                ]
            },
            docs: {
                src: ['_gh_pages/**/*.html']
            }
            // TODO:
            // test: {
            //    src: ['js/tests/visual/*.html']
            // }
        },
        /* jshint +W100 */

        watch: {
            src: {
                files: '<%= jshint.core.src %>',
                tasks: ['jshint:core', 'qunit', 'concat']
            },
            sass: {
                files: 'scss/**/*.scss',
                tasks: ['dist-css', 'docs']
            },
            docs: {
                files: 'docs/assets/scss/**/*.scss',
                tasks: ['dist-css', 'docs']
            }
        },

        connect: {
            server: {
                options: {
                    port: 3000,
                    base: '.'
                }
            }
        },

        'saucelabs-qunit': {
            all: {
                options: {
                    build: process.env.TRAVIS_JOB_ID,
                    throttled: 3,
                    maxRetries: 3,
                    maxPollRetries: 4,
                    urls: ['http://127.0.0.1:3000/test/js/index.html?hidepassed'],
                    browsers: grunt.file.readYAML('grunt/sauce_browsers.yml'),
                    sauceConfig: {
                        'video-upload-on-pass': false
                    }
                }
            }
        }
    });

    // Tasks
    // ==========
    // Load required plugins for tasks
    require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });
    require('time-grunt')(grunt);

    // Default
    grunt.registerTask('default', ['clean:dist', 'test']);

    // Test
    grunt.registerTask('test', ['dist-css', 'dist-js', 'test-css', 'test-js']);
    grunt.registerTask('test-css', ['scsslint:core']);

    // Test - JS subtasks
    var jsTestTasks = ['jshint:core', 'jshint:test', 'jshint:grunt', 'jscs:core', 'jscs:test', 'jscs:grunt'];
    if (saucekey !== null && process.env.TEST_SAUCE === 'true') {
        jsTestTasks.push('connect');
        jsTestTasks.push('saucelabs-qunit');
    } else {
        jsTestTasks.push('qunit');
    }
    grunt.registerTask('test-js', jsTestTasks);

    // CSS distribution
    grunt.registerTask('dist-css', ['sass:core', 'postcss:core', 'cssmin:core']);

    // JS distribution
    grunt.registerTask('dist-js', ['concat', 'uglify:core']);

    // Full distribution
    grunt.registerTask('dist', ['clean:dist', 'dist-css', 'dist-js']);

    // Docs tasks
    grunt.registerTask('docs-test-html', ['jekyll:docs', 'htmllint:docs']);
    grunt.registerTask('docs-test-css', ['scsslint:docs']);
    grunt.registerTask('docs-dist-css', ['sass:docs', 'postcss:docs', 'cssmin:docs']);
    grunt.registerTask('docs-test-js', ['jscs:docs']);
    grunt.registerTask('docs-dist-js', ['uglify:docs']);
    grunt.registerTask('docs', ['docs-test-css', 'docs-dist-css', 'docs-test-js', 'docs-dist-js', 'clean:docs', 'copy:docs']);
    grunt.registerTask('docs-github', ['jekyll:github']);

};
<commit_msg>Ignore role="main" error<commit_after>/*!
 * Figuration
 * Copyright 2013-2017 CAST, Inc.
 * Licensed under MIT (https://github.com/cast-org/figuration/blob/master/LICENSE)
 */

module.exports = function(grunt) {
    'use strict';

    // Force use of Unix newlines
    grunt.util.linefeed = '\n';

    RegExp.quote = function(string) {
        return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
    };

    var saucekey = null;
    if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined') {
        saucekey = process.env.SAUCE_ACCESS_KEY;
    }

    var autoprefixerSettings = require('./grunt/autoprefixer-settings.js');
    var autoprefixer = require('autoprefixer')(autoprefixerSettings);
    var flexbugs = require('postcss-flexbugs-fixes');

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        banner: '/*!\n' +
                ' * Figuration (v<%= pkg.version %>)\n' +
                ' * <%= pkg.homepage %>\n' +
                ' * Copyright 2013-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
                ' * Licensed under MIT (https://github.com/cast-org/figuration/blob/master/LICENSE)\n' +
                ' * -----\n' +
                ' * Portions Copyright 2011-<%= grunt.template.today("yyyy") %>  the Bootstrap Authors and Twitter, Inc.\n' +
                ' * Used under MIT License (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' +
                ' */\n',
        jqueryCheck: 'if (typeof jQuery === \'undefined\') {\n' +
                     '  throw new Error(\'CAST Figuration\\\'s JavaScript requires jQuery\');\n' +
                     '}\n',
        jqueryVersionCheck: '(function($) {\n' +
                            '  var version = $.fn.jquery.split(\' \')[0].split(\'.\');\n' +
                            '  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) {\n' +
                            '    throw new Error(\'CAST Figuration\\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0\');\n' +
                            '  }\n' +
                            '})(jQuery);\n\n',

        // File definitions
        // ==========
        jsCore: [
            'js/util.js',
            'js/drag.js',
            'js/collapse.js',
            'js/dropdown.js',
            'js/tab.js',
            'js/affix.js',
            'js/tooltip.js',
            'js/popover.js',
            'js/modal.js',
            'js/accordion.js',
            'js/tab-responsive.js',
            'js/slideshow.js',
            'js/scrollspy.js',
            'js/alert.js',
            'js/button.js',
            'js/lazy.js',
            'js/slider.js',
            'js/img-compare.js',
            'js/equalize.js',
            'js/player.js',
            'js/common.js'
        ],

        jsDocs: [
            'docs/assets/js/vendor/anchor.min.js',
            'docs/assets/js/vendor/clipboard.min.js',
            'docs/assets/js/vendor/holder.min.js',
            'docs/assets/js/src/docs.js'
        ],

        // Task configs
        // ==========
        clean: {
            dist: 'dist',
            docs: 'docs/dist'
        },

        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            grunt: {
                options: {
                    jshintrc: 'grunt/.jshintrc'
                },
                src: ['Gruntfile.js', 'grunt/*.js']
            },
            core: {
                src: '<%= jsCore %>'
            },
            test: {
                options: {
                    jshintrc: 'test/js/unit/.jshintrc'
                },
                src: 'test/js/unit/*.js'
            }
            /*,
            docs: {
                src: ['docs/assets/js/src/*.js', 'docs/assets/js/*.js', '!docs/assets/js/*.min.js']
            }
            */
        },

        jscs: {
            options: {
                config: '.jscsrc'
            },
            grunt: {
                src: '<%= jshint.grunt.src %>'
            },
            core: {
                src: '<%= jshint.core.src %>'
            },
            test: {
                src: '<%= jshint.test.src %>'
            },
            docs: {
                options: {
                    requireCamelCaseOrUpperCaseIdentifiers: null
                },
                src: ['docs/assets/js/src/*.js', 'docs/assets/js/*.js', '!docs/assets/js/*.min.js']
            }
        },

        qunit: {
            options: {
                inject: 'test/js/unit/phantom.js'
            },
            files: 'test/js/index.html'
        },

        concat: {
            options: {
                banner: '<%= banner %>\n<%= jqueryCheck %>\n<%= jqueryVersionCheck %>',
                stripBanners: false
            },
            core: {
                src: '<%= jsCore %>',
                dest: 'dist/js/<%= pkg.name %>.js'
            }
        },

        uglify: {
            options: {
                compress: {
                    warnings: false
                },
                mangle: true,
                output: {
                    comments: /^!|@preserve|@license|@cc_on/i
                }
            },
            core: {
                src: '<%= concat.core.dest %>',
                dest: 'dist/js/<%= pkg.name %>.min.js'
            },
            docs: {
                src: '<%= jsDocs %>',
                dest: 'docs/assets/js/docs.min.js'
            }
        },

        copy: {
            docs: {
                expand: true,
                cwd: 'dist/',
                src: ['**/*'],
                dest: 'docs/dist/'
            }
        },

        scsslint: {
            options: {
                configFile: '.scss-lint.yml'
            },
            core: {
                src: ['scss/*.scss', 'scss/**/*.scss', '!scss/base/_normalize.scss']
            },
            docs: {
                src: ['docs/assets/scss/*.scss']
            }
        },

        sass: {
            options: {
                includePaths: ['scss'],
                precision: 6,
                sourceComments: false,
                sourceMap: true,
                outputStyle: 'expanded'
            },
            core: {
                files: {
                    'dist/css/<%= pkg.name %>.css': 'scss/<%= pkg.name %>.scss'
                }
            },
            docs: {
                files: {
                    'docs/assets/css/docs.css': 'docs/assets/scss/docs.scss'
                }
            }
        },

        postcss: {
            core: {
                options: {
                    map: true,
                    processors: [flexbugs, autoprefixer]
                },
                src: ['dist/css/*.css', '!dist/css/*.min.css']
            },
            docs: {
                options: {
                    processors: [flexbugs, autoprefixer]
                },
                src: ['docs/assets/css/*.css', '!docs/assets/css/*.min.css']
            }
        },

        cssmin: {
            options: {
                specialComments: '*',
                sourceMap: true,
                advanced: false
            },
            core: {
                files: [
                    {
                        expand: true,
                        cwd: 'dist/css',
                        src: ['*.css', '!*.min.css'],
                        dest: 'dist/css',
                        ext: '.min.css'
                    }
                ]
            },
            docs: {
                files: [
                    {
                        expand: true,
                        cwd: 'docs/assets/css',
                        src: ['*.css', '!*.min.css'],
                        dest: 'docs/assets/css',
                        ext: '.min.css'
                    }
                ]
            }
        },

        jekyll: {
            options: {
                bundleExec: true,
                config: '_config.yml',
                incremental: false
            },
            docs: {},
            github: {
                options: {
                    raw: 'github: true'
                }
            }
        },

        /* jshint -W100 */
        htmllint: {
            options: {
                ignore: [
                    'Attribute "autocomplete" is only allowed when the input type is "color", "date", "datetime", "datetime-local", "email", "hidden", "month", "number", "password", "range", "search", "tel", "text", "time", "url", or "week".',
                    'Attribute "autocomplete" not allowed on element "button" at this point.',
                    'Consider using the "h1" element as a top-level heading only (all "h1" elements are treated as top-level headings by many screen readers and other tools).',
                    'Element "div" not allowed as child of element "progress" in this context. (Suppressing further errors from this subtree.)',
                    'Element "img" is missing required attribute "src".',
                    'The "color" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "date" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "datetime" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "datetime-local" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "month" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "time" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "week" input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
                    'The "main" role is unnecessary for element "main".'
                ]
            },
            docs: {
                src: ['_gh_pages/**/*.html']
            }
            // TODO:
            // test: {
            //    src: ['js/tests/visual/*.html']
            // }
        },
        /* jshint +W100 */

        watch: {
            src: {
                files: '<%= jshint.core.src %>',
                tasks: ['jshint:core', 'qunit', 'concat']
            },
            sass: {
                files: 'scss/**/*.scss',
                tasks: ['dist-css', 'docs']
            },
            docs: {
                files: 'docs/assets/scss/**/*.scss',
                tasks: ['dist-css', 'docs']
            }
        },

        connect: {
            server: {
                options: {
                    port: 3000,
                    base: '.'
                }
            }
        },

        'saucelabs-qunit': {
            all: {
                options: {
                    build: process.env.TRAVIS_JOB_ID,
                    throttled: 3,
                    maxRetries: 3,
                    maxPollRetries: 4,
                    urls: ['http://127.0.0.1:3000/test/js/index.html?hidepassed'],
                    browsers: grunt.file.readYAML('grunt/sauce_browsers.yml'),
                    sauceConfig: {
                        'video-upload-on-pass': false
                    }
                }
            }
        }
    });

    // Tasks
    // ==========
    // Load required plugins for tasks
    require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });
    require('time-grunt')(grunt);

    // Default
    grunt.registerTask('default', ['clean:dist', 'test']);

    // Test
    grunt.registerTask('test', ['dist-css', 'dist-js', 'test-css', 'test-js']);
    grunt.registerTask('test-css', ['scsslint:core']);

    // Test - JS subtasks
    var jsTestTasks = ['jshint:core', 'jshint:test', 'jshint:grunt', 'jscs:core', 'jscs:test', 'jscs:grunt'];
    if (saucekey !== null && process.env.TEST_SAUCE === 'true') {
        jsTestTasks.push('connect');
        jsTestTasks.push('saucelabs-qunit');
    } else {
        jsTestTasks.push('qunit');
    }
    grunt.registerTask('test-js', jsTestTasks);

    // CSS distribution
    grunt.registerTask('dist-css', ['sass:core', 'postcss:core', 'cssmin:core']);

    // JS distribution
    grunt.registerTask('dist-js', ['concat', 'uglify:core']);

    // Full distribution
    grunt.registerTask('dist', ['clean:dist', 'dist-css', 'dist-js']);

    // Docs tasks
    grunt.registerTask('docs-test-html', ['jekyll:docs', 'htmllint:docs']);
    grunt.registerTask('docs-test-css', ['scsslint:docs']);
    grunt.registerTask('docs-dist-css', ['sass:docs', 'postcss:docs', 'cssmin:docs']);
    grunt.registerTask('docs-test-js', ['jscs:docs']);
    grunt.registerTask('docs-dist-js', ['uglify:docs']);
    grunt.registerTask('docs', ['docs-test-css', 'docs-dist-css', 'docs-test-js', 'docs-dist-js', 'clean:docs', 'copy:docs']);
    grunt.registerTask('docs-github', ['jekyll:github']);

};
<|endoftext|>