<commit_before>// Generated on 2014-04-17 using generator-webapp 0.4.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
  var config = {
    app: 'app',
    dist: 'dist'
  };

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

    // Project settings
    config: config,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['bowerInstall']
      },
      js: {
        files: ['<%= config.app %>/scripts/{,*/}*.js', 'test/**/*.js'],
        tasks: ['jshint', 'karma:unit'],
        options: {
          livereload: true
        }
      },
      jstest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['test:watch']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      sass: {
        files: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['sass:server', 'autoprefixer']
      },
      styles: {
        files: ['<%= config.app %>/styles/{,*/}*.css'],
        tasks: ['newer:copy:styles', 'autoprefixer']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= config.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= config.app %>/images/{,*/}*'
        ]
      }
    },

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

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

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

    karma: {
      unit: {
        configFile: 'karma.conf.js'
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    sass: {
      options: {
        loadPath: [
          'bower_components'
        ]
      },
      dist: {
        files: [{
          expand: true,
          cwd: '<%= config.app %>/styles',
          src: ['*.scss'],
          dest: '.tmp/styles',
          ext: '.css'
        }]
      },
      server: {
        files: [{
          expand: true,
          cwd: '<%= config.app %>/styles',
          src: ['*.scss'],
          dest: '.tmp/styles',
          ext: '.css'
        }]
      }
    },

    // 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 HTML file
    bowerInstall: {
      app: {
        src: ['<%= config.app %>/index.html'],
        exclude: ['bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap.js']
      },
      sass: {
        src: ['<%= config.app %>/styles/{,*/}*.{scss,sass}']
      }
    },

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= config.dist %>/scripts/{,*/}*.js',
            '<%= config.dist %>/styles/{,*/}*.css',
            '<%= config.dist %>/images/{,*/}*.*',
            '<%= config.dist %>/styles/fonts/{,*/}*.*',
            '<%= config.dist %>/*.{ico,png}'
          ]
        }
      }
    },

    // 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: {
      options: {
        dest: '<%= config.dist %>'
      },
      html: '<%= config.app %>/index.html'
    },

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

    // The following *-min tasks produce minified files in the dist folder
    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= config.app %>/images',
          src: '{,*/}*.{gif,jpeg,jpg,png}',
          dest: '<%= config.dist %>/images'
        }]
      }
    },

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

    htmlmin: {
      dist: {
        options: {
          collapseBooleanAttributes: true,
          collapseWhitespace: true,
          removeAttributeQuotes: true,
          removeCommentsFromCDATA: true,
          removeEmptyAttributes: true,
          removeOptionalTags: true,
          removeRedundantAttributes: true,
          useShortDoctype: true
        },
        files: [{
          expand: true,
          cwd: '<%= config.dist %>',
          src: '{,*/}*.html',
          dest: '<%= config.dist %>'
        }]
      }
    },

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

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= config.app %>',
          dest: '<%= config.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            'images/{,*/}*.webp',
            '{,*/}*.html',
            'styles/fonts/{,*/}*.*'
          ]
        }]
      },
      styles: {
        expand: true,
        dot: true,
        cwd: '<%= config.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },
    release: {
      options: {
        file: 'bower.json',
        npm: false
      }
    },
    // Generates a custom Modernizr build that includes only the tests you
    // reference in your app
    modernizr: {
      dist: {
        devFile: 'bower_components/modernizr/modernizr.js',
        outputFile: '<%= config.dist %>/scripts/vendor/modernizr.js',
        files: {
          src: [
            '<%= config.dist %>/scripts/{,*/}*.js',
            '<%= config.dist %>/styles/{,*/}*.css',
            '!<%= config.dist %>/scripts/vendor/*'
          ]
        },
        uglify: true
      }
    },

    // Run some tasks in parallel to speed up build process
    concurrent: {
      server: [
        'sass:server',
        'copy:styles'
      ],
      test: [
        'copy:styles',
      ],
      dist: [
        'sass',
        'copy:styles',
        'imagemin',
        'svgmin'
      ]
    }
  });

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

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

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

  grunt.registerTask('test', function (target) {
    if (target !== 'watch') {
      grunt.task.run([
        'clean:server',
        'concurrent:test',
        'autoprefixer'
      ]);
    }

    grunt.task.run([
      'connect:test',
      'mocha'
    ]);
  });

  grunt.registerTask('build', [
    'clean:dist',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'cssmin',
    'uglify',
    'copy:dist',
    /*'modernizr',*/
    /*'rev',*/
    'usemin',
    'htmlmin',
    'karma:unit'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<commit_msg>added grunt release back<commit_after>// Generated on 2014-04-17 using generator-webapp 0.4.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
  var config = {
    app: 'app',
    dist: 'dist'
  };

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

    // Project settings
    config: config,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['bowerInstall']
      },
      js: {
        files: ['<%= config.app %>/scripts/{,*/}*.js', 'test/**/*.js'],
        tasks: ['jshint', 'karma:unit'],
        options: {
          livereload: true
        }
      },
      jstest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['test:watch']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      sass: {
        files: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['sass:server', 'autoprefixer']
      },
      styles: {
        files: ['<%= config.app %>/styles/{,*/}*.css'],
        tasks: ['newer:copy:styles', 'autoprefixer']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= config.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= config.app %>/images/{,*/}*'
        ]
      }
    },

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

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

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

    karma: {
      unit: {
        configFile: 'karma.conf.js'
      }
    },

    release: {
      options: {
        file: 'bower.json',
        npm: false
      }
    },
    sass: {
      options: {
        loadPath: [
          'bower_components'
        ]
      },
      dist: {
        files: [{
          expand: true,
          cwd: '<%= config.app %>/styles',
          src: ['*.scss'],
          dest: '.tmp/styles',
          ext: '.css'
        }]
      },
      server: {
        files: [{
          expand: true,
          cwd: '<%= config.app %>/styles',
          src: ['*.scss'],
          dest: '.tmp/styles',
          ext: '.css'
        }]
      }
    },

    // 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 HTML file
    bowerInstall: {
      app: {
        src: ['<%= config.app %>/index.html'],
        exclude: ['bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap.js']
      },
      sass: {
        src: ['<%= config.app %>/styles/{,*/}*.{scss,sass}']
      }
    },

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= config.dist %>/scripts/{,*/}*.js',
            '<%= config.dist %>/styles/{,*/}*.css',
            '<%= config.dist %>/images/{,*/}*.*',
            '<%= config.dist %>/styles/fonts/{,*/}*.*',
            '<%= config.dist %>/*.{ico,png}'
          ]
        }
      }
    },

    // 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: {
      options: {
        dest: '<%= config.dist %>'
      },
      html: '<%= config.app %>/index.html'
    },

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

    // The following *-min tasks produce minified files in the dist folder
    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= config.app %>/images',
          src: '{,*/}*.{gif,jpeg,jpg,png}',
          dest: '<%= config.dist %>/images'
        }]
      }
    },

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

    htmlmin: {
      dist: {
        options: {
          collapseBooleanAttributes: true,
          collapseWhitespace: true,
          removeAttributeQuotes: true,
          removeCommentsFromCDATA: true,
          removeEmptyAttributes: true,
          removeOptionalTags: true,
          removeRedundantAttributes: true,
          useShortDoctype: true
        },
        files: [{
          expand: true,
          cwd: '<%= config.dist %>',
          src: '{,*/}*.html',
          dest: '<%= config.dist %>'
        }]
      }
    },

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

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= config.app %>',
          dest: '<%= config.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            'images/{,*/}*.webp',
            '{,*/}*.html',
            'styles/fonts/{,*/}*.*'
          ]
        }]
      },
      styles: {
        expand: true,
        dot: true,
        cwd: '<%= config.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },
    // Generates a custom Modernizr build that includes only the tests you
    // reference in your app
    modernizr: {
      dist: {
        devFile: 'bower_components/modernizr/modernizr.js',
        outputFile: '<%= config.dist %>/scripts/vendor/modernizr.js',
        files: {
          src: [
            '<%= config.dist %>/scripts/{,*/}*.js',
            '<%= config.dist %>/styles/{,*/}*.css',
            '!<%= config.dist %>/scripts/vendor/*'
          ]
        },
        uglify: true
      }
    },

    // Run some tasks in parallel to speed up build process
    concurrent: {
      server: [
        'sass:server',
        'copy:styles'
      ],
      test: [
        'copy:styles',
      ],
      dist: [
        'sass',
        'copy:styles',
        'imagemin',
        'svgmin'
      ]
    }
  });

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

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

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

  grunt.registerTask('test', function (target) {
    if (target !== 'watch') {
      grunt.task.run([
        'clean:server',
        'concurrent:test',
        'autoprefixer'
      ]);
    }

    grunt.task.run([
      'connect:test',
      'mocha'
    ]);
  });

  grunt.registerTask('build', [
    'clean:dist',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'cssmin',
    'uglify',
    'copy:dist',
    /*'modernizr',*/
    /*'rev',*/
    'usemin',
    'htmlmin',
    'karma:unit'
  ]);

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


