<commit_before>var semver = require('semver'),
    fs = require('fs'),
    currentVersion = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version,
    env = require('./config/environment');

// Globals
var PROMPT_CONFIRM_CONFIG = 'confirmation',
    GIT_BRANCH = env.get('FILER_UPSTREAM_BRANCH'),
    GIT_REMOTE = env.get('FILER_UPSTREAM_REMOTE_NAME'),
    GIT_FULL_REMOTE = env.get('FILER_UPSTREAM_URI') + ' ' + GIT_BRANCH;

module.exports = function(grunt) {

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

    clean: ['dist/filer-test.js', 'dist/filer-issue225.js', 'dist/filer-perf.js'],

    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      develop: {
        src: 'dist/filer.js',
        dest: 'dist/filer.min.js'
      }
    },

    jshint: {
      // Don't bother with src/path.js
      all: [
        'gruntfile.js',
        'config/environment.js',
        'src/constants.js',
        'src/errors.js',
        'src/fs.js',
        'src/index.js',
        'src/shared.js',
        'src/shell.js',
        'src/fswatcher.js',
        'src/environment.js',
        'src/providers/**/*.js',
        'src/adapters/**/*.js',
        'src/directory-entry.js',
        'src/open-file-description.js',
        'src/super-node.js',
        'src/node.js',
        'src/stats.js',
        'src/filesystem/**/*.js'
      ]
    },

    browserify: {
      filerDist: {
        src: "./src/index.js",
        dest: "./dist/filer.js",
        options: {
          browserifyOptions: {
            commondir: false
          },
          bundleOptions: {
            standalone: 'Filer'
          },
          exclude: ["./node_modules/request/index.js"]
        }
      },
      filerPerf: {
        src: "./perf/index.js",
        dest: "./dist/filer-perf.js",
        options: {
          browserifyOptions: {
            commondir: false
          },
          bundleOptions: {
            standalone: 'Filer'
          }
        }
      },
      filerTest: {
        src: "./tests/index.js",
        dest: "./dist/filer-test.js"
      },
      // See tests/bugs/issue225.js
      filerIssue225: {
        src: "./src/index.js",
        dest: "./dist/filer-issue225.js",
        options: {
          browserifyOptions: {
            commondir: false
          },
          bundleOptions: {
            standalone: 'Filer'
          }
        }
      }
    },

    shell: {
      mocha: {
        // Run all tests (e.g., tests require()'ed in tests/index.js) and also tests/bugs/issue225.js
        // separately, since it can't be included in a browserify build.
        command: '"./node_modules/.bin/mocha" --reporter list tests/index.js && "./node_modules/.bin/mocha" --reporter list tests/bugs/issue225.js'
      }
    },

    bump: {
      options: {
        files: ['package.json', 'bower.json'],
        commit: true,
        commitMessage: 'v%VERSION%',
        commitFiles: ['package.json', 'bower.json', './dist/filer.js', './dist/filer.min.js'],
        createTag: true,
        tagName: 'v%VERSION%',
        tagMessage: 'v%VERSION%',
        push: true,
        pushTo: GIT_FULL_REMOTE
      }
    },

    'npm-checkBranch': {
      options: {
        branch: GIT_BRANCH
      }
    },

    'npm-publish': {
      options: {
        abortIfDirty: false
      }
    },

    prompt: {
      confirm: {
        options: {
          questions: [
            {
              config: PROMPT_CONFIRM_CONFIG,
              type: 'confirm',
              message: 'Bump version from ' + (currentVersion).cyan +
                          ' to ' + semver.inc(currentVersion, "patch").yellow + '?',
              default: false
            }
          ],
          then: function(results) {
            if (!results[PROMPT_CONFIRM_CONFIG]) {
              return grunt.fatal('User aborted...');
            }
          }
        }
      }
    },

    gitcheckout: {
      publish: {
        options: {
          branch: 'gh-pages',
          force: true
        }
      },
      revert: {
        options: {
          branch: GIT_BRANCH
        }
      }
    },

    gitpush: {
      publish: {
        options: {
          remote: GIT_REMOTE,
          branch: 'gh-pages',
          force: true
        },
      }
    },

    gitcommit: {
      publish: {
        options: {
          noStatus: true
        }
      }
    },

    gitadd: {
      publish: {
        files: {
          src: ['./dist/filer-test.js', './dist/filer-perf.js', 'tests/', 'perf/']
        }
      }
    },

    gitstash: {
      publish: {
      },
      pop: {
        options: {
          command: "pop"
        }
      }
    },

    gitrm: {
      publish: {
        options: {
          force: true
        },
        files: {
          src: ['./dist/filer-test.js', './dist/filer-perf.js', 'tests/', 'perf/']
        }
      }
    },

    connect: {
      serverForNode: {
        options: {
          port: 1234,
          base: '.'
        }
      },
      serverForBrowser: {
        options: {
          port: 1234,
          base: '.',
          keepalive: true
        }
      }
    },

    usebanner: {
      publish: {
        options: {
          position: "top"
        },
        files: {
          src: ['./dist/filer-test.js', './dist/filer-perf.js']
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-bump');
  grunt.loadNpmTasks('grunt-npm');
  grunt.loadNpmTasks('grunt-git');
  grunt.loadNpmTasks('grunt-prompt');
  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-browserify');
  grunt.loadNpmTasks('grunt-banner');

  grunt.registerTask('develop', ['clean', 'browserify:filerDist', 'browserify:filerIssue225']);
  grunt.registerTask('build-tests', ['clean', 'browserify:filerTest', 'browserify:filerPerf']);
  grunt.registerTask('release', ['test', 'develop', 'uglify']);

  grunt.registerTask('publish', 'Publish filer as a new version to NPM, bower and github.', function(patchLevel) {
    var allLevels = ['patch', 'minor', 'major'];

    // No level specified defaults to 'patch'
    patchLevel = (patchLevel || 'patch').toLowerCase();

    // Fail out if the patch level isn't recognized
    if (allLevels.filter(function(el) { return el == patchLevel; }).length === 0) {
      return grunt.fatal('Patch level not recognized! "Patch", "minor" or "major" only.');
    }

    // Set prompt message
    var promptOpts = grunt.config('prompt.confirm.options');
    promptOpts.questions[0].message =  'Bump version from ' + (currentVersion).cyan +
      ' to ' + semver.inc(currentVersion, patchLevel).yellow + '?';
    grunt.config('prompt.confirm.options', promptOpts);

    // Store the new version in the gh-pages commit message
    var ghPagesMessage = 'Tests for Filer v' + semver.inc(currentVersion, patchLevel);
    grunt.config('gitcommit.publish.options.message', ghPagesMessage);

    // Store the new version as a banner in the test file
    // NOTE: This is a hack intended to ensure that this build process
    //       succeeds even if no changes were made to the tests
    //       before publishing a new version. Otherwise, the automatic
    //       commit + push to github pages would break a normal build
    var bannerMsg = "/* Test file for filerjs v" + semver.inc(currentVersion, patchLevel) + "*/";
    grunt.config('usebanner.publish.options.banner', bannerMsg);

    grunt.task.run([
      'prompt:confirm',
      'checkBranch',
      'release',
      'bump:' + patchLevel,
      'build-tests',
      'usebanner:publish',
      'gitadd:publish',
      'gitstash:publish',
      'gitcheckout:publish',
      'gitrm:publish',
      'gitstash:pop',
      'gitcommit:publish',
      'gitpush:publish',
      'gitcheckout:revert',
      'npm-publish'
    ]);
  });
  grunt.registerTask('test-node', ['jshint', 'browserify:filerIssue225', 'connect:serverForNode', 'shell:mocha']);
  grunt.registerTask('test-browser', ['jshint', 'build-tests', 'connect:serverForBrowser']);
  grunt.registerTask('test', ['clean', 'test-node']);

  grunt.registerTask('default', ['test']);
};
<commit_msg>gitrm can't handle directories :/<commit_after>var semver = require('semver'),
    fs = require('fs'),
    currentVersion = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version,
    env = require('./config/environment');

// Globals
var PROMPT_CONFIRM_CONFIG = 'confirmation',
    GIT_BRANCH = env.get('FILER_UPSTREAM_BRANCH'),
    GIT_REMOTE = env.get('FILER_UPSTREAM_REMOTE_NAME'),
    GIT_FULL_REMOTE = env.get('FILER_UPSTREAM_URI') + ' ' + GIT_BRANCH;

module.exports = function(grunt) {

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

    clean: ['dist/filer-test.js', 'dist/filer-issue225.js', 'dist/filer-perf.js'],

    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      develop: {
        src: 'dist/filer.js',
        dest: 'dist/filer.min.js'
      }
    },

    jshint: {
      // Don't bother with src/path.js
      all: [
        'gruntfile.js',
        'config/environment.js',
        'src/constants.js',
        'src/errors.js',
        'src/fs.js',
        'src/index.js',
        'src/shared.js',
        'src/shell.js',
        'src/fswatcher.js',
        'src/environment.js',
        'src/providers/**/*.js',
        'src/adapters/**/*.js',
        'src/directory-entry.js',
        'src/open-file-description.js',
        'src/super-node.js',
        'src/node.js',
        'src/stats.js',
        'src/filesystem/**/*.js'
      ]
    },

    browserify: {
      filerDist: {
        src: "./src/index.js",
        dest: "./dist/filer.js",
        options: {
          browserifyOptions: {
            commondir: false
          },
          bundleOptions: {
            standalone: 'Filer'
          },
          exclude: ["./node_modules/request/index.js"]
        }
      },
      filerPerf: {
        src: "./perf/index.js",
        dest: "./dist/filer-perf.js",
        options: {
          browserifyOptions: {
            commondir: false
          },
          bundleOptions: {
            standalone: 'Filer'
          }
        }
      },
      filerTest: {
        src: "./tests/index.js",
        dest: "./dist/filer-test.js"
      },
      // See tests/bugs/issue225.js
      filerIssue225: {
        src: "./src/index.js",
        dest: "./dist/filer-issue225.js",
        options: {
          browserifyOptions: {
            commondir: false
          },
          bundleOptions: {
            standalone: 'Filer'
          }
        }
      }
    },

    shell: {
      mocha: {
        // Run all tests (e.g., tests require()'ed in tests/index.js) and also tests/bugs/issue225.js
        // separately, since it can't be included in a browserify build.
        command: '"./node_modules/.bin/mocha" --reporter list tests/index.js && "./node_modules/.bin/mocha" --reporter list tests/bugs/issue225.js'
      }
    },

    bump: {
      options: {
        files: ['package.json', 'bower.json'],
        commit: true,
        commitMessage: 'v%VERSION%',
        commitFiles: ['package.json', 'bower.json', './dist/filer.js', './dist/filer.min.js'],
        createTag: true,
        tagName: 'v%VERSION%',
        tagMessage: 'v%VERSION%',
        push: true,
        pushTo: GIT_FULL_REMOTE
      }
    },

    'npm-checkBranch': {
      options: {
        branch: GIT_BRANCH
      }
    },

    'npm-publish': {
      options: {
        abortIfDirty: false
      }
    },

    prompt: {
      confirm: {
        options: {
          questions: [
            {
              config: PROMPT_CONFIRM_CONFIG,
              type: 'confirm',
              message: 'Bump version from ' + (currentVersion).cyan +
                          ' to ' + semver.inc(currentVersion, "patch").yellow + '?',
              default: false
            }
          ],
          then: function(results) {
            if (!results[PROMPT_CONFIRM_CONFIG]) {
              return grunt.fatal('User aborted...');
            }
          }
        }
      }
    },

    gitcheckout: {
      publish: {
        options: {
          branch: 'gh-pages',
          force: true
        }
      },
      revert: {
        options: {
          branch: GIT_BRANCH
        }
      }
    },

    gitpush: {
      publish: {
        options: {
          remote: GIT_REMOTE,
          branch: 'gh-pages',
          force: true
        },
      }
    },

    gitcommit: {
      publish: {
        options: {
          noStatus: true
        }
      }
    },

    gitadd: {
      publish: {
        files: {
          src: ['./dist/filer-test.js', './dist/filer-perf.js']
        }
      }
    },

    gitstash: {
      publish: {
      },
      pop: {
        options: {
          command: "pop"
        }
      }
    },

    gitrm: {
      publish: {
        options: {
          force: true
        },
        files: {
          src: ['./dist/filer-test.js', './dist/filer-perf.js']
        }
      }
    },

    connect: {
      serverForNode: {
        options: {
          port: 1234,
          base: '.'
        }
      },
      serverForBrowser: {
        options: {
          port: 1234,
          base: '.',
          keepalive: true
        }
      }
    },

    usebanner: {
      publish: {
        options: {
          position: "top"
        },
        files: {
          src: ['./dist/filer-test.js', './dist/filer-perf.js']
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-bump');
  grunt.loadNpmTasks('grunt-npm');
  grunt.loadNpmTasks('grunt-git');
  grunt.loadNpmTasks('grunt-prompt');
  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-browserify');
  grunt.loadNpmTasks('grunt-banner');

  grunt.registerTask('develop', ['clean', 'browserify:filerDist', 'browserify:filerIssue225']);
  grunt.registerTask('build-tests', ['clean', 'browserify:filerTest', 'browserify:filerPerf']);
  grunt.registerTask('release', ['test', 'develop', 'uglify']);

  grunt.registerTask('publish', 'Publish filer as a new version to NPM, bower and github.', function(patchLevel) {
    var allLevels = ['patch', 'minor', 'major'];

    // No level specified defaults to 'patch'
    patchLevel = (patchLevel || 'patch').toLowerCase();

    // Fail out if the patch level isn't recognized
    if (allLevels.filter(function(el) { return el == patchLevel; }).length === 0) {
      return grunt.fatal('Patch level not recognized! "Patch", "minor" or "major" only.');
    }

    // Set prompt message
    var promptOpts = grunt.config('prompt.confirm.options');
    promptOpts.questions[0].message =  'Bump version from ' + (currentVersion).cyan +
      ' to ' + semver.inc(currentVersion, patchLevel).yellow + '?';
    grunt.config('prompt.confirm.options', promptOpts);

    // Store the new version in the gh-pages commit message
    var ghPagesMessage = 'Tests for Filer v' + semver.inc(currentVersion, patchLevel);
    grunt.config('gitcommit.publish.options.message', ghPagesMessage);

    // Store the new version as a banner in the test file
    // NOTE: This is a hack intended to ensure that this build process
    //       succeeds even if no changes were made to the tests
    //       before publishing a new version. Otherwise, the automatic
    //       commit + push to github pages would break a normal build
    var bannerMsg = "/* Test file for filerjs v" + semver.inc(currentVersion, patchLevel) + "*/";
    grunt.config('usebanner.publish.options.banner', bannerMsg);

    grunt.task.run([
      'prompt:confirm',
      'checkBranch',
      'release',
      'bump:' + patchLevel,
      'build-tests',
      'usebanner:publish',
      'gitadd:publish',
      'gitstash:publish',
      'gitcheckout:publish',
      'gitrm:publish',
      'gitstash:pop',
      'gitcommit:publish',
      'gitpush:publish',
      'gitcheckout:revert',
      'npm-publish'
    ]);
  });
  grunt.registerTask('test-node', ['jshint', 'browserify:filerIssue225', 'connect:serverForNode', 'shell:mocha']);
  grunt.registerTask('test-browser', ['jshint', 'build-tests', 'connect:serverForBrowser']);
  grunt.registerTask('test', ['clean', 'test-node']);

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


<commit_before>"use strict";
/*jshint node: true*/
/*eslint-env node*/

module.exports = function (grunt) {

    require("time-grunt")(grunt);

    // Since the tasks are split using load-grunt-config, a global object contains the configuration
    /*global configFile, configuration*/
    var ConfigFile = require("./make/configFile.js");
    global.configFile = new ConfigFile();
    global.configuration = Object.create(configFile.content);
    if (configFile.isNew()) {
        grunt.registerTask("default", function () {
            var done = this.async(); //eslint-disable-line no-invalid-this
            grunt.util.spawn({
                cmd: "node",
                args: ["make/config"],
                opts: {
                    stdio: "inherit"
                }
            }, function (error) {
                if (error) {
                    done();
                    return;
                }
                grunt.util.spawn({
                    grunt: true,
                    args: ["check", "jsdoc", "default"],
                    opts: {
                        stdio: "inherit"
                    }
                }, done);
            });
        });
        return;
    }

    configFile.readSourceFiles();

    // Amend the configuration with internal settings
    configuration.pkg = grunt.file.readJSON("./package.json");

    require("load-grunt-config")(grunt);
    grunt.task.loadTasks("grunt/tasks");

};
<commit_msg>Adds common path to global configuration (#208)<commit_after>"use strict";
/*jshint node: true*/
/*eslint-env node*/

module.exports = function (grunt) {

    require("time-grunt")(grunt);

    // Since the tasks are split using load-grunt-config, a global object contains the configuration
    /*global configFile, configuration*/
    var ConfigFile = require("./make/configFile.js");
    global.configFile = new ConfigFile();
    global.configuration = Object.create(configFile.content);
    if (configFile.isNew()) {
        grunt.registerTask("default", function () {
            var done = this.async(); //eslint-disable-line no-invalid-this
            grunt.util.spawn({
                cmd: "node",
                args: ["make/config"],
                opts: {
                    stdio: "inherit"
                }
            }, function (error) {
                if (error) {
                    done();
                    return;
                }
                grunt.util.spawn({
                    grunt: true,
                    args: ["check", "jsdoc", "default"],
                    opts: {
                        stdio: "inherit"
                    }
                }, done);
            });
        });
        return;
    }

    configFile.readSourceFiles();

    // Amend the configuration with internal settings
    configuration.pkg = grunt.file.readJSON("./package.json");

    // As well as known path
    configuration.path = {
        plato: "tmp/plato/"
    };

    require("load-grunt-config")(grunt);
    grunt.task.loadTasks("grunt/tasks");

};
<|endoftext|>


<commit_before> exports.BattleAbilities = {
 "drunkenfist": {
    desc: "If a contact move knocks out this Pokemon, the opponent receives damage equal to one-fourth of its max HP.",
		shortDesc: "If this Pokemon is KOed with a contact move, that move's user loses 1/4 its max HP.",
		id: "drunkenfist",
		name: "Drunken Fist",
		onSwitchIn: function (pokemon) {
			      this.add('-message', pokemon.name + " is drunk!");
			pokemon.addVolatile('confusion');
			 self: {
				boosts: {
			spa: 2,
			atk: 2
		},
			}
		},
		rating: 3,
		num: 800
	},
	"objection": {
		desc: "This Pokémon avoids all Rock-type attacks and hazards when switching in.",
		shortDesc: "On switch-in, this Pokemon avoids all Rock-type attacks and Stealth Rock.",
		onImmunity: function(type, target) {
			if (type === 'Normal' && !target.activeTurns) {
				return false;
			      this.add('-message', pokemon.name + " objectified the normal type move!");
			}
		},
		id: "objection",
		name: "OBJECTION",
		rating: 3.5,
		num: 801
	},
    }
};
<commit_msg>Update abilities.js<commit_after> exports.BattleAbilities = {
 "drunkenfist": {
    desc: "If a contact move knocks out this Pokemon, the opponent receives damage equal to one-fourth of its max HP.",
		shortDesc: "If this Pokemon is KOed with a contact move, that move's user loses 1/4 its max HP.",
		id: "drunkenfist",
		name: "Drunken Fist",
		onSwitchIn: function (pokemon) {
			      this.add('-message', pokemon.name + " is drunk!");
			pokemon.addVolatile('confusion');
			 self: {
				boosts: {
			spa: 2,
			atk: 2
		},
			}
		},
		rating: 3,
		num: 800
	},
	"objection": {
		desc: "This Pokémon avoids all Rock-type attacks and hazards when switching in.",
		shortDesc: "On switch-in, this Pokemon avoids all Rock-type attacks and Stealth Rock.",
		onImmunity: function(type, target) {
			if (type === 'Normal' && !target.activeTurns) {
				return false;
			      this.add('-message', pokemon.name + " objectified the normal type move!");
			}
		},
		id: "objection",
		name: "OBJECTION",
		rating: 3.5,
		num: 801
    }
};
<|endoftext|>


<commit_before>/*global module: true */
module.exports = function (grunt) {
	"use strict";

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		meta: {
			banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
				'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
				'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
				'* Copyright (c) <%= grunt.template.today("yyyy") %> */'
		},
		clean: {
			all: ['<%=pkg.folders.build %>'],
			css: {
				src: ['<%= pkg.folders.build + pkg.name + "-" + pkg.version %>/css/*.css',
						'!<%= pkg.folders.build + pkg.name + "-" + pkg.version %>/css/<%= pkg.name %>.css']
			}
		},
		jshint: {
			src: '<%=pkg.folders.jsSource %>' + '**/*.js',
			grunt: ['gruntfile.js'],
			options: {
				curly: true,
				eqeqeq: true,
				immed: true,
				latedef: true,
				newcap: true,
				noarg: true,
				sub: true,
				undef: true,
				boss: true,
				eqnull: true,
				unused: true,
				browser: true,
				strict: true,
				jquery: true,
				bitwise: true,
				trailing: true,
				regexp: true,
				nonew: true,
				forin: true,
				globals: {
					angular: true,
					moment: true,
					console: true,
					define: true,
					require: true
				}
			}
		},
		watch: {
			javascript: {
				files: ['<%=pkg.folders.jsSource %>' + '**/*.js'],
				tasks: ['jshint'],
				options: {
					livereload: true
				}
			},
			html: {
				files: ['<%=pkg.folders.wwwRoot %>' + '*.html'],
				options: {
					livereload: true
				}
			},
			css: {
				files: ['<%=pkg.folders.wwwRoot %>' + 'css/*'],
				options: {
					livereload: true
				}
			},
			images: {
				files: ['<%=pkg.folders.wwwRoot %>' + 'images/*'],
				options: {
					livereload: true
				}
			},
			karma: {
				files: ['<%=pkg.folders.testRoot %>/ui/' + '**/*.js'],
				tasks: ['karma:development:run']
			}
		},
		targethtml: {
			build: {
				files: {
					'<%= pkg.folders.build + pkg.name + "-" + pkg.version %>/': '<%=pkg.folders.wwwRoot %>*.html'
				}
			}
		},
		copy: {
			css: {
				files: [{
					expand: true,
					dest: '<%= pkg.folders.build + pkg.name + "-" + pkg.version %>/css/',
					src: ['*.css'],
					cwd: '<%= pkg.folders.wwwRoot%>css/'
				}]
			},
			images: {
				files: [{
					expand: true,
					dest: '<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/images/build/',
					src: ['**'],
					cwd: '<%= pkg.folders.wwwRoot%>images/build/'
				}]
			},
			font: {
				files: [{
					expand: true,
					dest: '<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/font/',
					src: ['**'],
					cwd: '<%= pkg.folders.wwwRoot%>font/'
				}]
			},
			deploy: {
				files: [{
					expand: true,
					dest: '<%=deployOrdner %>',
					src: ['<%= pkg.name + "-" + pkg.version + ".tar.gz"%>'],
					cwd: '<%= pkg.folders.build%>'
				}]
			},
			htaccess: {
				files: [{
					expand: true,
					dest: '<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/',
					src: ['.htaccess'],
					cwd: '<%= pkg.folders.wwwRoot%>'
				}]
			}
		},
		cssmin: {
			css: {
				files: {
					'<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/css/<&= pkg.name &>.css': [
							//include all css files in correct order, add new files in desired order
							'<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/css/bootstrap.css',
							'<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/css/bootstrap-responsive.css',
							'<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/css/project.css'
						]
				}
			}
		},
		karma: {
			development: {
				options: {
					configFile: 'karma.conf.js',
					background: true
				}
			},
			build: {
				options: {
					configFile: 'karma.conf.js',
					singleRun: true
				}
			}
		},
		compress: {
			tgz: {
				options: {
					mode: "tgz",
					archive: "<%= pkg.folders.build + pkg.name + '-' + pkg.version + '.tar.gz'%>"
				},
				expand: true,
				src:  ['**/*', '**/.*'],
				dest: '<%= pkg.name + "-" + pkg.version %>/',
				cwd: '<%= pkg.folders.build + pkg.name + "-" + pkg.version %>/'
			}
		},
		requirejs: {
			compile: {
				options: {
					baseUrl: "<%= pkg.folders.jsSource %>",
					name: "../../bower_components/almond/almond",
					include: "main",
					mainConfigFile: "<%= pkg.folders.jsSource %>/main.js",
					out: "<%= pkg.folders.build + pkg.name + '-' + pkg.version %>/js/main.js",
					optimize: "uglify2",
					paths: {
						'angular':'../../bower_components/angular/angular.min'
					},
					generateSourceMaps: true,
					preserveLicenseComments: false,
					useSourceUrl: true,
					uglify2: {
						// TODO - angular.js is already minified, mangling destroys it, so mangling is currently globally disabled
						mangle: false
					}
				}
			}
		},
		connect: {
			server: {
				options:  {
					port: 8000,
					base: '',
					hostname: '*'
				}
			}
		},
		manifest: {
			generate: {
				options: {
					basePath: "<%=pkg.folders.build + pkg.name + '-' + pkg.version%>",
					network: ["*"],
					fallback: [],
					exclude: [],
					preferOnline: false,
					timestamp: true
				},

				src: ["**/*", "!js/main.js.map", "!js/main.js.src", "!**/apple-touch-icon-precomposed.png",
					//TODO - remove folder names manually, update grunt-manifest to have it done automatically
					"!js", "!css", "!images", "!images/build"],
				dest: "<%= pkg.folders.build + pkg.name + '-' + pkg.version + '/' + pkg.name %>.manifest"
			}
		},
		license: {
			options: {
				unknown: true,
				start: '.',
				depth: null,
				output: "file"
			}
		},
		dataUri: {
			dist: {
				src: ['<%=pkg.folders.wwwRoot %>css/*.css'],
				dest: '<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/css/',
				options: {
					target: ['<%=pkg.folders.wwwRoot %>images/*.*'],
					fixDirLevel: true,
					baseDir: '<%=pkg.folders.wwwRoot %>css'
				}
			}
		}
	});

	grunt.registerTask("install", "Create a deployable artifact for production servers",
		function () {
			grunt.task.run("jshint");
			grunt.task.run("clean:all");
			grunt.task.run("requirejs");
			grunt.task.run("dataUri");
			grunt.task.run("cssmin");
			grunt.task.run("clean:css");
			grunt.task.run("copy:images");
			grunt.task.run("copy:font");
			grunt.task.run("copy:htaccess");
			grunt.task.run("targethtml:build");
			grunt.task.run("manifest");
			grunt.task.run("compress");
		}
	);

	//TODO - use a grunt plugin for version management
	grunt.registerTask("release", "Update version number",
		function (versionNumber) {
			var pkg, versions;
			if (!versionNumber) {
				grunt.fatal("Die Angabe welche Versionsnummer erhöht werden soll, ist zwingend notwendig ('Major', 'Release' oder 'Hotfix')");
			}

			if (versionNumber !== 'Major' && versionNumber !== 'Release' && versionNumber !== 'Hotfix') {
				grunt.fatal("Die zu erhöhende Versionsnummer muss 'Major', 'Release' oder 'Hotfix' sein: " + versionNumber);
			}

			pkg = grunt.file.readJSON('./package.json');
			grunt.log.writeln("Bisherige Version: " + pkg.version);

			versions = pkg.version.split(".");

			if (versionNumber === 'Major') {
				versions[0] = parseInt(versions[0], 10) + 1;
				versions[1] = 0;
				versions[2] = 0;
			} else if (versionNumber === 'Release') {
				versions[1] = parseInt(versions[1], 10) + 1;
				versions[2] = 0;
			} else if (versionNumber === 'Hotfix') {
				versions[2] = parseInt(versions[2], 10) + 1;
			}

			pkg.version = versions.join(".");

			grunt.log.writeln("Neue Version: " + pkg.version);
			grunt.file.write('./package.json', JSON.stringify(pkg, undefined, '\t'));
			grunt.log.writeln("");
			grunt.log.writeln("package.json wurde erfolgreich aktualisiert.");

		}
	);

	grunt.registerTask('license', 'List all packages (and their sub-packages) that this project depends on with license information', function() {
		function convertToCsv(data) {
			var ret = "", module, licenses, repository;

			for (module in data) {
				if (data.hasOwnProperty(module)) {
					licenses = data[module].licenses || "";
					repository = data[module].repository || "";
					ret = ret + module + ";" + licenses + ";" + repository + "\r\n";
				}
			}

			return ret;
		}
		var checker = require('license-checker'),
			fs = require('fs'),
			done = this.async(),
			defaults = {
				start: '.',
				unknown: false,
				depth: 1,
				include: 'all',
				output: 'console', //console or file
				filename: 'LICENSES',
				format: 'json' //json or csv
			},
			options = grunt.util._.extend(defaults, this.options());

		checker.init(options, function(data){
			if (options.format === 'csv') {
				data = convertToCsv(data);
			} else {
				data = JSON.stringify(data, null, 4);
			}

			if (options.output === 'file') {
				fs.writeFile(options.filename, data, function() {
					console.log('Successfully written '.green + options.filename.grey);
					done();
				});
			} else if (options.output === 'console') {
				grunt.log.writeln(data);
			} else {
				grunt.log.writeln("Unknown output channel: " + options.output);
			}
		});
	});

	grunt.registerTask('default', ['jshint']);
	grunt.registerTask('web', ['connect', 'watch']); //'karma:development'

	//call grunt.loadNpmTasks for all dependencies in package.json which names start with "grunt-"
	require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
};
<commit_msg>use release plugin, fixes #3<commit_after>/*global module: true */
module.exports = function (grunt) {
	"use strict";

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		meta: {
			banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
				'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
				'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
				'* Copyright (c) <%= grunt.template.today("yyyy") %> */'
		},
		clean: {
			all: ['<%=pkg.folders.build %>'],
			css: {
				src: ['<%= pkg.folders.build + pkg.name + "-" + pkg.version %>/css/*.css',
						'!<%= pkg.folders.build + pkg.name + "-" + pkg.version %>/css/<%= pkg.name %>.css']
			}
		},
		jshint: {
			src: '<%=pkg.folders.jsSource %>' + '**/*.js',
			grunt: ['gruntfile.js'],
			options: {
				curly: true,
				eqeqeq: true,
				immed: true,
				latedef: true,
				newcap: true,
				noarg: true,
				sub: true,
				undef: true,
				boss: true,
				eqnull: true,
				unused: true,
				browser: true,
				strict: true,
				jquery: true,
				bitwise: true,
				trailing: true,
				regexp: true,
				nonew: true,
				forin: true,
				globals: {
					angular: true,
					moment: true,
					console: true,
					define: true,
					require: true
				}
			}
		},
		watch: {
			javascript: {
				files: ['<%=pkg.folders.jsSource %>' + '**/*.js'],
				tasks: ['jshint'],
				options: {
					livereload: true
				}
			},
			html: {
				files: ['<%=pkg.folders.wwwRoot %>' + '*.html'],
				options: {
					livereload: true
				}
			},
			css: {
				files: ['<%=pkg.folders.wwwRoot %>' + 'css/*'],
				options: {
					livereload: true
				}
			},
			images: {
				files: ['<%=pkg.folders.wwwRoot %>' + 'images/*'],
				options: {
					livereload: true
				}
			},
			karma: {
				files: ['<%=pkg.folders.testRoot %>/ui/' + '**/*.js'],
				tasks: ['karma:development:run']
			}
		},
		targethtml: {
			build: {
				files: {
					'<%= pkg.folders.build + pkg.name + "-" + pkg.version %>/': '<%=pkg.folders.wwwRoot %>*.html'
				}
			}
		},
		copy: {
			css: {
				files: [{
					expand: true,
					dest: '<%= pkg.folders.build + pkg.name + "-" + pkg.version %>/css/',
					src: ['*.css'],
					cwd: '<%= pkg.folders.wwwRoot%>css/'
				}]
			},
			images: {
				files: [{
					expand: true,
					dest: '<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/images/build/',
					src: ['**'],
					cwd: '<%= pkg.folders.wwwRoot%>images/build/'
				}]
			},
			font: {
				files: [{
					expand: true,
					dest: '<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/font/',
					src: ['**'],
					cwd: '<%= pkg.folders.wwwRoot%>font/'
				}]
			},
			deploy: {
				files: [{
					expand: true,
					dest: '<%=deployOrdner %>',
					src: ['<%= pkg.name + "-" + pkg.version + ".tar.gz"%>'],
					cwd: '<%= pkg.folders.build%>'
				}]
			},
			htaccess: {
				files: [{
					expand: true,
					dest: '<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/',
					src: ['.htaccess'],
					cwd: '<%= pkg.folders.wwwRoot%>'
				}]
			}
		},
		cssmin: {
			css: {
				files: {
					'<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/css/<&= pkg.name &>.css': [
							//include all css files in correct order, add new files in desired order
							'<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/css/bootstrap.css',
							'<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/css/bootstrap-responsive.css',
							'<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/css/project.css'
						]
				}
			}
		},
		karma: {
			development: {
				options: {
					configFile: 'karma.conf.js',
					background: true
				}
			},
			build: {
				options: {
					configFile: 'karma.conf.js',
					singleRun: true
				}
			}
		},
		compress: {
			tgz: {
				options: {
					mode: "tgz",
					archive: "<%= pkg.folders.build + pkg.name + '-' + pkg.version + '.tar.gz'%>"
				},
				expand: true,
				src:  ['**/*', '**/.*'],
				dest: '<%= pkg.name + "-" + pkg.version %>/',
				cwd: '<%= pkg.folders.build + pkg.name + "-" + pkg.version %>/'
			}
		},
		requirejs: {
			compile: {
				options: {
					baseUrl: "<%= pkg.folders.jsSource %>",
					name: "../../bower_components/almond/almond",
					include: "main",
					mainConfigFile: "<%= pkg.folders.jsSource %>/main.js",
					out: "<%= pkg.folders.build + pkg.name + '-' + pkg.version %>/js/main.js",
					optimize: "uglify2",
					paths: {
						'angular':'../../bower_components/angular/angular.min'
					},
					generateSourceMaps: true,
					preserveLicenseComments: false,
					useSourceUrl: true,
					uglify2: {
						// TODO - angular.js is already minified, mangling destroys it, so mangling is currently globally disabled
						mangle: false
					}
				}
			}
		},
		connect: {
			server: {
				options:  {
					port: 8000,
					base: '',
					hostname: '*'
				}
			}
		},
		manifest: {
			generate: {
				options: {
					basePath: "<%=pkg.folders.build + pkg.name + '-' + pkg.version%>",
					network: ["*"],
					fallback: [],
					exclude: [],
					preferOnline: false,
					timestamp: true
				},

				src: ["**/*", "!js/main.js.map", "!js/main.js.src", "!**/apple-touch-icon-precomposed.png",
					//TODO - remove folder names manually, update grunt-manifest to have it done automatically
					"!js", "!css", "!images", "!images/build"],
				dest: "<%= pkg.folders.build + pkg.name + '-' + pkg.version + '/' + pkg.name %>.manifest"
			}
		},
		license: {
			options: {
				unknown: true,
				start: '.',
				depth: null,
				output: "file"
			}
		},
		dataUri: {
			dist: {
				src: ['<%=pkg.folders.wwwRoot %>css/*.css'],
				dest: '<%=pkg.folders.build + pkg.name + "-" + pkg.version %>/css/',
				options: {
					target: ['<%=pkg.folders.wwwRoot %>images/*.*'],
					fixDirLevel: true,
					baseDir: '<%=pkg.folders.wwwRoot %>css'
				}
			}
		},
		release: {
			options: {
				npm: false
			}
		}
	});

	grunt.registerTask("install", "Create a deployable artifact for production servers",
		function () {
			grunt.task.run("jshint");
			grunt.task.run("clean:all");
			grunt.task.run("requirejs");
			grunt.task.run("dataUri");
			grunt.task.run("cssmin");
			grunt.task.run("clean:css");
			grunt.task.run("copy:images");
			grunt.task.run("copy:font");
			grunt.task.run("copy:htaccess");
			grunt.task.run("targethtml:build");
			grunt.task.run("manifest");
			grunt.task.run("compress");
		}
	);

	grunt.registerTask('license', 'List all packages (and their sub-packages) that this project depends on with license information', function() {
		function convertToCsv(data) {
			var ret = "", module, licenses, repository;

			for (module in data) {
				if (data.hasOwnProperty(module)) {
					licenses = data[module].licenses || "";
					repository = data[module].repository || "";
					ret = ret + module + ";" + licenses + ";" + repository + "\r\n";
				}
			}

			return ret;
		}
		var checker = require('license-checker'),
			fs = require('fs'),
			done = this.async(),
			defaults = {
				start: '.',
				unknown: false,
				depth: 1,
				include: 'all',
				output: 'console', //console or file
				filename: 'LICENSES',
				format: 'json' //json or csv
			},
			options = grunt.util._.extend(defaults, this.options());

		checker.init(options, function(data){
			if (options.format === 'csv') {
				data = convertToCsv(data);
			} else {
				data = JSON.stringify(data, null, 4);
			}

			if (options.output === 'file') {
				fs.writeFile(options.filename, data, function() {
					console.log('Successfully written '.green + options.filename.grey);
					done();
				});
			} else if (options.output === 'console') {
				grunt.log.writeln(data);
			} else {
				grunt.log.writeln("Unknown output channel: " + options.output);
			}
		});
	});

	grunt.registerTask('default', ['jshint']);
	grunt.registerTask('web', ['connect', 'watch']); //'karma:development'

	//call grunt.loadNpmTasks for all dependencies in package.json which names start with "grunt-"
	require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    bower_concat: {
      all: {
        dest: 'build/<%= pkg.name %>.js',
        includeDev: true
      }
    },
    depconcat: {
      build: {
        options: {
          requireTemplate: '\\\n*@extends\\s+([^\\n\\r]+)[\\n\\r]*'
        },
        files: {
          'build/<%= pkg.name %>.js': [
            'build/<%= pkg.name %>.js',
            'src/*.js',
            'src/**/*.js'
          ]
        }
      }
    },
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
      },
      build: {
        files: {
          'build/<%= pkg.name %>.min.js': ['build/<%= pkg.name %>.js']
        }
      }
    },
    watch: {
      files: [
        'src/*.js',
        'src/**/*.js'
      ],
      tasks: [
        'bower_concat',
        'depconcat',
        'uglify'
      ]
    }
  });

  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-depconcat');
  grunt.loadNpmTasks('grunt-bower-concat');

  grunt.registerTask('default', [
    'bower_concat',
    'depconcat',
    'uglify',
    'watch'
  ]);
};
<commit_msg>Update gruntfile<commit_after>module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    bower_concat: {
      all: {
        dest: 'build/<%= pkg.name %>.js',
        includeDev: true
      }
    },
    depconcat: {
      build: {
        options: {
          requireTemplate: '\\\n*@extends\\s+([^\\n\\r]+)[\\n\\r]*'
        },
        files: {
          'build/<%= pkg.name %>.js': [
            'build/<%= pkg.name %>.js',
            'src/*.js',
            'src/**/*.js'
          ]
        }
      }
    },
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
      },
      build: {
        files: {
          'build/<%= pkg.name %>.min.js': ['build/<%= pkg.name %>.js']
        }
      }
    },
    watch: {
      files: [
        'src/*.js',
        'src/**/*.js'
      ],
      tasks: [
        'bower_concat',
        'depconcat',
        'uglify'
      ]
    }
  });
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-depconcat');
  grunt.loadNpmTasks('grunt-bower-concat');

  grunt.registerTask('default', [
    'bower_concat',
    'depconcat',
    'uglify',
    'watch'
  ]);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
    // Project Configuration
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        watch: {
            js: {
                files: ['gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**', 'test/**/*.js'],
                tasks: ['jshint'],
                options: {
                    livereload: true
                }
            },
            html: {
                files: ['public/views/**', 'app/views/**'],
                options: {
                    livereload: true
                }
            },
            css: {
                files: ['public/css/**'],
                options: {
                    livereload: true
                }
            }
        },
        jshint: {
            all: {
                src: ['gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**', 'test/**/*.js', '!test/coverage/**/*.js'],
                options: {
                    jshintrc: true
                }
            }
        },
        nodemon: {
            dev: {
                script: 'server.js',
                options: {
                    args: [],
                    ignore: ['public/**'],
                    ext: 'js',
                    nodeArgs: ['--debug'],
                    delayTime: 1,
                    env: {
                        PORT: 3000
                    },
                    cwd: __dirname
                }
            }
        },
        concurrent: {
            tasks: ['nodemon', 'watch'],
            options: {
                logConcurrentOutput: true
            }
        },
        mochaTest: {
            options: {
                reporter: 'spec',
                require: 'server.js'
            },
            src: ['test/mocha/**/*.js']
        },
        env: {
            test: {
                NODE_ENV: 'test'
            }
        },
        karma: {
            unit: {
                configFile: 'test/karma/karma.conf.js'
            }
        }
    });

    //Load NPM tasks
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-mocha-test');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-nodemon');
    grunt.loadNpmTasks('grunt-concurrent');
    grunt.loadNpmTasks('grunt-env');

    //Making grunt default to force in order not to break the project.
    grunt.option('force', true);

    //Default task(s).
    grunt.registerTask('default', ['jshint', 'concurrent']);

    //Test task.
    grunt.registerTask('test', ['env:test', 'mochaTest', 'karma:unit']);
};
<commit_msg>Create `mocha` grunt task which sets env<commit_after>'use strict';

