<commit_before>// Generated on 2016-11-28 using generator-angularfire-express 1.0.9
'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: {
      express: {
        files:  [ 'server/**/*.js' ],
          tasks:  [ 'express' ],
          options: {
          livereload: true,
            spawn: false
        }
      },

      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: 35729
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      styles: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
        tasks: ['newer:copy:styles', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: 35729
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    express: {
      options: {
        script: 'server/app.js',
          port: 3000
      },
      defaults: {}
    },
    open: {
      dev: {
        path: 'http://localhost:3000/'
      }
    },

    prod: {
      options: {
        script: 'server/app.js',
          port: 80
      },
      defaults: {}
    }

    // 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 %>/public/{,*/}*',
            '!<%= yeoman.dist %>/public/.git{,*/}*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      server: {
        options: {
          map: true,
        },
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      },
      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:  /\.\.\//
      },
      test: {
        devDependencies: true,
        src: '<%= karma.unit.configFile %>',
        ignorePath:  /\.\.\//,
        fileTypes:{
          js: {
            block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi,
              detect: {
                js: /'(.*\.js)'/gi
              },
              replace: {
                js: '\'{{filePath}}\','
              }
            }
          }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/public/scripts/{,*/}*.js',
          '<%= yeoman.dist %>/public/styles/{,*/}*.css',
          '<%= yeoman.dist %>/public/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/public/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 %>/public',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

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

    // 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 %>/public/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/public/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/public/public/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

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

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

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

    // 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',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

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

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          cwd: './server/',
          dest: '/server',
          src: '**/*.*'
        }, {
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>/public',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'views/{,*/}*.html',
            'images/{,*/}*.{webp}',
            'styles/fonts/{,*/}*.*'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/public/images',
          src: ['generated/*']
        }, {
          expand: true,
          cwd: 'bower_components/bootstrap/dist',
          src: 'fonts/*',
          dest: '<%= yeoman.dist %>/public'
        }]
      },
      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: [
        'copy:styles'
      ],
      test: [
        'copy:styles'
      ],
      dist: [
        'copy:styles',
        'imagemin',
        'svgmin'
      ]
    },

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

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

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

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

    grunt.task.run([
      'clean:server',
      'wiredep',
      'concurrent:server',
      'autoprefixer:server',
      'prod',
      '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',
    'wiredep',
    '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>Unpatch Gruntfile<commit_after>// Generated on 2016-11-28 using generator-angularfire-express 1.0.9
'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: {
      express: {
        files:  [ 'server/**/*.js' ],
          tasks:  [ 'express' ],
          options: {
          livereload: true,
            spawn: false
        }
      },

      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: 35729
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      styles: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
        tasks: ['newer:copy:styles', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: 35729
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    express: {
      options: {
        script: 'server/app.js',
          port: 3000
      },
      defaults: {}
    },
    open: {
      dev: {
        path: 'http://localhost:3000/'
      }
    },

    // 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 %>/public/{,*/}*',
            '!<%= yeoman.dist %>/public/.git{,*/}*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      server: {
        options: {
          map: true,
        },
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      },
      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:  /\.\.\//
      },
      test: {
        devDependencies: true,
        src: '<%= karma.unit.configFile %>',
        ignorePath:  /\.\.\//,
        fileTypes:{
          js: {
            block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi,
              detect: {
                js: /'(.*\.js)'/gi
              },
              replace: {
                js: '\'{{filePath}}\','
              }
            }
          }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/public/scripts/{,*/}*.js',
          '<%= yeoman.dist %>/public/styles/{,*/}*.css',
          '<%= yeoman.dist %>/public/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/public/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 %>/public',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

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

    // 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 %>/public/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/public/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/public/public/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

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

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

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

    // 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',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

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

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          cwd: './server/',
          dest: '/server',
          src: '**/*.*'
        }, {
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>/public',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'views/{,*/}*.html',
            'images/{,*/}*.{webp}',
            'styles/fonts/{,*/}*.*'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/public/images',
          src: ['generated/*']
        }, {
          expand: true,
          cwd: 'bower_components/bootstrap/dist',
          src: 'fonts/*',
          dest: '<%= yeoman.dist %>/public'
        }]
      },
      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: [
        'copy:styles'
      ],
      test: [
        'copy:styles'
      ],
      dist: [
        'copy:styles',
        'imagemin',
        'svgmin'
      ]
    },

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

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

    grunt.task.run([
      'clean:server',
      'wiredep',
      'concurrent:server',
      'autoprefixer:server',
      'express',
      'open',
      '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',
    'wiredep',
    '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>'use strict';

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);

    require('./grunt-tasks/grunt-atomizer')(grunt);

    // Configurable paths for the application
    var appConfig = {
        src: 'src',
        docs: 'docs',
        dist: 'dist',
        examples: 'examples',
        pkg: grunt.file.readJSON('package.json')
    };

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

        // -- Project Config -------------------------------------------------------
        project: appConfig,

        // -- Atomic.css -----------------------------------------------------------
        atomizer: {
            dist: {
                options: {
                    minify: false,
                    banner: [
                        '/*!',
                        'Atomic.css v<%= project.pkg.version %>',
                        'Copyright 2014 Yahoo! Inc. All rights reserved.',
                        'Licensed under the BSD License.',
                        'https://github.com/yahoo/atomic.css/blob/master/LICENSE.md',
                        '*/\n'
                    ].join('\n')
                },
                rules: '<%= project.src %>/rules.js',
                src: '<%= project.examples %>/example-config.js',
                dest: '<%= project.dist %>/atomic.css'
            }
        },

        // -- Clean ----------------------------------------------------------------
        clean: {
            dist: {
                files: [{
                    src: '<%=project.dist%>',
                    dot: true
                }]
            }
        },

        // -- Minify ---------------------------------------------------------------
        cssmin: {
            dist: {
                options: {
                    report: 'gzip'
                },
                files: [{
                    expand: true,
                    cwd: 'dist/',
                    src: ['**/*.css', '!**/*.min.css'],
                    dest: 'dist/',
                    ext: '.min.css'
                }]
            }
        }
    });

    grunt.registerTask('default', [
        'clean',
        'atomizer:dist',
        'cssmin:dist'
    ]);
};
<commit_msg>Updating copyright<commit_after>'use strict';

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);

    require('./grunt-tasks/grunt-atomizer')(grunt);

    // Configurable paths for the application
    var appConfig = {
        src: 'src',
        docs: 'docs',
        dist: 'dist',
        examples: 'examples',
        pkg: grunt.file.readJSON('package.json')
    };

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

        // -- Project Config -------------------------------------------------------
        project: appConfig,

        // -- Atomic.css -----------------------------------------------------------
        atomizer: {
            dist: {
                options: {
                    minify: false,
                    banner: [
                        '/*!',
                        'Atomic.css v<%= project.pkg.version %>',
                        'Copyright 2015 Yahoo! Inc. All rights reserved.',
                        'Licensed under the BSD License.',
                        'https://github.com/yahoo/atomic.css/blob/master/LICENSE.md',
                        '*/\n'
                    ].join('\n')
                },
                rules: '<%= project.src %>/rules.js',
                src: '<%= project.examples %>/example-config.js',
                dest: '<%= project.dist %>/atomic.css'
            }
        },

        // -- Clean ----------------------------------------------------------------
        clean: {
            dist: {
                files: [{
                    src: '<%=project.dist%>',
                    dot: true
                }]
            }
        },

        // -- Minify ---------------------------------------------------------------
        cssmin: {
            dist: {
                options: {
                    report: 'gzip'
                },
                files: [{
                    expand: true,
                    cwd: 'dist/',
                    src: ['**/*.css', '!**/*.min.css'],
                    dest: 'dist/',
                    ext: '.min.css'
                }]
            }
        }
    });

    grunt.registerTask('default', [
        'clean',
        'atomizer:dist',
        'cssmin:dist'
    ]);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
      },
      build: {
        src: 'dist/flow.js',
        dest: 'dist/flow.min.js'
      }
    },
    concat: {
      build: {
        files: {
          'dist/flow.js': [
            'src/flow.js'
          ]
        }
      }
    },
    jst: {
      compile: {
        options: {

        },
        files: {
          "dist/flow.js": ["dist/flow.js"]
        }
      }
    },
    coveralls: {
      options: {
        coverageDir: 'coverage/'
      }
    },
    karma: {
      options: {
        configFile: 'karma.conf.js'
      },
      watch: {
        autoWatch: true,
        background: false
      },
      continuous: {
        singleRun: true
      },
      coverage: {
        singleRun: true,
        browsers: ['Firefox'],
        reporters: ['progress', 'coverage'],
        preprocessors: {
          'src/*.js': 'coverage'
        },
        coverageReporter: {
          type: "lcov",
          dir: "coverage"
        }
      },
      saucelabs: {
        singleRun: true,
        reporters: ['progress', 'saucelabs'],
        preprocessors: {
          'src/*.js': 'coverage'
        },
        coverageReporter: {
          type: "lcov",
          dir: "coverage"
        },
        // global config for SauceLabs
        sauceLabs: {
          testName: 'flow.js',
          username: grunt.option('sauce-username') || process.env.SAUCE_USERNAME,
          accessKey: grunt.option('sauce-access-key') || process.env.SAUCE_ACCESS_KEY,
          tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
          startConnect: false
        }
      }
    },
    clean: {
      release: ["dist/"]
    },
    bump: {
      options: {
        files: ['package.json', 'bower.json'],
        updateConfigs: ['pkg'],
        commit: true,
        commitMessage: 'Release v%VERSION%',
        commitFiles: ['-a'], // '-a' for all files
        createTag: true,
        tagName: 'v%VERSION%',
        tagMessage: 'Version %VERSION%',
        push: true,
        pushTo: 'origin',
        gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
      }
    },
    'template': {
      'release': {
        'options': {
          'data': {
            'version': '<%= pkg.version %>'
          }
        },
        'files': {
          'dist/flow.js': ['dist/flow.js']
        }
      }
    }
  });

  // Loading dependencies
  for (var key in grunt.file.readJSON("package.json").devDependencies) {
    if (key !== "grunt" && key.indexOf("grunt") === 0) grunt.loadNpmTasks(key);
  }

  // Default task.
  grunt.registerTask('default', ['test']);
  // Release tasks
  grunt.registerTask('build', ['concat', 'template', 'uglify']);
  grunt.registerTask('release', function(type) {
    type = type ? type : 'patch';
    grunt.task.run('bump-only:' + type);
    grunt.task.run('clean', 'build');
    grunt.task.run('bump-commit');
  });
  // Development
  grunt.registerTask('test', ["karma:coverage"]);
};
<commit_msg>fix release command bump<commit_after>module.exports = function(grunt) {
  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
      },
      build: {
        src: 'dist/flow.js',
        dest: 'dist/flow.min.js'
      }
    },
    concat: {
      build: {
        files: {
          'dist/flow.js': [
            'src/flow.js'
          ]
        }
      }
    },
    jst: {
      compile: {
        options: {

        },
        files: {
          "dist/flow.js": ["dist/flow.js"]
        }
      }
    },
    coveralls: {
      options: {
        coverageDir: 'coverage/'
      }
    },
    karma: {
      options: {
        configFile: 'karma.conf.js'
      },
      watch: {
        autoWatch: true,
        background: false
      },
      continuous: {
        singleRun: true
      },
      coverage: {
        singleRun: true,
        browsers: ['Firefox'],
        reporters: ['progress', 'coverage'],
        preprocessors: {
          'src/*.js': 'coverage'
        },
        coverageReporter: {
          type: "lcov",
          dir: "coverage"
        }
      },
      saucelabs: {
        singleRun: true,
        reporters: ['progress', 'saucelabs'],
        preprocessors: {
          'src/*.js': 'coverage'
        },
        coverageReporter: {
          type: "lcov",
          dir: "coverage"
        },
        // global config for SauceLabs
        sauceLabs: {
          testName: 'flow.js',
          username: grunt.option('sauce-username') || process.env.SAUCE_USERNAME,
          accessKey: grunt.option('sauce-access-key') || process.env.SAUCE_ACCESS_KEY,
          tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
          startConnect: false
        }
      }
    },
    clean: {
      release: ["dist/"]
    },
    bump: {
      options: {
        files: ['package.json'],
        updateConfigs: ['pkg'],
        commit: true,
        commitMessage: 'Release v%VERSION%',
        commitFiles: ['-a'], // '-a' for all files
        createTag: true,
        tagName: 'v%VERSION%',
        tagMessage: 'Version %VERSION%',
        push: true,
        pushTo: 'origin',
        gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
      }
    },
    'template': {
      'release': {
        'options': {
          'data': {
            'version': '<%= pkg.version %>'
          }
        },
        'files': {
          'dist/flow.js': ['dist/flow.js']
        }
      }
    }
  });

  // Loading dependencies
  for (var key in grunt.file.readJSON("package.json").devDependencies) {
    if (key !== "grunt" && key.indexOf("grunt") === 0) grunt.loadNpmTasks(key);
  }

  // Default task.
  grunt.registerTask('default', ['test']);
  // Release tasks
  grunt.registerTask('build', ['concat', 'template', 'uglify']);
  grunt.registerTask('release', function(type) {
    type = type ? type : 'patch';
    grunt.task.run('bump-only:' + type);
    grunt.task.run('clean', 'build');
    grunt.task.run('bump-commit');
  });
  // Development
  grunt.registerTask('test', ["karma:coverage"]);
};
<|endoftext|>