<commit_before>module.exports = function (grunt) {
    var rigger = require('rigger'),
        path = require('path');

    var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;

    var folderMount = function folderMount(connect, point) {
        return connect.static(path.resolve(point));
    };

    var saucekey = null;

    if (typeof process.env["SAUCE_ACCESS_KEY"] !== "undefined") {
        saucekey = process.env["SAUCE_ACCESS_KEY"];
    }

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-livereload');
    grunt.loadNpmTasks('grunt-regarde');
    grunt.loadNpmTasks('grunt-contrib-connect');

    grunt.loadNpmTasks('grunt-saucelabs');

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

        meta: {
            banner: '/*!\n' +
                    ' <%= pkg.name %> - v<%= pkg.version %>\n' +
                    ' Copyright (c) <%= grunt.template.today("yyyy") %> Adam Barclay.\n' +
                    ' Distributed under MIT license\n' +
                    ' http://github.com/barclayadam/HelixJS\n' +
                    '*/\n'
        },

        uglify: {
            options: {
                banner: '<%= meta.banner %>',

                sourceMap: 'lib/hx.min.sourcemap.js',
            },

            build: {
                files: {
                    'lib/hx.min.js': ['lib/hx.js']
                }
            }
        },

        connect: {
            livereload: {
                options: {
                    port: 9001,

                    middleware: function (connect, options) {
                        return [lrSnippet, folderMount(connect, '.')]
                    }
                }
            }
        },

        regarde: {
            serve: {
                files: ['src/**/*.*', 'spec/**/*.*'],
                tasks: ['build', 'livereload']
            }
        },

        'saucelabs-jasmine': {
            all: {
                username: 'barclayadam', // if not provided it'll default to ENV SAUCE_USERNAME (if applicable)
                key: saucekey,

                urls: ['http://localhost:9001/spec/runner.html'],

                concurrency: '3',

                testTimeout: 35000,
                testInterval: 1500,

                testname: 'HelixJS test suite',

                browsers: [
                    { browserName: 'chrome', platform: 'Windows 2008' },
                    { browserName: 'chrome', platform: 'Windows 2003' },
                    { browserName: 'chrome', platform: 'Linux' },
                    { browserName: 'chrome', platform: 'Mac 10.8' },

                    { browserName: 'internet explorer', version: 9, platform: "Windows 2008" },
                    { browserName: 'internet explorer', version: 10, platform: "Windows 2012" },

                    { browserName: 'firefox', platform: "Windows 2008" },
                    { browserName: 'firefox', platform: "Linux" },
                    { browserName: 'firefox', platform: "Mac 10.6" }

                    // TODO: Fix in this combination  { browserName: 'internet explorer', version: 8, platform: "Windows 2008" },
                    // TODO: Having connection issues { browserName: 'opera', platform: "Windows 2008" }
                ]
            }
        }
    });

    grunt.registerTask('rig', 'Compile files using rigger', function () {
        var inPath = 'src/hx.js',
            outPath = 'lib/hx.js',
            done = this.async();

        rigger.process(grunt.file.read(inPath), {
            cwd: path.resolve(path.dirname(inPath)),
            separator: grunt.util.linefeed
        }, function (_, output, settings) {
            grunt.file.write(outPath, output, {
                encoding: 'utf8'
            });

            done();
        });
    });

    grunt.registerTask('build', ['rig', 'uglify']);
    grunt.registerTask('serve', ['livereload-start', 'connect']);

    if (saucekey) {
        grunt.registerTask('test', ['rig', 'connect', 'saucelabs-jasmine']);
    } else {
        grunt.registerTask('test', ['rig', 'serve']);
    }

    grunt.registerTask('default', ['serve', 'regarde']);
};<commit_msg>regarde task now only rigs, not uglifies<commit_after>module.exports = function (grunt) {
    var rigger = require('rigger'),
        path = require('path');

    var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;

    var folderMount = function folderMount(connect, point) {
        return connect.static(path.resolve(point));
    };

    var saucekey = null;

    if (typeof process.env["SAUCE_ACCESS_KEY"] !== "undefined") {
        saucekey = process.env["SAUCE_ACCESS_KEY"];
    }

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-livereload');
    grunt.loadNpmTasks('grunt-regarde');
    grunt.loadNpmTasks('grunt-contrib-connect');

    grunt.loadNpmTasks('grunt-saucelabs');

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

        meta: {
            banner: '/*!\n' +
                    ' <%= pkg.name %> - v<%= pkg.version %>\n' +
                    ' Copyright (c) <%= grunt.template.today("yyyy") %> Adam Barclay.\n' +
                    ' Distributed under MIT license\n' +
                    ' http://github.com/barclayadam/HelixJS\n' +
                    '*/\n'
        },

        uglify: {
            options: {
                banner: '<%= meta.banner %>',

                sourceMap: 'lib/hx.min.sourcemap.js',
            },

            build: {
                files: {
                    'lib/hx.min.js': ['lib/hx.js']
                }
            }
        },

        connect: {
            livereload: {
                options: {
                    port: 9001,

                    middleware: function (connect, options) {
                        return [lrSnippet, folderMount(connect, '.')]
                    }
                }
            }
        },

        regarde: {
            serve: {
                files: ['src/**/*.*', 'spec/**/*.*'],
                tasks: ['rig', 'livereload']
            }
        },

        'saucelabs-jasmine': {
            all: {
                username: 'barclayadam', // if not provided it'll default to ENV SAUCE_USERNAME (if applicable)
                key: saucekey,

                urls: ['http://localhost:9001/spec/runner.html'],

                concurrency: '3',

                testTimeout: 35000,
                testInterval: 1500,

                testname: 'HelixJS test suite',

                browsers: [
                    { browserName: 'chrome', platform: 'Windows 2008' },
                    { browserName: 'chrome', platform: 'Windows 2003' },
                    { browserName: 'chrome', platform: 'Linux' },
                    { browserName: 'chrome', platform: 'Mac 10.8' },

                    { browserName: 'internet explorer', version: 9, platform: "Windows 2008" },
                    { browserName: 'internet explorer', version: 10, platform: "Windows 2012" },

                    { browserName: 'firefox', platform: "Windows 2008" },
                    { browserName: 'firefox', platform: "Linux" },
                    { browserName: 'firefox', platform: "Mac 10.6" }

                    // TODO: Fix in this combination  { browserName: 'internet explorer', version: 8, platform: "Windows 2008" },
                    // TODO: Having connection issues { browserName: 'opera', platform: "Windows 2008" }
                ]
            }
        }
    });

    grunt.registerTask('rig', 'Compile files using rigger', function () {
        var inPath = 'src/hx.js',
            outPath = 'lib/hx.js',
            done = this.async();

        rigger.process(grunt.file.read(inPath), {
            cwd: path.resolve(path.dirname(inPath)),
            separator: grunt.util.linefeed
        }, function (_, output, settings) {
            grunt.file.write(outPath, output, {
                encoding: 'utf8'
            });

            done();
        });
    });

    grunt.registerTask('build', ['rig', 'uglify']);
    grunt.registerTask('serve', ['livereload-start', 'connect']);

    if (saucekey) {
        grunt.registerTask('test', ['rig', 'connect', 'saucelabs-jasmine']);
    } else {
        grunt.registerTask('test', ['rig', 'serve']);
    }

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


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

  grunt.initConfig({
    connect: {
      server: {
        options: {
          port: 8080,
          hostname: '*',
          keepalive: true
        }
      }
    },
    jshint: {
      all: ['src/webcomponents/*.html', 'demo/**/*.html'],
      options : {
        'extract': 'auto',
        'browser': true,
        'devel': true,
        'curly': true,
        'bitwise': true,
        'eqeqeq': true,
        'forin': true,
        'freeze': true,
        'funcscope': true,
        'futurehostile': true,
        'latedef': true,
        'nocomma': true,
        'nonbsp': true,
        'notypeof': true,
        'shadow': true,
        'undef': true,
        'singleGroups': true,
        'unused': true
        //'nonew': true,
        //'strict': true,
        //'varstmt': true
      }
    }
  });
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.registerTask('default', ['jshint', 'connect']);
};
<commit_msg>we no longer use grunt<commit_after><|endoftext|>