module.exports = function(grunt) {
    // Project Configuration
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        watch: {
            js: {
                files: ['gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**', 'test/**/*.js'],
                tasks: ['jshint'],
                options: {
                    livereload: true
                }
            },
            html: {
                files: ['public/views/**', 'app/views/**'],
                options: {
                    livereload: true
                }
            },
            css: {
                files: ['public/css/**'],
                options: {
                    livereload: true
                }
            }
        },
        jshint: {
            all: {
                src: ['gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**', 'test/**/*.js', '!test/coverage/**/*.js'],
                options: {
                    jshintrc: true
                }
            }
        },
        nodemon: {
            dev: {
                script: 'server.js',
                options: {
                    args: [],
                    ignore: ['public/**'],
                    ext: 'js',
                    nodeArgs: ['--debug'],
                    delayTime: 1,
                    env: {
                        PORT: 3000
                    },
                    cwd: __dirname
                }
            }
        },
        concurrent: {
            tasks: ['nodemon', 'watch'],
            options: {
                logConcurrentOutput: true
            }
        },
        mochaTest: {
            options: {
                reporter: 'spec',
                require: 'server.js'
            },
            src: ['test/mocha/**/*.js']
        },
        env: {
            test: {
                NODE_ENV: 'test'
            }
        },
        karma: {
            unit: {
                configFile: 'test/karma/karma.conf.js'
            }
        }
    });

    //Load NPM tasks
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-mocha-test');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-nodemon');
    grunt.loadNpmTasks('grunt-concurrent');
    grunt.loadNpmTasks('grunt-env');

    //Making grunt default to force in order not to break the project.
    grunt.option('force', true);

    //Default task(s).
    grunt.registerTask('default', ['jshint', 'concurrent']);

    //Test task.
    grunt.registerTask('test', ['env:test', 'mochaTest', 'karma:unit']);
    grunt.registerTask('mocha', ['env:test', 'mochaTest']);
};
<|endoftext|>


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

  var PathConfig = require('./grunt-settings.js');
  require('jit-grunt')(grunt);

  grunt.initConfig({

    config: PathConfig,

    /**
     * Prompts and questions - https://github.com/dylang/grunt-prompt
     * We need to ask a few things from you first,
     * then the project can get underway!
     */
    prompt: {
      browserSync: {
        options: {
          questions: [
            {
              name:    'browserSyncConfirm',
              type:    'confirm',                                         // list, checkbox, confirm, input, password
              message: 'Want to use browserSync?', // Question to ask the user, function needs to return a string,
              default: false                    // default value if nothing is entered
            },
            {
              config:  'browserSync.default_options.options.proxy',     // arbitrary name or config for any other grunt task
              type:    'input',                                         // list, checkbox, confirm, input, password
              message: 'Enter the Vagrant URL', // Question to ask the user, function needs to return a string,
              default: 'drivdigital.dev:8080',                    // default value if nothing is entered
              when: function (answers) {
                      return answers['browserSyncConfirm'] === true;
                    },
            }
          ]
        }
      },
    },

    /**
     * Compiling stylesheets
     */

    // Import whole folder into a file
    sass_globbing: {
      target: {
        files: {
          '<%= config.scssPartials %>_components.scss': '<%= config.scssDir %>components/*.scss',
          '<%= config.scssPartials %>_mixins.scss': '<%= config.scssPartials %>mixins/*.scss',
        }
      }
    },

    //sass
    sass: {
      options: PathConfig.hasBower,
      dev: {
        options: {
          style: 'nested'
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.sassDir %>',
            src: ['**/*.scss', '!<%= config.sassMainFileName %>.scss'],
            dest: '<%= config.cssDir %>',
            ext: '.css'
          },
          {src: '<%= config.sassDir %><%= config.sassMainFileName %>.scss', dest: '<%= config.cssMainFileDir %><%= config.cssMainFileName %>.css'}
        ]
      },
      dist: {
        options: {
          style: 'nested'
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.sassDir %>',
            src: ['**/*.scss', '!<%= config.sassMainFileName %>.scss'],
            dest: '<%= config.cssDir %>',
            ext: '.css'
          },
          {
            src: '<%= config.sassDir %><%= config.sassMainFileName %>.scss',
            dest: '<%= config.cssMainFileDir %><%= config.cssMainFileName %>.css'
          }
        ]
      },
      min: {
        options: {
          Style: 'compressed'
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.sassDir %>',
            src: ['**/*.scss', '!<%= config.sassMainFileName %>.scss'],
            dest: '<%= config.cssDir %>',
            ext: '.min.css'
          },
          {src: '<%= config.sassDir %><%= config.sassMainFileName %>.scss', dest: '<%= config.cssMainFileDir %><%= config.cssMainFileName %>.min.css'}
        ]
      }
    },

    // Autoprefix
    postcss: {
      options: {
        map: false,
        processors: [
        require('autoprefixer')({
          browsers: ['> 20%', 'last 10 versions', 'Firefox > 20']
        })
        ],
        remove: false
      },
      dist: {
        src: '<%= config.cssDir %>*.css'
      }
    },

    /**
     * Minifications
     */

    // Make JS tiny
    uglify: {
      options: {
        mangle: false
      },
      js: {
        files: {
          '<%= config.jsDir %>scripts-header.min.js': ['<%= config.jsDir %>scripts-header.js'],
          '<%= config.jsDir %>scripts-footer.min.js': ['<%= config.jsDir %>scripts-footer.js']
        }
      }
    },

    // Minify Images
    imagemin: {
      dynamic: {
        files: [{
          expand: true,
          cwd: '<%= config.imgDir %>',
          src: ['**/*.{png,jpg,gif,svg}'],
          dest: '<%= config.imgDir %>'
        }]
      }
    },

    /**
     * Live reloading
     */
    // See your changes in the browser as they happen.
    browserSync: {
      default_options: {
        bsFiles: {
          src: [
          "<%= config.cssDir %>*.css",
          "*.php,",
          "**/*.php,"
          ]
        },
        options: {
          watchTask: true,
          proxy: "<%= config.proxy %>" // If your site runs through MAMP, whats the URL
        }
      }
    },

    // Watch for any changes
    watch: {
      js: {
        files: ['<%= config.jsDir %>*.js'],
      },
      css: {
        // Watch sass changes, merge mqs & run bs
        files: ['<%= config.scssDir %>*.scss', '<%= config.scssDir %>**/*.scss'],
        tasks: ['sass_globbing:target', 'sass', 'postcss:dist', 'browserSync' ]
      },
      options: {
          spawn: false // Very important, don't miss this
        }
      }
    });

  // Standard grunt task – compile css and watch
  grunt.registerTask('default', [
    'prompt:browserSync', // Config
    'sass_globbing:target', // Glob together needed folders
    'sass:dev', // Run sass
    'postcss:dist', // Post Process with Auto-Prefix
    'uglify', // minify javascript
    'browserSync', // live reload
    'watch' // Keep watching for any changes
    ]);

  // Minify everything from css to js
  grunt.registerTask('slim', [
    'uglify', // minify javascript
    'sass_globbing:target', // Glob together needed folders
    'sass:min', // Run sass
    'postcss:dist', // Post Process with Auto-Prefix
    ]);
};
<commit_msg>Removed false from runtime<commit_after>module.exports = function(grunt) {

  var PathConfig = require('./grunt-settings.js');
  require('jit-grunt')(grunt);

  grunt.initConfig({

    config: PathConfig,

    /**
     * Prompts and questions - https://github.com/dylang/grunt-prompt
     * We need to ask a few things from you first,
     * then the project can get underway!
     */
    prompt: {
      browserSync: {
        options: {
          questions: [
            {
              name:    'browserSyncConfirm',
              type:    'confirm',                                         // list, checkbox, confirm, input, password
              message: 'Want to use browserSync?', // Question to ask the user, function needs to return a string,
              default: false                    // default value if nothing is entered
            },
            {
              config:  'browserSync.default_options.options.proxy',     // arbitrary name or config for any other grunt task
              type:    'input',                                         // list, checkbox, confirm, input, password
              message: 'Enter the Vagrant URL', // Question to ask the user, function needs to return a string,
              default: 'drivdigital.dev:8080',                    // default value if nothing is entered
              when: function (answers) {
                      return answers['browserSyncConfirm'] === true;
                    },
            }
          ]
        }
      },
    },

    /**
     * Compiling stylesheets
     */

    // Import whole folder into a file
    sass_globbing: {
      target: {
        files: {
          '<%= config.scssPartials %>_components.scss': '<%= config.scssDir %>components/*.scss',
          '<%= config.scssPartials %>_mixins.scss': '<%= config.scssPartials %>mixins/*.scss',
        }
      }
    },

    //sass
    sass: {
      options: PathConfig.hasBower,
      dev: {
        options: {
          style: 'nested'
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.sassDir %>',
            src: ['**/*.scss', '!<%= config.sassMainFileName %>.scss'],
            dest: '<%= config.cssDir %>',
            ext: '.css'
          },
          {src: '<%= config.sassDir %><%= config.sassMainFileName %>.scss', dest: '<%= config.cssMainFileDir %><%= config.cssMainFileName %>.css'}
        ]
      },
      dist: {
        options: {
          style: 'nested'
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.sassDir %>',
            src: ['**/*.scss', '!<%= config.sassMainFileName %>.scss'],
            dest: '<%= config.cssDir %>',
            ext: '.css'
          },
          {
            src: '<%= config.sassDir %><%= config.sassMainFileName %>.scss',
            dest: '<%= config.cssMainFileDir %><%= config.cssMainFileName %>.css'
          }
        ]
      },
      min: {
        options: {
          Style: 'compressed'
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.sassDir %>',
            src: ['**/*.scss', '!<%= config.sassMainFileName %>.scss'],
            dest: '<%= config.cssDir %>',
            ext: '.min.css'
          },
          {src: '<%= config.sassDir %><%= config.sassMainFileName %>.scss', dest: '<%= config.cssMainFileDir %><%= config.cssMainFileName %>.min.css'}
        ]
      }
    },

    // Autoprefix
    postcss: {
      options: {
        map: false,
        processors: [
        require('autoprefixer')({
          browsers: ['> 20%', 'last 10 versions', 'Firefox > 20']
        })
        ],
        remove: false
      },
      dist: {
        src: '<%= config.cssDir %>*.css'
      }
    },

    /**
     * Minifications
     */

    // Make JS tiny
    uglify: {
      options: {
        mangle: false
      },
      js: {
        files: {
          '<%= config.jsDir %>scripts-header.min.js': ['<%= config.jsDir %>scripts-header.js'],
          '<%= config.jsDir %>scripts-footer.min.js': ['<%= config.jsDir %>scripts-footer.js']
        }
      }
    },

    // Minify Images
    imagemin: {
      dynamic: {
        files: [{
          expand: true,
          cwd: '<%= config.imgDir %>',
          src: ['**/*.{png,jpg,gif,svg}'],
          dest: '<%= config.imgDir %>'
        }]
      }
    },

    /**
     * Live reloading
     */
    // See your changes in the browser as they happen.
    browserSync: {
      default_options: {
        bsFiles: {
          src: [
          "<%= config.cssDir %>*.css",
          "*.php,",
          "**/*.php,"
          ]
        },
        options: {
          watchTask: true,
          proxy: "<%= config.proxy %>" // If your site runs through MAMP, whats the URL
        }
      }
    },

    // Watch for any changes
    watch: {
      js: {
        files: ['<%= config.jsDir %>*.js'],
      },
      css: {
        // Watch sass changes, merge mqs & run bs
        files: ['<%= config.scssDir %>*.scss', '<%= config.scssDir %>**/*.scss'],
        tasks: ['sass_globbing:target', 'sass', 'postcss:dist', 'browserSync' ]
      },
      options: {
          spawn: false // Very important, don't miss this
        }
      }
    });

  // Standard grunt task – compile css and watch
  grunt.registerTask('default', [
    'prompt:browserSync', // Config
    'sass_globbing:target', // Glob together needed folders
    'sass:dev', // Run sass
    'postcss:dist', // Post Process with Auto-Prefix
    'uglify', // minify javascript
    'watch' // Keep watching for any changes
    ]);

  // Minify everything from css to js
  grunt.registerTask('slim', [
    'uglify', // minify javascript
    'sass_globbing:target', // Glob together needed folders
    'sass:min', // Run sass
    'postcss:dist', // Post Process with Auto-Prefix
    ]);
};
<|endoftext|>


