<commit_before>'use strict';
var redis = require('redis');

module.exports = function (grunt) {
  // load all grunt tasks
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    mochaTest: {
      integration: {
        options: {
          reporter: 'spec'
        },
        src: ['app.js', 'routes/**/*(!spec).js', 'services/**/*(!spec).js', 'integration.spec.js']
      },
      unit: {
        options: {
          reporter: 'spec'
        },
        src: ['app.js', 'routes/**/*.js', 'services/**/*.js']
      }
    },
    shell: {
      herokuLocal: {
        command: 'heroku local'
      },
      failBuildOnGitDiff: {
        command: 'git diff-index --quiet HEAD --'
      }
    },
    filerev: {
      js: {
        src: 'dist/**/*.js'
      },
      css :{
        src: 'dist/**/*.css'
      }
    },
    copy: {
      index: {
        src: 'public/index.html',
        dest: 'dist/index.html'
      }
    },
    useminPrepare: {
      html: 'public/index.html',
      options: {
        dest: 'dist'
      }
    },
    usemin: {
      html: 'dist/index.html',
      options: {
        assetsDirs: ['dist']
      }
    },
    clean: {
      dist: ['dist/**/*.*']
    }
  });

  grunt.registerTask('clearData', function() {
    var done = this.async();

    //TODO: grunt-services doesn't wait for redis to start completely, so 100ms delay
    //good opportunity to PR grunt-services to add better wait logic
    setTimeout(function () {
      var redisClient = redis.createClient(process.env.REDIS_URL);

      redisClient.on("ready", function () {
        redisClient.flushall(function () {
          done();
        });
      });
    }, 100);
  });

  //TODO: set a different server port for integration testing to allow testing while serving
  grunt.registerTask('integration', ['startRedis', 'clearData', 'force:mochaTest:integration', 'stopRedis']);
  grunt.registerTask('unit', ['mochaTest:unit']);

  grunt.registerTask('serve', ['startRedis', 'shell:herokuLocal', 'stopRedis']);

  grunt.registerTask('ci', ['build', 'shell:failBuildOnGitDiff', 'clearData', 'mochaTest']);

  grunt.registerTask('build', ['clean', 'copy:index', 'useminPrepare', 'concat', 'cssmin', 'uglify', 'filerev', 'usemin']);

};<commit_msg>Fixing git diff command.<commit_after>'use strict';
var redis = require('redis');

module.exports = function (grunt) {
  // load all grunt tasks
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    mochaTest: {
      integration: {
        options: {
          reporter: 'spec'
        },
        src: ['app.js', 'routes/**/*(!spec).js', 'services/**/*(!spec).js', 'integration.spec.js']
      },
      unit: {
        options: {
          reporter: 'spec'
        },
        src: ['app.js', 'routes/**/*.js', 'services/**/*.js']
      }
    },
    shell: {
      herokuLocal: {
        command: 'heroku local'
      },
      failBuildOnGitDiff: {
        command: 'git status --porcelain',
        options: {
          stdout: false,
          stderr: false,
          stdin: false,
          callback: function (err, stdout, stderr, cb) {
            var changesDetected = !!stdout.length;
            if (changesDetected) {
              grunt.warn('Git changes detected. Did you forget to build and commit dist?');
            } else {
              cb();
            }
          }
        }
      }
    },
    filerev: {
      js: {
        src: 'dist/**/*.js'
      },
      css :{
        src: 'dist/**/*.css'
      }
    },
    copy: {
      index: {
        src: 'public/index.html',
        dest: 'dist/index.html'
      }
    },
    useminPrepare: {
      html: 'public/index.html',
      options: {
        dest: 'dist'
      }
    },
    usemin: {
      html: 'dist/index.html',
      options: {
        assetsDirs: ['dist']
      }
    },
    clean: {
      dist: ['dist/**/*.*']
    }
  });

  grunt.registerTask('clearData', function() {
    var done = this.async();

    //TODO: grunt-services doesn't wait for redis to start completely, so 100ms delay
    //good opportunity to PR grunt-services to add better wait logic
    setTimeout(function () {
      var redisClient = redis.createClient(process.env.REDIS_URL);

      redisClient.on("ready", function () {
        redisClient.flushall(function () {
          done();
        });
      });
    }, 100);
  });

  //TODO: set a different server port for integration testing to allow testing while serving
  grunt.registerTask('integration', ['startRedis', 'clearData', 'force:mochaTest:integration', 'stopRedis']);
  grunt.registerTask('unit', ['mochaTest:unit']);

  grunt.registerTask('serve', ['startRedis', 'shell:herokuLocal', 'stopRedis']);

  grunt.registerTask('ci', ['build', 'shell:failBuildOnGitDiff', 'clearData', 'mochaTest']);

  grunt.registerTask('build', ['clean', 'copy:index', 'useminPrepare', 'concat', 'cssmin', 'uglify', 'filerev', 'usemin']);

};<|endoftext|>


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

    clean: ['out/'],

    mkdir: {
      'out': {
        options: {
          create: ['out']
        }
      }
    },

    run: {
      'generate-listings': {
        cmd: 'tools/gen.js',
        args: [ 'cts', 'unittests', 'demos' ]
      },
      'test': {
        cmd: 'tools/run.js',
        args: [ 'unittests' ]
      },
      'build-out': {
        cmd: 'npx',
        args: [
          'babel',
          '--source-maps', 'true',
          '--extensions', '.ts',
          '--out-dir', 'out/',
          'src/',
        ]
      },
      'build-shaderc': {
        cmd: 'npx',
        args: [
          'babel',
          '--plugins', 'babel-plugin-transform-commonjs-es2015-modules',
          'node_modules/@webgpu/shaderc/dist/index.js',
          '-o', 'out/shaderc.js',
        ]
      },
      'lint': {
        cmd: 'npx',
        args: ['tslint', '--project', '.']
      },
      'fix': {
        cmd: 'npx',
        args: ['tslint', '--project', '.', '--fix']
      },
      'check-git-is-clean': {
        cmd: 'git',
        args: ['diff-index', '--quiet', 'HEAD', '--']
      }
    },

    'http-server': {
      '.': {
        root: '.',
        port: 8080,
        host: '127.0.0.1',
        cache: 5,
      }
    },

    ts: {
      'check': {
        tsconfig: {
          tsconfig: 'tsconfig.json',
          passThrough: true,
        },
      },

      'out/': {
        tsconfig: {
          tsconfig: 'tsconfig.web.json',
          passThrough: true,
        },
      },
    },
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-http-server');
  grunt.loadNpmTasks('grunt-mkdir');
  grunt.loadNpmTasks('grunt-run');
  grunt.loadNpmTasks('grunt-ts');

  const publishedTasks = [];
  function publishTask(name, desc, deps) {
    grunt.registerTask(name, deps);
    publishedTasks.push({ name, desc });
  }

  publishTask('check', 'Check Typescript build', [
    'ts:check',
  ]);
  publishedTasks.push({ name: 'run:{lint,fix}', desc: 'Run tslint' });
  publishTask('build', 'Build out/', [
    'mkdir:out',
    'run:build-shaderc',
    'run:build-out',
    'run:generate-listings',
  ]);
  publishTask('serve', 'Serve out/ on 127.0.0.1:8080', [
    'http-server:.',
  ]);
  publishedTasks.push({ name: 'clean', desc: 'Clean out/' });

  grunt.registerTask('default', '', () => {
    console.log('Available tasks (see grunt --help for info):');
    for (const { name, desc } of publishedTasks) {
      console.log(`$ grunt ${name}`);
      console.log(`  ${desc}`);
    }
  });

  publishTask('presubmit', 'Run all presubmit checks', [
    'check',
    'build',
    'run:test',

    // 'format',  // TODO
    'run:fix',
    'run:check-git-is-clean',
  ]);
};
<commit_msg>fix presubmit<commit_after>module.exports = function(grunt) {
  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    clean: ['out/'],

    mkdir: {
      'out': {
        options: {
          create: ['out']
        }
      }
    },

    run: {
      'generate-listings': {
        cmd: 'tools/gen.js',
        args: [ 'cts', 'unittests', 'demos' ]
      },
      'test': {
        cmd: 'tools/run.js',
        args: [ 'unittests' ]
      },
      'build-out': {
        cmd: 'npx',
        args: [
          'babel',
          '--source-maps', 'true',
          '--extensions', '.ts',
          '--out-dir', 'out/',
          'src/',
        ]
      },
      'build-shaderc': {
        cmd: 'npx',
        args: [
          'babel',
          '--plugins', 'babel-plugin-transform-commonjs-es2015-modules',
          'node_modules/@webgpu/shaderc/dist/index.js',
          '-o', 'out/shaderc.js',
        ]
      },
      'lint': {
        cmd: 'npx',
        args: ['tslint', '--project', '.']
      },
      'fix': {
        cmd: 'npx',
        args: ['tslint', '--project', '.', '--fix']
      },
      'check-git-is-clean': {
        cmd: 'git',
        args: ['diff-index', '--quiet', 'HEAD']
      }
    },

    'http-server': {
      '.': {
        root: '.',
        port: 8080,
        host: '127.0.0.1',
        cache: 5,
      }
    },

    ts: {
      'check': {
        tsconfig: {
          tsconfig: 'tsconfig.json',
          passThrough: true,
        },
      },

      'out/': {
        tsconfig: {
          tsconfig: 'tsconfig.web.json',
          passThrough: true,
        },
      },
    },
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-http-server');
  grunt.loadNpmTasks('grunt-mkdir');
  grunt.loadNpmTasks('grunt-run');
  grunt.loadNpmTasks('grunt-ts');

  const publishedTasks = [];
  function publishTask(name, desc, deps) {
    grunt.registerTask(name, deps);
    publishedTasks.push({ name, desc });
  }

  publishTask('check', 'Check Typescript build', [
    'ts:check',
  ]);
  publishedTasks.push({ name: 'run:{lint,fix}', desc: 'Run tslint' });
  publishTask('build', 'Build out/', [
    'mkdir:out',
    'run:build-shaderc',
    'run:build-out',
    'run:generate-listings',
  ]);
  publishTask('serve', 'Serve out/ on 127.0.0.1:8080', [
    'http-server:.',
  ]);
  publishedTasks.push({ name: 'clean', desc: 'Clean out/' });

  grunt.registerTask('default', '', () => {
    console.log('Available tasks (see grunt --help for info):');
    for (const { name, desc } of publishedTasks) {
      console.log(`$ grunt ${name}`);
      console.log(`  ${desc}`);
    }
  });

  publishTask('presubmit', 'Run all presubmit checks', [
    'check',
    'build',
    'run:test',

    // 'format',  // TODO
    // 'run:fix',  // TODO
    'run:check-git-is-clean',
  ]);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            main: {
                src: [
                    'bower_components/leaflet-control-osm-geocoder/images/*',
                    'bower_components/leaflet-fullscreen/*.png',
                    'bower_components/leaflet/dist/images/*'

                ],
                dest: 'img/',
            },
        },
        concat: {
            options: {
                // define a string to put between each file in the concatenated output
                separator: ';'
            },
            lib: {
                // the files to concatenate
                src: '<%= pkg.files %>',
                // the location of the resulting JS file
                dest: '<%= pkg.name %>.lib.js'
            }
        },
        uglify: {
            options: {
                // the banner is inserted at the top of the output
                banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
            },
            dist: {
                files: {
                    '<%= pkg.name %>.lib.min.js': ['<%= concat.lib.dest %>'],
                    '<%= pkg.name %>.min.js': ['<%= pkg.name %>.conf.js', '<%= pkg.name %>.js']
                }
            }
        },
        cssmin: {
            options: {
                keepSpecialComments: false,
                target: 'img'
            },
            combine: {
                files: {
                    '<%= pkg.name %>.min.css': [
                        'bower_components/leaflet/dist/leaflet.css',
                        'bower_components/leaflet-control-osm-geocoder/Control.OSMGeocoder.css',
                        'bower_components/Leaflet.label/dist/leaflet.label.css',
                        'bower_components/leaflet-fullscreen/Control.FullScreen.css',
                        'bower_components/leaflet.markercluster/dist/MarkerCluster.Default.css',
                        'bower_components/leaflet.markercluster/dist/MarkerCluster.css',
                        'css/main.css',
                        'css/layout.css',
                        'css/table.css'
                    ]
                }
            }
        },
        jshint: {
            // define the files to lint
            files: ['Gruntfile.js', 'js/**/*.js', '<%= pkg.name %>.js'],
        }
    });

    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-jshint');

    grunt.registerTask('jshint', ['jshint']);
    grunt.registerTask('default', [/*'jshint',*/ 'copy', 'concat', 'uglify', 'cssmin']);
}
<commit_msg>Grunt copy for image with flatten option<commit_after>'use strict';