<commit_before>'use strict';

module.exports = function (grunt) {

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

    require('./tasks/patterns')(grunt);

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

    var _ = require('lodash');

    // Configurable paths
    var paths = {
        tmp: '.tmp',
        docs: 'docs',
        docsDist: 'docs/dist',
        libDist: 'dist'
    };

    var pkg = grunt.file.readJSON('package.json');

    var config = grunt.file.readYAML('./config.yaml');

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

        // Project settings
        paths: paths,
        pkg: pkg,

        // Watches files for changes and runs tasks based on the changed files
        watch: {
            bower: {
                files: ['bower.json'],
                tasks: ['bowerInstall']
            },
            js: {
                files: ['<%= paths.docs %>/scripts/{,*/}*.js'],
                tasks: ['jshint'],
                options: {
                    livereload: true
                }
            },
            gruntfile: {
                files: ['Gruntfile.js']
            },
            patterns: {
                files: ['<%= paths.docs %>/*.ejs', '<%= paths.docs %>/content/**/*.md'],
                tasks: ['copy:tpl', 'template', 'patterns:server']
            },
            less: {
                files: ['less/**/*.less', '<%= paths.docs %>/styles/**/*.less'],
                tasks: ['less:server', 'autoprefixer']
            },
            styles: {
                files: ['<%= paths.docs %>/styles/{,*/}*.css'],
                tasks: ['newer:copy:styles', 'autoprefixer']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                files: [
                    '<%= paths.tmp %>/{,*/}*.html',
                    '<%= paths.tmp %>/styles/{,*/}*.css',
                    '<%= paths.docs %>/images/{,*/}*'
                ]
            }
        },

        template: {
            server: {
                engine: 'ejs',
                variables: { globals: config, pkg: pkg },
                files: [{
                    expand: true,
                    cwd: '<%= paths.tmp %>',
                    dest: '<%= paths.tmp %>',
                    src: '{index,resources,changelog,example-preexam}.tpl.ejs',
                    ext: '.html'
                }]
            },
            dist: {
                engine: 'ejs',
                variables: { globals: config, pkg: pkg, env: 'prod' },
                files: [{
                    expand: true,
                    cwd: '<%= paths.tmp %>',
                    dest: '<%= paths.tmp %>',
                    src: '{index,resources,changelog,example-preexam}.tpl.ejs',
                    ext: '.html'
                }]
            }
        },

        // The actual grunt server settings
        connect: {
            options: {
                port: grunt.option('port') || 9000,
                open: true,
                livereload: 35729,
                hostname: '0.0.0.0'
            },
            livereload: {
                options: {
                    middleware: function(connect) {
                        return [
                            connect.static(paths.tmp),
                            connect().use('/bower_components', connect.static('./bower_components')),
                            connect.static(paths.docs)
                        ];
                    }
                }
            },
            dist: {
                options: {
                    base: '<%= paths.docsDist %>',
                    livereload: false
                }
            }
        },

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

        lesslint: {
            src: ['less/**/_*.less', '<%= paths.docs %>/styles/**/_*.less'],
            options: {
                csslint: {
                    'box-model': false,
                    'adjoining-classes': false,
                    'qualified-headings': false,
                    'empty-rules': false,
                    'outline-none': false,
                    'unique-headings': false
                }
            }
        },

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

        // Compiles LESS to CSS and generates necessary files if requested
        less: {
            theme: {
                options: {
                    compress: true,
                },
                files: [{
                    expand: true,
                    cwd: 'less',
                    src: ['usptostrap.less'],
                    dest: '<%= paths.libDist %>/css/',
                    ext: '.min.css'
                }]
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= paths.docs %>/styles',
                    src: ['pattern-library.less'],
                    dest: '<%= paths.tmp %>/styles',
                    ext: '.css'
                }]
            },
            server: {
                files: [{
                    expand: true,
                    cwd: '<%= paths.docs %>/styles',
                    src: ['pattern-library.less'],
                    dest: '<%= paths.tmp %>/styles',
                    ext: '.css'
                }]
            }
        },

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

        // Automatically inject Bower components into the HTML file
        bowerInstall: {
            app: {
                src: ['<%= paths.docs %>/header.ejs', '<%= paths.docs %>/footer.ejs'],
                exclude: ['bower_components/bootstrap/js/bootstrap.js', 'bower_components/bootstrap/dist/css/bootstrap.css', 'bower_components/bootstrap/dist/js/bootstrap.js']
            },
            less: {
                src: ['<%= paths.docs %>/styles/{,*/}*.{less}']
            }
        },

        // Renames files for browser caching purposes
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= paths.docsDist %>/scripts/{,*/}*.js',
                        '<%= paths.docsDist %>/styles/{,*/}*.css',
                        '<%= paths.docsDist %>/images/{,*/}*.*',
                        '<%= paths.docsDist %>/styles/fonts/{,*/}*.*',
                        '<%= paths.docsDist %>/*.{ico,png}'
                    ]
                }
            }
        },

        // 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: {
            options: {
                dest: '<%= paths.docsDist %>'
            },
            html: ['<%= paths.tmp %>/**/*.ejs']
        },

        // Performs rewrites based on rev and the useminPrepare configuration
        usemin: {
            options: {
                assetsDirs: ['<%= paths.docsDist %>', '<%= paths.docsDist %>/images']
            },
            html: ['<%= paths.tmp %>/**/*.ejs'],
            css: ['<%= paths.docsDist %>/styles/{,*/}*.css']
        },

        // The following *-min tasks produce minified files in the dist folder
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: 'images',
                    src: '{,*/}*.{gif,jpeg,jpg,png}',
                    dest: '<%= paths.libDist %>/images'
                }]
            }
        },

        // was breaking svg sprite
        // svgmin: {
        //     dist: {
        //         files: [{
        //             expand: true,
        //             cwd: 'images',
        //             src: '{,*/}*.svg',
        //             dest: '<%= paths.libDist %>/images'
        //         }]
        //     }
        // },

        htmlmin: {
            dist: {
                options: {
                    // collapseBooleanAttributes: true,
                    // collapseWhitespace: true,
                    // removeAttributeQuotes: true,
                    // removeCommentsFromCDATA: true,
                    // removeEmptyAttributes: true,
                    // removeOptionalTags: true,
                    // removeRedundantAttributes: true,
                    // useShortDoctype: true
                },
                files: [{
                    expand: true,
                    cwd: '.tmp',
                    src: '{,*/}*.html',
                    dest: '<%= paths.docsDist %>'
                }]
            }
        },

        patterns: {
            server: {
                options: {
                    variables: config,
                    patternRoot: '<%= paths.docs %>/content',
                    urlRoot: '',
                    template: '<%= paths.tmp %>/pattern.tpl.ejs'
                },
                files: [{
                    expand: true,
                    cwd: '<%= paths.docs %>/content',
                    src: '**/*.md',
                    dest: '<%= paths.tmp %>'
                }]
            },
            dist: {
                options: {
                    variables: _.extend({ env: 'prod' }, config),
                    patternRoot: '<%= paths.docs %>/content',
                    urlRoot: '',
                    template: '<%= paths.tmp %>/pattern.tpl.ejs'
                },
                files: [{
                    expand: true,
                    cwd: '<%= paths.docs %>/content',
                    src: '**/*.md',
                    dest: '<%= paths.tmp %>'
                }]
            }
        },

        // Copies remaining files to places other tasks can use
        copy: {

            // copy the tpl to the tmp folder so we can usemin it
            tpl: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= paths.docs %>',
                    dest: '<%= paths.tmp %>',
                    src: '*.ejs'
                }]
            },

            dist: {
                files: [{ // htmlshiv to docsDist for < IE9
                    dot: true,
                    expand: true,
                    cwd: '<%= paths.docs %>/vendor/html5shiv/',
                    dest: '<%= paths.docsDist %>/vendor/html5shiv/',
                    src: ['html5shiv.min.js'],
                }, { // icon sprite to docsDist folder
                    expand: true,
                    dot: true,
                    cwd: 'images',
                    dest: '<%= paths.docsDist %>/images/icons',
                    src: '*.svg'
                }, { // src less to libDist folder
                    dot: true,
                    expand: true,
                    cwd: 'less',
                    dest: '<%= paths.libDist %>/less',
                    src: ['**/*.less']
                }, { // icons to libDist folder
                    dot: true,
                    expand: true,
                    dest: '<%= paths.libDist %>',
                    src: ['images/**/*.svg'],
                }, { // icons to docDist folder
                    dot: true,
                    expand: true,
                    dest: '<%= paths.docsDist %>',
                    src: ['images/**/*.svg'],
                }]
            },
            release: { // move the libDist folder under the docsDist folder for access from io page
                dot: true,
                expand: true,
                cwd: '<%= paths.libDist %>',
                src: ['*.*'],
                dest: '<%= paths.docsDist %>/dist/'
            },
            styles: { // copy non-less files to tmp
                expand: true,
                dot: true,
                cwd: '<%= paths.docs %>/styles',
                dest: '<%= paths.tmp %>/styles/',
                src: '{,*/}*.css'
            },
            images: { // copy root images to tmp for serving
                expand: true,
                dot: true,
                cwd: 'images',
                dest: '<%= paths.tmp %>/images/',
                src: '**/*.*'
            }
        },

        // zips up src less files, images, and minified css
        zip: {
            '<%= paths.libDist %>/usptostrap-<%= pkg.version %>.zip': ['<%= paths.libDist %>/**/*']
        },

        // Run some tasks in parallel to speed up build process
        concurrent: {
            server: [
                // 'lesslint',
                'jshint',
                'less:server',
                'patterns:server',
                'template:server',
                'copy:styles',
                'copy:images'
            ],
            dist: [
                // 'lesslint',
                'jshint',
                'less:dist',
                'less:theme',
                'copy:styles',
                'imagemin'
                // 'svgmin'
            ]
        }
    });

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

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

    grunt.registerTask('build', [
        'clean:dist',
        'copy:tpl',
        'useminPrepare',
        'concurrent:dist',
        'autoprefixer',
        'concat:generated',
        'cssmin:generated',
        'uglify:generated',
        'copy:dist',
        'rev',
        'usemin',
        'patterns:dist',
        'template:dist',
        'htmlmin',
        'zip',
        'copy:release'
    ]);

    grunt.registerTask('default', [
        'newer:jshint',
        'build'
    ]);
};
<commit_msg>Fixes build process for docs/images<commit_after>'use strict';