<commit_before>/*global module:false*/

module.exports = function (grunt) {
  'use strict';
  var path = require('path');
  var mountFolder = function (connect, dir) {
    return connect.static(path.resolve(dir));
  };

  var configuration = {
    pkg: grunt.file.readJSON('package.json'),
    dir: {
      src: {
        root: 'src',
        demos: '<%= config.dir.src.root %>/demos',
        widgets: '<%= config.dir.src.root %>/widgets'
      },
      dist: {
        root: 'dist',
        assets: '<%= config.dir.dist.root %>/assets',
        demos: '<%= config.dir.dist.root %>/demos',
        flot: '<%= config.dir.dist.assets %>/flot',
        font: '<%= config.dir.dist.assets %>/font-awesome/font',
        richwidgets: '<%= config.dir.dist.assets %>/richwidgets'
      },
      test: {
        root: 'test'
      },
      lib: {
        root: 'lib',
        bootstrap: '<%= config.dir.lib.root %>/bootstrap',
        fontawesome: '<%= config.dir.lib.root %>/font-awesome',
        jquery: '<%= config.dir.lib.root %>/jquery',
        jqueryui: '<%= config.dir.lib.root %>/jquery-ui',
        flot: {
          lib: '<%= config.dir.lib.root %>/flot',
          axisLabels: '<%= config.dir.lib.root %>/flotAxisLabels',
          orderBars: '<%= config.dir.lib.root %>/flotOrderBars',
          tooltip :  '<%= config.dir.lib.root %>/flotTooltip'
        }
      }
    },
    banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
      '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
      '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
      ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n'
  };

  grunt.registerTask('bower', [
    'shell:bowerInstall'
  ]);

  grunt.registerTask('build', [
    'jshint',
    'copy:font',
    'copy:jquery',
    'copy:jqueryui',
    'copy:flot',
    'copy:js',
    'less:bootstrap',
    'less:fontawesome',
    'less:widgets',
    'less:dist',
    'concat:flot',
    'uglify:dist',
    'copy:demoAssets',
    'copy:demoResources',
    'yuidoc',
  ]);

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

  grunt.registerTask('dist', [
    'clean:dist',
    'build',
    'uglify:demo',
    'cssmin:demo',
    'assemble:production',
    'test'
  ]);

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

  grunt.registerTask('travis', [
    'dist'
  ]);

  grunt.registerTask('dev', [
    'clean:demo',
    'build',
    'assemble:dev',
//    'karma:dev',
    'connect:dev',
    'watch'
  ]);

  grunt.registerTask('site', [
    'dist',
    'gh-pages'
  ]);

  grunt.initConfig({
    config: configuration,
    demo: grunt.file.readYAML('src/demos/data/site.yml'),

    clean: {
      dist: [ '<%= config.dir.dist.root %>' ],
      demo: ['<%= demo.destination %>/**/*.{html,md}']
    },

    less: {
      bootstrap: {
        options: {
          paths: ['<%= config.dir.lib.bootstrap %>/less']
        },
        src: '<%= config.dir.lib.bootstrap %>/less/bootstrap.less',
        dest: '<%= config.dir.dist.assets %>/bootstrap/bootstrap.css'
      },
      fontawesome: {
        options: {
          paths: ['<%= config.dir.lib.fontawesome %>/less']
        },
        src: '<%= config.dir.src.widgets %>/font-awesome-richwidgets.less',
        dest: '<%= config.dir.dist.assets %>/font-awesome/font-awesome.css'
      },
      widgets: {
        options: {
          paths: ['<%= config.dir.src.widgets %>', '<%= config.dir.lib.root %>']
        },
        files: grunt.file.expandMapping('*/**/*.less', '<%= config.dir.dist.richwidgets %>/', { // */**/*.less: exclude files in the widgets folder itself
          cwd: 'src/widgets',
          rename: function (destBase, destPath) {
            return destBase + destPath.replace(/\.less$/, '.css');
          }
        })
      },
      dist: {
        options: {
          paths: ['<%= config.dir.src.widgets %>', '<%= config.dir.lib.root %>'],
          yuicompress: true
        },
        src: '<%= config.dir.src.widgets %>/main.less',
        dest: '<%= config.dir.dist.richwidgets %>/richwidgets.min.css'
      }
    },

    cssmin: {
      demo: {
        files: {
          '<%= config.dir.dist.demos %>/assets-demo/richwidgets-demo.min.css': ['<%= config.dir.dist.richwidgets %>/richwidgets.min.css', '<%= config.dir.dist.assets %>/font-awesome/font-awesome.css']
        }
      }
    },

    uglify: {
      options: {
        banner: '// JBoss RedHat (c)\n'
      },
      dist: {
        options: {
          compress: true
        },
        files: [
          {
            '<%= config.dir.dist.assets %>/richwidgets/richwidgets.min.js': ['<%= config.dir.dist.flot %>/richwidgets.flot.js', '<%= config.dir.src.widgets %>/**/*.js']
          }
        ]
      },
      demo: {
        options: {
          compress: true,
          nonull: true
        },
        files: [
          {
            '<%= config.dir.dist.demos %>/assets-demo/richwidgets-demo.min.js': [
              '<%= config.dir.dist.assets %>/jquery/jquery.min.js',
              '<%= config.dir.dist.assets %>/jquery-ui/minified/jquery-ui.min.js',
              '<%= config.dir.dist.flot %>/richwidgets.flot.js',
              '<%= config.dir.dist.richwidgets %>/richwidgets.min.js'
            ]
          }
        ]
      }
    },

    concat: {
      flot: {
        options: {
          separator: ';',
          nonull: true
        },
        src: [
          '<%= config.dir.dist.flot %>/jquery.flot.js',
          '<%= config.dir.dist.flot %>/jquery.flot.selection.js',
          '<%= config.dir.dist.flot %>/jquery.flot.pie.js',
          '<%= config.dir.dist.flot %>/jquery.flot.categories.js',
          '<%= config.dir.dist.flot %>/jquery.flot.symbol.js',
          '<%= config.dir.dist.flot %>/jquery.flot.tooltip.js',
          '<%= config.dir.dist.flot %>/jquery.flot.orderBars.js'
        ],
        dest: '<%= config.dir.dist.flot %>/richwidgets.flot.js'
      }
    },

    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: 'nofunc',
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        unused: 'vars',
        boss: true,
        eqnull: true,
        browser: true,
        trailing: true,
        quotmark: 'single',
        camelcase:true
      },
      gruntfile: {
        options: {
          indent: 2,
          globals: {
            jQuery: true,
            require: true
          }
        },
        src: 'Gruntfile.js'
      },
      widgets: {
        options: {
          globals: {
            jQuery: true
          }
        },
        src: ['src/widgets/**/*.js']
      },
      demos: {
        options: {
          globals: {
            '$': true,
            module: true,
            require: true,
            source: true  // global used in autocomplete demos
          }
        },
        src: ['src/demos/**/*.js']
      },
      tests: {
        options: {
          camelcase:false,
          globals: {
            jQuery: true,
            '$': true,
            it: true,
            expect: true,
            runs: true,
            waitsFor: true,
            beforeEach: true,
            afterEach: true,
            define: true,
            describe: true,
            jasmine: true,
            requirejs: true
          }
        },
        src: ['test/**/*.js']
      }
    },

    copy: {
      font: {
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.lib.fontawesome %>/font',
            src: ['**'],
            dest: '<%= config.dir.dist.font %>'
          }
        ]
      },
      jquery: {
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.lib.jquery %>',
            src: ['*.js', '*.map'],
            dest: '<%= config.dir.dist.assets %>/jquery'
          }
        ]
      },
      jqueryui: {
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.lib.jqueryui %>/ui',
            src: ['**'],
            dest: '<%= config.dir.dist.assets %>/jquery-ui'
          }
        ]
      },
      flot: {
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.lib.flot.lib %>',
            src: ['**.js','!**/examples/**','!jquery.js'],
            dest: '<%= config.dir.dist.assets %>/flot'
          },
          {
            expand: true,
            cwd: '<%= config.dir.lib.flot.axisLabels %>',
            src: ['**.js'],
            dest: '<%= config.dir.dist.assets %>/flot'
          },
          {
            expand: true,
            cwd: '<%= config.dir.lib.flot.orderBars %>/js',
            src: ['**.js'],
            dest: '<%= config.dir.dist.assets %>/flot'
          },
          {
            expand: true,
            cwd: '<%= config.dir.lib.flot.tooltip %>/js',
            src: ['**.js','!jquery.flot.js'],
            dest: '<%= config.dir.dist.assets %>/flot'
          }
        ]
      },
      js: {
        files: grunt.file.expandMapping('**/*.js', '<%= config.dir.dist.richwidgets %>/', {
          cwd: 'src/widgets',
          rename: function (destBase, destPath) {
            return destBase + destPath;
          }
        })
      },
      demoAssets: {
        options: {
          banner: '<%= banner %>'
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.lib.root %>',
            src: [
              'modernizr/modernizr.js',
              'highlightjs/highlight.pack.js',
              'highlightjs/styles/github.css',
              'bootstrap/js/dropdown.js',
              'bootstrap/js/collapse.js'
            ],
            dest: '<%= config.dir.dist.demos %>/assets-demo/'
          },
          {
            expand: true,
            cwd: '<%= config.dir.dist.font %>',
            src: '*',
            dest: '<%= config.dir.dist.demos %>/assets-demo/font/'
          },
          {
            expand: true,
            cwd: '<%= config.dir.src.demos %>/pages',
            src: ['**/*.{css,js}'],
            dest: '<%= config.dir.dist.demos %>/assets-demo/'
          }
        ]
      },
      demoResources: {
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.src.demos %>',
            src: ['CNAME', '**/*.png'],
            dest: '<%= config.dir.dist.demos %>/'
          }
        ]
      }
    },

    shell: {
      options: {
        stdout: true
      },
      bowerInstall: {
        command: 'bower install'
      }
    },

    parallel: {
      options: {
        grunt: true
      }
    },

    karma: {
      options: {
        configFile: 'karma.conf.js'
      },
      test: {
        singleRun: true,
        autoWatch: false
      },
      dev: {
        singleRun: false,
        autoWatch: false,
        background: true,  // run karma in a child process so it doesn't block subsequent grunt tasks
        reporters: 'dots'
      }
    },

    watch: {
      options: {
        livereload: false,
        forever: true
      },
      less: {
        files: ['<%= config.dir.src.widgets %>/**/*.less'],
        tasks: ['less:widgets']
      },
      js: {
        files: ['<%= config.dir.src.widgets %>/**/*.js'],
        tasks: ['copy:js']
      },
      // Activate once the following issue is resolved:
      // https://github.com/gruntjs/grunt-contrib-watch/issues/186
      // karma: {
      //   files: ['<%= config.dir.src.widgets %>/**/*.js', '<%= config.dir.test.root %>/**/*.js'],
      //   tasks: ['karma:dev:run']
      // },
      demo: {
        files: [
          '<%= config.dir.src.demos %>/**',
          'README.md',
          'CONTRIBUTING.md'
        ],
        tasks: ['copy:demoAssets', 'assemble:dev']
      },
      dist: {
        options: {
          livereload: true
        },
        files: [
          '<%= config.dir.dist.assets %>/**/*.js',
          '<%= config.dir.dist.assets %>/**/*.css',
          '<%= config.dir.dist.demos %>/**/*.html'
        ],
        tasks: []
      }
    },

    connect: {
      options: {
        port: 9000,
        // change this to '0.0.0.0' to access the server from outside
        //hostname: 'localhost'
        hostname: '0.0.0.0'
      },
      demo: {
        options: {
          middleware: function (connect) {
            return [
              mountFolder(connect, 'dist/demos')
            ];
          }
        }
      },
      dev: {
        options: {
          middleware: function (connect) {
            return [
              mountFolder(connect, 'dist/demos'),
              mountFolder(connect, 'dist')
            ];
          }
        }
      }
    },

    yuidoc: {
      compile: {
        name: '<%= config.pkg.name %>',
        description: '<%= config.pkg.description %>',
        logo: '../logo.png',
        version: '<%= config.pkg.version %>',
        url: '<%= config.pkg.homepage %>',
        options: {
          paths: 'src/widgets',
          themedir: 'lib/yuidoc-bootstrap-theme',
          helpers : ['lib/yuidoc-bootstrap-theme/helpers/helpers.js'],
          outdir: 'dist/demos/api'
        }
      }
    },

    assemble: {
      options: {
        prettify: {indent: 2},
        data: 'src/demos/**/*.{json,yml}',
        assets: './dist/demos/assets',
        helpers: ['src/demos/helpers/helper-*.js', 'node_modules/yfm/lib/*.js'],
        layoutdir: 'src/demos/templates/layouts',
        layout: 'default.hbs',
        partials: ['src/demos/templates/includes/**/*.hbs'],
        postprocess: function(content) {
          // replace links to github markdown files with relative links to html versions of the files
          content = content.replace(/https:\/\/github\.com\/richwidgets\/richwidgets\/blob\/master\/([a-zA-Z]*)\.md/g, function(match, name) {
            return name === 'README' ? 'about.html' : name.toLowerCase() + '.html';
          });
          return content;
        }
      },
      production: {
        options: {production: true},
        files: [
          { expand: true, cwd: 'src/demos/pages', src: ['**/*.hbs'], dest: '<%= demo.destination %>/' }
        ]
      },
      dev: {
        options: {production: false},
        files: [
          { expand: true, cwd: 'src/demos/pages', src: ['**/*.hbs'], dest: '<%= demo.destination %>/' }
        ]
      }
    },

    'gh-pages': {
      options: {
        base: 'dist/demos',
        branch: 'master',
        repo: 'git@github.com:richwidgets/richwidgets.github.io.git'
      },
      src: ['**']
    }
  });

  // load all the grunt-* dependencies found in the package.json file
  require('matchdep').filterDev('grunt-*').forEach(function (plugin) {
    grunt.loadNpmTasks(plugin);
  });

  grunt.loadNpmTasks('assemble');
  grunt.loadNpmTasks('assemble-less');  // not related to assemble
};
<commit_msg>added yuidoc step to watch:js to allow fast documentation turnaround<commit_after>/*global module:false*/