<commit_before>'use strict';

/**
 * Module dependencies.
 */
var _ = require('lodash'),
  defaultAssets = require('./config/assets/default'),
  testAssets = require('./config/assets/test'),
  fs = require('fs'),
  path = require('path');

module.exports = function (grunt) {
  // Project Configuration
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    env: {
      test: {
        NODE_ENV: 'test'
      },
      dev: {
        NODE_ENV: 'development'
      },
      prod: {
        NODE_ENV: 'production'
      }
    },
    watch: {
      serverViews: {
        files: defaultAssets.server.views,
        options: {
          livereload: true
        }
      },
      serverJS: {
        files: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.allJS),
        tasks: ['jshint'],
        options: {
          livereload: true
        }
      },
      clientViews: {
        files: defaultAssets.client.views,
        options: {
          livereload: true
        }
      },
      clientJS: {
        files: defaultAssets.client.js,
        tasks: ['jshint'],
        options: {
          livereload: true
        }
      },
      clientCSS: {
        files: defaultAssets.client.css,
        tasks: ['csslint'],
        options: {
          livereload: true
        }
      },
      clientSCSS: {
        files: defaultAssets.client.sass,
        tasks: ['sass', 'csslint'],
        options: {
          livereload: true
        }
      },
      clientLESS: {
        files: defaultAssets.client.less,
        tasks: ['less', 'csslint'],
        options: {
          livereload: true
        }
      }
    },
    nodemon: {
      dev: {
        script: 'server.js',
        options: {
          nodeArgs: ['--debug'],
          ext: 'js,html',
          watch: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config)
        }
      }
    },
    concurrent: {
      default: ['nodemon', 'watch'],
      debug: ['nodemon', 'watch', 'node-inspector'],
      options: {
        logConcurrentOutput: true
      }
    },
    jshint: {
      all: {
        src: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e),
        options: {
          jshintrc: true,
          node: true,
          mocha: true,
          jasmine: true
        }
      }
    },
    csslint: {
      options: {
        csslintrc: '.csslintrc'
      },
      all: {
        src: defaultAssets.client.css
      }
    },
    ngAnnotate: {
      production: {
        files: {
          'public/dist/application.js': defaultAssets.client.js
        }
      }
    },
    clean: ['public/dist/application.min.css', 'public/dist/application.min.js'],
    uglify: {
      production: {
        options: {
          mangle: false
        },
        files: {
          'public/dist/application.min.js': 'public/dist/application.js'
        }
      }
    },
    cssmin: {
      combine: {
        files: {
          'public/dist/application.min.css': defaultAssets.client.css
        }
      }
    },
    sass: {
      dist: {
        files: [{
          expand: true,
          src: defaultAssets.client.sass,
          ext: '.css',
          rename: function (base, src) {
            return src.replace('/scss/', '/css/');
          }
				}]
      }
    },
    less: {
      dist: {
        files: [{
          expand: true,
          src: defaultAssets.client.less,
          ext: '.css',
          rename: function (base, src) {
            return src.replace('/less/', '/css/');
          }
				}]
      }
    },
    'node-inspector': {
      custom: {
        options: {
          'web-port': 1337,
          'web-host': 'localhost',
          'debug-port': 5858,
          'save-live-edit': true,
          'no-preload': true,
          'stack-trace-limit': 50,
          'hidden': []
        }
      }
    },
    mochaTest: {
      src: testAssets.tests.server,
      options: {
        reporter: 'spec'
      }
    },
    mocha_istanbul: {
      coverage: {
        src: testAssets.tests.server,
        options: {
          print: 'detail',
          coverage: true,
          require: 'test.js',
          coverageFolder: 'coverage',
          reportFormats: ['cobertura','lcovonly'],
          check: {
            lines: 40,
            statements: 40
          }
        }
      }
    },
    karma: {
      unit: {
        configFile: 'karma.conf.js'
      }
    },
    protractor: {
      options: {
        configFile: 'protractor.conf.js',
        keepAlive: true,
        noColor: false,
        webdriverManagerUpdate: true
      },
      e2e: {
        options: {
          args: {} // Target-specific arguments
        }
      }
    },
    copy: {
      localConfig: {
        src: 'config/env/local.example.js',
        dest: 'config/env/local.js',
        filter: function () {
          return !fs.existsSync('config/env/local.js');
        }
      }
    }
  });

  grunt.event.on('coverage', function(lcovFileContents, done) {
    require('coveralls').handleInput(lcovFileContents, function(err) {
      if (err) {
        return done(err);
      }
      done();
    });
  });

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

  // Make sure upload directory exists
  grunt.task.registerTask('mkdir:upload', 'Task that makes sure upload directory exists.', function () {
    // Get the callback
    var done = this.async();

    grunt.file.mkdir(path.normalize(__dirname + '/modules/users/client/img/profile/uploads'));

    done();
  });

  // Connect to the MongoDB instance and load the models
  grunt.task.registerTask('mongoose', 'Task that connects to the MongoDB instance and loads the application models.', function () {
    // Get the callback
    var done = this.async();

    // Use mongoose configuration
    var mongoose = require('./config/lib/mongoose.js');

    // Connect to database
    mongoose.connect(function (db) {
      done();
    });
  });

  grunt.task.registerTask('server', 'Starting the server', function () {
    // Get the callback
    var done = this.async();

    var path = require('path');
    var app = require(path.resolve('./config/lib/app'));
    var server = app.start(function () {
      done();
    });
  });

  // Lint CSS and JavaScript files.
  grunt.registerTask('lint', ['sass', 'less', 'jshint', 'csslint']);

  // Lint project files and minify them into two production files.
  grunt.registerTask('build', ['env:prod', 'lint', 'ngAnnotate', 'uglify', 'cssmin']);

  // Run the project tests
  grunt.registerTask('test', ['env:test', 'lint', 'mkdir:upload', 'copy:localConfig', 'server', 'mochaTest', 'karma:unit', 'protractor']);
  grunt.registerTask('test:server', ['env:test', 'lint', 'server', 'mochaTest']);
  grunt.registerTask('test:client', ['env:test', 'lint', 'server', 'karma:unit']);
  grunt.registerTask('test:e2e', ['env:test', 'lint', 'server', 'protractor']);

  // Run project coverage
  grunt.registerTask('coverage', ['env:test', 'lint', 'mocha_istanbul:coverage']);

  // Run the project in development mode
  grunt.registerTask('default', ['env:dev', 'lint', 'mkdir:upload', 'copy:localConfig', 'concurrent:default']);

  // Run the project in debug mode
  grunt.registerTask('debug', ['env:dev', 'lint', 'mkdir:upload', 'copy:localConfig', 'concurrent:debug']);

  // Run the project in production mode
  grunt.registerTask('prod', ['build', 'env:prod', 'mkdir:upload', 'copy:localConfig', 'concurrent:default']);

  grunt.registerTask('heroku:production', ['clean', 'less', 'cssmin', 'uglify']);
};
<commit_msg>deleted clean task<commit_after>'use strict';