module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            main: {
                expand: true,
                cwd: 'bower_components/',
                src: [
                    'leaflet-control-osm-geocoder/images/*',
                    'leaflet-fullscreen/*.png',
                    'leaflet/dist/images/*'

                ],
                dest: 'img/',
                flatten: true,
                filter: 'isFile'
            },
        },
        concat: {
            options: {
                // define a string to put between each file in the concatenated output
                separator: ';'
            },
            lib: {
                // the files to concatenate
                src: '<%= pkg.files %>',
                // the location of the resulting JS file
                dest: '<%= pkg.name %>.lib.js'
            }
        },
        uglify: {
            options: {
                // the banner is inserted at the top of the output
                banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
            },
            dist: {
                files: {
                    '<%= pkg.name %>.lib.min.js': ['<%= concat.lib.dest %>'],
                    '<%= pkg.name %>.min.js': ['<%= pkg.name %>.conf.js', '<%= pkg.name %>.js']
                }
            }
        },
        cssmin: {
            options: {
                keepSpecialComments: false,
                target: 'img'
            },
            combine: {
                files: {
                    '<%= pkg.name %>.min.css': [
                        'bower_components/leaflet/dist/leaflet.css',
                        'bower_components/leaflet-control-osm-geocoder/Control.OSMGeocoder.css',
                        'bower_components/Leaflet.label/dist/leaflet.label.css',
                        'bower_components/leaflet-fullscreen/Control.FullScreen.css',
                        'bower_components/leaflet.markercluster/dist/MarkerCluster.Default.css',
                        'bower_components/leaflet.markercluster/dist/MarkerCluster.css',
                        'css/main.css',
                        'css/layout.css',
                        'css/table.css'
                    ]
                }
            }
        },
        jshint: {
            // define the files to lint
            files: ['Gruntfile.js', 'js/**/*.js', '<%= pkg.name %>.js'],
        }
    });

    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-jshint');

    grunt.registerTask('jshint', ['jshint']);
    grunt.registerTask('default', [/*'jshint',*/ 'copy', 'concat', 'uglify', 'cssmin']);
}
<|endoftext|>


<commit_before>// SauceLabs unit tests setup.

module.exports = function gruntConfig(grunt) {
  var browsers = [
    { browserName: 'chrome', version: '57.0', platform: 'Windows 10' },
    { browserName: 'firefox', version: '52.0', platform: 'Windows 10' },
    { browserName: 'safari', version: '10.0', platform: 'macOS 10.12' },
    { browserName: 'MicrosoftEdge', version: '14.14393', platform: 'Windows 10' },
    { browserName: 'internet explorer', version: '11.103', platform: 'Windows 10' },
    { browserName: 'internet explorer', version: '10.0', platform: 'Windows 7' },
    { browserName: 'internet explorer', version: '9.0', platform: 'Windows 7' }
  ];

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    connect: {
      server: {
        options: {
          base: '',
          port: 9999
        }
      }
    },
    'saucelabs-mocha': {
      all: {
        options: {
          urls: [
            'http://127.0.0.1:9999/test/test.html'
          ],
          browsers: browsers,
          build: process.env.TRAVIS_JOB_ID,
          testname: 'Mocha Unit Tests',
          throttled: 5,
          sauceConfig: {
            recordVideo: false,
            recordScreenshots: false
          }
        }
      }
    },
    watch: {}
  });

  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-saucelabs');

  grunt.registerTask('default', ['connect', 'saucelabs-mocha']);
};
<commit_msg>Update SauceLabs setup for Travis<commit_after>// SauceLabs unit tests setup.

module.exports = function gruntConfig(grunt) {
  var browsers = [
    { browserName: 'chrome', version: '57.0', platform: 'Windows 10' },
    { browserName: 'firefox', version: '52.0', platform: 'Windows 10' },
    { browserName: 'safari', version: '10.0', platform: 'macOS 10.12' },
    { browserName: 'MicrosoftEdge', version: '14.14393', platform: 'Windows 10' },
    { browserName: 'internet explorer', version: '11.103', platform: 'Windows 10' },
    { browserName: 'internet explorer', version: '10.0', platform: 'Windows 7' },
    { browserName: 'internet explorer', version: '9.0', platform: 'Windows 7' }
  ];

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    connect: {
      server: {
        options: {
          base: '',
          port: 9999
        }
      }
    },
    'saucelabs-mocha': {
      all: {
        options: {
          urls: [
            'http://127.0.0.1:9999/test/test.html'
          ],
          browsers: browsers,
          build: process.env.TRAVIS_JOB_ID,
          testname: 'Mocha Unit Tests',
          throttled: 5,
          sauceConfig: {
            recordVideo: false,
            recordScreenshots: false,
            tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
          },
          tunneled: false
        }
      }
    },
    watch: {}
  });

  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-saucelabs');

  grunt.registerTask('default', ['connect', 'saucelabs-mocha']);
};
<|endoftext|>


<commit_before>// Generated on 2014-09-13 using generator-angular 0.9.8
'use strict';

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