module.exports = function (grunt) {
  'use strict';
  var path = require('path');
  var mountFolder = function (connect, dir) {
    return connect.static(path.resolve(dir));
  };

  var configuration = {
    pkg: grunt.file.readJSON('package.json'),
    dir: {
      src: {
        root: 'src',
        demos: '<%= config.dir.src.root %>/demos',
        widgets: '<%= config.dir.src.root %>/widgets'
      },
      dist: {
        root: 'dist',
        assets: '<%= config.dir.dist.root %>/assets',
        demos: '<%= config.dir.dist.root %>/demos',
        flot: '<%= config.dir.dist.assets %>/flot',
        font: '<%= config.dir.dist.assets %>/font-awesome/font',
        richwidgets: '<%= config.dir.dist.assets %>/richwidgets'
      },
      test: {
        root: 'test'
      },
      lib: {
        root: 'lib',
        bootstrap: '<%= config.dir.lib.root %>/bootstrap',
        fontawesome: '<%= config.dir.lib.root %>/font-awesome',
        jquery: '<%= config.dir.lib.root %>/jquery',
        jqueryui: '<%= config.dir.lib.root %>/jquery-ui',
        flot: {
          lib: '<%= config.dir.lib.root %>/flot',
          axisLabels: '<%= config.dir.lib.root %>/flotAxisLabels',
          orderBars: '<%= config.dir.lib.root %>/flotOrderBars',
          tooltip :  '<%= config.dir.lib.root %>/flotTooltip'
        }
      }
    },
    banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
      '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
      '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
      ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n'
  };

  grunt.registerTask('bower', [
    'shell:bowerInstall'
  ]);

  grunt.registerTask('build', [
    'jshint',
    'copy:font',
    'copy:jquery',
    'copy:jqueryui',
    'copy:flot',
    'copy:js',
    'less:bootstrap',
    'less:fontawesome',
    'less:widgets',
    'less:dist',
    'concat:flot',
    'uglify:dist',
    'copy:demoAssets',
    'copy:demoResources',
    'yuidoc'
  ]);

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

  grunt.registerTask('dist', [
    'clean:dist',
    'build',
    'uglify:demo',
    'cssmin:demo',
    'assemble:production',
    'test'
  ]);

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

  grunt.registerTask('travis', [
    'dist'
  ]);

  grunt.registerTask('dev', [
    'clean:demo',
    'build',
    'assemble:dev',
//    'karma:dev',
    'connect:dev',
    'watch'
  ]);

  grunt.registerTask('site', [
    'dist',
    'gh-pages'
  ]);

  grunt.initConfig({
    config: configuration,
    demo: grunt.file.readYAML('src/demos/data/site.yml'),

    clean: {
      dist: [ '<%= config.dir.dist.root %>' ],
      demo: ['<%= demo.destination %>/**/*.{html,md}']
    },

    less: {
      bootstrap: {
        options: {
          paths: ['<%= config.dir.lib.bootstrap %>/less']
        },
        src: '<%= config.dir.lib.bootstrap %>/less/bootstrap.less',
        dest: '<%= config.dir.dist.assets %>/bootstrap/bootstrap.css'
      },
      fontawesome: {
        options: {
          paths: ['<%= config.dir.lib.fontawesome %>/less']
        },
        src: '<%= config.dir.src.widgets %>/font-awesome-richwidgets.less',
        dest: '<%= config.dir.dist.assets %>/font-awesome/font-awesome.css'
      },
      widgets: {
        options: {
          paths: ['<%= config.dir.src.widgets %>', '<%= config.dir.lib.root %>']
        },
        files: grunt.file.expandMapping('*/**/*.less', '<%= config.dir.dist.richwidgets %>/', { // */**/*.less: exclude files in the widgets folder itself
          cwd: 'src/widgets',
          rename: function (destBase, destPath) {
            return destBase + destPath.replace(/\.less$/, '.css');
          }
        })
      },
      dist: {
        options: {
          paths: ['<%= config.dir.src.widgets %>', '<%= config.dir.lib.root %>'],
          yuicompress: true
        },
        src: '<%= config.dir.src.widgets %>/main.less',
        dest: '<%= config.dir.dist.richwidgets %>/richwidgets.min.css'
      }
    },

    cssmin: {
      demo: {
        files: {
          '<%= config.dir.dist.demos %>/assets-demo/richwidgets-demo.min.css': ['<%= config.dir.dist.richwidgets %>/richwidgets.min.css', '<%= config.dir.dist.assets %>/font-awesome/font-awesome.css']
        }
      }
    },

    uglify: {
      options: {
        banner: '// JBoss RedHat (c)\n'
      },
      dist: {
        options: {
          compress: true
        },
        files: [
          {
            '<%= config.dir.dist.assets %>/richwidgets/richwidgets.min.js': ['<%= config.dir.dist.flot %>/richwidgets.flot.js', '<%= config.dir.src.widgets %>/**/*.js']
          }
        ]
      },
      demo: {
        options: {
          compress: true,
          nonull: true
        },
        files: [
          {
            '<%= config.dir.dist.demos %>/assets-demo/richwidgets-demo.min.js': [
              '<%= config.dir.dist.assets %>/jquery/jquery.min.js',
              '<%= config.dir.dist.assets %>/jquery-ui/minified/jquery-ui.min.js',
              '<%= config.dir.dist.flot %>/richwidgets.flot.js',
              '<%= config.dir.dist.richwidgets %>/richwidgets.min.js'
            ]
          }
        ]
      }
    },

    concat: {
      flot: {
        options: {
          separator: ';',
          nonull: true
        },
        src: [
          '<%= config.dir.dist.flot %>/jquery.flot.js',
          '<%= config.dir.dist.flot %>/jquery.flot.selection.js',
          '<%= config.dir.dist.flot %>/jquery.flot.pie.js',
          '<%= config.dir.dist.flot %>/jquery.flot.categories.js',
          '<%= config.dir.dist.flot %>/jquery.flot.symbol.js',
          '<%= config.dir.dist.flot %>/jquery.flot.tooltip.js',
          '<%= config.dir.dist.flot %>/jquery.flot.orderBars.js'
        ],
        dest: '<%= config.dir.dist.flot %>/richwidgets.flot.js'
      }
    },

    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: 'nofunc',
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        unused: 'vars',
        boss: true,
        eqnull: true,
        browser: true,
        trailing: true,
        quotmark: 'single',
        camelcase:true
      },
      gruntfile: {
        options: {
          indent: 2,
          globals: {
            jQuery: true,
            require: true
          }
        },
        src: 'Gruntfile.js'
      },
      widgets: {
        options: {
          globals: {
            jQuery: true
          }
        },
        src: ['src/widgets/**/*.js']
      },
      demos: {
        options: {
          globals: {
            '$': true,
            module: true,
            require: true,
            source: true  // global used in autocomplete demos
          }
        },
        src: ['src/demos/**/*.js']
      },
      tests: {
        options: {
          camelcase:false,
          globals: {
            jQuery: true,
            '$': true,
            it: true,
            expect: true,
            runs: true,
            waitsFor: true,
            beforeEach: true,
            afterEach: true,
            define: true,
            describe: true,
            jasmine: true,
            requirejs: true
          }
        },
        src: ['test/**/*.js']
      }
    },

    copy: {
      font: {
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.lib.fontawesome %>/font',
            src: ['**'],
            dest: '<%= config.dir.dist.font %>'
          }
        ]
      },
      jquery: {
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.lib.jquery %>',
            src: ['*.js', '*.map'],
            dest: '<%= config.dir.dist.assets %>/jquery'
          }
        ]
      },
      jqueryui: {
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.lib.jqueryui %>/ui',
            src: ['**'],
            dest: '<%= config.dir.dist.assets %>/jquery-ui'
          }
        ]
      },
      flot: {
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.lib.flot.lib %>',
            src: ['**.js','!**/examples/**','!jquery.js'],
            dest: '<%= config.dir.dist.assets %>/flot'
          },
          {
            expand: true,
            cwd: '<%= config.dir.lib.flot.axisLabels %>',
            src: ['**.js'],
            dest: '<%= config.dir.dist.assets %>/flot'
          },
          {
            expand: true,
            cwd: '<%= config.dir.lib.flot.orderBars %>/js',
            src: ['**.js'],
            dest: '<%= config.dir.dist.assets %>/flot'
          },
          {
            expand: true,
            cwd: '<%= config.dir.lib.flot.tooltip %>/js',
            src: ['**.js','!jquery.flot.js'],
            dest: '<%= config.dir.dist.assets %>/flot'
          }
        ]
      },
      js: {
        files: grunt.file.expandMapping('**/*.js', '<%= config.dir.dist.richwidgets %>/', {
          cwd: 'src/widgets',
          rename: function (destBase, destPath) {
            return destBase + destPath;
          }
        })
      },
      demoAssets: {
        options: {
          banner: '<%= banner %>'
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.lib.root %>',
            src: [
              'modernizr/modernizr.js',
              'highlightjs/highlight.pack.js',
              'highlightjs/styles/github.css',
              'bootstrap/js/dropdown.js',
              'bootstrap/js/collapse.js'
            ],
            dest: '<%= config.dir.dist.demos %>/assets-demo/'
          },
          {
            expand: true,
            cwd: '<%= config.dir.dist.font %>',
            src: '*',
            dest: '<%= config.dir.dist.demos %>/assets-demo/font/'
          },
          {
            expand: true,
            cwd: '<%= config.dir.src.demos %>/pages',
            src: ['**/*.{css,js}'],
            dest: '<%= config.dir.dist.demos %>/assets-demo/'
          }
        ]
      },
      demoResources: {
        files: [
          {
            expand: true,
            cwd: '<%= config.dir.src.demos %>',
            src: ['CNAME', '**/*.png'],
            dest: '<%= config.dir.dist.demos %>/'
          }
        ]
      }
    },

    shell: {
      options: {
        stdout: true
      },
      bowerInstall: {
        command: 'bower install'
      }
    },

    parallel: {
      options: {
        grunt: true
      }
    },

    karma: {
      options: {
        configFile: 'karma.conf.js'
      },
      test: {
        singleRun: true,
        autoWatch: false
      },
      dev: {
        singleRun: false,
        autoWatch: false,
        background: true,  // run karma in a child process so it doesn't block subsequent grunt tasks
        reporters: 'dots'
      }
    },

    watch: {
      options: {
        livereload: false,
        forever: true
      },
      less: {
        files: ['<%= config.dir.src.widgets %>/**/*.less'],
        tasks: ['less:widgets']
      },
      js: {
        files: ['<%= config.dir.src.widgets %>/**/*.js'],
        tasks: ['copy:js', 'yuidoc']
      },
      // Activate once the following issue is resolved:
      // https://github.com/gruntjs/grunt-contrib-watch/issues/186
      // karma: {
      //   files: ['<%= config.dir.src.widgets %>/**/*.js', '<%= config.dir.test.root %>/**/*.js'],
      //   tasks: ['karma:dev:run']
      // },
      demo: {
        files: [
          '<%= config.dir.src.demos %>/**',
          'README.md',
          'CONTRIBUTING.md'
        ],
        tasks: ['copy:demoAssets', 'assemble:dev']
      },
      dist: {
        options: {
          livereload: true
        },
        files: [
          '<%= config.dir.dist.assets %>/**/*.js',
          '<%= config.dir.dist.assets %>/**/*.css',
          '<%= config.dir.dist.demos %>/**/*.html'
        ],
        tasks: []
      }
    },

    connect: {
      options: {
        port: 9000,
        // change this to '0.0.0.0' to access the server from outside
        //hostname: 'localhost'
        hostname: '0.0.0.0'
      },
      demo: {
        options: {
          middleware: function (connect) {
            return [
              mountFolder(connect, 'dist/demos')
            ];
          }
        }
      },
      dev: {
        options: {
          middleware: function (connect) {
            return [
              mountFolder(connect, 'dist/demos'),
              mountFolder(connect, 'dist')
            ];
          }
        }
      }
    },

    yuidoc: {
      compile: {
        name: '<%= config.pkg.name %>',
        description: '<%= config.pkg.description %>',
        logo: '../logo.png',
        version: '<%= config.pkg.version %>',
        url: '<%= config.pkg.homepage %>',
        options: {
          paths: 'src/widgets',
          themedir: 'lib/yuidoc-bootstrap-theme',
          helpers : ['lib/yuidoc-bootstrap-theme/helpers/helpers.js'],
          outdir: 'dist/demos/api'
        }
      }
    },

    assemble: {
      options: {
        prettify: {indent: 2},
        data: 'src/demos/**/*.{json,yml}',
        assets: './dist/demos/assets',
        helpers: ['src/demos/helpers/helper-*.js', 'node_modules/yfm/lib/*.js'],
        layoutdir: 'src/demos/templates/layouts',
        layout: 'default.hbs',
        partials: ['src/demos/templates/includes/**/*.hbs'],
        postprocess: function(content) {
          // replace links to github markdown files with relative links to html versions of the files
          content = content.replace(/https:\/\/github\.com\/richwidgets\/richwidgets\/blob\/master\/([a-zA-Z]*)\.md/g, function(match, name) {
            return name === 'README' ? 'about.html' : name.toLowerCase() + '.html';
          });
          return content;
        }
      },
      production: {
        options: {production: true},
        files: [
          { expand: true, cwd: 'src/demos/pages', src: ['**/*.hbs'], dest: '<%= demo.destination %>/' }
        ]
      },
      dev: {
        options: {production: false},
        files: [
          { expand: true, cwd: 'src/demos/pages', src: ['**/*.hbs'], dest: '<%= demo.destination %>/' }
        ]
      }
    },

    'gh-pages': {
      options: {
        base: 'dist/demos',
        branch: 'master',
        repo: 'git@github.com:richwidgets/richwidgets.github.io.git'
      },
      src: ['**']
    }
  });

  // load all the grunt-* dependencies found in the package.json file
  require('matchdep').filterDev('grunt-*').forEach(function (plugin) {
    grunt.loadNpmTasks(plugin);
  });

  grunt.loadNpmTasks('assemble');
  grunt.loadNpmTasks('assemble-less');  // not related to assemble
};
<|endoftext|>