/**
 * Module dependencies.
 */
var _ = require('lodash'),
  defaultAssets = require('./config/assets/default'),
  testAssets = require('./config/assets/test'),
  fs = require('fs'),
  path = require('path');

module.exports = function (grunt) {
  // Project Configuration
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    env: {
      test: {
        NODE_ENV: 'test'
      },
      dev: {
        NODE_ENV: 'development'
      },
      prod: {
        NODE_ENV: 'production'
      }
    },
    watch: {
      serverViews: {
        files: defaultAssets.server.views,
        options: {
          livereload: true
        }
      },
      serverJS: {
        files: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.allJS),
        tasks: ['jshint'],
        options: {
          livereload: true
        }
      },
      clientViews: {
        files: defaultAssets.client.views,
        options: {
          livereload: true
        }
      },
      clientJS: {
        files: defaultAssets.client.js,
        tasks: ['jshint'],
        options: {
          livereload: true
        }
      },
      clientCSS: {
        files: defaultAssets.client.css,
        tasks: ['csslint'],
        options: {
          livereload: true
        }
      },
      clientSCSS: {
        files: defaultAssets.client.sass,
        tasks: ['sass', 'csslint'],
        options: {
          livereload: true
        }
      },
      clientLESS: {
        files: defaultAssets.client.less,
        tasks: ['less', 'csslint'],
        options: {
          livereload: true
        }
      }
    },
    nodemon: {
      dev: {
        script: 'server.js',
        options: {
          nodeArgs: ['--debug'],
          ext: 'js,html',
          watch: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.views, defaultAssets.server.allJS, defaultAssets.server.config)
        }
      }
    },
    concurrent: {
      default: ['nodemon', 'watch'],
      debug: ['nodemon', 'watch', 'node-inspector'],
      options: {
        logConcurrentOutput: true
      }
    },
    jshint: {
      all: {
        src: _.union(defaultAssets.server.gruntConfig, defaultAssets.server.allJS, defaultAssets.client.js, testAssets.tests.server, testAssets.tests.client, testAssets.tests.e2e),
        options: {
          jshintrc: true,
          node: true,
          mocha: true,
          jasmine: true
        }
      }
    },
    csslint: {
      options: {
        csslintrc: '.csslintrc'
      },
      all: {
        src: defaultAssets.client.css
      }
    },
    ngAnnotate: {
      production: {
        files: {
          'public/dist/application.js': defaultAssets.client.js
        }
      }
    },
    clean: ['public/dist/application.min.css', 'public/dist/application.min.js'],
    uglify: {
      production: {
        options: {
          mangle: false
        },
        files: {
          'public/dist/application.min.js': 'public/dist/application.js'
        }
      }
    },
    cssmin: {
      combine: {
        files: {
          'public/dist/application.min.css': defaultAssets.client.css
        }
      }
    },
    sass: {
      dist: {
        files: [{
          expand: true,
          src: defaultAssets.client.sass,
          ext: '.css',
          rename: function (base, src) {
            return src.replace('/scss/', '/css/');
          }
				}]
      }
    },
    less: {
      dist: {
        files: [{
          expand: true,
          src: defaultAssets.client.less,
          ext: '.css',
          rename: function (base, src) {
            return src.replace('/less/', '/css/');
          }
				}]
      }
    },
    'node-inspector': {
      custom: {
        options: {
          'web-port': 1337,
          'web-host': 'localhost',
          'debug-port': 5858,
          'save-live-edit': true,
          'no-preload': true,
          'stack-trace-limit': 50,
          'hidden': []
        }
      }
    },
    mochaTest: {
      src: testAssets.tests.server,
      options: {
        reporter: 'spec'
      }
    },
    mocha_istanbul: {
      coverage: {
        src: testAssets.tests.server,
        options: {
          print: 'detail',
          coverage: true,
          require: 'test.js',
          coverageFolder: 'coverage',
          reportFormats: ['cobertura','lcovonly'],
          check: {
            lines: 40,
            statements: 40
          }
        }
      }
    },
    karma: {
      unit: {
        configFile: 'karma.conf.js'
      }
    },
    protractor: {
      options: {
        configFile: 'protractor.conf.js',
        keepAlive: true,
        noColor: false,
        webdriverManagerUpdate: true
      },
      e2e: {
        options: {
          args: {} // Target-specific arguments
        }
      }
    },
    copy: {
      localConfig: {
        src: 'config/env/local.example.js',
        dest: 'config/env/local.js',
        filter: function () {
          return !fs.existsSync('config/env/local.js');
        }
      }
    }
  });

  grunt.event.on('coverage', function(lcovFileContents, done) {
    require('coveralls').handleInput(lcovFileContents, function(err) {
      if (err) {
        return done(err);
      }
      done();
    });
  });

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

  // Make sure upload directory exists
  grunt.task.registerTask('mkdir:upload', 'Task that makes sure upload directory exists.', function () {
    // Get the callback
    var done = this.async();

    grunt.file.mkdir(path.normalize(__dirname + '/modules/users/client/img/profile/uploads'));

    done();
  });

  // Connect to the MongoDB instance and load the models
  grunt.task.registerTask('mongoose', 'Task that connects to the MongoDB instance and loads the application models.', function () {
    // Get the callback
    var done = this.async();

    // Use mongoose configuration
    var mongoose = require('./config/lib/mongoose.js');

    // Connect to database
    mongoose.connect(function (db) {
      done();
    });
  });

  grunt.task.registerTask('server', 'Starting the server', function () {
    // Get the callback
    var done = this.async();

    var path = require('path');
    var app = require(path.resolve('./config/lib/app'));
    var server = app.start(function () {
      done();
    });
  });

  // Lint CSS and JavaScript files.
  grunt.registerTask('lint', ['sass', 'less', 'jshint', 'csslint']);

  // Lint project files and minify them into two production files.
  grunt.registerTask('build', ['env:prod', 'lint', 'ngAnnotate', 'uglify', 'cssmin']);

  // Run the project tests
  grunt.registerTask('test', ['env:test', 'lint', 'mkdir:upload', 'copy:localConfig', 'server', 'mochaTest', 'karma:unit', 'protractor']);
  grunt.registerTask('test:server', ['env:test', 'lint', 'server', 'mochaTest']);
  grunt.registerTask('test:client', ['env:test', 'lint', 'server', 'karma:unit']);
  grunt.registerTask('test:e2e', ['env:test', 'lint', 'server', 'protractor']);

  // Run project coverage
  grunt.registerTask('coverage', ['env:test', 'lint', 'mocha_istanbul:coverage']);

  // Run the project in development mode
  grunt.registerTask('default', ['env:dev', 'lint', 'mkdir:upload', 'copy:localConfig', 'concurrent:default']);

  // Run the project in debug mode
  grunt.registerTask('debug', ['env:dev', 'lint', 'mkdir:upload', 'copy:localConfig', 'concurrent:debug']);

  // Run the project in production mode
  grunt.registerTask('prod', ['build', 'env:prod', 'mkdir:upload', 'copy:localConfig', 'concurrent:default']);

  grunt.registerTask('heroku:production', ['less', 'cssmin', 'uglify']);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
    // Do grunt-related things in here.
    grunt.initConfig({
        // Project configuration
        pkg: grunt.file.readJSON('package.json'),

        jshint: {
            files: ['gruntfile.js'],
        },

        concat: {
            css: {
                src: ['node_modules/normalize.css/normalize.css', 'src/css/style.css'],
                dest: 'dist/css/style.css'
            }
        },

        cssmin: {
            target: {
                files: [{
                    expand: true,
                    cwd: 'dist/css',
                    src: '*.css',
                    dest: 'dist/css',
                    ext: '.min.css'
                }]
            }
        },

        processhtml: {
            dist: {
                files: {
                    'dist/index.html': ['src/index.html']
                }
            }
        },

        copy: {
            main: {
                expand: true,
                cwd: 'src/img/',
                src: '*',
                dest: 'dist/img/',
            }
        },

        watch: {
            html: {
                files: ['src/index.html'],
                tasks: ['processhtml']
            },
            css: {
                files: ['app/css/*.*'],
                tasks: ['concat', 'cssmin']
            },
            gruntfile: {
                files: ['gruntfile.js'],
                tasks: ['jshint']
            },
            img: {
                files: ['src/img/*'],
                tasks: ['copy']
            },

        }
    });

    // Load the plugins that provides the tasks:
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-processhtml');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-watch');

    // Default tasks:
    grunt.registerTask('default', ['jshint', 'concat', 'cssmin', 'processhtml', 'copy']);

};<commit_msg>chore: Add 'clean' task to 'gruntfile.js'<commit_after>module.exports = function(grunt) {
    // Do grunt-related things in here.
    grunt.initConfig({
        // Project configuration
        pkg: grunt.file.readJSON('package.json'),

        jshint: {
            files: ['gruntfile.js'],
        },

        concat: {
            css: {
                src: ['node_modules/normalize.css/normalize.css', 'src/css/style.css'],
                dest: 'dist/css/style.css'
            }
        },

        cssmin: {
            target: {
                files: [{
                    expand: true,
                    cwd: 'dist/css',
                    src: '*.css',
                    dest: 'dist/css',
                    ext: '.min.css'
                }]
            }
        },

        clean: {
            css: ["dist/css/*.css", "!dist/css/*.min.css"]
        },

        processhtml: {
            dist: {
                files: {
                    'dist/index.html': ['src/index.html']
                }
            }
        },

        copy: {
            main: {
                expand: true,
                cwd: 'src/img/',
                src: '*',
                dest: 'dist/img/',
            }
        },

        watch: {
            html: {
                files: ['src/index.html'],
                tasks: ['processhtml']
            },
            css: {
                files: ['app/css/*.*'],
                tasks: ['concat', 'cssmin', 'clean']
            },
            gruntfile: {
                files: ['gruntfile.js'],
                tasks: ['jshint']
            },
            img: {
                files: ['src/img/*'],
                tasks: ['copy']
            },

        }
    });

    // Load the plugins that provides the tasks:
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-processhtml');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-watch');

    // Default tasks:
    grunt.registerTask('default', ['jshint', 'concat', 'cssmin', 'clean', 'processhtml', 'copy']);

};<|endoftext|>