module.exports = function (grunt) {

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

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Configurable paths for the application
  var appConfig = {
    app: require('./bower.json').appPath || 'app',
    dist: 'dist/official'
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      compass: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: 9001,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      dist: {
        options: {
          open: true,
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: {
        src: [
          'Gruntfile.js',
          '<%= yeoman.app %>/scripts/{,*/}*.js'
        ]
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/{,*/}*',
            '!<%= yeoman.dist %>/.git*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        ignorePath:  /\.\.\//
      },
      sass: {
        src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        ignorePath: /(\.\.\/){1,2}bower_components\//
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        sassDir: '<%= yeoman.app %>/styles',
        cssDir: '.tmp/styles',
        generatedImagesDir: '.tmp/images/generated',
        imagesDir: '<%= yeoman.app %>/images',
        javascriptsDir: '<%= yeoman.app %>/scripts',
        fontsDir: '<%= yeoman.app %>/styles/fonts',
        importPath: './bower_components',
        httpImagesPath: '/images',
        httpGeneratedImagesPath: '/images/generated',
        httpFontsPath: '/styles/fonts',
        relativeAssets: false,
        assetCacheBuster: false,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= yeoman.dist %>/images/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/scripts/{,*/}*.js',
          '<%= yeoman.dist %>/styles/{,*/}*.css',
          '<%= yeoman.dist %>/styles/fonts/*'
        ]
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      options: {
        assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images']
      }
    },

    // The following *-min tasks will produce minified files in the dist folder
    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['*.html', 'views/{,*/}*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // ng-annotate tries to make the code safe for minification automatically
    // by using the Angular long form for dependency injection.
    ngAnnotate: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: ['*.js', '!oldieshim.js'],
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'views/{,*/}*.html',
            'images/{,*/}*.{webp}',
            'fonts/*',
            'json/**'
          ]
        }, {
          expand: true,
          cwd: 'landing',
          src: 'index.html',
          dest: 'dist'
        }, {
          expand: true,
          cwd: '.',
          src: 'CNAME',
          dest: 'dist' // FIXME: change to <%= yeoman.dist %> when we landed.
        },
        {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }, {
          expand: true,
          cwd: '.',
          src: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/*',
          dest: '<%= yeoman.dist %>'
        }, {
          expand: true,
          cwd: 'bower_components/components-font-awesome/fonts/',
          src: '*',
          dest: '<%= yeoman.dist %>/fonts'
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server'
      ],
      test: [
        'compass'
      ],
      dist: [
        'compass:dist',
        'imagemin',
        'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: 'test/karma.conf.js',
        singleRun: true
      }
    }
  });

  grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'wiredep',
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

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

  grunt.registerTask('build', [
    'clean:dist',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngAnnotate',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<commit_msg>Removed landing page<commit_after>// Generated on 2014-09-13 using generator-angular 0.9.8
'use strict';

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

module.exports = function (grunt) {

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

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Configurable paths for the application
  var appConfig = {
    app: require('./bower.json').appPath || 'app',
    dist: 'dist'
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      compass: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: 9001,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      dist: {
        options: {
          open: true,
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: {
        src: [
          'Gruntfile.js',
          '<%= yeoman.app %>/scripts/{,*/}*.js'
        ]
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/{,*/}*',
            '!<%= yeoman.dist %>/.git*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        ignorePath:  /\.\.\//
      },
      sass: {
        src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        ignorePath: /(\.\.\/){1,2}bower_components\//
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        sassDir: '<%= yeoman.app %>/styles',
        cssDir: '.tmp/styles',
        generatedImagesDir: '.tmp/images/generated',
        imagesDir: '<%= yeoman.app %>/images',
        javascriptsDir: '<%= yeoman.app %>/scripts',
        fontsDir: '<%= yeoman.app %>/styles/fonts',
        importPath: './bower_components',
        httpImagesPath: '/images',
        httpGeneratedImagesPath: '/images/generated',
        httpFontsPath: '/styles/fonts',
        relativeAssets: false,
        assetCacheBuster: false,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= yeoman.dist %>/images/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/scripts/{,*/}*.js',
          '<%= yeoman.dist %>/styles/{,*/}*.css',
          '<%= yeoman.dist %>/styles/fonts/*'
        ]
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      options: {
        assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images']
      }
    },

    // The following *-min tasks will produce minified files in the dist folder
    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['*.html', 'views/{,*/}*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // ng-annotate tries to make the code safe for minification automatically
    // by using the Angular long form for dependency injection.
    ngAnnotate: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: ['*.js', '!oldieshim.js'],
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'views/{,*/}*.html',
            'images/{,*/}*.{webp}',
            'fonts/*',
            'json/**'
          ]
        }, {
          expand: true,
          cwd: '.',
          src: 'CNAME',
          dest: '<%= yeoman.dist %>'
        },
        {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }, {
          expand: true,
          cwd: '.',
          src: 'bower_components/bootstrap-sass-official/assets/fonts/bootstrap/*',
          dest: '<%= yeoman.dist %>'
        }, {
          expand: true,
          cwd: 'bower_components/components-font-awesome/fonts/',
          src: '*',
          dest: '<%= yeoman.dist %>/fonts'
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server'
      ],
      test: [
        'compass'
      ],
      dist: [
        'compass:dist',
        'imagemin',
        'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: 'test/karma.conf.js',
        singleRun: true
      }
    }
  });

  grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'wiredep',
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

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

  grunt.registerTask('build', [
    'clean:dist',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngAnnotate',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

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


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

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      all: [
        'src/cache.adderall.js',
        'Gruntfile.js'
      ],
      options: {
        jshintrc: true
      }
    },
    browserify: {
      standalone: {
        src: [ 'src/cache.adderall.js' ],
        dest: 'dist/cache.adderall.js',
        options: {
          transform: [
            [ "babelify", {presets: ["es2015"]} ]
          ],
          plugin: [
            [ "minifyify", { output: "dist/cache.adderall.js.map", map: 'cache.adderall.js.map' } ],
            [ "browserify-header" ]
          ],
          browserifyOptions: {
            standalone: 'adderall',
            debug: true
          }
        }
      }
    },
    watch: {
      files: ['src/cache.adderall.js', '!**/node_modules/**'],
      tasks: ['default']
    },
    connect: {
      devel: {
        options: {
          protocol: 'http',
          port: 8443,
          hostname: '*',
          base: '.',
          open: 'http://localhost:8443/demo'
        }
      }
    }
  });

  // Load NPM Tasks
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-browserify');
  grunt.loadNpmTasks('grunt-contrib-connect');

  // Register tasks.
  grunt.registerTask('default', ['jshint', 'browserify']);
  grunt.registerTask('test', ['jshint']);
  grunt.registerTask('serve', ['default', 'connect:devel', 'watch']);

};
<commit_msg>Changed demo server port<commit_after>module.exports = function(grunt) {
  "use strict";

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      all: [
        'src/cache.adderall.js',
        'Gruntfile.js'
      ],
      options: {
        jshintrc: true
      }
    },
    browserify: {
      standalone: {
        src: [ 'src/cache.adderall.js' ],
        dest: 'dist/cache.adderall.js',
        options: {
          transform: [
            [ "babelify", {presets: ["es2015"]} ]
          ],
          plugin: [
            [ "minifyify", { output: "dist/cache.adderall.js.map", map: 'cache.adderall.js.map' } ],
            [ "browserify-header" ]
          ],
          browserifyOptions: {
            standalone: 'adderall',
            debug: true
          }
        }
      }
    },
    watch: {
      files: ['src/cache.adderall.js', '!**/node_modules/**'],
      tasks: ['default']
    },
    connect: {
      devel: {
        options: {
          protocol: 'http',
          port: 1919,
          hostname: '*',
          base: '.',
          open: 'http://localhost:1919/demo'
        }
      }
    }
  });

  // Load NPM Tasks
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-browserify');
  grunt.loadNpmTasks('grunt-contrib-connect');

  // Register tasks.
  grunt.registerTask('default', ['jshint', 'browserify']);
  grunt.registerTask('test', ['jshint']);
  grunt.registerTask('serve', ['default', 'connect:devel', 'watch']);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
    // Project configuration.
    grunt.initConfig({

        // Various Grunt tasks...

        buildcontrol: {
            options: {
                dir: '_site',
                commit: true,
                push: true,
                message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
            },
            pages: {
                options: {
                    remote: 'git@github.com:orestes/blog.orestes.io.git',
                    branch: 'gh-pages'
                }
            }
        }
    });

    grunt.registerTask('build', [
        // Collection of tasks that build code to the 'dist' directory...
    ]);

    grunt.loadNpmTasks('grunt-build-control');
};<commit_msg>Define 'deploy' task. Much nicer than doing 'grunt buildcontrol' all the time.<commit_after>module.exports = function(grunt) {
    // Project configuration.
    grunt.initConfig({

        // Various Grunt tasks...

        buildcontrol: {
            options: {
                dir: '_site',
                commit: true,
                push: true,
                message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
            },
            pages: {
                options: {
                    remote: 'git@github.com:orestes/blog.orestes.io.git',
                    branch: 'gh-pages'
                }
            }
        }
    });

    grunt.registerTask('deploy', ['buildcontrol:pages']);

    grunt.loadNpmTasks('grunt-build-control');
};
<|endoftext|>


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

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

    /* ====================================
        Project configuration
    ==================================== */

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

        /*
            Project paths
        ==================================== */
        project: {
            sass: "source/sass",
            css: "dist/css",
            js: "dist/js",
            js_dev: "source/js",
            js_partials: "source/js/components"
        },

        /*
            Concurrent
        ==================================== */
        concurrent: {
            build: {
                tasks: ['build:js', 'build:css'],
                options: {
                    logConcurrentOutput: false
                }
            }
        },

        /*
            Watch
        ==================================== */
        watch: {
            sass: {
                files: ['<%= project.sass %>/**/*.scss'],
                tasks: ['build:css'],
                options: {
                    livereload: true,
                }
            },
            concat: {
                files: ['<%= project.js_dev %>/**/*.js'],
                tasks: ['build:js'],
                options: {
                    livereload: true,
                }
            },
            browserify: {
                files: '<%= project.js_dev %>/**/*.js',
                tasks: 'browserify'
            },
        },

        /*
            Sass
        ==================================== */
        sass: {
            dev: {
                options: {
                    outputStyle: 'expanded',
                    trace: true
                },
                files: {
                    '<%= project.css %>/style__<%= pkg.version %>.css': '<%= project.sass %>/style.scss'
                }
            },
            dist: {
                options: {
                    outputStyle: 'compressed'
                },
                files: {
                    '<%= project.css %>/style__<%= pkg.version %>.css': '<%= project.sass %>/style.scss'
                }
            }
        },

        /*
            Browserify
        ==================================== */
        browserify: {
            dist: {
                src: '<%= project.js_dev %>/main.js',
                dest: '<%= project.js %>/script__<%= pkg.version %>.js'
            }
        },

        /*
            JSHint
        ==================================== */
        jshint: {
            all: {
                src: '<%= project.js_partials %>/*.js'
            },

            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish'),
                ignores: [
                ]
            }
        },

        /*
            Javascript uglify
        ==================================== */
        uglify: {
            options: {
                mangle: false,
                compress: {
                    drop_console: true
                }
            },
            my_target: {
                files: {
                    '<%= project.js %>/script__<%= pkg.version %>.js': ['<%= project.js %>/script__<%= pkg.version %>.js']
                }
            }
        },

        /*
            CSS autoprefixer
        ==================================== */
        autoprefixer: {
            dist: {
                options: {
                    browsers: ['last 3 versions', '> 1%', 'ie 8', 'ie 7']
                },
                src: '<%= project.css %>/style__<%= pkg.version %>.css',
                dest: '<%= project.css %>/style__<%= pkg.version %>.css'
            }
        },

        /*
            Server
        ==================================== */
        connect: {
            server: {
                options: {
                    hostname: 'localhost',
                    port: 8080,
                    base: './',
                    open: 'http://localhost:8080/'
                }
            }
        }
    });

    /* ====================================
        Tasks
    ==================================== */

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

    grunt.registerTask('build', [
        'concurrent:build'
    ]);

    grunt.registerTask('build:js', [
        'jshint',
        'browserify'
    ]);

    grunt.registerTask('build:css', [
        'sass:dev',
        'autoprefixer'
    ]);

    grunt.registerTask('dist',[
        'sass:dist',
        'autoprefixer',
        'browserify',
        'uglify'
    ]);

};
<commit_msg>Added JSHint to Grunt dist task<commit_after>module.exports = function(grunt) {

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

    /* ====================================
        Project configuration
    ==================================== */

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

        /*
            Project paths
        ==================================== */
        project: {
            sass: "source/sass",
            css: "dist/css",
            js: "dist/js",
            js_dev: "source/js",
            js_partials: "source/js/components"
        },

        /*
            Concurrent
        ==================================== */
        concurrent: {
            build: {
                tasks: ['build:js', 'build:css'],
                options: {
                    logConcurrentOutput: false
                }
            }
        },

        /*
            Watch
        ==================================== */
        watch: {
            sass: {
                files: ['<%= project.sass %>/**/*.scss'],
                tasks: ['build:css'],
                options: {
                    livereload: true,
                }
            },
            concat: {
                files: ['<%= project.js_dev %>/**/*.js'],
                tasks: ['build:js'],
                options: {
                    livereload: true,
                }
            },
            browserify: {
                files: '<%= project.js_dev %>/**/*.js',
                tasks: 'browserify'
            },
        },

        /*
            Sass
        ==================================== */
        sass: {
            dev: {
                options: {
                    outputStyle: 'expanded',
                    trace: true
                },
                files: {
                    '<%= project.css %>/style__<%= pkg.version %>.css': '<%= project.sass %>/style.scss'
                }
            },
            dist: {
                options: {
                    outputStyle: 'compressed'
                },
                files: {
                    '<%= project.css %>/style__<%= pkg.version %>.css': '<%= project.sass %>/style.scss'
                }
            }
        },

        /*
            Browserify
        ==================================== */
        browserify: {
            dist: {
                src: '<%= project.js_dev %>/main.js',
                dest: '<%= project.js %>/script__<%= pkg.version %>.js'
            }
        },

        /*
            JSHint
        ==================================== */
        jshint: {
            all: {
                src: '<%= project.js_partials %>/*.js'
            },

            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish'),
                ignores: [
                ]
            }
        },

        /*
            Javascript uglify
        ==================================== */
        uglify: {
            options: {
                mangle: false,
                compress: {
                    drop_console: true
                }
            },
            my_target: {
                files: {
                    '<%= project.js %>/script__<%= pkg.version %>.js': ['<%= project.js %>/script__<%= pkg.version %>.js']
                }
            }
        },

        /*
            CSS autoprefixer
        ==================================== */
        autoprefixer: {
            dist: {
                options: {
                    browsers: ['last 3 versions', '> 1%', 'ie 8', 'ie 7']
                },
                src: '<%= project.css %>/style__<%= pkg.version %>.css',
                dest: '<%= project.css %>/style__<%= pkg.version %>.css'
            }
        },

        /*
            Server
        ==================================== */
        connect: {
            server: {
                options: {
                    hostname: 'localhost',
                    port: 8080,
                    base: './',
                    open: 'http://localhost:8080/'
                }
            }
        }
    });

    /* ====================================
        Tasks
    ==================================== */

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

    grunt.registerTask('build', [
        'concurrent:build'
    ]);

    grunt.registerTask('build:js', [
        'jshint',
        'browserify'
    ]);

    grunt.registerTask('build:css', [
        'sass:dev',
        'autoprefixer'
    ]);

    grunt.registerTask('dist',[
        'sass:dist',
        'autoprefixer',
        'jshint',
        'browserify',
        'uglify'
    ]);

};
<|endoftext|>


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

   grunt.initConfig({

      pkg:grunt.file.readJSON("package.json")

   ,  concat: {
         oboe:{
            src: [
               'src/util.js'
            ,  'src/libs/polyfills.js'
            ,  'src/libs/clarinet.js'
            ,  'src/streamingXhr.js'
            ,  'src/jsonPath.js'
            ,  'src/jsonBuilder.js'
            ,  'src/pubsub.js'
            ,  'src/controller.js'
            ,  'src/api.js'
            ],
            dest: 'dist/oboe.concat.js'
         }
      }

   ,  wrap: {
         export: {
            src: 'dist/oboe.concat.js',
            dest: '.',
            wrapper: [
               // having a local undefined and window, Object etc allows slightly better minification:
               '// this file is the concatenation of several js files. See https://github.com/jimhigson/oboe.js/tree/master/src ' +
                   'for the unconcatenated source\n' +
               '(function  (window, Object, Array, Error, undefined ) {'
            ,           '})(window, Object, Array, Error);'
            ]
         }
      }

   ,  uglify: {
         build:{
            files:{
               'dist/oboe.min.js': 'dist/oboe.concat.js'
            }
         }
      }

   ,  jstestdriver: {

         options:{
            verbose:true
         }
      ,  files:{src:['test/jsTestDriver-dev.conf']}
      }

   });

   grunt.loadNpmTasks('grunt-contrib-concat');
   grunt.loadNpmTasks('grunt-wrap');
   grunt.loadNpmTasks('grunt-contrib-uglify');
   grunt.loadNpmTasks('grunt-jstestdriver');

   grunt.registerTask('devtest', ['jstestdriver']);
   grunt.registerTask('build', ['concat:oboe']);
   grunt.registerTask('minify', ['uglify']);
   grunt.registerTask('default', ['concat:oboe', 'wrap:export', 'uglify']);

};<commit_msg>move comment to a more logical place<commit_after>module.exports = function (grunt) {

   grunt.initConfig({

      pkg:grunt.file.readJSON("package.json")

   ,  concat: {
         oboe:{
            src: [
               'src/util.js'
            ,  'src/libs/polyfills.js'
            ,  'src/libs/clarinet.js'
            ,  'src/streamingXhr.js'
            ,  'src/jsonPath.js'
            ,  'src/jsonBuilder.js'
            ,  'src/pubsub.js'
            ,  'src/controller.js'
            ,  'src/api.js'
            ],
            dest: 'dist/oboe.concat.js'
         }
      }

   ,  wrap: {
         export: {
            src: 'dist/oboe.concat.js',
            dest: '.',
            wrapper: [
               '// this file is the concatenation of several js files. See https://github.com/jimhigson/oboe.js/tree/master/src ' +
                   'for the unconcatenated source\n' +
               // having a local undefined, window, Object etc allows slightly better minification:
               '(function  (window, Object, Array, Error, undefined ) {'
            ,           '})(window, Object, Array, Error);'
            ]
         }
      }

   ,  uglify: {
         build:{
            files:{
               'dist/oboe.min.js': 'dist/oboe.concat.js'
            }
         }
      }

   ,  jstestdriver: {

         options:{
            verbose:true
         }
      ,  files:{src:['test/jsTestDriver-dev.conf']}
      }

   });

   grunt.loadNpmTasks('grunt-contrib-concat');
   grunt.loadNpmTasks('grunt-wrap');
   grunt.loadNpmTasks('grunt-contrib-uglify');
   grunt.loadNpmTasks('grunt-jstestdriver');

   grunt.registerTask('devtest', ['jstestdriver']);
   grunt.registerTask('build', ['concat:oboe']);
   grunt.registerTask('minify', ['uglify']);
   grunt.registerTask('default', ['concat:oboe', 'wrap:export', 'uglify']);

};<|endoftext|>


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

grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-browser-sync");
grunt.loadNpmTasks('grunt-contrib-copy');

grunt.initConfig({
	jshint: {
		all: {
			src: ["Gruntfile.js", "public/js/**/*.js"],
			options: {
				jshintrc: true
			}
		}
	},
	less: {
		development: {
			options: {
				paths: ["public/less"],
				sourceMap: true,
				sourceMapFilename: "public/css/style.css.map",
				sourceMapRootpath: "/"
			},
			files: {
				"public/css/style.css": "public/less/style.less"
			}
		}
	},
	copy: {
		vendor: {
			files: [
			  { expand: true,
					cwd: "node_modules/font-awesome/",
					src: ["css/**", "fonts/**"],
					dest: "public/vendor/",
					filter: "isFile" }
			]
		}
	},
	watch: {
		scripts: {
			files: ["public/less/**/*.less"],
			tasks: ["less"],
			options: {
				spawn: false
			}
		}
	},
	browserSync: {
		dev: {
			bsFiles: {
				src: "public/css/*.css"
			},
			options: {
				port: 3001,
				watchTask: true
			}
		}
	}
});

grunt.registerTask("default", ["browserSync", "watch"]);

grunt.registerTask("build", ["copy", "less"]);

<commit_msg>fix gruntfile<commit_after>var grunt = require("grunt");

grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-less");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-browser-sync");
grunt.loadNpmTasks('grunt-contrib-copy');

grunt.initConfig({
	jshint: {
		all: {
			src: ["Gruntfile.js", "public/js/**/*.js"],
			options: {
				jshintrc: true
			}
		}
	},
	less: {
		development: {
			options: {
				paths: ["public/less"],
				sourceMap: true,
				sourceMapFilename: "css/style.css.map",
				sourceMapRootpath: "/"
			},
			files: {
				"public/css/style.css": "less/style.less"
			}
		}
	},
	copy: {
		vendor: {
			files: [
			  { expand: true,
					cwd: "node_modules/font-awesome/",
					src: ["css/**", "fonts/**"],
					dest: "vendor/",
					filter: "isFile" }
			]
		}
	},
	watch: {
		scripts: {
			files: ["less/**/*.less"],
			tasks: ["less"],
			options: {
				spawn: false
			}
		}
	},
	browserSync: {
		dev: {
			bsFiles: {
				src: "css/*.css"
			},
			options: {
				port: 3001,
				watchTask: true
			}
		}
	}
});

grunt.registerTask("default", ["browserSync", "watch"]);

grunt.registerTask("build", ["copy", "less"]);

<|endoftext|>


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

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

		jshint: {
			src: [
				"**/*.js", "!{node_modules,ViewStack/transitions}/**", "!**/themes/**", "!*/css/*.js"
			],
			options: {
				jshintrc: ".jshintrc"
			}
		},

		// Task for compiling less files into CSS files
		less : {
			// Compile less code for each widget
			widgets : {
				files: [
					{
						expand: true,
						src: ["*/themes/*/*.less", "list/*/themes/*/*.less", "!**/variables.less",
						      "!{dijit,mobile}/themes/*/*.less", "*/css/*.less",
							 "ViewStack/transitions/*.less"],
						ext: ".css"
					}
				]
			}
		},

		// Convert CSS files to JS files
		cssToJs : {
			src: [
				"*/themes/*/*.css", "list/*/themes/*/*.css",
				"!{dijit,mobile}/themes/*/*.css", "ViewStack/transitions/*.css"
			],
			options: {
				remove: true	// remove intermediate CSS files, generated from LESS files in less step
			}
		},

		// Copied from grunt web site but not tested
		uglify: {
			options: {
				banner: "/*! <%= pkg.name %> <%= grunt.template.today('yyyy-mm-dd') %> */\n"
			},
			build: {
				src: "src/<%= pkg.name %>.js",
				dest: "build/<%= pkg.name %>.min.js"
			}
		},

		intern: {
			local: {
				options: {
					runType: "runner",
					config: "tests/intern.local",
					reporters: ["runner"]
				}
			},
			"local.android": {
				options: {
					runType: "runner",
					config: "tests/intern.local.android",
					reporters: ["runner"]
				}
			},
			"local.ios": {
				options: {
					runType: "runner",
					config: "tests/intern.local.ios",
					reporters: ["runner"]
				}
			},
			remote: {
				options: {
					runType: "runner",
					config: "tests/intern",
					reporters: ["runner"]
				}
			}
		},

		"jsdoc-amddcl": {
			deliteful: {
				files: [
					{
						args: [
							"-c",
							"./node_modules/jsdoc-amddcl/conf.json"
						],
						src: [
							".",
							"./README.md",
							"./package.json"
						],
						imports: [
							"../delite/out"
						]
					},
					{
						args: [
							"-X",
							"-c",
							"./node_modules/jsdoc-amddcl/conf.json"
						],
						src: [
							".",
							"./README.md",
							"./package.json"
						],
						dest: "./out/doclets.json",
						imports: [
							"../delite/out"
						]
					}
				]
			}
		}
	});

	// Load plugins
	grunt.loadNpmTasks("intern");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-less");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("jsdoc-amddcl");
	grunt.loadTasks("../delite/themes/tasks");// Custom cssToJs task to convert CSS to JS

	// Aliases
	grunt.registerTask("default", ["less", "cssToJs"]);
	grunt.registerTask("jsdoc", "jsdoc-amddcl");

	// Testing.
	// always specify the target e.g. grunt test:remote, grunt test:remote
	// then add on any other flags afterwards e.g. console, lcovhtml
	var testTaskDescription = "Run this task instead of the intern task directly! \n" +
		"Always specify the test target e.g. \n" +
		"grunt test:local\n" +
		"grunt test:local.android\n" +
		"grunt test:local.ios\n" +
		"grunt test:remote\n\n" +
		"Add any optional reporters via a flag e.g. \n" +
		"grunt test:local:console\n" +
		"grunt test:local:lcovhtml\n" +
		"grunt test:local:console:lcovhtml";
	grunt.registerTask("test", testTaskDescription, function (target) {
		function addReporter(reporter) {
			var property = "intern." + target + ".options.reporters",
				value = grunt.config.get(property);
			if (value.indexOf(reporter) !== -1) {
				return;
			}
			value.push(reporter);
			grunt.config.set(property, value);
		}
		if (this.flags.lcovhtml) {
			addReporter("lcovhtml");
		}

		if (this.flags.console) {
			addReporter("console");
		}
		grunt.task.run("intern:" + target);
	});
};<commit_msg>Change upon jsdoc-amddcl/pull/23 and more cleanup.<commit_after>/*global module */
module.exports = function (grunt) {

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

		jshint: {
			src: [
				"**/*.js", "!{node_modules,ViewStack/transitions}/**", "!**/themes/**", "!*/css/*.js"
			],
			options: {
				jshintrc: ".jshintrc"
			}
		},

		// Task for compiling less files into CSS files
		less : {
			// Compile less code for each widget
			widgets : {
				files: [
					{
						expand: true,
						src: ["*/themes/*/*.less", "list/*/themes/*/*.less", "!**/variables.less",
						      "!{dijit,mobile}/themes/*/*.less", "*/css/*.less",
							 "ViewStack/transitions/*.less"],
						ext: ".css"
					}
				]
			}
		},

		// Convert CSS files to JS files
		cssToJs : {
			src: [
				"*/themes/*/*.css", "list/*/themes/*/*.css",
				"!{dijit,mobile}/themes/*/*.css", "ViewStack/transitions/*.css"
			],
			options: {
				remove: true	// remove intermediate CSS files, generated from LESS files in less step
			}
		},

		// Copied from grunt web site but not tested
		uglify: {
			options: {
				banner: "/*! <%= pkg.name %> <%= grunt.template.today('yyyy-mm-dd') %> */\n"
			},
			build: {
				src: "src/<%= pkg.name %>.js",
				dest: "build/<%= pkg.name %>.min.js"
			}
		},

		intern: {
			local: {
				options: {
					runType: "runner",
					config: "tests/intern.local",
					reporters: ["runner"]
				}
			},
			"local.android": {
				options: {
					runType: "runner",
					config: "tests/intern.local.android",
					reporters: ["runner"]
				}
			},
			"local.ios": {
				options: {
					runType: "runner",
					config: "tests/intern.local.ios",
					reporters: ["runner"]
				}
			},
			remote: {
				options: {
					runType: "runner",
					config: "tests/intern",
					reporters: ["runner"]
				}
			}
		},

		"jsdoc-amddcl": {
			docs: {
				files: [
					{
						src: [
							".",
							"./README.md",
							"./package.json"
						],
						imports: [
							"../delite/out"
						]
					}
				]
			},
			export: {
				files: [
					{
						args: [
							"-X"
						],
						src: [
							".",
							"./README.md",
							"./package.json"
						],
						dest: "./out/doclets.json",
						imports: [
							"../delite/out"
						]
					}
				]
			}
		}
	});

	// Load plugins
	grunt.loadNpmTasks("intern");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-less");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("jsdoc-amddcl");
	grunt.loadTasks("../delite/themes/tasks");// Custom cssToJs task to convert CSS to JS

	// Aliases
	grunt.registerTask("default", ["less", "cssToJs"]);
	grunt.registerTask("jsdoc", "jsdoc-amddcl");

	// Testing.
	// always specify the target e.g. grunt test:remote, grunt test:remote
	// then add on any other flags afterwards e.g. console, lcovhtml
	var testTaskDescription = "Run this task instead of the intern task directly! \n" +
		"Always specify the test target e.g. \n" +
		"grunt test:local\n" +
		"grunt test:local.android\n" +
		"grunt test:local.ios\n" +
		"grunt test:remote\n\n" +
		"Add any optional reporters via a flag e.g. \n" +
		"grunt test:local:console\n" +
		"grunt test:local:lcovhtml\n" +
		"grunt test:local:console:lcovhtml";
	grunt.registerTask("test", testTaskDescription, function (target) {
		function addReporter(reporter) {
			var property = "intern." + target + ".options.reporters",
				value = grunt.config.get(property);
			if (value.indexOf(reporter) !== -1) {
				return;
			}
			value.push(reporter);
			grunt.config.set(property, value);
		}
		if (this.flags.lcovhtml) {
			addReporter("lcovhtml");
		}

		if (this.flags.console) {
			addReporter("console");
		}
		grunt.task.run("intern:" + target);
	});
};<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        jshint: {
            allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
            options: {
                jshintrc: '.jshintrc',
            }
        },
        mochacli: {
            all: ['test/**/*.js'],
            options: {
                reporter: 'spec',
                ui: 'tdd'
            }
        },
        'mocha_istanbul': {
            coveralls: {
                src: [ 'test/lib', 'test/lib/utils' ],
                options: {
                    coverage: true,
                    legend: true,
                    check: {
                        lines: 95,
                        statements: 96
                    },
                    root: './lib',
                    reportFormats: ['lcov']
                }
            }
        }
    })

    grunt.event.on('coverage', function(lcov, done){
        require('coveralls').handleInput(lcov, function(error) {
            if (error) {
                console.log(error)
                return done(error)
            }
            done()
        })
    })

    // Load the plugins
    grunt.loadNpmTasks('grunt-contrib-jshint')
    grunt.loadNpmTasks('grunt-mocha-cli')
    grunt.loadNpmTasks('grunt-mocha-istanbul')

    // Configure tasks
    grunt.registerTask('coveralls', ['mocha_istanbul:coveralls'])
    grunt.registerTask('default', ['test'])

    grunt.registerTask('test', ['mochacli', 'jshint', 'coveralls'])
}
<commit_msg>Increase coverage to 100%<commit_after>'use strict';