module.exports = function (grunt) {

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

    require('./tasks/patterns')(grunt);

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

    var _ = require('lodash');

    // Configurable paths
    var paths = {
        tmp: '.tmp',
        docs: 'docs',
        docsDist: 'docs/dist',
        libDist: 'dist'
    };

    var pkg = grunt.file.readJSON('package.json');

    var config = grunt.file.readYAML('./config.yaml');

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

        // Project settings
        paths: paths,
        pkg: pkg,

        // Watches files for changes and runs tasks based on the changed files
        watch: {
            bower: {
                files: ['bower.json'],
                tasks: ['bowerInstall']
            },
            js: {
                files: ['<%= paths.docs %>/scripts/{,*/}*.js'],
                tasks: ['jshint'],
                options: {
                    livereload: true
                }
            },
            gruntfile: {
                files: ['Gruntfile.js']
            },
            patterns: {
                files: ['<%= paths.docs %>/*.ejs', '<%= paths.docs %>/content/**/*.md'],
                tasks: ['copy:tpl', 'template', 'patterns:server']
            },
            less: {
                files: ['less/**/*.less', '<%= paths.docs %>/styles/**/*.less'],
                tasks: ['less:server', 'autoprefixer']
            },
            styles: {
                files: ['<%= paths.docs %>/styles/{,*/}*.css'],
                tasks: ['newer:copy:styles', 'autoprefixer']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                files: [
                    '<%= paths.tmp %>/{,*/}*.html',
                    '<%= paths.tmp %>/styles/{,*/}*.css',
                    '<%= paths.docs %>/images/{,*/}*'
                ]
            }
        },

        template: {
            server: {
                engine: 'ejs',
                variables: { globals: config, pkg: pkg },
                files: [{
                    expand: true,
                    cwd: '<%= paths.tmp %>',
                    dest: '<%= paths.tmp %>',
                    src: '{index,resources,changelog,example-preexam}.tpl.ejs',
                    ext: '.html'
                }]
            },
            dist: {
                engine: 'ejs',
                variables: { globals: config, pkg: pkg, env: 'prod' },
                files: [{
                    expand: true,
                    cwd: '<%= paths.tmp %>',
                    dest: '<%= paths.tmp %>',
                    src: '{index,resources,changelog,example-preexam}.tpl.ejs',
                    ext: '.html'
                }]
            }
        },

        // The actual grunt server settings
        connect: {
            options: {
                port: grunt.option('port') || 9000,
                open: true,
                livereload: 35729,
                hostname: '0.0.0.0'
            },
            livereload: {
                options: {
                    middleware: function(connect) {
                        return [
                            connect.static(paths.tmp),
                            connect().use('/bower_components', connect.static('./bower_components')),
                            connect.static(paths.docs)
                        ];
                    }
                }
            },
            dist: {
                options: {
                    base: '<%= paths.docsDist %>',
                    livereload: false
                }
            }
        },

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

        lesslint: {
            src: ['less/**/_*.less', '<%= paths.docs %>/styles/**/_*.less'],
            options: {
                csslint: {
                    'box-model': false,
                    'adjoining-classes': false,
                    'qualified-headings': false,
                    'empty-rules': false,
                    'outline-none': false,
                    'unique-headings': false
                }
            }
        },

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

        // Compiles LESS to CSS and generates necessary files if requested
        less: {
            theme: {
                options: {
                    compress: true,
                },
                files: [{
                    expand: true,
                    cwd: 'less',
                    src: ['usptostrap.less'],
                    dest: '<%= paths.libDist %>/css/',
                    ext: '.min.css'
                }]
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= paths.docs %>/styles',
                    src: ['pattern-library.less'],
                    dest: '<%= paths.tmp %>/styles',
                    ext: '.css'
                }]
            },
            server: {
                files: [{
                    expand: true,
                    cwd: '<%= paths.docs %>/styles',
                    src: ['pattern-library.less'],
                    dest: '<%= paths.tmp %>/styles',
                    ext: '.css'
                }]
            }
        },

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

        // Automatically inject Bower components into the HTML file
        bowerInstall: {
            app: {
                src: ['<%= paths.docs %>/header.ejs', '<%= paths.docs %>/footer.ejs'],
                exclude: ['bower_components/bootstrap/js/bootstrap.js', 'bower_components/bootstrap/dist/css/bootstrap.css', 'bower_components/bootstrap/dist/js/bootstrap.js']
            },
            less: {
                src: ['<%= paths.docs %>/styles/{,*/}*.{less}']
            }
        },

        // Renames files for browser caching purposes
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= paths.docsDist %>/scripts/{,*/}*.js',
                        '<%= paths.docsDist %>/styles/{,*/}*.css',
                        '<%= paths.docsDist %>/images/{,*/}*.*',
                        '<%= paths.docsDist %>/styles/fonts/{,*/}*.*',
                        '<%= paths.docsDist %>/*.{ico,png}'
                    ]
                }
            }
        },

        // 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: {
            options: {
                dest: '<%= paths.docsDist %>'
            },
            html: ['<%= paths.tmp %>/**/*.ejs']
        },

        // Performs rewrites based on rev and the useminPrepare configuration
        usemin: {
            options: {
                assetsDirs: ['<%= paths.docsDist %>', '<%= paths.docsDist %>/images']
            },
            html: ['<%= paths.tmp %>/**/*.ejs'],
            css: ['<%= paths.docsDist %>/styles/{,*/}*.css']
        },

        // The following *-min tasks produce minified files in the dist folder
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= paths.docs %>/images',
                    src: '{,*/}*.{gif,jpeg,jpg,png}',
                    dest: '<%= paths.docsDist %>/images'
                }]
            }
        },

        // was breaking svg sprite
        // svgmin: {
        //     dist: {
        //         files: [{
        //             expand: true,
        //             cwd: 'images',
        //             src: '{,*/}*.svg',
        //             dest: '<%= paths.libDist %>/images'
        //         }]
        //     }
        // },

        htmlmin: {
            dist: {
                options: {
                    // collapseBooleanAttributes: true,
                    // collapseWhitespace: true,
                    // removeAttributeQuotes: true,
                    // removeCommentsFromCDATA: true,
                    // removeEmptyAttributes: true,
                    // removeOptionalTags: true,
                    // removeRedundantAttributes: true,
                    // useShortDoctype: true
                },
                files: [{
                    expand: true,
                    cwd: '.tmp',
                    src: '{,*/}*.html',
                    dest: '<%= paths.docsDist %>'
                }]
            }
        },

        patterns: {
            server: {
                options: {
                    variables: config,
                    patternRoot: '<%= paths.docs %>/content',
                    urlRoot: '',
                    template: '<%= paths.tmp %>/pattern.tpl.ejs'
                },
                files: [{
                    expand: true,
                    cwd: '<%= paths.docs %>/content',
                    src: '**/*.md',
                    dest: '<%= paths.tmp %>'
                }]
            },
            dist: {
                options: {
                    variables: _.extend({ env: 'prod' }, config),
                    patternRoot: '<%= paths.docs %>/content',
                    urlRoot: '',
                    template: '<%= paths.tmp %>/pattern.tpl.ejs'
                },
                files: [{
                    expand: true,
                    cwd: '<%= paths.docs %>/content',
                    src: '**/*.md',
                    dest: '<%= paths.tmp %>'
                }]
            }
        },

        // Copies remaining files to places other tasks can use
        copy: {

            // copy the tpl to the tmp folder so we can usemin it
            tpl: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= paths.docs %>',
                    dest: '<%= paths.tmp %>',
                    src: '*.ejs'
                }]
            },

            dist: {
                files: [{ // htmlshiv to docsDist for < IE9
                    dot: true,
                    expand: true,
                    cwd: '<%= paths.docs %>/vendor/html5shiv/',
                    dest: '<%= paths.docsDist %>/vendor/html5shiv/',
                    src: ['html5shiv.min.js'],
                }, { // icon sprite to docsDist folder
                    expand: true,
                    dot: true,
                    cwd: 'images',
                    dest: '<%= paths.docsDist %>/images/icons',
                    src: '*.svg'
                }, { // src less to libDist folder
                    dot: true,
                    expand: true,
                    cwd: 'less',
                    dest: '<%= paths.libDist %>/less',
                    src: ['**/*.less']
                }, { // icons to libDist folder
                    dot: true,
                    expand: true,
                    dest: '<%= paths.libDist %>',
                    src: ['images/**/*.svg'],
                }, { // icons to docDist folder
                    dot: true,
                    expand: true,
                    dest: '<%= paths.docsDist %>',
                    src: ['images/**/*.svg'],
                }]
            },
            release: { // move the libDist folder under the docsDist folder for access from io page
                dot: true,
                expand: true,
                cwd: '<%= paths.libDist %>',
                src: ['*.*'],
                dest: '<%= paths.docsDist %>/dist/'
            },
            styles: { // copy non-less files to tmp
                expand: true,
                dot: true,
                cwd: '<%= paths.docs %>/styles',
                dest: '<%= paths.tmp %>/styles/',
                src: '{,*/}*.css'
            },
            images: { // copy root images to tmp for serving
                expand: true,
                dot: true,
                cwd: 'images',
                dest: '<%= paths.tmp %>/images/',
                src: '**/*.*'
            }
        },

        // zips up src less files, images, and minified css
        zip: {
            '<%= paths.libDist %>/usptostrap-<%= pkg.version %>.zip': ['<%= paths.libDist %>/**/*']
        },

        // Run some tasks in parallel to speed up build process
        concurrent: {
            server: [
                // 'lesslint',
                'jshint',
                'less:server',
                'patterns:server',
                'template:server',
                'copy:styles',
                'copy:images'
            ],
            dist: [
                // 'lesslint',
                'jshint',
                'less:dist',
                'less:theme',
                'copy:styles',
                'imagemin'
                // 'svgmin'
            ]
        }
    });

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

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

    grunt.registerTask('build', [
        'clean:dist',
        'copy:tpl',
        'useminPrepare',
        'concurrent:dist',
        'autoprefixer',
        'concat:generated',
        'cssmin:generated',
        'uglify:generated',
        'copy:dist',
        'rev',
        'usemin',
        'patterns:dist',
        'template:dist',
        'htmlmin',
        'zip',
        'copy:release'
    ]);

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