<commit_before>module.exports = function(grunt){
    grunt.initConfig({
        "pkg": "package.json",
        "jshint": {
            "files": ["src/**/*.js","test/**/*.js","!src/solver.js"],
            "options": {
                "curly": true,
                "eqeqeq": true,
                "latedef": true,
                "indent": 4,
                "noempty": true,
                "quotmark": "double",
                "undef": true
            }
        },
        "mochaTest": {
            "test": {
                "options": {
                    "reporter": "json",
                    "quite": "true",
                    "captureFile": "test_results.txt"
                },
                "src": ["test/*.js"]
            }
        },
        "browserify": {
            "dist": {
                "files": {
                    "src/solver.js": ["./src/main.js"]
                },
                "options": {
                    "banner": "(function(){if (typeof exports === \"object\") {module.exports =  require(\"./main\");}})();"
                }
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-uglify");
    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-mocha-test");
    grunt.loadNpmTasks("grunt-browserify");
    grunt.registerTask("default", ["jshint"]);
    grunt.registerTask("test", ["jshint","mochaTest"]);
    grunt.registerTask("speed", function(){require("./benchmark/bench.test_suite");});
    grunt.registerTask("prod", ["jshint","mochaTest","browserify"]);

}
<commit_msg>added global ignores to js hint<commit_after>module.exports = function(grunt){
    grunt.initConfig({
        "pkg": "package.json",
        "jshint": {
            "files": ["src/**/*.js","test/**/*.js","!src/solver.js"],
            "options": {
                "curly": true,
                "eqeqeq": true,
                "latedef": true,
                "indent": 4,
                "noempty": true,
                "quotmark": "double",
                "undef": true,
                "globals": {"define": true, "window" :true}
            }
        },
        "mochaTest": {
            "test": {
                "options": {
                    "reporter": "json",
                    "quite": "true",
                    "captureFile": "test_results.txt"
                },
                "src": ["test/*.js"]
            }
        },
        "browserify": {
            "dist": {
                "files": {
                    "src/solver.js": ["./src/main.js"]
                },
                "options": {
                    "banner": "(function(){if (typeof exports === \"object\") {module.exports =  require(\"./main\");}})();"
                }
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-uglify");
    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-mocha-test");
    grunt.loadNpmTasks("grunt-browserify");
    grunt.registerTask("default", ["jshint"]);
    grunt.registerTask("test", ["jshint","mochaTest"]);
    grunt.registerTask("speed", function(){require("./benchmark/bench.test_suite");});
    grunt.registerTask("prod", ["jshint","mochaTest","browserify"]);

}
<|endoftext|>


<commit_before>/**
 * Copyright (c) 2013-2014 Memba Sarl. All rights reserved.
 * Sources at https://github.com/Memba/Kidoju-Platform
 */

/* jslint node: true */
/* jshint node: true */

'use strict';

module.exports = function (grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        watch: {
            files: ['<%= jshint.files %>'],
            tasks: ['lint', 'test']
        },
        jshint: {
            files: ['gruntfile.js', 'src/js/kidoju.*.js', 'test/browsers/*.js', 'test/zombie/*.js'],
            options: {
                // options here to override JSHint defaults
                jshintrc: '.jshintrc'
                /*
                globals: {
                    jQuery: true,
                    console: true,
                    module: true,
                    document: true
                }
                */
            }
        },
        kendo_lint: {
            files: ['src/js/kidoju.*.js']
        },
        csslint: {
            strict: {
                options: {
                    import: 2
                },
                src: ['src/styles/kidoju.*.css']
            }
        },
        // TODO: Consider linting html too
        mocha: {
            browsers: {
                options: {
                    //debug: true,
                    log: true,
                    logErrors: true,
                    reporter: 'Spec',
                    run: true,
                    timeout: 5000
                },
                src: ['test/browsers/kidoju.*.html']
            }
        },
        mochaTest: {
            zombie: {
                options: {
                    //debug: true,
                    quiet: false,
                    reporter: 'spec',
                    timeout: 10000,
                    ui: 'bdd'
                },
                src: ['test/zombie/kidoju.*.js']
            }
        },
        clean: ['dist/', 'docs/'],
        copy: {
            /*
            dist: {
                options: {
                    process: function(src, filepath) {
                        //Replace with min versions
                        var ret;
                        if (filepath === 'src/js/init.js'){
                            ret = src
                                .replace(/DEBUG[\s]*=[\s]*true/gm, 'DEBUG = false')
                                .replace(/init.js/gm, 'init.min.js');
                        }
                        return ret || src;
                    },*/
                    //noProcess: ['**/*.{png,gif,jpg,ico,psd}'] //otherwise images are corrupted
                /*},
                files: [
                    //{ cwd: 'src/styles', src: ['fonts/**'], dest: 'dist/styles', expand: true },
                    { cwd: 'src/styles', src: ['images/**'], dest: 'dist/styles', expand: true }
                ]
            },*/
            vendor: {
                files: [{
                    expand: true,
                    cwd: 'src/js/vendor/',
                    src: '**',
                    dest: 'dist/js/vendor/'
                }]
            }
        },
        concat: {
            css: {
                src: ['src/styles/kidoju*.css'],
                dest: 'dist/styles/<%= pkg.filename %>.css'
            },
            js: {
                options: {
                    separator: '\n;\n',
                    process: function(src /*, filepath*/) {
                        //Replace DEBUG = true with DEBUG = false
                        return src.replace(/DEBUG[\s]*=[\s]*true/gm, 'DEBUG = false');
                    }
                },
                src: [/*'src/js/vendor/*.js',*/ 'src/js/kidoju*.js'],
                dest: 'dist/js/<%= pkg.filename %>.js'
            }
        },
        uglify: {
            options: {
                banner: '// <%= pkg.name %> <%= pkg.version %> built on <%= grunt.template.today("dd-mm-yyyy") %> - <%= pkg.copyright %>\n',
                sourceMap: true,
                sourceMapName: 'dist/js/<%= pkg.filename %>.min.map'
            },
            dist: {
                files: {
                    'dist/js/<%= pkg.filename %>.min.js': ['<%= concat.js.dest %>']
                }
            }
        },
        cssmin: {
            widgets: {
                options: {
                    banner: '/* <%= pkg.name %> <%= pkg.version %> built on <%= grunt.template.today("dd-mm-yyyy") %> - <%= pkg.copyright %> */\n'
                },
                files: {
                    'dist/styles/<%= pkg.filename %>.min.css': ['<%= concat.css.dest %>']
                }
            }
        },
        imagemin: {
            widgets: {
                files: [{
                    expand: true,
                    cwd: 'src/styles/images/',
                    src: ['**/*.{png,jpg,gif}'],
                    dest: 'dist/styles/images/'
                }]
            }
        },
        jsdoc : {
            dist : {
                src: ['src/**/*.js', 'README.md'],
                options: {
                    destination: 'docs',
                    template : 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template',
                    configure : 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template/jsdoc.conf.json'
                }
            }
        }
        /*
        yuidoc: {
            compile: {
                name: '<%= pkg.name %>',
                description: '<%= pkg.description %>',
                version: '<%= pkg.version %>',
                url: '<%= pkg.homepage %>',
                options: {
                    paths: 'src/js/',
                    outdir: 'docs/yui/'
                }
            }
        }
        */
    });

    //Watching
    grunt.loadNpmTasks('grunt-contrib-watch');

    //Linting
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-kendo-lint');
    grunt.loadNpmTasks('grunt-contrib-csslint');

    //Testing
    grunt.loadNpmTasks('grunt-mocha');
    grunt.loadNpmTasks('grunt-mocha-test');

    //Building
    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-contrib-imagemin');
    grunt.loadNpmTasks('grunt-jsdoc');
    //grunt.loadNpmTasks('grunt-contrib-yuidoc');

    grunt.registerTask('lint', ['jshint', 'kendo_lint', 'csslint']);
    grunt.registerTask('test', ['mocha', 'mochaTest']);
    grunt.registerTask('build', ['clean', 'copy', 'concat', 'uglify', 'cssmin', 'imagemin', 'jsdoc']);
    grunt.registerTask('default', ['lint', 'test', 'build']);
};
<commit_msg>Increased PhantomJS timeout for mocha tests<commit_after>/**
 * Copyright (c) 2013-2014 Memba Sarl. All rights reserved.
 * Sources at https://github.com/Memba/Kidoju-Platform
 */

/* jslint node: true */
/* jshint node: true */

'use strict';

module.exports = function (grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        watch: {
            files: ['<%= jshint.files %>'],
            tasks: ['lint', 'test']
        },
        jshint: {
            files: ['gruntfile.js', 'src/js/kidoju.*.js', 'test/browsers/*.js', 'test/zombie/*.js'],
            options: {
                // options here to override JSHint defaults
                jshintrc: '.jshintrc'
                /*
                globals: {
                    jQuery: true,
                    console: true,
                    module: true,
                    document: true
                }
                */
            }
        },
        kendo_lint: {
            files: ['src/js/kidoju.*.js']
        },
        csslint: {
            strict: {
                options: {
                    import: 2
                },
                src: ['src/styles/kidoju.*.css']
            }
        },
        // TODO: Consider linting html too
        mocha: {
            browsers: {
                options: {
                    //debug: true,
                    log: true,
                    logErrors: true,
                    reporter: 'Spec',
                    run: true,
                    timeout: 10000
                },
                src: ['test/browsers/kidoju.*.test.html']
            }
        },
        mochaTest: {
            zombie: {
                options: {
                    //debug: true,
                    quiet: false,
                    reporter: 'spec',
                    timeout: 10000,
                    ui: 'bdd'
                },
                src: ['test/zombie/kidoju.*.test.js']
            }
        },
        clean: ['dist/', 'docs/'],
        copy: {
            /*
            dist: {
                options: {
                    process: function(src, filepath) {
                        //Replace with min versions
                        var ret;
                        if (filepath === 'src/js/init.js'){
                            ret = src
                                .replace(/DEBUG[\s]*=[\s]*true/gm, 'DEBUG = false')
                                .replace(/init.js/gm, 'init.min.js');
                        }
                        return ret || src;
                    },*/
                    //noProcess: ['**/*.{png,gif,jpg,ico,psd}'] //otherwise images are corrupted
                /*},
                files: [
                    //{ cwd: 'src/styles', src: ['fonts/**'], dest: 'dist/styles', expand: true },
                    { cwd: 'src/styles', src: ['images/**'], dest: 'dist/styles', expand: true }
                ]
            },*/
            vendor: {
                files: [{
                    expand: true,
                    cwd: 'src/js/vendor/',
                    src: '**',
                    dest: 'dist/js/vendor/'
                }]
            }
        },
        concat: {
            css: {
                src: ['src/styles/kidoju*.css'],
                dest: 'dist/styles/<%= pkg.filename %>.css'
            },
            js: {
                options: {
                    separator: '\n;\n',
                    process: function(src /*, filepath*/) {
                        //Replace DEBUG = true with DEBUG = false
                        return src.replace(/DEBUG[\s]*=[\s]*true/gm, 'DEBUG = false');
                    }
                },
                src: [/*'src/js/vendor/*.js',*/ 'src/js/kidoju*.js'],
                dest: 'dist/js/<%= pkg.filename %>.js'
            }
        },
        uglify: {
            options: {
                banner: '// <%= pkg.name %> <%= pkg.version %> built on <%= grunt.template.today("dd-mm-yyyy") %> - <%= pkg.copyright %>\n',
                sourceMap: true,
                sourceMapName: 'dist/js/<%= pkg.filename %>.min.map'
            },
            dist: {
                files: {
                    'dist/js/<%= pkg.filename %>.min.js': ['<%= concat.js.dest %>']
                }
            }
        },
        cssmin: {
            widgets: {
                options: {
                    banner: '/* <%= pkg.name %> <%= pkg.version %> built on <%= grunt.template.today("dd-mm-yyyy") %> - <%= pkg.copyright %> */\n'
                },
                files: {
                    'dist/styles/<%= pkg.filename %>.min.css': ['<%= concat.css.dest %>']
                }
            }
        },
        imagemin: {
            widgets: {
                files: [{
                    expand: true,
                    cwd: 'src/styles/images/',
                    src: ['**/*.{png,jpg,gif}'],
                    dest: 'dist/styles/images/'
                }]
            }
        },
        jsdoc : {
            dist : {
                src: ['src/**/*.js', 'README.md'],
                options: {
                    destination: 'docs',
                    template : 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template',
                    configure : 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template/jsdoc.conf.json'
                }
            }
        }
        /*
        yuidoc: {
            compile: {
                name: '<%= pkg.name %>',
                description: '<%= pkg.description %>',
                version: '<%= pkg.version %>',
                url: '<%= pkg.homepage %>',
                options: {
                    paths: 'src/js/',
                    outdir: 'docs/yui/'
                }
            }
        }
        */
    });

    //Watching
    grunt.loadNpmTasks('grunt-contrib-watch');

    //Linting
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-kendo-lint');
    grunt.loadNpmTasks('grunt-contrib-csslint');

    //Testing
    grunt.loadNpmTasks('grunt-mocha');
    grunt.loadNpmTasks('grunt-mocha-test');

    //Building
    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-contrib-imagemin');
    grunt.loadNpmTasks('grunt-jsdoc');
    //grunt.loadNpmTasks('grunt-contrib-yuidoc');

    grunt.registerTask('lint', ['jshint', 'kendo_lint', 'csslint']);
    grunt.registerTask('test', ['mocha', 'mochaTest']);
    grunt.registerTask('build', ['clean', 'copy', 'concat', 'uglify', 'cssmin', 'imagemin', 'jsdoc']);
    grunt.registerTask('default', ['lint', 'test', 'build']);
};
<|endoftext|>