<commit_before>/*global module:false*/
module.exports = function(grunt) {
    'use strict'

    // Project configuration.
    grunt.initConfig({
      // Metadata.
        pkg: grunt.file.readJSON('package.json'),
        banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
            '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
            '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
            '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
            ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
        tmp : 'tmp',
        dist: 'dist',
        distFiles : {
            build : 'build.js',
            templates : 'template.js',
            styles : 'styles.css'
        },
        features: 'app/**',
        // Task configuration.
        browserify : {
            dist : {
                src : 'app/main/index.js',
                dest : '<%= dist + "/" + distFiles.build %>'
            }
        },
        clean : ['tmp'],
        concat: {
            options: {
                separator : '\n',
                banner : '<%= grunt.banner %>'
            },

            styles: {
                src : ['<%= features + "/styles.styl" %>'],
                dest: '<%= tmp + "/styles.styl" %>'
            }
        },
        copy : {
            dist : {
                src : ['<%= features + "/assets/*" %>'],
                dest: '<%= dist + "/assets/" %>'
            }
        },
        stylus: {
            options: {
                compress: true,
                use : [require('nib')],
                import : ['nib']
            },
            dist : {
                src : ['<%= concat.styles.dest %>'],
                dest : '<%= dist + "/" + distFiles.styles %>'
            }
        },
        jshint: {
            options: {
                jshintrc : true
            },
            gruntfile: {
                src: 'Gruntfile.js'
            },
            lib_test: {
                src: ['app/**/*.js', 'app/*.js']
            }
        },
        html2js: {
            options: {
                base: '../charados/app/',
                module : 'templates'
            },
            dist: {
                src: '<%= features + "/templates/*.html" %>',
                dest: '<%= dist + "/" + distFiles.templates %>'
            }
        },
        'compile-handlebars': {
            dist: {
                template: 'app/index.hbl',
                templateData: {
                    ngVersion: '1.3.7',
                    styles: '<%= distFiles.styles %>',
                    templates: '<%= distFiles.templates %>',
                    build: '<%= distFiles.build %>'
                },
                output: 'dist/index.html'
            }
        },
        connect : {
            serve: {
                options: {
                    port: 3000,
                    livereload : true,
                    open : true,
                    base : '<%= dist %>'
                }
            }
        },
        watch: {
            options: {
                livereload : true
            },
            gruntfile: {
                files: '<%= jshint.gruntfile.src %>',
                tasks: ['jshint:gruntfile']
            },
            jshint: {
                files: '<%= jshint.lib_test.src %>',
                tasks: ['jshint:lib_test']
            },
            styles: {
                files: '<%= concat.styles.src %>',
                tasks: ['styles']
            },
            templates: {
                files: '<%= html2js.dist.src %>',
                tasks: ['html2js:dist']
            },
            handlebars: {
                files: 'app/index.hbl',
                tasks : ['compile-handlebars']
            },
            browserify: {
                files: '<%= jshint.lib_test.src %>',
                tasks: ['browserify:dist']
            },
            assets: {
                files: 'app/**/assets/*',
                tasks: ['newer:copy:dist']
            }
        }
    });

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-connect')
    grunt.loadNpmTasks('grunt-contrib-concat')
    grunt.loadNpmTasks('grunt-contrib-copy')
    grunt.loadNpmTasks('grunt-contrib-jshint')
    grunt.loadNpmTasks('grunt-contrib-stylus')
    grunt.loadNpmTasks('grunt-contrib-watch')
    grunt.loadNpmTasks('grunt-contrib-clean')
    grunt.loadNpmTasks('grunt-compile-handlebars')
    grunt.loadNpmTasks('grunt-html2js')
    grunt.loadNpmTasks('grunt-newer')
    grunt.loadNpmTasks('grunt-browserify')

    // Default task.
    grunt.registerTask('styles', ['concat', 'stylus'])
    grunt.registerTask('compile', ['jshint', 'browserify'])
    grunt.registerTask('templates', ['html2js', 'compile-handlebars'])
    grunt.registerTask('build', ['newer:copy:dist', 'styles', 'compile', 'templates', 'clean'])
    grunt.registerTask('serve', ['build', 'connect:serve', 'watch'])
    grunt.registerTask('default', ['build'])
}
<commit_msg>fixed copy configuration<commit_after>/*global module:false*/
module.exports = function(grunt) {
    'use strict'

    // Project configuration.
    grunt.initConfig({
      // Metadata.
        pkg: grunt.file.readJSON('package.json'),
        banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
            '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
            '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
            '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
            ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
        tmp : 'tmp',
        dist: 'dist',
        distFiles : {
            build : 'build.js',
            templates : 'template.js',
            styles : 'styles.css'
        },
        features: 'app/**',
        // Task configuration.
        browserify : {
            dist : {
                src : 'app/main/index.js',
                dest : '<%= dist + "/" + distFiles.build %>'
            }
        },
        clean : ['tmp'],
        concat: {
            options: {
                separator : '\n',
                banner : '<%= grunt.banner %>'
            },

            styles: {
                src : ['<%= features + "/styles.styl" %>'],
                dest: '<%= tmp + "/styles.styl" %>'
            }
        },
        copy : {
            dist : {
                files : [
                    {
                        expand : true,
                        cwd : 'app',
                        src : '**/assets/*',
                        flatten : true,
                        dest : '<%= dist + "/assets" %>'
                    }
                ]
            }
        },
        stylus: {
            options: {
                compress: true,
                use : [require('nib')],
                import : ['nib']
            },
            dist : {
                src : ['<%= concat.styles.dest %>'],
                dest : '<%= dist + "/" + distFiles.styles %>'
            }
        },
        jshint: {
            options: {
                jshintrc : true
            },
            gruntfile: {
                src: 'Gruntfile.js'
            },
            lib_test: {
                src: ['app/**/*.js', 'app/*.js']
            }
        },
        html2js: {
            options: {
                base: '../charados/app/',
                module : 'templates'
            },
            dist: {
                src: '<%= features + "/templates/*.html" %>',
                dest: '<%= dist + "/" + distFiles.templates %>'
            }
        },
        'compile-handlebars': {
            dist: {
                template: 'app/index.hbl',
                templateData: {
                    ngVersion: '1.3.7',
                    styles: '<%= distFiles.styles %>',
                    templates: '<%= distFiles.templates %>',
                    build: '<%= distFiles.build %>'
                },
                output: 'dist/index.html'
            }
        },
        connect : {
            serve: {
                options: {
                    port: 3000,
                    livereload : true,
                    open : true,
                    base : '<%= dist %>'
                }
            }
        },
        watch: {
            options: {
                livereload : true
            },
            gruntfile: {
                files: '<%= jshint.gruntfile.src %>',
                tasks: ['jshint:gruntfile']
            },
            jshint: {
                files: '<%= jshint.lib_test.src %>',
                tasks: ['jshint:lib_test']
            },
            styles: {
                files: '<%= concat.styles.src %>',
                tasks: ['styles']
            },
            templates: {
                files: '<%= html2js.dist.src %>',
                tasks: ['html2js:dist']
            },
            handlebars: {
                files: 'app/index.hbl',
                tasks : ['compile-handlebars']
            },
            browserify: {
                files: '<%= jshint.lib_test.src %>',
                tasks: ['browserify:dist']
            },
            assets: {
                files: 'app/**/assets/*',
                tasks: ['newer:copy:dist']
            }
        }
    });

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-connect')
    grunt.loadNpmTasks('grunt-contrib-concat')
    grunt.loadNpmTasks('grunt-contrib-copy')
    grunt.loadNpmTasks('grunt-contrib-jshint')
    grunt.loadNpmTasks('grunt-contrib-stylus')
    grunt.loadNpmTasks('grunt-contrib-watch')
    grunt.loadNpmTasks('grunt-contrib-clean')
    grunt.loadNpmTasks('grunt-compile-handlebars')
    grunt.loadNpmTasks('grunt-html2js')
    grunt.loadNpmTasks('grunt-newer')
    grunt.loadNpmTasks('grunt-browserify')

    // Default task.
    grunt.registerTask('styles', ['concat', 'stylus'])
    grunt.registerTask('compile', ['jshint', 'browserify'])
    grunt.registerTask('templates', ['html2js', 'compile-handlebars'])
    grunt.registerTask('build', ['newer:copy:dist', 'styles', 'compile', 'templates', 'clean'])
    grunt.registerTask('serve', ['build', 'connect:serve', 'watch'])
    grunt.registerTask('default', ['build'])
}
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
  var watchFiles = {
    serverViews: ['views/**/*.jade'],
    serverJS: ['Gruntfile.js', 'app.js', 'routes/**/*.js', 'controllers/**/*.js',
      'brokers/**/*.js', 'middleware/**/*.js', 'db/**/*.js'],
    clientCSS: ['public/*.css']
  };

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    watch: {
      serverViews: {
        files: watchFiles.serverViews,
        options: {
          livereload: true
        }
      },
      serverJS: {
        files: watchFiles.serverJS,
        tasks: ['jshint'],
        options: {
          livereload: true
        }
      }
    },
    copy: {
      js: {
        files: [
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/js', src: [
            'jquery/dist/jquery.js',
	    'lodash/dist/lodash.js',
            'jplayer/dist/jplayer/jquery.jplayer.js',
            'bootstrap/dist/js/bootstrap.js'
          ]}
        ]
      },
      swf: {
        files: [
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/swf', src: [
            'jplayer/dist/jplayer/jquery.jplayer.swf'
          ]}
        ]
      },
      css: {
        files: [
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/css', src: [
            'bootstrap/dist/css/bootstrap.css',
            'jplayer/dist/skin/blue.monday/css/jplayer.blue.monday.css'
          ]},
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/css', src: [
            'font-awesome/css/font-awesome.css'
          ]}
        ]
      },
      images: {
        files: [
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/image', src: [
            'jplayer/dist/skin/blue.monday/image/jplayer.blue.monday.jpg',
            'jplayer/dist/skin/blue.monday/image/jplayer.blue.monday.seeking.gif',
            'jplayer/dist/skin/blue.monday/image/jplayer.blue.monday.video.play.png'
          ]}
        ]
      },
      fonts: {
        files: [
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/fonts', src: [
            'bootstrap/fonts/glyphicons-halflings-regular.eot',
            'bootstrap/fonts/glyphicons-halflings-regular.svg',
            'bootstrap/fonts/glyphicons-halflings-regular.ttf',
            'bootstrap/fonts/glyphicons-halflings-regular.woff',
            'bootstrap/fonts/glyphicons-halflings-regular.woff2'
          ]}
        ]
      }
    },
    nodemon: {
      dev: {
        script: 'app.js',
        options: {
          nodeArgs: ['--debug'],
          ext: 'js,jade',
          watch: watchFiles.serverViews.concat(watchFiles.serverJS)
        }
      }
    },
    concurrent: {
      default: ['nodemon', 'watch'],
      debug: ['nodemon', 'watch', 'node-inspector'],
      options: {
        logConcurrentOutput: true,
        limit: 10
      }
    }
  });

  require('load-grunt-tasks')(grunt);
  grunt.option('force', true);

  grunt.registerTask('default', ['copy', 'lint', 'concurrent:default']);
  grunt.registerTask('debug', ['lint', 'concurrent:debug']);
  grunt.registerTask('lint', ['jshint', 'csslint']);

  var seed = require('./tasks/seed');
  grunt.task.registerTask('seed', 'Seeds default data', seed);
};
<commit_msg>Added grunt copy task for fontawesome fonts.<commit_after>'use strict';