module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        jshint: {
            allFiles: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'index.js'],
            options: {
                jshintrc: '.jshintrc',
            }
        },
        mochacli: {
            all: ['test/**/*.js'],
            options: {
                reporter: 'spec',
                ui: 'tdd'
            }
        },
        'mocha_istanbul': {
            coveralls: {
                src: [ 'test/lib', 'test/lib/utils' ],
                options: {
                    coverage: true,
                    legend: true,
                    check: {
                        lines: 100,
                        statements: 100
                    },
                    root: './lib',
                    reportFormats: ['lcov']
                }
            }
        }
    })

    grunt.event.on('coverage', function(lcov, done){
        require('coveralls').handleInput(lcov, function(error) {
            if (error) {
                console.log(error)
                return done(error)
            }
            done()
        })
    })

    // Load the plugins
    grunt.loadNpmTasks('grunt-contrib-jshint')
    grunt.loadNpmTasks('grunt-mocha-cli')
    grunt.loadNpmTasks('grunt-mocha-istanbul')

    // Configure tasks
    grunt.registerTask('coveralls', ['mocha_istanbul:coveralls'])
    grunt.registerTask('default', ['test'])

    grunt.registerTask('test', ['mochacli', 'jshint', 'coveralls'])
}
<|endoftext|>


<commit_before>var saucelabsConfig = require('./conf/saucelabs.js');

module.exports = function(grunt) {
  grunt.initConfig({

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

    // Karma runner
    karma: {
      options: {
        configFile: 'conf/karma.js',
      },
      local: {
      },
      continuous: {
        autoWatch: true,
        singleRun: false
      },
      saucelabs: {
        reporters: ['saucelabs'],
        sauceLabs: {
          testName: "Tree Multiselect tests"
        },
        customLaunchers: saucelabsConfig.browsers,
        browsers: Object.keys(saucelabsConfig.browsers)
      }
    },

    // JSHint
    jshint: {
      all: ['src/jquery.tree-multiselect.js']
    },

    // Minify CSS
    cssmin: {
      dist: {
        files: {
          'dist/jquery.tree-multiselect.min.css': ['src/jquery.tree-multiselect.css']
        }
      }
    },

    // Uglify JS
    uglify: {
      dist: {
        options: {
          preserveComments: false,
        },
        files: {
          'dist/jquery.tree-multiselect.min.js': ['src/jquery.tree-multiselect.js']
        }
      }
    },

    // Put headers on distributed files
    usebanner: {
      dist: {
        options: {
          position: 'top',
          banner: "/* jQuery Tree Multiselect v<%= pkg.version %> | " +
                  "(c) Patrick Tsai et al. | MIT Licensed */",
          linebreak: true
        },
        files: {
          src: ['dist/*.min.*']
        }
      }
    },

    // Upload LCOV data to coveralls.io
    coveralls: {
      ci: {
        src: 'coverage/**/lcov.info',
        force: false
      }
    }
  });

  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-banner');
  grunt.loadNpmTasks('grunt-coveralls');

  grunt.registerTask('test-local', ['karma:local', 'jshint']);
  grunt.registerTask('test-watch', ['karma:continuous']);
  grunt.registerTask('test-travis', ['test-local', 'coveralls', 'karma:saucelabs']);
  grunt.registerTask('release', ['test-local', 'cssmin', 'uglify', 'usebanner']);

  grunt.registerTask('default', 'test-local');
};
<commit_msg>Don't sauce_connect, karma!<commit_after>var saucelabsConfig = require('./conf/saucelabs.js');