<commit_before>'use strict';

var npm = require('npm');

module.exports = function(grunt) {

  grunt.loadNpmTasks('grunt-release');

  grunt.initConfig({
    release: {
      options: {
        tagName: 'v<%= version %>',
        commitMessage: 'bump v<%= version %> :tada:',
        tagMessage: 'v<%= version %>'
      }
    }
  });

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

    npm.load({
      logLevel: 'error'
    }, function(error) {
      if(error) {
        grunt.fail.fatal('Could not load npm');
        return;
      }

      npm.runScript('test', function(error) {
        if(error) {
          grunt.fail.fatal('tests failed');
          return;
        }

        grunt.log.write('tests passed, wtg');
        done();
      });
    });
  });

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

  ['patch', 'major', 'minor'].forEach(function(level) {
    grunt.registerTask('ember:release:' + level, ['test', 'release:' + level]);
  });
};
<commit_msg>remove grunt test, as it merely invokes npm test, but in a complicated way.<commit_after>'use strict';

module.exports = function(grunt) {

  grunt.loadNpmTasks('grunt-release');

  grunt.initConfig({
    release: {
      options: {
        tagName: 'v<%= version %>',
        commitMessage: 'bump v<%= version %> :tada:',
        tagMessage: 'v<%= version %>'
      }
    }
  });

  [
    'patch',
    'major',
    'minor'
  ].forEach(function(level) {
    grunt.registerTask('ember:release:' + level, ['test', 'release:' + level]);
  });
};
<|endoftext|>