module.exports = function(grunt) {
  var watchFiles = {
    serverViews: ['views/**/*.jade'],
    serverJS: ['Gruntfile.js', 'app.js', 'routes/**/*.js', 'controllers/**/*.js',
      'brokers/**/*.js', 'middleware/**/*.js', 'db/**/*.js'],
    clientCSS: ['public/*.css']
  };

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    watch: {
      serverViews: {
        files: watchFiles.serverViews,
        options: {
          livereload: true
        }
      },
      serverJS: {
        files: watchFiles.serverJS,
        tasks: ['jshint'],
        options: {
          livereload: true
        }
      }
    },
    copy: {
      js: {
        files: [
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/js', src: [
            'jquery/dist/jquery.js',
	          'lodash/dist/lodash.js',
            'jplayer/dist/jplayer/jquery.jplayer.js',
            'bootstrap/dist/js/bootstrap.js'
          ]}
        ]
      },
      swf: {
        files: [
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/swf', src: [
            'jplayer/dist/jplayer/jquery.jplayer.swf'
          ]}
        ]
      },
      css: {
        files: [
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/css', src: [
            'bootstrap/dist/css/bootstrap.css',
            'jplayer/dist/skin/blue.monday/css/jplayer.blue.monday.css'
          ]},
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/css', src: [
            'font-awesome/css/font-awesome.css'
          ]}
        ]
      },
      images: {
        files: [
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/image', src: [
            'jplayer/dist/skin/blue.monday/image/jplayer.blue.monday.jpg',
            'jplayer/dist/skin/blue.monday/image/jplayer.blue.monday.seeking.gif',
            'jplayer/dist/skin/blue.monday/image/jplayer.blue.monday.video.play.png'
          ]}
        ]
      },
      fonts: {
        files: [
          {expand: true, flatten: true, cwd: 'bower_components', dest: 'public/lib/fonts', src: [
            'bootstrap/fonts/glyphicons-halflings-regular.eot',
            'bootstrap/fonts/glyphicons-halflings-regular.svg',
            'bootstrap/fonts/glyphicons-halflings-regular.ttf',
            'bootstrap/fonts/glyphicons-halflings-regular.woff',
            'bootstrap/fonts/glyphicons-halflings-regular.woff2',
            'font-awesome/fonts/fontawesome-webfont.eot',
            'font-awesome/fonts/fontawesome-webfont.svg',
            'font-awesome/fonts/fontawesome-webfont.ttf',
            'font-awesome/fonts/fontawesome-webfont.woff',
            'font-awesome/fonts/fontawesome-webfont.woff2'
          ]}
        ]
      }
    },
    nodemon: {
      dev: {
        script: 'app.js',
        options: {
          nodeArgs: ['--debug'],
          ext: 'js,jade',
          watch: watchFiles.serverViews.concat(watchFiles.serverJS)
        }
      }
    },
    concurrent: {
      default: ['nodemon', 'watch'],
      debug: ['nodemon', 'watch', 'node-inspector'],
      options: {
        logConcurrentOutput: true,
        limit: 10
      }
    }
  });

  require('load-grunt-tasks')(grunt);
  grunt.option('force', true);

  grunt.registerTask('default', ['copy', 'lint', 'concurrent:default']);
  grunt.registerTask('debug', ['lint', 'concurrent:debug']);
  grunt.registerTask('lint', ['jshint', 'csslint']);

  var seed = require('./tasks/seed');
  grunt.task.registerTask('seed', 'Seeds default data', seed);
};
<|endoftext|>