module.exports = function(grunt) {
  grunt.initConfig({

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

    // Karma runner
    karma: {
      options: {
        configFile: 'conf/karma.js',
      },
      local: {
      },
      continuous: {
        autoWatch: true,
        singleRun: false
      },
      saucelabs: {
        reporters: ['saucelabs'],
        sauceLabs: {
          testName: "Tree Multiselect tests",
          startConnect: false
        },
        customLaunchers: saucelabsConfig.browsers,
        browsers: Object.keys(saucelabsConfig.browsers)
      }
    },

    // JSHint
    jshint: {
      all: ['src/jquery.tree-multiselect.js']
    },

    // Minify CSS
    cssmin: {
      dist: {
        files: {
          'dist/jquery.tree-multiselect.min.css': ['src/jquery.tree-multiselect.css']
        }
      }
    },

    // Uglify JS
    uglify: {
      dist: {
        options: {
          preserveComments: false,
        },
        files: {
          'dist/jquery.tree-multiselect.min.js': ['src/jquery.tree-multiselect.js']
        }
      }
    },

    // Put headers on distributed files
    usebanner: {
      dist: {
        options: {
          position: 'top',
          banner: "/* jQuery Tree Multiselect v<%= pkg.version %> | " +
                  "(c) Patrick Tsai et al. | MIT Licensed */",
          linebreak: true
        },
        files: {
          src: ['dist/*.min.*']
        }
      }
    },

    // Upload LCOV data to coveralls.io
    coveralls: {
      ci: {
        src: 'coverage/**/lcov.info',
        force: false
      }
    }
  });

  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-banner');
  grunt.loadNpmTasks('grunt-coveralls');

  grunt.registerTask('test-local', ['karma:local', 'jshint']);
  grunt.registerTask('test-watch', ['karma:continuous']);
  grunt.registerTask('test-travis', ['test-local', 'coveralls', 'karma:saucelabs']);
  grunt.registerTask('release', ['test-local', 'cssmin', 'uglify', 'usebanner']);

  grunt.registerTask('default', 'test-local');
};
<|endoftext|>


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

	'use strict';

	// Project configuration.
	grunt.initConfig({
		pkg: require('./package'),
		meta: {
			banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
			'<%= grunt.template.today("yyyy-mm-dd") %> */'
		},

		jshint: {
			all: [
				'Gruntfile.js',
				'js/main.js'
			],
			options: {
				jshintrc: '.jshintrc'
			}
		},

		// Build modernizr
		modernizr: {
			devFile: 'js/vendor/modernizr-2.6.2.js',
			outputFile : 'dist/js/vendor/modernizr-for-<%= pkg.version %>.min.js',

			extra: {
				shiv: true,
				mq: true
			},

			// Minify
			uglify: true,

			// Files
			files: ['js/**/*.js', 'scss/**/*.scss']
		},

		sass: {
			dev: {
				options: {
					unixNewlines: true,
					style: 'expanded'
				},
				files: {
					'css/main.css': 'scss/main.scss'
				}
			},
			deploy: {
				options: {
					style: 'compressed'
				},
				files: {
					'dist/css/main-<%= pkg.version %>.min.css': 'scss/main.scss'
				}

			}
		},

		clean: {
			deploy: ["dist"]
		},

		uglify: {
			deploy: {
				options: {
					sourceMap: "dist/js/main-<%= pkg.version %>.min.map"
				},
				files: {
					'dist/js/main-<%= pkg.version %>.min.js': [
						'js/vendor/jquery-*.min.js',
						'js/plugins/log.js',
						'js/main.js'
					],
				}
			}
		},

		copy: {
			deploy: {
				files: [
					{src: ['js/**'], dest: 'dist/'}
				]
			}
		},

		watch: {

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

			js: {
				files: [
					'Gruntfile.js',
					'js/main.js'
				],
				tasks: 'jshint'
			}
		}
	});

	grunt.registerTask( "fix-sourcemap", function() {
		var paths = [];
		var fs = require("fs");

		grunt.task.requires('uglify');

		paths.push(grunt.config.get('uglify.deploy.options.sourceMap'));
		for(var k in grunt.config.get('uglify.deploy.files')) {
			k = grunt.template.process(k);
			paths.push(k);
		}

		paths.forEach(function( filename ) {
			grunt.log.writeln(filename);
			var text = fs.readFileSync( filename, "utf8" );

			// Modify map/min so that it points to files in the same folder;
			// see https://github.com/mishoo/UglifyJS2/issues/47
			if ( /\.map$/.test( filename ) ) {
				text = text.replace( /"(dist\/)?js\//g, "\"" );
				fs.writeFileSync( filename, text, "utf-8" );
			} else if ( /\.min\.js$/.test( filename ) ) {
				text = text.replace( /sourceMappingURL=(dist\/)?js\//, "sourceMappingURL=" );
				fs.writeFileSync( filename, text, "utf-8" );
			}
		});

	});

	// Load some stuff
	grunt.loadNpmTasks('grunt-modernizr');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-sass');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');

	// A task for development
	grunt.registerTask('dev', ['jshint', 'sass:dev']);

	// A task for deployment
	grunt.registerTask('deploy', ['jshint', 'clean', 'modernizr', 'sass:deploy', 'uglify', 'copy', 'fix-sourcemap']);

	// Default task
	grunt.registerTask('default', ['jshint', 'sass:dev', 'uglify', 'copy', 'fix-sourcemap']);

};
<commit_msg>Clean up Gruntfile.js<commit_after>module.exports = function (grunt) {

	'use strict';

	// Project configuration.
	grunt.initConfig({
		pkg: require('./package'),
		meta: {
			banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
			'<%= grunt.template.today("yyyy-mm-dd") %> */'
		},

		jshint: {
			all: [
				'Gruntfile.js',
				'js/main.js'
			],
			options: {
				jshintrc: '.jshintrc'
			}
		},

		// Build modernizr
		modernizr: {
			devFile: 'js/vendor/modernizr-2.6.2.js',
			outputFile : 'dist/js/vendor/modernizr-for-<%= pkg.version %>.min.js',

			extra: {
				shiv: true,
				mq: true
			},

			// Minify
			uglify: true,

			// Files
			files: ['js/**/*.js', 'scss/**/*.scss']
		},

		sass: {
			dev: {
				options: {
					unixNewlines: true,
					style: 'expanded'
				},
				files: {
					'css/main.css': 'scss/main.scss'
				}
			},
			deploy: {
				options: {
					style: 'compressed'
				},
				files: {
					'dist/css/main-<%= pkg.version %>.min.css': 'scss/main.scss'
				}

			}
		},

		clean: {
			deploy: ['dist']
		},

		uglify: {
			deploy: {
				options: {
					sourceMap: 'dist/js/main-<%= pkg.version %>.min.map'
				},
				files: {
					'dist/js/main-<%= pkg.version %>.min.js': [
						'js/vendor/jquery-*.min.js',
						'js/plugins/log.js',
						'js/main.js'
					],
				}
			}
		},

		copy: {
			deploy: {
				files: [{
					src: ['js/**'],
					dest: 'dist/'
				}]
			}
		},

		watch: {
			scss: {
				files: ['scss/**/*.scss'],
				tasks: 'sass:dev'
			},

			js: {
				files: [
					'Gruntfile.js',
					'js/main.js'
				],
				tasks: 'jshint'
			}
		}
	});

	// Load some stuff
	grunt.loadNpmTasks('grunt-modernizr');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-sass');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-watch');

	grunt.loadTasks('grunt-tasks');

	// A task for development
	grunt.registerTask('dev', ['jshint', 'sass:dev']);

	// A task for deployment
	grunt.registerTask('deploy', ['jshint', 'clean', 'modernizr', 'sass:deploy', 'uglify', 'copy', 'fix-sourcemap']);

	// Default task
	grunt.registerTask('default', ['jshint', 'sass:dev', 'uglify', 'copy', 'fix-sourcemap']);

};
<|endoftext|>


<commit_before>var gruntRequireConfig = require('./src/dev/requireConfig').gruntConfig;