<commit_before>
var path = require('path');

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

  // Project configuration.
  grunt.initConfig({
    // Task configuration.
    jshint: {
      options: {
        jshintrc : '.jshintrc'
      },
      all: {
        src: ['./app/**/*.js']
      }
    },
    sass : {
      main : {
        src : ['public/assets/sass/main.scss'],
        dest : 'public/assets/sass/main.css'
      }
    },
    connect: {
      test: {
        options: {
          port: 9090,
          base: './public/'
        }
      }
    },
    complexity: {
      options: {
        cyclomatic: 3,
        halstead: 10,
        maintainability: 100
      },
      generic: {
        src: '<%= jshint.all.src %>'
      }
    },
    browserify2: {
      app: {
        entry: './app/app.js',
        compile: './public/js/app.build.js'
      }
    },
    copy: {
      css: {
          src: './vendor/bootstrap/dist/css/bootstrap.css',
          dest: './public/css/bootstrap.css'
      },
      font: {
        src: './vendor/bootstrap/dist/fonts/*',
        dest: './public/fonts/*'
      }
    },
    concat : {
        options: {
          separator: ';'
        },
        vendor: {
          src: [
            './vendor/jquery/jquery.js',
            './vendor/angular/angular.js',
            './vendor/angular-cookies/angular-cookies.js',
            './vendor/angular-resource/angular-resource.js',
            './vendor/angular-route/angular-route.js',
            './vendor/bootstrap/dist/js/bootstrap.js'
          ],
          dest: './public/js/app.vendor.build.js'
        }
    },

    uglify : {
      build : {
        files: {
          './public/js/app.vendor.build.min.js': ['./public/js/app.vendor.build.js']
        }
      }
    },

    watch: {
      options : {
        interrupt:true
      },
      all: {
        files: '<%= jshint.all.src %>',
        tasks: ['jshint:all', 'nodeunit']
      },
      client: {
        files: ['./app/**/*.js'],
        tasks: ['browserify2']
      }
    }
  });

  // These plugins provide necessary tasks.

  grunt.registerTask('test', ['jshint', 'complexity', 'nodeunit']);

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

  // Default task.
  grunt.registerTask('default', ['browserify2', 'concat', 'copy:css', 'copy:font', 'connect:test','watch:client']);
};
<commit_msg>update font copy<commit_after>
var path = require('path');

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

  // Project configuration.
  grunt.initConfig({
    // Task configuration.
    jshint: {
      options: {
        jshintrc : '.jshintrc'
      },
      all: {
        src: ['./app/**/*.js']
      }
    },
    sass : {
      main : {
        src : ['public/assets/sass/main.scss'],
        dest : 'public/assets/sass/main.css'
      }
    },
    connect: {
      test: {
        options: {
          port: 9090,
          base: './public/'
        }
      }
    },
    complexity: {
      options: {
        cyclomatic: 3,
        halstead: 10,
        maintainability: 100
      },
      generic: {
        src: '<%= jshint.all.src %>'
      }
    },
    browserify2: {
      app: {
        entry: './app/app.js',
        compile: './public/js/app.build.js'
      }
    },
    copy: {
      css: {
          src: './vendor/bootstrap/dist/css/bootstrap.css',
          dest: './public/css/bootstrap.css'
      },
      font: {
        src: './vendor/bootstrap/dist/fonts/*',
        dest: './public/fonts/'
      }
    },
    concat : {
        options: {
          separator: ';'
        },
        vendor: {
          src: [
            './vendor/jquery/jquery.js',
            './vendor/angular/angular.js',
            './vendor/angular-cookies/angular-cookies.js',
            './vendor/angular-resource/angular-resource.js',
            './vendor/angular-route/angular-route.js',
            './vendor/bootstrap/dist/js/bootstrap.js'
          ],
          dest: './public/js/app.vendor.build.js'
        }
    },

    uglify : {
      build : {
        files: {
          './public/js/app.vendor.build.min.js': ['./public/js/app.vendor.build.js']
        }
      }
    },

    watch: {
      options : {
        interrupt:true
      },
      all: {
        files: '<%= jshint.all.src %>',
        tasks: ['jshint:all', 'nodeunit']
      },
      client: {
        files: ['./app/**/*.js'],
        tasks: ['browserify2']
      }
    }
  });

  // These plugins provide necessary tasks.

  grunt.registerTask('test', ['jshint', 'complexity', 'nodeunit']);

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

  // Default task.
  grunt.registerTask('default', ['browserify2', 'concat', 'copy:css', 'copy:font', 'connect:test','watch:client']);
};
<|endoftext|>


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

  var CONTEXT = process.env.CONTEXT || 'prod';

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-coffee');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-mocha');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-hull-dox');
  grunt.loadNpmTasks('grunt-hull-widgets');
  grunt.loadNpmTasks('grunt-s3');
  grunt.loadNpmTasks('grunt-git-describe');
  grunt.loadNpmTasks('grunt-coverjs');
  grunt.loadNpmTasks('grunt-plato');

  var pkg = grunt.file.readJSON('bower.json');
  var clientConfig = grunt.file.readJSON('.grunt/client.json');
  var remoteConfig = grunt.file.readJSON('.grunt/remote.json');

  var port = 3001;

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

  // Lookup of the available libs and injects them for the build
  // in the requirejs conf
  var clientLibs = grunt.file.glob
    .sync('src/client/**/*.coffee')
    .map(function (clientLib) {
      return clientLib.replace('.coffee', '').replace('src/', 'lib/');
    });

  var remoteLibs = grunt.file.glob
    .sync('src/remote/**/*.coffee')
    .map(function (clientLib) {
      return clientLib.replace('.coffee', '').replace('src/', 'lib/');
    });

  // Lookup of the Aura Extensions and injects them in the requirejs build
  var auraExtensions = grunt.file.glob
    .sync('aura-extensions/**/*.js')
    .map(function (extension) {
      return extension.replace('.js', '');
    });

  var clientRJSConfig = (function () {
    var _c = clientConfig.requireJS;
    _c.include = _c.include.concat(auraExtensions).concat(clientLibs);
    _c.optimize = CONTEXT !== "prod" ? "none" : "uglify";
    return _c;
  })();

  var remoteRJSConfig = (function () {
    var _c = remoteConfig.requireJS;
    _c.include = _c.include.concat(remoteLibs);
    _c.optimize = CONTEXT !== "prod" ? "none" : "uglify";
    return _c;
  })();

  var gruntConfig = {
    PKG_VERSION: pkg.version,
    clean: {
      client: {
        src: 'lib/client/**/*'
      },
      remote: {
        src: 'lib/remote/**/*'
      },
      reset: {
        src: ['build', 'lib', 'tmp', 'dist', 'components', 'node_modules']
      }
    },
    dox: {
      files: {
        baseDir: 'widgets',
        src: 'widgets/**/main.js',
        dest: 'dist/<%= PKG_VERSION %>/docs'
      }
    },
    coffee: {
      compile: {
        options: {
          header: true
        }
      },
      remote: {
        files: grunt.file.expandMapping(remoteConfig.srcFiles, 'lib/', {
          rename: function (destBase, destPath) {
            return destBase + destPath.replace(/\.coffee$/, '.js').replace(/^src\//, "");
          }
        })
      },
      client: {
        files: grunt.file.expandMapping(clientConfig.srcFiles, 'lib/', {
          rename: function (destBase, destPath) {
            return destBase + destPath.replace(/\.coffee$/, '.js').replace(/^src\//, "");
          }
        })
      }
    },
    connect: {
      server: {
        options: {
          port: port
        }
      }
    },
    requirejs: {
      client: {
        options: clientRJSConfig
      },
      remote: {
        options: remoteRJSConfig
      },
      upload: {
        options: {
          paths: {
            jquery: "empty:",
            "jquery.ui.widget" : 'components/jquery-file-upload/js/vendor/jquery.ui.widget',
            "jquery.fileupload" : 'components/jquery-file-upload/js/jquery.fileupload'
          },
          include: [
            'jquery.fileupload'
          ],
          out: 'tmp/widgets/upload/deps/jquery.fileupload.js'
        }
      },
      registration: {
        options: {
          paths: { h5f: 'widgets/registration/h5f' },
          shim: { h5f: { exports: 'H5F' } },
          include: ['h5f'],
          out: 'tmp/widgets/registration/deps.js'
        }
      },
      dox: {
        options: {
          paths: { prism: 'widgets/dox/dox/prism' },
          shim: { prism: { exports: 'Prism' } },
          include: ['prism'],
          out: 'tmp/widgets/dox/dox/deps.js'
        }
      }
    },
    mocha: {
      hull: {
        src: ["spec/index.html"]
      }
    },
    watch: {
      widgets: {
        files: ['widgets/**/*'],
        tasks: ['hull_widgets']
      },
      remote: {
        files: remoteConfig.srcFiles,
        tasks: ['dist:remote', 'do_test']
      },
      client: {
        files: clientConfig.srcFiles,
        tasks: ['dist:client', 'do_test']
      },
      spec: {
        files: ['spec/**/*.js'],
        tasks: ['mocha']
      }
    },
    version: {
      template: "define(function () { return '<%= PKG_VERSION %>';});",
      dest: 'lib/version.js'
    },
    hull_widgets: {
      hull: {
        src: 'widgets',
        before: ['requirejs:upload', 'requirejs:registration', 'requirejs:dox'],
        dest: 'dist/<%= PKG_VERSION%>',
        optimize: CONTEXT === 'prod'
      }
    },
    describe: {
      out: 'dist/<%= PKG_VERSION%>/REVISION'
    },
    cover: {
      compile: {
        files: {
          'build/instrumented/*.js' : ['lib/**/*.js']
        },
        options: {
          basePath: 'lib'
        }
      }
    },
    plato: {
      develop: {
        files: {
          'build/report': ['lib/**/*.js']
        }
      }
    },
    dist: {
      "remote": ['clean:remote', 'coffee:remote', 'version', 'requirejs:remote'],
      "client": ['clean:client', 'coffee:client', 'version', 'requirejs:client'],
      "widgets": ["hull_widgets"],
      "docs": ['dox']
    }
  };

  var aws = false;
  if (grunt.file.exists('.grunt/grunt-aws.json')) {
    aws = grunt.file.readJSON('.grunt/grunt-aws.json');
    if (aws) {
      gruntConfig.aws = aws;
      gruntConfig.s3 = {
        options: {
          key: '<%= aws.key %>',
          secret: '<%= aws.secret %>',
          bucket: '<%= aws.bucket %>',
          access: 'public-read',
          // debug: true,
          encodePaths: true,
          maxOperations: 20
        },
        prod: {
          upload: [
            {
              gzip:  true,
              src: 'dist/<%= PKG_VERSION %>/**/*',
              dest: '',
              rel: 'dist/'
            },
            {
              gzip:  false,
              src: 'dist/<%= PKG_VERSION %>/**/*',
              dest: '',
              rel: 'dist/'
            }
          ]
        }
      };
    }
  }
  grunt.initConfig(gruntConfig);

  // default build task
  grunt.registerTask('do_test', ['cover', 'plato', 'mocha']);
  grunt.registerTask('test', ['dist:client', 'dist:remote', 'do_test']);
  grunt.registerTask('default', ['connect', 'test', 'dist:widgets', 'watch']);
  grunt.registerTask('deploy', ['dist', 'describe', 's3']);
  grunt.registerTask('reset', ['clean:reset']);

  grunt.registerMultiTask('dist', 'Builds the various flavours of hull.js', function () {
    grunt.task.run(this.data);
  });

  grunt.registerTask("version", "generate a file from a template", function () {
    var conf = grunt.config("version");
    grunt.file.write(conf.dest, grunt.template.process(conf.template));
    grunt.log.writeln('Generated \'' + conf.dest + '\' successfully.');
  });
};
<commit_msg>Defines the vendor-free versions of hull.js (WIP)<commit_after>module.exports = function (grunt) {
  'use strict';

  var CONTEXT = process.env.CONTEXT || 'prod';

  var clone = grunt.util._.clone;

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-coffee');
  grunt.loadNpmTasks('grunt-contrib-connect');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-mocha');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-hull-dox');
  grunt.loadNpmTasks('grunt-hull-widgets');
  grunt.loadNpmTasks('grunt-s3');
  grunt.loadNpmTasks('grunt-git-describe');
  grunt.loadNpmTasks('grunt-coverjs');
  grunt.loadNpmTasks('grunt-plato');

  var pkg = grunt.file.readJSON('bower.json');
  var clientConfig = grunt.file.readJSON('.grunt/client.json');
  var remoteConfig = grunt.file.readJSON('.grunt/remote.json');

  var port = 3001;

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

  // Lookup of the available libs and injects them for the build
  // in the requirejs conf
  var clientLibs = grunt.file.glob
    .sync('src/client/**/*.coffee')
    .map(function (clientLib) {
      return clientLib.replace('.coffee', '').replace('src/', 'lib/');
    });

  var remoteLibs = grunt.file.glob
    .sync('src/remote/**/*.coffee')
    .map(function (clientLib) {
      return clientLib.replace('.coffee', '').replace('src/', 'lib/');
    });

  // Lookup of the Aura Extensions and injects them in the requirejs build
  var auraExtensions = grunt.file.glob
    .sync('aura-extensions/**/*.js')
    .map(function (extension) {
      return extension.replace('.js', '');
    });

  var clientRJSConfig = (function () {
    var _c = clientConfig.requireJS;
    _c.include = _c.include.concat(auraExtensions).concat(clientLibs);
    _c.optimize = CONTEXT !== "prod" ? "none" : "uglify";
    return _c;
  })();

  var remoteRJSConfig = (function () {
    var _c = remoteConfig.requireJS;
    _c.include = _c.include.concat(remoteLibs);
    _c.optimize = CONTEXT !== "prod" ? "none" : "uglify";
    return _c;
  })();

  var gruntConfig = {
    PKG_VERSION: pkg.version,
    clean: {
      client: {
        src: 'lib/client/**/*'
      },
      remote: {
        src: 'lib/remote/**/*'
      },
      reset: {
        src: ['build', 'lib', 'tmp', 'dist', 'components', 'node_modules']
      }
    },
    dox: {
      files: {
        baseDir: 'widgets',
        src: 'widgets/**/main.js',
        dest: 'dist/<%= PKG_VERSION %>/docs'
      }
    },
    coffee: {
      compile: {
        options: {
          header: true
        }
      },
      remote: {
        files: grunt.file.expandMapping(remoteConfig.srcFiles, 'lib/', {
          rename: function (destBase, destPath) {
            return destBase + destPath.replace(/\.coffee$/, '.js').replace(/^src\//, "");
          }
        })
      },
      client: {
        files: grunt.file.expandMapping(clientConfig.srcFiles, 'lib/', {
          rename: function (destBase, destPath) {
            return destBase + destPath.replace(/\.coffee$/, '.js').replace(/^src\//, "");
          }
        })
      }
    },
    connect: {
      server: {
        options: {
          port: port
        }
      }
    },
    requirejs: {
      "client-no-backbone": {
        options: (function (c) {
          c.paths.underscore = 'empty:';
          c.paths.backbone = 'empty:';
          c.out = c.out.replace('hull.js', 'hull.no-backbone.js');
          return c;
        })(clone(clientRJSConfig, true))
      },
      "client-no-underscore": {
        options: (function (c) {
          c.paths.underscore = 'empty:';
          c.out = c.out.replace('hull.js', 'hull.no-underscore.js');
          return c;
        })(clone(clientRJSConfig, true))
      },
      client: {
        options: clone(clientRJSConfig, true)
      },
      remote: {
        options: clone(remoteRJSConfig, true)
      },
      upload: {
        options: {
          paths: {
            jquery: "empty:",
            "jquery.ui.widget" : 'components/jquery-file-upload/js/vendor/jquery.ui.widget',
            "jquery.fileupload" : 'components/jquery-file-upload/js/jquery.fileupload'
          },
          include: [
            'jquery.fileupload'
          ],
          out: 'tmp/widgets/upload/deps/jquery.fileupload.js'
        }
      },
      registration: {
        options: {
          paths: { h5f: 'widgets/registration/h5f' },
          shim: { h5f: { exports: 'H5F' } },
          include: ['h5f'],
          out: 'tmp/widgets/registration/deps.js'
        }
      },
      dox: {
        options: {
          paths: { prism: 'widgets/dox/dox/prism' },
          shim: { prism: { exports: 'Prism' } },
          include: ['prism'],
          out: 'tmp/widgets/dox/dox/deps.js'
        }
      }
    },
    mocha: {
      hull: {
        src: ["spec/index.html"]
      }
    },
    watch: {
      widgets: {
        files: ['widgets/**/*'],
        tasks: ['hull_widgets']
      },
      remote: {
        files: remoteConfig.srcFiles,
        tasks: ['dist:remote', 'do_test']
      },
      client: {
        files: clientConfig.srcFiles,
        tasks: ['dist:client', 'do_test']
      },
      spec: {
        files: ['spec/**/*.js'],
        tasks: ['mocha']
      }
    },
    version: {
      template: "define(function () { return '<%= PKG_VERSION %>';});",
      dest: 'lib/version.js'
    },
    hull_widgets: {
      hull: {
        src: 'widgets',
        before: ['requirejs:upload', 'requirejs:registration', 'requirejs:dox'],
        dest: 'dist/<%= PKG_VERSION%>',
        optimize: CONTEXT === 'prod'
      }
    },
    describe: {
      out: 'dist/<%= PKG_VERSION%>/REVISION'
    },
    cover: {
      compile: {
        files: {
          'build/instrumented/*.js' : ['lib/**/*.js']
        },
        options: {
          basePath: 'lib'
        }
      }
    },
    plato: {
      develop: {
        files: {
          'build/report': ['lib/**/*.js']
        }
      }
    },
    dist: {
      "remote": ['clean:remote', 'coffee:remote', 'version', 'requirejs:remote'],
      "client": ['clean:client', 'coffee:client', 'version', 'requirejs:client'],
      "client-no-underscore": ['clean:client', 'coffee:client', 'version', 'requirejs:client-no-underscore'],
      "client-no-backbone": ['clean:client', 'coffee:client', 'version', 'requirejs:client-no-backbone'],
      "widgets": ["hull_widgets"],
      "docs": ['dox']
    }
  };

  var aws = false;
  if (grunt.file.exists('.grunt/grunt-aws.json')) {
    aws = grunt.file.readJSON('.grunt/grunt-aws.json');
    if (aws) {
      gruntConfig.aws = aws;
      gruntConfig.s3 = {
        options: {
          key: '<%= aws.key %>',
          secret: '<%= aws.secret %>',
          bucket: '<%= aws.bucket %>',
          access: 'public-read',
          // debug: true,
          encodePaths: true,
          maxOperations: 20
        },
        prod: {
          upload: [
            {
              gzip:  true,
              src: 'dist/<%= PKG_VERSION %>/**/*',
              dest: '',
              rel: 'dist/'
            },
            {
              gzip:  false,
              src: 'dist/<%= PKG_VERSION %>/**/*',
              dest: '',
              rel: 'dist/'
            }
          ]
        }
      };
    }
  }
  grunt.initConfig(gruntConfig);

  // default build task
  grunt.registerTask('do_test', ['cover', 'plato', 'mocha']);
  grunt.registerTask('test', ['dist:client', 'dist:remote', 'do_test']);
  grunt.registerTask('default', ['connect', 'test', 'dist:widgets', 'watch']);
  grunt.registerTask('deploy', ['dist', 'describe', 's3']);
  grunt.registerTask('reset', ['clean:reset']);

  grunt.registerMultiTask('dist', 'Builds the various flavours of hull.js', function () {
    grunt.task.run(this.data);
  });

  grunt.registerTask("version", "generate a file from a template", function () {
    var conf = grunt.config("version");
    grunt.file.write(conf.dest, grunt.template.process(conf.template));
    grunt.log.writeln('Generated \'' + conf.dest + '\' successfully.');
  });
};
<|endoftext|>