<commit_before>/*jshint camelcase: false */

'use strict';

module.exports = function (grunt) {

  var app = {
    files: {
      js: [
        'Gruntfile.js',
        'generators/{,**/}*.js',
        'test/{,**/}*.js'
      ]
    }
  };

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

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      gruntfile: {
        files: ['Gruntfile.js']
      },
      js: {
        files: app.files.js,
        tasks: ['jshint', 'jscs', 'mocha']
      }
    },

    // JavaScript Lint
    jshint: {
      options: {
        jshintrc: true,
        reporter: require('jshint-stylish')
      },
      all: app.files.js
    },

    // JavaScript Code Style check
    jscs: {
      all: app.files.js
    },

    shell: {
      options: {
        stdout: true,
        stderr: false
      },
      test: {
        command: 'npm test'
      }
    },

    mochaTest: {
      test: {
        options: {
          reporter: 'spec'
        },
        src: 'test/index.js'
      }
    },

    mocha_istanbul: {
      coverage: {
        src: 'test/index.js',
        options: {
          quiet: true
        }
      },
      coveralls: {
        src: 'test/index.js',
        options: {
          quiet: true,
          coverage:true,
          check: {
            lines: 75,
            statements: 75
          },
          root: 'app',
          reportFormats: ['cobertura','lcovonly']
        }
      }
    },

    clean: {
      temp: ['.tmp'],
      coverage: ['test/coverage.html']
    }
  });

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

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

  grunt.registerTask('mocha', ['mochaTest:test']);
  grunt.registerTask('coverage', ['mocha_istanbul:coverage']);
  grunt.registerTask('coveralls', ['mocha_istanbul:coveralls']);

  grunt.registerTask('test', ['clean', 'jshint', 'jscs', 'coverage', 'mocha']);
  grunt.registerTask('travis', ['jshint', 'jscs', 'coverage', 'coveralls', 'mocha']);
  grunt.registerTask('default', ['test']);
};
<commit_msg>Fix grunt clean task<commit_after>/*jshint camelcase: false */