module.exports = function (grunt) {
    grunt.initConfig({
        requirejs: {
            core: {
                options: gruntRequireConfig
            }
        },
        concat: {

        },
        jst: {
            templates: {
                compile: {
                    options: {
                        prettify: true,
                        processName: function (filePath) {
                            var parts = filePath.split('/');
                            var fileName = parts[parts.length - 1];
                            return fileName.split('.')[0];
                        }
                    },
                    files: {
                        "build/js/templates.js": ["src/templates/*.html"]
                    }
                }
            }
        },
        less: {
            development: {
                options: {
                    paths: ['src/less']
                },
                files: {
                    "build/css/razorflow.css": "src/less/razorflow.less"
                }
            }
        },
        jshint: {
            options: {
                jshintrc: 'src/js/.jshintrc'
            },
            files: [
                "src/js/**/*.js"
            ]
        },
        karma: {
            dev: {
                configFile: './karma.conf.js',
                singleRun: true
            }
        },
        shell: {
            coverageReport: {
                command: 'cat "build/coverage/PhantomJS 1.9.7 (Mac OS X)/coverage.txt"',
                options: {
                    stdout: true
                }
            }
        },
        lodash: {
            build: {
                dest: 'src/vendor/js/lodash.rf.js',
                options: {
                    include: ['extend', 'pluck', 'map', 'each', 'isNumber', 'isNaN', 'isArray', 'isObject', 'find', 'defer', 'delay', 'max', 'min', 'sortBy', 'flatten', 'clone', 'cloneDeep', 'values', 'pick', 'reduce', 'filter', 'indexOf', 'keys', 'debounce'],
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-requirejs');
    grunt.loadNpmTasks('grunt-contrib-jst');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-shell');
    grunt.loadNpmTasks('grunt-lodash');
    grunt.loadNpmTasks('grunt-contrib-copy');

    grunt.registerTask('compile', ['less', 'jst:templates']);
    grunt.registerTask('test', ['compile', 'karma:dev', 'shell:coverageReport']);

    grunt.registerTask('build', ["less", "jst:templates", 'requirejs:core'])
}<commit_msg>add assert module<commit_after>var gruntRequireConfig = require('./src/dev/requireConfig').gruntConfig;

module.exports = function (grunt) {
    grunt.initConfig({
        requirejs: {
            core: {
                options: gruntRequireConfig
            }
        },
        concat: {

        },
        jst: {
            templates: {
                compile: {
                    options: {
                        prettify: true,
                        processName: function (filePath) {
                            var parts = filePath.split('/');
                            var fileName = parts[parts.length - 1];
                            return fileName.split('.')[0];
                        }
                    },
                    files: {
                        "build/js/templates.js": ["src/templates/*.html"]
                    }
                }
            }
        },
        less: {
            development: {
                options: {
                    paths: ['src/less']
                },
                files: {
                    "build/css/razorflow.css": "src/less/razorflow.less"
                }
            }
        },
        jshint: {
            options: {
                jshintrc: 'src/js/.jshintrc'
            },
            files: [
                "src/js/**/*.js"
            ]
        },
        karma: {
            dev: {
                configFile: './karma.conf.js',
                singleRun: true
            }
        },
        shell: {
            coverageReport: {
                command: 'cat "build/coverage/PhantomJS 1.9.7 (Mac OS X)/coverage.txt"',
                options: {
                    stdout: true
                }
            }
        },
        lodash: {
            build: {
                dest: 'src/vendor/js/lodash.rf.js',
                options: {
                    include: ['extend', 'pluck', 'map', 'each', 'isNumber', 'isString', 'isNaN', 'isArray', 'isObject', 'find', 'defer', 'delay', 'max', 'min', 'sortBy', 'flatten', 'clone', 'cloneDeep', 'values', 'pick', 'reduce', 'filter', 'indexOf', 'keys', 'debounce'],
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-requirejs');
    grunt.loadNpmTasks('grunt-contrib-jst');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-shell');
    grunt.loadNpmTasks('grunt-lodash');
    grunt.loadNpmTasks('grunt-contrib-copy');

    grunt.registerTask('compile', ['less', 'jst:templates']);
    grunt.registerTask('test', ['compile', 'karma:dev', 'shell:coverageReport']);

    grunt.registerTask('build', ["less", "jst:templates", 'requirejs:core'])
}<|endoftext|>


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

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

  grunt.initConfig({
    eslint: {
      options: {
        configFile: 'eslint.json'
      },
      target: ['src', 'Gruntfile']
    },

    mocha_phantomjs: {
      all: ['test/**/*.html']
    },

    urequire: {
      _defaults: {
        path: 'src',
        main: 'listener'
      },
      main: {
        template: 'combined',
        dstPath: 'index.js'
      },
      min : {
        template: 'combined',
        dstPath: 'index.min.js',
        optimize: 'uglify2'
      }
    }
  });

  grunt.registerTask('default', ['eslint', 'mocha_phantomjs', 'urequire']);
}
<commit_msg>remove unit testing from grunt default build and moved to pre-commit hook<commit_after>module.exports = function(grunt) {

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

  grunt.initConfig({
    eslint: {
      options: {
        configFile: 'eslint.json'
      },
      target: ['src', 'Gruntfile']
    },

    mocha_phantomjs: {
      all: ['test/**/*.html']
    },

    urequire: {
      _defaults: {
        path: 'src',
        main: 'listener'
      },
      main: {
        template: 'combined',
        dstPath: 'index.js'
      },
      min : {
        template: 'combined',
        dstPath: 'index.min.js',
        optimize: 'uglify2'
      }
    }
  });

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


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

    grunt.initConfig({
        concurrent: {
            tasks: ['watch'],
            options: {
                logConcurrentOutput: true
            }
        },
        watch: {
            test: {
                files: ['test/**/*.js'],
                tasks: [
                    'karma'
                ]
            },
            js: {
                files: ['src/**'],
                tasks: [
                    'closureCompiler:targetName',
                    'less'
                ]
            }
        },
        less: {
            options: {
                compress: false
            },
            development: {
                files: {
                    "dist/entry.css": "src/css/*.less"
                }
            }
        },
        jshint: {
            all: [
                'src/**/*.js'
            ],
            options: {
                jshintrc: true,
                ignores: ['src/blocks/*.js']
            }
        },
        karma: {
            options: {
                frameworks: ['mocha', 'chai'],
                files: [
                    'test_util/*.js',
                    'extern/jquery/jquery.js',
                    'extern/blockly/blockly_compressed.js',
                    'dist/entry.js'
                ]
            },
            unit: {
                configFile: 'karma.conf.js',
                logLevel: 'ERROR',
                files: [
                    { src : ['test/**/*.js'] }
                ]
            }
        },
        closureCompiler: {
            options: {
                compilerFile: 'node_modules/closurecompiler/compiler/compiler.jar',
                checkModified: true,
                compilerOpts: {
                    create_source_map: 'entry.js.map',
                    compilation_level: 'SIMPLE_OPTIMIZATIONS',
                    language_in: 'ECMASCRIPT5',
                    language_out: 'ECMASCRIPT5',
                    formatting: 'pretty_print'
                }
            },
            targetName: {
                src: ['src/entry.js', 'src/**/*.js', '!src/workspace/block_entry.js'],
                dest: 'dist/entry.js'
            },
            dist: {
                options: {
                    compilerOpts: {
                        compilation_level: 'SIMPLE_OPTIMIZATIONS',
                        language_in: 'ECMASCRIPT5',
                        language_out: 'ECMASCRIPT5'
                    }
                },
                expand: false,
                src: ['src/entry.js', 'src/**/*.js'],
                dest: 'dist/entry.min.js',
                ext: '.min.js'
            }
        }
    });

    // Load NPM tasks
    grunt.loadNpmTasks('grunt-closure-tools');
    //grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-concurrent');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-contrib-less');

    grunt.option('force', true);

    // Default tasks.
    grunt.registerTask('default', [
        'closureCompiler',
        'karma',
        'less'
    ]);

    grunt.registerTask('development', [
        'watch',
        'closureCompiler:targetName',
        'karma',
        'concurrent'
    ]);

    grunt.registerTask('closure', ['closureCompiler']);
};
<commit_msg>restore gruntFile<commit_after>module.exports = function(grunt) {
    'use strict';

    grunt.initConfig({
        concurrent: {
            tasks: ['watch'],
            options: {
                logConcurrentOutput: true
            }
        },
        watch: {
            test: {
                files: ['test/**/*.js'],
                tasks: [
                    'karma'
                ]
            },
            js: {
                files: ['src/**'],
                tasks: [
                    'closureCompiler:targetName',
                    'karma',
                    'jshint',
                    'less'
                ]
            }
        },
        less: {
            options: {
                compress: false
            },
            development: {
                files: {
                    "dist/entry.css": "src/css/*.less"
                }
            }
        },
        jshint: {
            all: [
                'src/**/*.js'
            ],
            options: {
                jshintrc: true,
                ignores: ['src/blocks/*.js']
            }
        },
        karma: {
            options: {
                frameworks: ['mocha', 'chai'],
                files: [
                    'test_util/*.js',
                    'extern/jquery/jquery.js',
                    'extern/blockly/blockly_compressed.js',
                    'dist/entry.js'
                ]
            },
            unit: {
                configFile: 'karma.conf.js',
                logLevel: 'ERROR',
                files: [
                    { src : ['test/**/*.js'] }
                ]
            }
        },
        closureCompiler: {
            options: {
                compilerFile: 'node_modules/closurecompiler/compiler/compiler.jar',
                checkModified: true,
                compilerOpts: {
                    create_source_map: 'entry.js.map',
                    compilation_level: 'SIMPLE_OPTIMIZATIONS',
                    language_in: 'ECMASCRIPT5',
                    language_out: 'ECMASCRIPT5',
                    formatting: 'pretty_print'
                }
            },
            targetName: {
                src: ['src/entry.js', 'src/**/*.js', '!src/workspace/block_entry.js'],
                dest: 'dist/entry.js'
            },
            dist: {
                options: {
                    compilerOpts: {
                        compilation_level: 'SIMPLE_OPTIMIZATIONS',
                        language_in: 'ECMASCRIPT5',
                        language_out: 'ECMASCRIPT5'
                    }
                },
                expand: false,
                src: ['src/entry.js', 'src/**/*.js'],
                dest: 'dist/entry.min.js',
                ext: '.min.js'
            }
        }
    });

    // Load NPM tasks
    grunt.loadNpmTasks('grunt-closure-tools');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-concurrent');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-contrib-less');

    grunt.option('force', true);

    // Default tasks.
    grunt.registerTask('default', [
        'closureCompiler',
        'karma',
        'jshint',
        'less'
    ]);

    grunt.registerTask('development', [
        'watch',
        'closureCompiler:targetName',
        'karma',
        'concurrent'
    ]);

    grunt.registerTask('closure', ['closureCompiler']);
};
<|endoftext|>