'use strict';

module.exports = function (grunt) {

  var app = {
    files: {
      js: [
        'Gruntfile.js',
        'generators/{,**/}*.js',
        'test/{,**/}*.js'
      ]
    }
  };

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

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      gruntfile: {
        files: ['Gruntfile.js']
      },
      js: {
        files: app.files.js,
        tasks: ['jshint', 'jscs', 'mocha']
      }
    },

    // JavaScript Lint
    jshint: {
      options: {
        jshintrc: true,
        reporter: require('jshint-stylish')
      },
      all: app.files.js
    },

    // JavaScript Code Style check
    jscs: {
      all: app.files.js
    },

    shell: {
      options: {
        stdout: true,
        stderr: false
      },
      test: {
        command: 'npm test'
      }
    },

    mochaTest: {
      test: {
        options: {
          reporter: 'spec'
        },
        src: 'test/index.js'
      }
    },

    mocha_istanbul: {
      coverage: {
        src: 'test/index.js',
        options: {
          quiet: true
        }
      },
      coveralls: {
        src: 'test/index.js',
        options: {
          quiet: true,
          coverage:true,
          check: {
            lines: 75,
            statements: 75
          },
          root: 'app',
          reportFormats: ['cobertura','lcovonly']
        }
      }
    },

    clean: {
      temp: ['.tmp'],
      coverage: ['coverage']
    }
  });

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

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

  grunt.registerTask('mocha', ['mochaTest:test']);
  grunt.registerTask('coverage', ['mocha_istanbul:coverage']);
  grunt.registerTask('coveralls', ['mocha_istanbul:coveralls']);

  grunt.registerTask('test', ['clean', 'jshint', 'jscs', 'coverage', 'mocha']);
  grunt.registerTask('travis', ['jshint', 'jscs', 'coverage', 'coveralls', 'mocha']);
  grunt.registerTask('default', ['test']);
};
<|endoftext|>