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

    var config = {
        dev: {
            path: 'dev',
            assets: 'dev/assets',
            partials: 'dev/partials'
        },
        staging: {
            path: 'staging',
            assets: 'staging/assets',
            partials: 'staging/partials'
        },
        build: {
            path: 'build',
            assets: 'build/assets',
            partials: 'build/partials'
        }
    };

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

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        config: config,
        banner: '/*! <%= pkg.projectName %> - v<%= pkg.version %> - by <%= pkg.developers %> - <%= grunt.template.today("dd-mm-yyyy") %> */\n',
        clean: {
            staging: [
                '<%= config.staging.path %>/**/*',
                '!<%= config.staging.path %>/**/.git',
                '!<%= config.staging.path %>/**/.svn'
            ],
            build: [
                '<%= config.build.path %>/**/*',
                '!<%= config.build.path %>/**/.git',
                '!<%= config.build.path %>/**/.svn'
            ],
            joycss: ['<%= config.build.assets %>/css/main.min.joy']
        },
        less: {
            staging: {
                files: {
                    '<%= config.staging.assets %>/css/main.min.css': '<%= config.dev.assets %>/less/main.less'
                },
                options: {
                    yuicompress: false
                }
            },
            build: {
                files: {
                    '<%= config.build.assets %>/css/main.min.css': '<%= config.dev.assets %>/less/main.less'
                },
                options: {
                    yuicompress: false
                }
            }
        },
        jshint: {
            files: [
                'Gruntfile.js',
                '<%= config.dev.assets %>/js/{,*/}*.js',
                '!<%= config.dev.assets %>/js/vendor/*'
            ],
            options: {
                jshintrc: '.jshintrc'
            }
        },
        uglify: {
            options: {
                banner: '<%= banner %>',
                mangle: {
                    except: ['jQuery', 'Backbone']
                }
            }
        },
        concat: {
            options: {
                separator: ';'
            }
        },
        modernizr: {
            'devFile': '<%= config.dev.assets %>/js/vendor/lib/modernizr.min.js',
            'outputFile': '<%= config.build.assets %>/js/vendor/lib/modernizr.min.js',
            'matchCommunityTests': true,
            'files': [
                '<%= config.build.assets %>/css/{,*/}*.css',
                '<%= config.dev.assets %>/js/**/*'
            ],
            'excludeFiles': [
                '<%= config.dev.assets %>/js/vendor/modernizr.min.js'
            ],
            'tests' : [],
        },
        joycss: {
            build: {
                options: {
                    layout: 'auto',
                    alpha: true
                },
                cwd: '<%= config.build.assets %>/css/',
                src: ['**'],
                dest: '<%= config.build.assets %>/css/'
            }
        },
        rename: {
            main: {
                files: [{
                    src: ['<%= config.build.assets %>/img/main.min-sprite.png'],
                    dest: '<%= config.build.assets %>/img/main-sprite.png'
                }]
            }
        },
        replace: {
            sprite: {
                src: ['<%= config.build.assets %>/css/*.css'],
                overwrite: true,
                replacements: [{
                    from: 'main.min-sprite.png',
                    to: 'main-sprite.png?' + '<%= new Date().getTime() %>'
                }]
            },
            escSprite: {
                src: ['<%= config.build.assets %>/css/*.css'],
                overwrite: true,
                replacements: [{
                    from: '?esc)',
                    to: '?<%= new Date().getTime() %>)'
                }]
            }
        },
        imagemin: {
            options: {
                optimizationLevel: 7
            },
            build: {
                expand: true,
                cwd: '<%= config.build.assets %>/img',
                src: '{,*/}*.{png,jpg,jpeg}',
                dest: '<%= config.build.assets %>/img'
            }
        },
        imageEmbed: {
            build: {
                src: ['<%= config.build.assets %>/css/main.min.css'],
                dest: '<%= config.build.assets %>/css/main.min.css',
                options: {
                    deleteAfterEncoding: true,
                    maxImageSize: 20480
                }
            }
        },
        svgmin: {
            build: {
                files: [{
                    expand: true,
                    cwd: '<%= config.dev.assets %>/svg',
                    src: ['**/*.svg'],
                    dest: '<%= config.build.assets %>/svg'
                }, {
                    expand: true,
                    cwd: '<%= config.dev.assets %>/font',
                    src: ['**/*.svg'],
                    dest: '<%= config.build.assets %>/font'
                }]
            }
        },
        htmlbuild: {
            staging: {
                src: '<%= config.dev.path %>/*.html',
                dest: '<%= config.staging.path %>/',
                options: {
                    sections: {
                        header: '<%= config.dev.partials %>/header.html',
                        footer: '<%= config.dev.partials %>/footer.html'
                    }
                }
            },
            build: {
                src: '<%= config.dev.path %>/*.html',
                dest: '<%= config.build.path %>/',
                options: {
                    sections: {
                        header: '<%= config.dev.partials %>/header.html',
                        footer: '<%= config.dev.partials %>/footer.html'
                    }
                }
            }
        },
        useminPrepare: {
            options: {
                dest: '<%= config.build.path %>',
                root: '<%= config.dev.path %>'
            },
            html: '<%= config.build.path %>/index.html'
        },
        usemin: {
            options: {
                assetsDirs: ['<%= config.dev.path %>'],
                dirs: ['<%= config.build.path %>']
            },
            html: ['<%= config.build.path %>/{,*/}*.html']
        },
        htmlmin: {
            build: {
                options: {
                    removeComments: true,
                    collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeRedundantAttributes: false,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true
                },
                expand: true,
                cwd: '<%= config.build.path %>',
                src: ['**/*.html'],
                dest: '<%= config.build.path %>'
            }
        },
        htmlcompressor: {
            build: {
                options: {
                    type: 'html',
                    preserveServerScript: true,
                    compressJs: true
                },
                expand: true,
                cwd: '<%= config.build.path %>',
                src: ['**/*.html'],
                dest: '<%= config.build.path %>'
            }
        },
        cmq: {
            build: {
                options: {
                    log: 'true'
                },
                files: {
                    '<%= config.build.assets %>/css/': ['<%= config.build.assets %>/css/*.css']
                }
            }
        },
        csso: {
            build: {
                options: {
                    report: 'gzip',
                    banner: '<%= banner %>'
                },
                files: {
                    '<%= config.build.assets %>/css/main.min.css': ['<%= config.build.assets %>/css/main.min.css']
                }
            }
        },
        cachebreaker: {
            js: {
                'asset_url': 'assets/js/main.min.js',
                files: {
                    src: '<%= config.build.path %>/*.html'
                }
            },
            css: {
                'asset_url': 'assets/css/main.min.css',
                files: {
                    src: '<%= config.build.path %>/*.html'
                }
            }
        },
        copy: {
            staging: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= config.dev.assets %>',
                    dest: '<%= config.staging.assets %>',
                    src: [
                        '*.{ico,png,txt,json}',
                        '.htaccess',
                        'img/**/*',
                        'swf/**/*',
                        'css/**/*',
                        'js/**/*',
                        'font/**/*'
                    ]
                }]
            },
            build: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= config.dev.assets %>',
                    dest: '<%= config.build.assets %>',
                    src: [
                        '*.{ico,png,txt,json}',
                        '.htaccess',
                        'img/**/*',
                        'swf/**/*',
                        'css/**/*',
                        'font/**/*'
                    ]
                }]
            }
        },
        watch: {
            scripts: {
                files: [
                    '<%= config.dev.assets %>/js/*.js',
                    '<%= config.dev.assets %>/js/**/*.js'
                ],
                tasks: ['jshint', 'concat']
            },
            css: {
                files: [
                    '<%= config.dev.assets %>/less/**/*',
                    '<%= config.dev.assets %>/css/**/*',
                    '<%= config.dev.assets %>/img/**/*',
                    '<%= config.dev.assets %>/svg/**/*',
                    '<%= config.dev.assets %>/swf/**/*',
                ],
                tasks: ['concurrent:staging'],
                options: {
                    livereload: true
                }
            },
            html: {
                files: [
                    '<%= config.dev.path %>/**/*.html',
                    '<%= config.dev.path %>/*.html'
                ],
                tasks: ['htmlbuild:staging'],
                options: {
                    livereload: true
                }
            }
        },
        connect: {
            options: {
                port: 9000,
                livereload: 35729,
                hostname: '0.0.0.0'
            },
            livereload: {
                options: {
                    open: true,
                    base: [
                        config.staging.path
                    ]
                }
            }
        },
        concurrent: {
            staging: [
                'less:staging',
                'copy:staging'
            ]
        }
    });

    grunt.registerTask('default', [
        'clean:staging',
        'concurrent:staging',
        'htmlbuild:staging',
        'connect:livereload',
        'watch'
    ]);

    grunt.registerTask('build', [
        'clean:build',
        'copy:build',
        'svgmin',
        'less:build',
        'cmq',
        'joycss',
        'rename',
        'replace',
        'imageEmbed',
        'csso',
        'imagemin',
        'modernizr',
        'htmlbuild:build',
        'useminPrepare',
        'concat',
        'uglify',
        'usemin',
        'cachebreaker',
        'htmlmin',
        'htmlcompressor',
        'clean:joycss'
    ]);
};
<commit_msg>Ajusta escopo do 'use strict'<commit_after>'use strict';

module.exports = function(grunt) {
    var config = {
        dev: {
            path: 'dev',
            assets: 'dev/assets',
            partials: 'dev/partials'
        },
        staging: {
            path: 'staging',
            assets: 'staging/assets',
            partials: 'staging/partials'
        },
        build: {
            path: 'build',
            assets: 'build/assets',
            partials: 'build/partials'
        }
    };

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

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        config: config,
        banner: '/*! <%= pkg.projectName %> - v<%= pkg.version %> - by <%= pkg.developers %> - <%= grunt.template.today("dd-mm-yyyy") %> */\n',
        clean: {
            staging: [
                '<%= config.staging.path %>/**/*',
                '!<%= config.staging.path %>/**/.git',
                '!<%= config.staging.path %>/**/.svn'
            ],
            build: [
                '<%= config.build.path %>/**/*',
                '!<%= config.build.path %>/**/.git',
                '!<%= config.build.path %>/**/.svn'
            ],
            joycss: ['<%= config.build.assets %>/css/main.min.joy']
        },
        less: {
            staging: {
                files: {
                    '<%= config.staging.assets %>/css/main.min.css': '<%= config.dev.assets %>/less/main.less'
                },
                options: {
                    yuicompress: false
                }
            },
            build: {
                files: {
                    '<%= config.build.assets %>/css/main.min.css': '<%= config.dev.assets %>/less/main.less'
                },
                options: {
                    yuicompress: false
                }
            }
        },
        jshint: {
            files: [
                'Gruntfile.js',
                '<%= config.dev.assets %>/js/{,*/}*.js',
                '!<%= config.dev.assets %>/js/vendor/*'
            ],
            options: {
                jshintrc: '.jshintrc'
            }
        },
        uglify: {
            options: {
                banner: '<%= banner %>',
                mangle: {
                    except: ['jQuery', 'Backbone']
                }
            }
        },
        concat: {
            options: {
                separator: ';'
            }
        },
        modernizr: {
            'devFile': '<%= config.dev.assets %>/js/vendor/lib/modernizr.min.js',
            'outputFile': '<%= config.build.assets %>/js/vendor/lib/modernizr.min.js',
            'matchCommunityTests': true,
            'files': [
                '<%= config.build.assets %>/css/{,*/}*.css',
                '<%= config.dev.assets %>/js/**/*'
            ],
            'excludeFiles': [
                '<%= config.dev.assets %>/js/vendor/modernizr.min.js'
            ],
            'tests' : [],
        },
        joycss: {
            build: {
                options: {
                    layout: 'auto',
                    alpha: true
                },
                cwd: '<%= config.build.assets %>/css/',
                src: ['**'],
                dest: '<%= config.build.assets %>/css/'
            }
        },
        rename: {
            main: {
                files: [{
                    src: ['<%= config.build.assets %>/img/main.min-sprite.png'],
                    dest: '<%= config.build.assets %>/img/main-sprite.png'
                }]
            }
        },
        replace: {
            sprite: {
                src: ['<%= config.build.assets %>/css/*.css'],
                overwrite: true,
                replacements: [{
                    from: 'main.min-sprite.png',
                    to: 'main-sprite.png?' + '<%= new Date().getTime() %>'
                }]
            },
            escSprite: {
                src: ['<%= config.build.assets %>/css/*.css'],
                overwrite: true,
                replacements: [{
                    from: '?esc)',
                    to: '?<%= new Date().getTime() %>)'
                }]
            }
        },
        imagemin: {
            options: {
                optimizationLevel: 7
            },
            build: {
                expand: true,
                cwd: '<%= config.build.assets %>/img',
                src: '{,*/}*.{png,jpg,jpeg}',
                dest: '<%= config.build.assets %>/img'
            }
        },
        imageEmbed: {
            build: {
                src: ['<%= config.build.assets %>/css/main.min.css'],
                dest: '<%= config.build.assets %>/css/main.min.css',
                options: {
                    deleteAfterEncoding: true,
                    maxImageSize: 20480
                }
            }
        },
        svgmin: {
            build: {
                files: [{
                    expand: true,
                    cwd: '<%= config.dev.assets %>/svg',
                    src: ['**/*.svg'],
                    dest: '<%= config.build.assets %>/svg'
                }, {
                    expand: true,
                    cwd: '<%= config.dev.assets %>/font',
                    src: ['**/*.svg'],
                    dest: '<%= config.build.assets %>/font'
                }]
            }
        },
        htmlbuild: {
            staging: {
                src: '<%= config.dev.path %>/*.html',
                dest: '<%= config.staging.path %>/',
                options: {
                    sections: {
                        header: '<%= config.dev.partials %>/header.html',
                        footer: '<%= config.dev.partials %>/footer.html'
                    }
                }
            },
            build: {
                src: '<%= config.dev.path %>/*.html',
                dest: '<%= config.build.path %>/',
                options: {
                    sections: {
                        header: '<%= config.dev.partials %>/header.html',
                        footer: '<%= config.dev.partials %>/footer.html'
                    }
                }
            }
        },
        useminPrepare: {
            options: {
                dest: '<%= config.build.path %>',
                root: '<%= config.dev.path %>'
            },
            html: '<%= config.build.path %>/index.html'
        },
        usemin: {
            options: {
                assetsDirs: ['<%= config.dev.path %>'],
                dirs: ['<%= config.build.path %>']
            },
            html: ['<%= config.build.path %>/{,*/}*.html']
        },
        htmlmin: {
            build: {
                options: {
                    removeComments: true,
                    collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeRedundantAttributes: false,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true
                },
                expand: true,
                cwd: '<%= config.build.path %>',
                src: ['**/*.html'],
                dest: '<%= config.build.path %>'
            }
        },
        htmlcompressor: {
            build: {
                options: {
                    type: 'html',
                    preserveServerScript: true,
                    compressJs: true
                },
                expand: true,
                cwd: '<%= config.build.path %>',
                src: ['**/*.html'],
                dest: '<%= config.build.path %>'
            }
        },
        cmq: {
            build: {
                options: {
                    log: 'true'
                },
                files: {
                    '<%= config.build.assets %>/css/': ['<%= config.build.assets %>/css/*.css']
                }
            }
        },
        csso: {
            build: {
                options: {
                    report: 'gzip',
                    banner: '<%= banner %>'
                },
                files: {
                    '<%= config.build.assets %>/css/main.min.css': ['<%= config.build.assets %>/css/main.min.css']
                }
            }
        },
        cachebreaker: {
            js: {
                'asset_url': 'assets/js/main.min.js',
                files: {
                    src: '<%= config.build.path %>/*.html'
                }
            },
            css: {
                'asset_url': 'assets/css/main.min.css',
                files: {
                    src: '<%= config.build.path %>/*.html'
                }
            }
        },
        copy: {
            staging: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= config.dev.assets %>',
                    dest: '<%= config.staging.assets %>',
                    src: [
                        '*.{ico,png,txt,json}',
                        '.htaccess',
                        'img/**/*',
                        'swf/**/*',
                        'css/**/*',
                        'js/**/*',
                        'font/**/*'
                    ]
                }]
            },
            build: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= config.dev.assets %>',
                    dest: '<%= config.build.assets %>',
                    src: [
                        '*.{ico,png,txt,json}',
                        '.htaccess',
                        'img/**/*',
                        'swf/**/*',
                        'css/**/*',
                        'font/**/*'
                    ]
                }]
            }
        },
        watch: {
            scripts: {
                files: [
                    '<%= config.dev.assets %>/js/*.js',
                    '<%= config.dev.assets %>/js/**/*.js'
                ],
                tasks: ['jshint', 'concat']
            },
            css: {
                files: [
                    '<%= config.dev.assets %>/less/**/*',
                    '<%= config.dev.assets %>/css/**/*',
                    '<%= config.dev.assets %>/img/**/*',
                    '<%= config.dev.assets %>/svg/**/*',
                    '<%= config.dev.assets %>/swf/**/*',
                ],
                tasks: ['concurrent:staging'],
                options: {
                    livereload: true
                }
            },
            html: {
                files: [
                    '<%= config.dev.path %>/**/*.html',
                    '<%= config.dev.path %>/*.html'
                ],
                tasks: ['htmlbuild:staging'],
                options: {
                    livereload: true
                }
            }
        },
        connect: {
            options: {
                port: 9000,
                livereload: 35729,
                hostname: '0.0.0.0'
            },
            livereload: {
                options: {
                    open: true,
                    base: [
                        config.staging.path
                    ]
                }
            }
        },
        concurrent: {
            staging: [
                'less:staging',
                'copy:staging'
            ]
        }
    });

    grunt.registerTask('default', [
        'clean:staging',
        'concurrent:staging',
        'htmlbuild:staging',
        'connect:livereload',
        'watch'
    ]);

    grunt.registerTask('build', [
        'clean:build',
        'copy:build',
        'svgmin',
        'less:build',
        'cmq',
        'joycss',
        'rename',
        'replace',
        'imageEmbed',
        'csso',
        'imagemin',
        'modernizr',
        'htmlbuild:build',
        'useminPrepare',
        'concat',
        'uglify',
        'usemin',
        'cachebreaker',
        'htmlmin',
        'htmlcompressor',
        'clean:joycss'
    ]);
};
<|endoftext|>


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

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

    // Compiles our Sass
    sass: {
      options: {
        precision: 6,
        sourceComments: false,
        outputStyle: 'compressed'
      },
      dist: {
        files: {
          'css/primer.css': 'scss/primer.scss'
        }
      }
    },

    // Handle vendor prefixing
    postcss: {
      options: {
        processors: [
          require('autoprefixer-core')({ browsers: ['last 2 versions', 'ie 8', 'ie 9'] })
        ]
      },
      dist: {
        src: 'css/*.css'
      },
      docs: {
        src: '_site/*.css'
      }
    },

    // Runs CSS reporting
    parker: {
      options: {
        metrics: [
          'TotalStylesheets',
          'TotalStylesheetSize',
          'TotalRules',
          'TotalSelectors',
          'TotalIdentifiers',
          'TotalDeclarations',
          'SelectorsPerRule',
          'IdentifiersPerSelector',
          'SpecificityPerSelector',
          'TopSelectorSpecificity',
          'TopSelectorSpecificitySelector',
          'TotalIdSelectors',
          'TotalUniqueColours',
          'TotalImportantKeywords',
          'TotalMediaQueries'
        ],
        file: "css/.primer-stats.md",
        usePackage: true
      },
      src: [
        'css/*.css'
      ]
    },

    // Build tooling

    watch: {
      sass: {
        files: ['scss/**/*.scss', 'docs/docs.scss'],
        tasks: ['sass', 'postcss', 'parker']
      }
    },

    jekyll: {
      options: {
        src: 'docs',
        dest: '_site',
        config: '_config.yml',
        raw: "version: <%= pkg.version %>"
      },
      dist: {
        serve: false
      },
      serve: {
        serve: true
      }
    },

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

  // Load dependencies
  grunt.loadNpmTasks('grunt-postcss');
  grunt.loadNpmTasks('grunt-build-control');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-jekyll');
  grunt.loadNpmTasks('grunt-parker');
  grunt.loadNpmTasks('grunt-sass');

  // Generate and format the CSS
  grunt.registerTask('default', ['sass', 'jekyll:dist', 'postcss', 'parker']);

  // Publish to GitHub
  grunt.registerTask('publish', ['jekyll:dist', 'postcss:docs', 'buildcontrol:pages']);
};
<commit_msg>Update output filenames<commit_after>module.exports = function(grunt) {

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

    // Compiles our Sass
    sass: {
      options: {
        precision: 6,
        sourceComments: false,
        outputStyle: 'compressed'
      },
      dist: {
        files: {
          'css/carbon.css': 'scss/carbon.scss'
        }
      }
    },

    // Handle vendor prefixing
    postcss: {
      options: {
        processors: [
          require('autoprefixer-core')({ browsers: ['last 2 versions', 'ie 8', 'ie 9'] })
        ]
      },
      dist: {
        src: 'css/*.css'
      },
      docs: {
        src: '_site/*.css'
      }
    },

    // Runs CSS reporting
    parker: {
      options: {
        metrics: [
          'TotalStylesheets',
          'TotalStylesheetSize',
          'TotalRules',
          'TotalSelectors',
          'TotalIdentifiers',
          'TotalDeclarations',
          'SelectorsPerRule',
          'IdentifiersPerSelector',
          'SpecificityPerSelector',
          'TopSelectorSpecificity',
          'TopSelectorSpecificitySelector',
          'TotalIdSelectors',
          'TotalUniqueColours',
          'TotalImportantKeywords',
          'TotalMediaQueries'
        ],
        file: "css/.carbon-stats.md",
        usePackage: true
      },
      src: [
        'css/*.css'
      ]
    },

    // Build tooling

    watch: {
      sass: {
        files: ['scss/**/*.scss', 'docs/docs.scss'],
        tasks: ['sass', 'postcss', 'parker']
      }
    },

    jekyll: {
      options: {
        src: 'docs',
        dest: '_site',
        config: '_config.yml',
        raw: "version: <%= pkg.version %>"
      },
      dist: {
        serve: false
      },
      serve: {
        serve: true
      }
    },

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

  // Load dependencies
  grunt.loadNpmTasks('grunt-postcss');
  grunt.loadNpmTasks('grunt-build-control');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-jekyll');
  grunt.loadNpmTasks('grunt-parker');
  grunt.loadNpmTasks('grunt-sass');

  // Generate and format the CSS
  grunt.registerTask('default', ['sass', 'jekyll:dist', 'postcss', 'parker']);

  // Publish to GitHub
  grunt.registerTask('publish', ['jekyll:dist', 'postcss:docs', 'buildcontrol:pages']);
};
<|endoftext|>


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

	//prepare frontend boilerplate
	var
		less = {}, concat = {}, watch = {},
		sizes = [ //defaults in comments
			'base', //this always shows
			'small', //30em
			'medium', //46.875em
			'large', //56em
			'xlarge', //62em
			'xxlarge', //70em
			'xxxlarge', //80em
			'xxxxlarge' //100em
		],
		basename = sizes[0],
		components_css_dir = "build/components/**/css",
		global_css_dir = "build/global/css",
		dist_dir = 'css/dist';

	for (var i = 0; i < sizes.length; i++) {

		var size = sizes[i], lessfiles = {};
		lessfiles['css/build/'+size+'.min.css'] = [
			global_css_dir+'/elements/**/*.'+size+'.less',
			components_css_dir+'/*.'+size+'.less'
		];
		lessfiles['css/build/'+size+'.retina.min.css'] = [components_css_dir+'/*.'+size+'.retina.less'];
		less[size] = {
			options: {
				paths: ['less'],
				compress: true
			},
			files: lessfiles
		};
		concat["css_"+size] = {
			src: [
				global_css_dir+'/helpers/queries.'+size+'.css',
				'css/build/'+size+'.min.css',
				global_css_dir+'/helpers/queries.close.css',
				global_css_dir+'/helpers/queries.'+size+'.retina.css',
				'css/build/'+size+'.retina.min.css',
				global_css_dir+'/helpers/queries.close2.css'
			],
			dest: 'css/dist/'+size+'.min.css',
			seperator: '\n'
		};
		concat["css_"+size+"_dumb"] = {
			src: [
				'css/build/'+size+'.min.css'
			],
			dest: 'css/dist/'+size+'_dumb.min.css',
			seperator: '\n'
		};
		watch["css_"+size] = {
			files: [
				global_css_dir+'/elements/**/*.'+size+'.less',
				global_css_dir+'/elements/**/*.'+size+'.retina.less',
				components_css_dir+'/*.'+size+'.less',
				components_css_dir+'/*.'+size+'.retina.less',
				global_css_dir+'/mixins/*.css',
				global_css_dir+'/helpers/*.css'
			],
			tasks: [
				'less:'+size,
				'concat:css_'+size,
				'concat:css_'+size+'_dumb',
				'concat:css_production',
				'concat:css_production_dumb'
			]
		};

	};
	//add in specific locations

	less[basename].files['css/build/'+basename+'.min.css'].unshift(global_css_dir+'/utility.less');
	less[basename].files['css/build/'+basename+'.min.css'].unshift(global_css_dir+'/reset.less');

	less['print'] = {
		options: {
			paths: ['less'],
			compress: true
		},
		files: {
			'css/dist/print.css': [
				global_css_dir+'/print.less'
			],
		}
	};

	concat['css_production'] = {
		src: [
			'<banner>',
			'css/dist/base.min.css',
			'css/dist/small.min.css',
			'css/dist/medium.min.css',
			'css/dist/large.min.css',
			'css/dist/xlarge.min.css',
			'css/dist/xxlarge.min.css',
			'css/dist/xxxlarge.min.css',
			'css/dist/xxxxlarge.min.css',
			'css/dist/print.css'
		],
		dest: 'css/dist/production.min.css',
		seperator: '\n'
	};
	concat['css_production_dumb'] = {
		src: [
			'<banner>',
			'css/dist/base_dumb.min.css',
			'css/dist/small_dumb.min.css',
			'css/dist/medium_dumb.min.css',
			'css/dist/large_dumb.min.css',
			'css/dist/xlarge_dumb.min.css',
			'css/dist/print.css'
		],
		dest: 'css/dist/production_dumb.min.css',
		seperator: '\n'
	};
	concat['js'] = {
		src: [
			// modernizr at the top of the page so not included here
			'build/global/js/vendor/jquery-1.9.1.min.js',
			'build/global/js/vendor/jquery-migrate-1.1.1.min.js',
			'build/global/js/vendor/ios-orientationchange-fix.src.js',
			'build/global/js/vendor/response.src.js',
			'build/global/js/vendor/highcharts.js',
			'build/global/js/do.src.js',
			'build/global/js/browser_detection.src.js',
			'build/global/js/jquery.whim.src.js',
			'build/global/js/responseTrigger.src.js',
			'build/components/**/js/vendor/*.js',
			'build/components/**/js/*.js',
			'build/global/js/start.src.js',
		],
		dest: 'js/dist/site.src.js',
		seperator: '\n'
	};
	//additional watch print, and watch js
	watch['css_print'] = {
		files: [
			'build/print.less',
		],
		tasks: [
			'less:print',
			'concat:css_production',
			'concat:css_production_dumb'
		]
	};
	watch['js'] = {
		files: [
			'build/global/js/vendor/*.js',
			'build/global/js/*.js',
			'build/components/**/js/vendor/*.js',
			'build/components/**/js/*.js',
		],
		tasks: [
			'concat:js'
		]
	};

	//do grunt configuration
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		meta: {
			banner: '/*! DNA Designed Communications Limited | Copyright 2015*/'
		},
		imageoptim: {
			// these paths should match directories
			files: ['images'],
			options: {
				quitAfter: true
			}
		},
		less: less,
		concat: concat,
		watch: watch
	});

	grunt.loadNpmTasks('grunt-css');
	grunt.loadNpmTasks('grunt-contrib-less');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-imageoptim');

	grunt.registerTask('default', ['less', 'concat', 'watch']);
};
<commit_msg>Fix bootstrap grid not being included by default<commit_after>module.exports = function(grunt) {

	//prepare frontend boilerplate
	var
		less = {}, concat = {}, watch = {},
		sizes = [ //defaults in comments
			'base', //this always shows
			'small', //30em
			'medium', //46.875em
			'large', //56em
			'xlarge', //62em
			'xxlarge', //70em
			'xxxlarge', //80em
			'xxxxlarge' //100em
		],
		basename = sizes[0],
		components_css_dir = "build/components/**/css",
		global_css_dir = "build/global/css",
		dist_dir = 'css/dist';

	less['grid'] = {
		options: {
			paths: ['less'],
			compress: true
		},
		files: {
			'css/dist/grid.media.min.css': global_css_dir+'/mixins/grid.media.less',
			'css/dist/grid.dumb.min.css': global_css_dir+'/mixins/grid.dumb.less'
		}
	};

	for (var i = 0; i < sizes.length; i++) {

		var size = sizes[i], lessfiles = {};
		lessfiles['css/build/'+size+'.min.css'] = [
			global_css_dir+'/elements/**/*.'+size+'.less',
			components_css_dir+'/*.'+size+'.less'
		];
		lessfiles['css/build/'+size+'.retina.min.css'] = [components_css_dir+'/*.'+size+'.retina.less'];
		less[size] = {
			options: {
				paths: ['less'],
				compress: true
			},
			files: lessfiles
		};
		concat["css_"+size] = {
			src: [
				global_css_dir+'/helpers/queries.'+size+'.css',
				'css/build/'+size+'.min.css',
				global_css_dir+'/helpers/queries.close.css',
				global_css_dir+'/helpers/queries.'+size+'.retina.css',
				'css/build/'+size+'.retina.min.css',
				global_css_dir+'/helpers/queries.close2.css'
			],
			dest: 'css/dist/'+size+'.min.css',
			seperator: '\n'
		};
		concat["css_"+size+"_dumb"] = {
			src: [
				'css/build/'+size+'.min.css'
			],
			dest: 'css/dist/'+size+'_dumb.min.css',
			seperator: '\n'
		};
		watch["css_"+size] = {
			files: [
				global_css_dir+'/elements/**/*.'+size+'.less',
				global_css_dir+'/elements/**/*.'+size+'.retina.less',
				components_css_dir+'/*.'+size+'.less',
				components_css_dir+'/*.'+size+'.retina.less',
				global_css_dir+'/mixins/*.css',
				global_css_dir+'/helpers/*.css'
			],
			tasks: [
				'less:'+size,
				'concat:css_'+size,
				'concat:css_'+size+'_dumb',
				'concat:css_production',
				'concat:css_production_dumb'
			]
		};

	};
	//add in specific locations

	less[basename].files['css/build/'+basename+'.min.css'].unshift(global_css_dir+'/utility.less');
	less[basename].files['css/build/'+basename+'.min.css'].unshift(global_css_dir+'/reset.less');

	less['print'] = {
		options: {
			paths: ['less'],
			compress: true
		},
		files: {
			'css/dist/print.css': [
				global_css_dir+'/print.less'
			],
		}
	};

	concat['css_production'] = {
		src: [
			'<banner>',
			'css/dist/grid.media.min.css',
			'css/dist/base.min.css',
			'css/dist/small.min.css',
			'css/dist/medium.min.css',
			'css/dist/large.min.css',
			'css/dist/xlarge.min.css',
			'css/dist/xxlarge.min.css',
			'css/dist/xxxlarge.min.css',
			'css/dist/xxxxlarge.min.css',
			'css/dist/print.css'
		],
		dest: 'css/dist/production.min.css',
		seperator: '\n'
	};
	concat['css_production_dumb'] = {
		src: [
			'<banner>',
			'css/dist/grid.dumb.min.css',
			'css/dist/base_dumb.min.css',
			'css/dist/small_dumb.min.css',
			'css/dist/medium_dumb.min.css',
			'css/dist/large_dumb.min.css',
			'css/dist/xlarge_dumb.min.css',
			'css/dist/print.css'
		],
		dest: 'css/dist/production_dumb.min.css',
		seperator: '\n'
	};
	concat['js'] = {
		src: [
			// modernizr at the top of the page so not included here
			'build/global/js/vendor/jquery-1.9.1.min.js',
			'build/global/js/vendor/jquery-migrate-1.1.1.min.js',
			'build/global/js/vendor/ios-orientationchange-fix.src.js',
			'build/global/js/vendor/response.src.js',
			'build/global/js/vendor/highcharts.js',
			'build/global/js/do.src.js',
			'build/global/js/browser_detection.src.js',
			'build/global/js/jquery.whim.src.js',
			'build/global/js/responseTrigger.src.js',
			'build/components/**/js/vendor/*.js',
			'build/components/**/js/*.js',
			'build/global/js/start.src.js',
		],
		dest: 'js/dist/site.src.js',
		seperator: '\n'
	};
	//additional watch print, and watch js
	watch['css_print'] = {
		files: [
			'build/print.less',
		],
		tasks: [
			'less:print',
			'concat:css_production',
			'concat:css_production_dumb'
		]
	};
	watch['js'] = {
		files: [
			'build/global/js/vendor/*.js',
			'build/global/js/*.js',
			'build/components/**/js/vendor/*.js',
			'build/components/**/js/*.js',
		],
		tasks: [
			'concat:js'
		]
	};

	//do grunt configuration
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		meta: {
			banner: '/*! DNA Designed Communications Limited | Copyright 2015*/'
		},
		imageoptim: {
			// these paths should match directories
			files: ['images'],
			options: {
				quitAfter: true
			}
		},
		less: less,
		concat: concat,
		watch: watch
	});

	grunt.loadNpmTasks('grunt-css');
	grunt.loadNpmTasks('grunt-contrib-less');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-imageoptim');

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


<commit_before>module.exports = function (grunt) {
    // Load tasks
    require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});

    // Project configuration.
    grunt.initConfig({
        pkg: require('./package.json'),
        cfg: {
            src: 'src',
            demo: 'demo',
            build: 'build',
            dist: 'dist',
            docs: 'docs',
            bower: 'bower_components'
        },
        clean: {
            build: ['<%=cfg.build%>'],
            dist: ['<%=cfg.dist%>', '<%=cfg.docs%>'],
            docs: ['<%=cfg.docs%>'],
            tmp: ['<%=cfg.build%>/router.js', '<%=cfg.build%>/api.js']
        },

        // Validate
        jshint: {
            options: {
                undef: true,
                unused: 'vars',
                nonew: true,
                nonbsp: true,
                bitwise: true
            },
            grunt: {
                options: {
                    node: true
                },
                files: {
                    src: ['Gruntfile.js']
                }
            },
            src: {
                options: {
                    browser: true,
                    sub: true,
                    globalstrict: true,

                    globals: {
                        angular: true,
                        module: true
                    }
                },
                files: {
                    src: ['<%=cfg.src%>/**/*.js', '!<%=cfg.src%>/module.js', '!<%=cfg.src%>/**/*.spec.js']
                }
            },
            bundle: {
                options: {
                    browser: true,
                    sub: true,

                    globals: {
                        angular: true
                    }
                },
                files: {
                    src: ['<%=cfg.build%>/dist/angular-data-router.js']
                }
            },
            demo: {
                options: {
                    browser: true,
                    sub: true,

                    globals: {
                        angular: true
                    }
                },
                files: {
                    src: ['<%=cfg.demo%>/**/*.js']
                }
            },
            test: {
                options: {
                    browser: true,
                    sub: true,
                    globalstrict: true,
                    globals: {
                        angular: true,
                        describe: true,
                        it: true,
                        beforeEach: true,
                        expect: true,
                        module: true,
                        inject: true,
                        spyOn: true
                    }
                },
                files: {
                    src: ['<%=cfg.src%>/**/*.spec.js']
                }
            }
        },

        // Compile
        concat: {
            options: {
                banner: '/**\n * @license angular-data-router v<%=pkg.version%>\n * (c) 2015 Michal Dvorak https://github.com/mdvorak/angular-data-router\n * License: MIT\n */'
            },
            router: {
                options: {
                    get banner() {
                        var module = grunt.file.read('src/module.js');
                        return '<%=concat.options.banner%>\n(function dataRouterModule(angular) {\n' + module + '\n';
                    },
                    footer: '\n})(angular);',
                    process: function (src) {
                        return src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
                    }
                },
                files: [{
                    dest: '<%=cfg.build%>/router.js',
                    src: [
                        '<%=cfg.src%>/dataRouterRegistry.js',
                        '<%=cfg.src%>/dataRouterLoader.js',
                        '<%=cfg.src%>/dataRouter.js',
                        '<%=cfg.src%>/matchMap.js',
                        '<%=cfg.src%>/eventSupport.js',
                        '<%=cfg.src%>/directives/**/*.js',
                        '<%=cfg.src%>/dataApi.js',
                        '!<%=cfg.src%>/**/*.spec.js'
                    ]
                }]
            },
            api: {
                options: {
                    banner: '<%=concat.options.banner%>\n(function dataApiModule(angular) {\n"use strict";\n',
                    footer: '\n})(angular);',
                    process: function (src) {
                        return src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
                    }
                },
                files: [{
                    dest: '<%=cfg.build%>/api.js',
                    src: ['<%=cfg.src%>/dataApi.js', '!<%=cfg.src%>/**/*.spec.js']
                }]
            }
        },

        ngAnnotate: {
            build: {
                files: [
                    {
                        '<%=cfg.build%>/dist/angular-data-router.js': '<%=cfg.build%>/router.js',
                        '<%=cfg.build%>/dist/components/data-api.js': '<%=cfg.build%>/api.js'
                    }
                ]
            }
        },

        jsbeautifier: {
            options: {
                jslintHappy: true
            },
            build: {
                src: [
                    '<%=cfg.build%>/dist/angular-data-router.js',
                    '<%=cfg.build%>/dist/components/*.js'
                ]
            }
        },

        uglify: {
            build: {
                options: {
                    banner: '/*\n angular-data-router v<%=pkg.version%>\n (c) 2015 Michal Dvorak https://github.com/mdvorak/angular-data-router\n License: MIT\n*/',
                    sourceMap: true
                },
                files: [{
                    expand: true,
                    src: ['<%=cfg.build%>/dist/**/*.js'],
                    ext: '.min.js'
                }]
            }
        },

        // Tests
        karma: {
            options: {
                frameworks: ['detectBrowsers', 'jasmine'],
                singleRun: true,
                files: [
                    // Libraries
                    '<%=cfg.bower%>/angular/angular.js',
                    '<%=cfg.bower%>/angular-mocks/angular-mocks.js',

                    // Application files
                    '<%=cfg.build%>/dist/angular-data-router.js',

                    // Tests
                    '<%=cfg.src%>/**/*.spec.js'
                ]
            },
            default: {},
            debug: {
                options: {
                    singleRun: false,
                    browsers: ['Chrome']
                }
            }
        },

        // Release
        copy: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%=cfg.build%>/dist',
                    dest: '<%=cfg.dist%>',
                    src: ['**']
                }]
            }
        },
        gitadd: {
            dist: {
                options: {
                    all: true
                },
                files: {
                    src: [
                        '<%=cfg.dist%>/**'
                    ]
                }
            }
        },
        bump: {
            options: {
                pushTo: 'origin',
                commitMessage: '[release v%VERSION%]',
                commitFiles: ['package.json', 'dist/**']
            }
        },

        // Docs
        ngdocs: {
            options: {
                dest: 'docs',
                html5Mode: false,
                scripts: [
                    'https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js',
                    'https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-animate.min.js',
                    '<%=cfg.build%>/dist/angular-data-router.js'
                ]
            },
            api: {
                src: [
                    '<%=cfg.build%>/dist/angular-data-router.js',
                    '<%=cfg.src%>/docs/**/*.js'
                ],
                title: 'Angular Data Router Documentation'
            }
        },
        'gh-pages': {
            options: {
                base: 'docs'
            },
            src: ['**']
        },

        // Demo
        connect: {
            server: {
                options: {
                    hostname: 'localhost',
                    port: 9000
                }
            }
        },
        watch: {
            src: {
                files: ['<%=cfg.src%>/**/*.js'],
                tasks: ['javascript', 'jshint:test', 'ngdocs']
            },
            demo: {
                files: ['<%=cfg.demo%>/**/*.js'],
                tasks: ['jshint:demo']
            }
        }
    });

    // Private tasks
    grunt.registerTask('javascript', ['jshint:src', 'concat:router', 'concat:api', 'ngAnnotate:build', 'jshint:bundle', 'jsbeautifier:build', 'uglify:build', 'clean:tmp']);

    // Public tasks
    grunt.registerTask('default', ['jshint:grunt', 'clean:build', 'javascript', 'jshint:test', 'karma:default']);
    grunt.registerTask('debug', ['karma:debug']);
    grunt.registerTask('demo', ['jshint:demo', 'default', 'connect:server', 'watch']);

    grunt.registerTask('docs', ['jshint:grunt', 'clean:build', 'clean:docs', 'javascript', 'ngdocs', 'gh-pages']);
    grunt.registerTask('dist', ['default', 'clean:dist', 'copy:dist']);
    grunt.registerTask('release', ['git-is-clean', 'bump-only', 'dist', 'gitadd:dist', 'bump-commit', 'git-is-clean']);
};
<commit_msg>release test<commit_after>module.exports = function (grunt) {
    // Load tasks
    require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});

    // Project configuration.
    grunt.initConfig({
        pkg: require('./package.json'),
        cfg: {
            src: 'src',
            demo: 'demo',
            build: 'build',
            dist: 'dist',
            docs: 'docs',
            bower: 'bower_components'
        },
        clean: {
            build: ['<%=cfg.build%>'],
            dist: ['<%=cfg.dist%>', '<%=cfg.docs%>'],
            docs: ['<%=cfg.docs%>'],
            tmp: ['<%=cfg.build%>/router.js', '<%=cfg.build%>/api.js']
        },

        // Validate
        jshint: {
            options: {
                undef: true,
                unused: 'vars',
                nonew: true,
                nonbsp: true,
                bitwise: true
            },
            grunt: {
                options: {
                    node: true
                },
                files: {
                    src: ['Gruntfile.js']
                }
            },
            src: {
                options: {
                    browser: true,
                    sub: true,
                    globalstrict: true,

                    globals: {
                        angular: true,
                        module: true
                    }
                },
                files: {
                    src: ['<%=cfg.src%>/**/*.js', '!<%=cfg.src%>/module.js', '!<%=cfg.src%>/**/*.spec.js']
                }
            },
            bundle: {
                options: {
                    browser: true,
                    sub: true,

                    globals: {
                        angular: true
                    }
                },
                files: {
                    src: ['<%=cfg.build%>/dist/angular-data-router.js']
                }
            },
            demo: {
                options: {
                    browser: true,
                    sub: true,

                    globals: {
                        angular: true
                    }
                },
                files: {
                    src: ['<%=cfg.demo%>/**/*.js']
                }
            },
            test: {
                options: {
                    browser: true,
                    sub: true,
                    globalstrict: true,
                    globals: {
                        angular: true,
                        describe: true,
                        it: true,
                        beforeEach: true,
                        expect: true,
                        module: true,
                        inject: true,
                        spyOn: true
                    }
                },
                files: {
                    src: ['<%=cfg.src%>/**/*.spec.js']
                }
            }
        },

        // Compile
        concat: {
            options: {
                banner: '/**\n * @license angular-data-router v<%=pkg.version%>\n * (c) 2015 Michal Dvorak https://github.com/mdvorak/angular-data-router\n * License: MIT\n */'
            },
            router: {
                options: {
                    get banner() {
                        var module = grunt.file.read('src/module.js');
                        return '<%=concat.options.banner%>\n(function dataRouterModule(angular) {\n' + module + '\n';
                    },
                    footer: '\n})(angular);',
                    process: function (src) {
                        return src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
                    }
                },
                files: [{
                    dest: '<%=cfg.build%>/router.js',
                    src: [
                        '<%=cfg.src%>/dataRouterRegistry.js',
                        '<%=cfg.src%>/dataRouterLoader.js',
                        '<%=cfg.src%>/dataRouter.js',
                        '<%=cfg.src%>/matchMap.js',
                        '<%=cfg.src%>/eventSupport.js',
                        '<%=cfg.src%>/directives/**/*.js',
                        '<%=cfg.src%>/dataApi.js',
                        '!<%=cfg.src%>/**/*.spec.js'
                    ]
                }]
            },
            api: {
                options: {
                    banner: '<%=concat.options.banner%>\n(function dataApiModule(angular) {\n"use strict";\n',
                    footer: '\n})(angular);',
                    process: function (src) {
                        return src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
                    }
                },
                files: [{
                    dest: '<%=cfg.build%>/api.js',
                    src: ['<%=cfg.src%>/dataApi.js', '!<%=cfg.src%>/**/*.spec.js']
                }]
            }
        },

        ngAnnotate: {
            build: {
                files: [
                    {
                        '<%=cfg.build%>/dist/angular-data-router.js': '<%=cfg.build%>/router.js',
                        '<%=cfg.build%>/dist/components/data-api.js': '<%=cfg.build%>/api.js'
                    }
                ]
            }
        },

        jsbeautifier: {
            options: {
                jslintHappy: true
            },
            build: {
                src: [
                    '<%=cfg.build%>/dist/angular-data-router.js',
                    '<%=cfg.build%>/dist/components/*.js'
                ]
            }
        },

        uglify: {
            build: {
                options: {
                    banner: '/*\n angular-data-router v<%=pkg.version%>\n (c) 2015 Michal Dvorak https://github.com/mdvorak/angular-data-router\n License: MIT\n*/',
                    sourceMap: true
                },
                files: [{
                    expand: true,
                    src: ['<%=cfg.build%>/dist/**/*.js'],
                    ext: '.min.js'
                }]
            }
        },

        // Tests
        karma: {
            options: {
                frameworks: ['detectBrowsers', 'jasmine'],
                singleRun: true,
                files: [
                    // Libraries
                    '<%=cfg.bower%>/angular/angular.js',
                    '<%=cfg.bower%>/angular-mocks/angular-mocks.js',

                    // Application files
                    '<%=cfg.build%>/dist/angular-data-router.js',

                    // Tests
                    '<%=cfg.src%>/**/*.spec.js'
                ]
            },
            default: {},
            debug: {
                options: {
                    singleRun: false,
                    browsers: ['Chrome']
                }
            }
        },

        // Release
        copy: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%=cfg.build%>/dist',
                    dest: '<%=cfg.dist%>',
                    src: ['**']
                }]
            }
        },
        gitadd: {
            dist: {
                options: {
                    all: true
                },
                files: {
                    src: [
                        '<%=cfg.dist%>/**'
                    ]
                }
            }
        },
        bump: {
            options: {
                pushTo: 'origin',
                commitMessage: '[release v%VERSION%]',
                commitFiles: ['package.json', 'dist/**'],
                updateConfigs: ['pkg']
            }
        },

        // Docs
        ngdocs: {
            options: {
                dest: 'docs',
                html5Mode: false,
                scripts: [
                    'https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js',
                    'https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular-animate.min.js',
                    '<%=cfg.build%>/dist/angular-data-router.js'
                ]
            },
            api: {
                src: [
                    '<%=cfg.build%>/dist/angular-data-router.js',
                    '<%=cfg.src%>/docs/**/*.js'
                ],
                title: 'Angular Data Router Documentation'
            }
        },
        'gh-pages': {
            options: {
                base: 'docs'
            },
            src: ['**']
        },

        // Demo
        connect: {
            server: {
                options: {
                    hostname: 'localhost',
                    port: 9000
                }
            }
        },
        watch: {
            src: {
                files: ['<%=cfg.src%>/**/*.js'],
                tasks: ['javascript', 'jshint:test', 'ngdocs']
            },
            demo: {
                files: ['<%=cfg.demo%>/**/*.js'],
                tasks: ['jshint:demo']
            }
        }
    });

    // Private tasks
    grunt.registerTask('javascript', ['jshint:src', 'concat:router', 'concat:api', 'ngAnnotate:build', 'jshint:bundle', 'jsbeautifier:build', 'uglify:build', 'clean:tmp']);

    // Public tasks
    grunt.registerTask('default', ['jshint:grunt', 'clean:build', 'javascript', 'jshint:test', 'karma:default']);
    grunt.registerTask('debug', ['karma:debug']);
    grunt.registerTask('demo', ['jshint:demo', 'default', 'connect:server', 'watch']);

    grunt.registerTask('docs', ['jshint:grunt', 'clean:build', 'clean:docs', 'javascript', 'ngdocs', 'gh-pages']);
    grunt.registerTask('dist', ['default', 'clean:dist', 'copy:dist']);
    grunt.registerTask('release', ['git-is-clean', 'bump-only', 'dist', 'gitadd:dist', 'bump-commit', 'git-is-clean']);
};
<|endoftext|>


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

        sass: {
            options: {
                sourceMap: true,
                sourceMapEmbed: true,
                outputStyle: 'compressed'
            },
            dist: {
                files: {
                    'css/resizefly-admin.css': 'css/src/*.scss'
                }
            }
        },

        uglify: {
            dev: {
                options: {
                    mangle: false,
                    sourceMap: true,
                    // sourceMapIn: 'js/resizefly-admin.js.map',
                    banner: '(function ($) {',
                    footer: '\n})(jQuery);',
                    preserveComments: 'some'
                },
                files: {
                    'js/resizefly-admin.min.js': 'js/src/*.js'
                }
            },
            dist: {
                options: {
                    mangle: true,
                    preserveComments: 'some',
                    banner: '(function ($) {',
                    footer: '\n})(jQuery);',
                    compress: {
                        drop_console: true
                    }
                },
                files: {
                    'js/resizefly-admin.min.js': 'js/src/*.js'
                }
            }
        },

        pot: {
            admin: {
                options: {
                    text_domain: 'resizefly',
                    dest: 'languages/',
                    language: 'PHP',
                    encoding: 'utf-8',
                    keywords: [ //WordPress localisation functions
                        '__:1',
                        '_e:1',
                        '_x:1,2c',
                        'esc_html__:1',
                        'esc_html_e:1',
                        'esc_html_x:1,2c',
                        'esc_attr__:1',
                        'esc_attr_e:1',
                        'esc_attr_x:1,2c',
                        '_ex:1,2c',
                        '_n:1,2',
                        '_nx:1,2,4c',
                        '_n_noop:1,2',
                        '_nx_noop:1,2,3c'
                    ],
                    msgid_bugs_address: 'hi@resizefly.com'
                },
                files: [{
                    expand: true,
                    src: ['**/*.php', '!node_modules/**']
                }]
            }
        },

        'string-replace': {
            php: {
                files: [{
                    expand: true,
                    cwd: 'src/Common',
                    src: ['**/*.php'],
                    dest: 'src/Common',
                    filter: 'isFile'
                }],
                options: {
                    replacements: [
                        {
                            pattern: /namespace\s+?([^;]+);/,
                            replacement: 'namespace Alpipego\\Resizefly\\Common\\$1;'
                        },
                        {
                            pattern: /use\s+?([^;]+)(?=\\)([^;]+);/g,
                            replacement: 'use Alpipego\\Resizefly\\Common\\$1$2;'
                        }
                    ]
                }
            }
        },

        copy: {
            php: {
                files: [
                    {
                        expand: true,
                        cwd: 'vendor/pimple/pimple/src/Pimple',
                        src: ['**', '!**/Tests/**'],
                        dest: 'src/Common/Pimple'
                    },
                    {
                        expand: true,
                        cwd: 'vendor/psr/container/src',
                        src: '**',
                        dest: 'src/Common/Psr/Container'
                    },
                    {
                        src: 'vendor/composer/ClassLoader.php',
                        dest: 'src/Common/Composer/Autoload/ClassLoader.php'
                    }
                ]
            }
        },

        watch: {
            js: {
                files: ['Gruntfile.js', 'js/src/**/*.js'],
                tasks: 'uglify:dev'
            },
            sass: {
                files: ['Gruntfile.js', 'css/src/**/*.scss'],
                tasks: 'sass'
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-sass');
    grunt.loadNpmTasks('grunt-pot');
    grunt.loadNpmTasks('grunt-string-replace');
    grunt.loadNpmTasks('grunt-contrib-copy');

    grunt.registerTask('third-party', ['copy:php', 'string-replace:php']);
    grunt.registerTask('default', ['uglify:dev', 'sass', 'watch']);
    grunt.registerTask('build', ['pot', 'uglify:dist', 'sass']);
};
<commit_msg>minor task changes<commit_after>module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        sass: {
            options: {
                outputStyle: 'compressed'
            },
            dist: {
                files: {
                    'css/resizefly-admin.css': 'css/src/inc.scss'
                }
            }
        },

        uglify: {
            dev: {
                options: {
                    mangle: false,
                    sourceMap: true,
                    banner: '(function ($) {',
                    footer: '\n})(jQuery);',
                    preserveComments: 'some'
                },
                files: {
                    'js/resizefly-admin.min.js': 'js/src/*.js'
                }
            },
            dist: {
                options: {
                    mangle: true,
                    preserveComments: 'some',
                    banner: '(function ($) {',
                    footer: '\n})(jQuery);',
                    compress: {
                        drop_console: true
                    }
                },
                files: {
                    'js/resizefly-admin.min.js': 'js/src/*.js'
                }
            }
        },

        pot: {
            admin: {
                options: {
                    text_domain: 'resizefly',
                    dest: 'languages/',
                    language: 'PHP',
                    encoding: 'utf-8',
                    keywords: [ //WordPress localisation functions
                        '__:1',
                        '_e:1',
                        '_x:1,2c',
                        'esc_html__:1',
                        'esc_html_e:1',
                        'esc_html_x:1,2c',
                        'esc_attr__:1',
                        'esc_attr_e:1',
                        'esc_attr_x:1,2c',
                        '_ex:1,2c',
                        '_n:1,2',
                        '_nx:1,2,4c',
                        '_n_noop:1,2',
                        '_nx_noop:1,2,3c'
                    ],
                    msgid_bugs_address: 'hi@resizefly.com'
                },
                files: [{
                    expand: true,
                    src: ['**/*.php', '!node_modules/**']
                }]
            }
        },

        'string-replace': {
            php: {
                files: [{
                    expand: true,
                    cwd: 'src/Common',
                    src: ['**/*.php'],
                    dest: 'src/Common',
                    filter: 'isFile'
                }],
                options: {
                    replacements: [
                        {
                            pattern: /namespace\s+?([^;]+);/,
                            replacement: 'namespace Alpipego\\Resizefly\\Common\\$1;'
                        },
                        {
                            pattern: /use\s+?([^;]+)(?=\\)([^;]+);/g,
                            replacement: 'use Alpipego\\Resizefly\\Common\\$1$2;'
                        }
                    ]
                }
            }
        },

        copy: {
            php: {
                files: [
                    {
                        expand: true,
                        cwd: 'vendor/pimple/pimple/src/Pimple',
                        src: ['**', '!**/Tests/**'],
                        dest: 'src/Common/Pimple'
                    },
                    {
                        expand: true,
                        cwd: 'vendor/psr/container/src',
                        src: '**',
                        dest: 'src/Common/Psr/Container'
                    },
                    {
                        src: 'vendor/composer/ClassLoader.php',
                        dest: 'src/Common/Composer/Autoload/ClassLoader.php'
                    }
                ]
            }
        },

        watch: {
            js: {
                files: ['Gruntfile.js', 'js/src/**/*.js'],
                tasks: 'uglify:dev'
            },
            sass: {
                files: ['Gruntfile.js', 'css/src/**/*.scss'],
                tasks: 'sass'
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-sass');
    grunt.loadNpmTasks('grunt-pot');
    grunt.loadNpmTasks('grunt-string-replace');
    grunt.loadNpmTasks('grunt-contrib-copy');

    grunt.registerTask('third-party', ['copy:php', 'string-replace:php']);
    grunt.registerTask('default', ['uglify:dev', 'sass', 'watch']);
    grunt.registerTask('build', ['pot', 'uglify:dist', 'sass']);
};
<|endoftext|>


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

    require('load-grunt-tasks')(grunt);
    grunt.loadTasks('./build/tasks');
    require('time-grunt')(grunt);

    var devServer = require('./build/webpack/dev-server'),
        devBuildConfig = require('./build/webpack/dev.config'),
        prodBuildConfig = require('./build/webpack/dev.config'),
        jestConfig = grunt.file.readJSON('./build/jest/config.json'),
        jestCacheDir = jestConfig.cacheDirectory.replace(/<rootDir>\//, '');

    // Define the configuration for all the tasks
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        clean: {
            dist: {
                src: ['dist/*']
            }
        },

        copy: {

            build: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    }
                ]
            },

            release: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    },
                    {
                        cwd: 'dist/bundle/js',
                        expand: true,
                        src: ['*.js'],
                        dest: 'dist/bundle/js'
                    }
                ],
                options: {
                    process: function(content, srcpath) {

                        if (/\.js$/.test(srcpath)) {
                            return content.replace(
                            /(\w+)\.createClass\(\s*\{\s*displayName:\s*["'][A-Za-z]+["'],/g,
                            '$1.createClass({');
                        }
                    }
                }
            },

            server: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    },
                    {
                        cwd: '.',
                        expand: true,
                        src: ['mock/responses/**/*.json'],
                        dest: 'dist/bundle'
                    }
                ]
            }
        },

        htmlmin: {
            release: {
                options: {
                    removeComments: true,
                    collapseWhitespace: true
                },
                files: {
                    'dist/bundle/index.html': 'dist/bundle/index.html'
                }
            }
        },

        genTests: {
            all: {
                options: {
                    srcDir: 'src/js',
                    sampleTest: 'build/jest/Sample-test.jsx',
                    testEslintrc: 'build/jest/.eslintrc',
                    ignore: /.*src\/js\/((?:constants))\/[a-zA-Z]+\.jsx?/
                }
            }
        },

        flow: {
            options: {}
        },

        eslint: {
            source: {
                src: ['src/js/{,*/}*.{js,jsx}', '!src/js/{,*/}__tests__/*.js']
            },

            tests: {
                src: ['src/js/{,*/}__tests__/*.{js,jsx}', 'mock/{,*/}*.js'],
                options: {
                    globals: ['jest'],
                    envs: ['jasmine', 'amd', 'node', 'browser']
                }
            },

            scripts: {
                src: ['Gruntfile.js', 'build/{,*/}*.js'],
                options: {
                    configFile: 'build/.eslintrc'
                }
            }
        },

        jsonlint: {
            cfgfiles: {
                src: [
                    '.eslintrc',
                    'src/js/{,*/}__tests__/.eslintrc',
                    'build/**/*.json'
                ]
            }
        },

        jester: {
            all: {
                options: {
                    coverage: true,
                    config: 'build/jest/config.json',
                    testPathPattern: /.*-test\.jsx?/,
                    cacheDir: jestCacheDir
                }
            },

            smoke: {
                options: {
                    coverage: true,
                    config: 'build/jest/config.json',
                    testPathPattern: /.*-test\.jsx?/,
                    cacheDir: jestCacheDir,
                    smoke: true,
                    // useCache: false
                }
            }
        },

        webpack: {
            dev: devBuildConfig,
            build: prodBuildConfig
        },

        shell: {
            options: {
                failOnError: true
            },
            createGenDir: {
                command: 'mkdir -p ' + jestCacheDir
            }

        },

        watch: {
            html: {
                files: ['src/*.html'],
                tasks: ['copy:html']
            }
        }

    });

    grunt.registerTask('lint', [
        'jsonlint',
        'eslint'
    ]);

    grunt.registerTask('smoke', [
        'lint',
        'shell:createGenDir',
        'jester:smoke'
    ]);

    grunt.registerTask('test', [
        'lint',
        'shell:createGenDir',
        'jester:all'
    ]);

    grunt.registerTask('serve', 'Compile then start a connect web server',
        function() {
            grunt.task.run([
                'lint',
                'clean:dist',
                'copy:server',
                'watch:html'
            ]);

            devServer.start();
        }

    );

    grunt.registerTask('build', [
        'genTests',
        'test',
        'clean:dist',
        'webpack:build',
        'copy:build'
    ]);

    grunt.registerTask('release', [
        'test',
        'clean:dist',
        'webpack:build',
        'copy:release',
        'htmlmin'
    ]);

};
<commit_msg>Bring back `genTests` during build<commit_after>/* eslint-disable babel/object-shorthand */

module.exports = function(grunt) {

    require('load-grunt-tasks')(grunt);
    grunt.loadTasks('./build/tasks');
    require('time-grunt')(grunt);

    var devServer = require('./build/webpack/dev-server'),
        devBuildConfig = require('./build/webpack/dev.config'),
        prodBuildConfig = require('./build/webpack/dev.config'),
        jestConfig = grunt.file.readJSON('./build/jest/config.json'),
        jestCacheDir = jestConfig.cacheDirectory.replace(/<rootDir>\//, '');

    // Define the configuration for all the tasks
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        clean: {
            dist: {
                src: ['dist/*']
            }
        },

        copy: {

            build: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    }
                ]
            },

            release: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    },
                    {
                        cwd: 'dist/bundle/js',
                        expand: true,
                        src: ['*.js'],
                        dest: 'dist/bundle/js'
                    }
                ],
                options: {
                    process: function(content, srcpath) {

                        if (/\.js$/.test(srcpath)) {
                            return content.replace(
                            /(\w+)\.createClass\(\s*\{\s*displayName:\s*["'][A-Za-z]+["'],/g,
                            '$1.createClass({');
                        }
                    }
                }
            },

            server: {
                files: [
                    {
                        cwd: 'src',
                        expand: true,
                        src: ['index.html'],
                        dest: 'dist/bundle/'
                    },
                    {
                        cwd: '.',
                        expand: true,
                        src: ['mock/responses/**/*.json'],
                        dest: 'dist/bundle'
                    }
                ]
            }
        },

        htmlmin: {
            release: {
                options: {
                    removeComments: true,
                    collapseWhitespace: true
                },
                files: {
                    'dist/bundle/index.html': 'dist/bundle/index.html'
                }
            }
        },

        genTests: {
            all: {
                options: {
                    srcDir: 'src/js',
                    sampleTest: 'build/jest/Sample-test.jsx',
                    testEslintrc: 'build/jest/.eslintrc',
                    ignore: /.*src\/js\/((?:constants))\/[a-zA-Z]+\.jsx?/
                }
            }
        },

        flow: {
            options: {}
        },

        eslint: {
            source: {
                src: ['src/js/{,*/}*.{js,jsx}', '!src/js/{,*/}__tests__/*.js']
            },

            tests: {
                src: ['src/js/{,*/}__tests__/*.{js,jsx}', 'mock/{,*/}*.js'],
                options: {
                    globals: ['jest'],
                    envs: ['jasmine', 'amd', 'node', 'browser']
                }
            },

            scripts: {
                src: ['Gruntfile.js', 'build/{,*/}*.js'],
                options: {
                    configFile: 'build/.eslintrc'
                }
            }
        },

        jsonlint: {
            cfgfiles: {
                src: [
                    '.eslintrc',
                    'src/js/{,*/}__tests__/.eslintrc',
                    'build/**/*.json'
                ]
            }
        },

        jester: {
            all: {
                options: {
                    coverage: true,
                    config: 'build/jest/config.json',
                    testPathPattern: /.*-test\.jsx?/,
                    cacheDir: jestCacheDir
                }
            },

            smoke: {
                options: {
                    coverage: true,
                    config: 'build/jest/config.json',
                    testPathPattern: /.*-test\.jsx?/,
                    cacheDir: jestCacheDir,
                    smoke: true,
                    // useCache: false
                }
            }
        },

        webpack: {
            dev: devBuildConfig,
            build: prodBuildConfig
        },

        shell: {
            options: {
                failOnError: true
            },
            createGenDir: {
                command: 'mkdir -p ' + jestCacheDir
            }

        },

        watch: {
            html: {
                files: ['src/*.html'],
                tasks: ['copy:html']
            }
        }

    });

    grunt.registerTask('lint', [
        'jsonlint',
        'eslint'
    ]);

    grunt.registerTask('smoke', [
        'lint',
        'shell:createGenDir',
        'jester:smoke'
    ]);

    grunt.registerTask('test', [
        'lint',
        'shell:createGenDir',
        'jester:all'
    ]);

    grunt.registerTask('serve', 'Compile then start a connect web server',
        function() {
            grunt.task.run([
                'lint',
                'clean:dist',
                'copy:server',
                'watch:html'
            ]);

            devServer.start();
        }

    );

    grunt.registerTask('build', [
        // 'genTests',
        'test',
        'clean:dist',
        'webpack:build',
        'copy:build'
    ]);

    grunt.registerTask('release', [
        'test',
        'clean:dist',
        'webpack:build',
        'copy:release',
        'htmlmin'
    ]);

};
<|endoftext|>


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

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            main: {
                files: [
                    {
                        src: 'src/<%= pkg.name %>.js',
                        dest: 'build/<%= pkg.name %>.js'
                    }
                ]
            }
        },
        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
                preserveComments: 'some'
            },
            build: {
                src: 'src/<%= pkg.name %>.js',
                dest: 'build/<%= pkg.name %>.min.js'
            }
        },
        jshint: {
            all: [
                'Gruntfile.js',
                'src/**/*.js',
                'test/**/*.js'
            ],
            options: {
                jshintrc: '.jshintrc'
            }
        },
        karma: {
            options: {
                configFile: 'karma.conf.js'
            },
            tdd: {
                options: {
                    background: true,
                    singleRun: false
                }
            },
            ci: {
                options: {
                    background: false,
                    singleRun: true
                }
            }
        },
        bump: {
            options: {
                files: [ 'package.json', 'bower.json' ],
                commitFiles: [ 'package.json', 'bower.json' ],
                pushTo: "origin"
            }
        },
        watch: {
            js: {
                files: [ '**/*.js', '!node_modules/**/*.js' ],
                tasks: [ 'tdd_rerun' ],
                options: {
                    nospawn: true
                }
            }
        },
        bower: {
            install: {
                options: {
                    copy: false
                }
            }
        },
        vanilli: {
            options: {
                port: 14000,
                logLevel: "info"
            },
            start: {},
            stop: {}
        }
    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-bower-task');
    grunt.loadNpmTasks('grunt-vanilli');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-bump');
    grunt.loadNpmTasks('grunt-bunyan');

    grunt.registerTask('tdd', [ 'jshint', 'karma:tdd:start', 'watch' ]);
    grunt.registerTask('tdd_rerun', [ 'jshint', 'karma:tdd:run' ]);

    grunt.registerTask('build', [ 'jshint', 'bunyan', 'vanilli:start', 'karma:ci', 'vanilli:stop', 'uglify', 'copy' ]);
    grunt.registerTask('ci', [ 'bower', 'build' ]);

    grunt.registerTask('default', [ 'build' ]);
};
<commit_msg>Added 'release' task.<commit_after>/*globals module*/
module.exports = function (grunt) {
    "use strict";

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            main: {
                files: [
                    {
                        src: 'src/<%= pkg.name %>.js',
                        dest: 'build/<%= pkg.name %>.js'
                    }
                ]
            }
        },
        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
                preserveComments: 'some'
            },
            build: {
                src: 'src/<%= pkg.name %>.js',
                dest: 'build/<%= pkg.name %>.min.js'
            }
        },
        jshint: {
            all: [
                'Gruntfile.js',
                'src/**/*.js',
                'test/**/*.js'
            ],
            options: {
                jshintrc: '.jshintrc'
            }
        },
        karma: {
            options: {
                configFile: 'karma.conf.js'
            },
            tdd: {
                options: {
                    background: true,
                    singleRun: false
                }
            },
            ci: {
                options: {
                    background: false,
                    singleRun: true
                }
            }
        },
        bump: {
            options: {
                files: [ 'package.json', 'bower.json' ],
                commitFiles: [ 'package.json', 'bower.json' ],
                pushTo: "origin"
            }
        },
        watch: {
            js: {
                files: [ '**/*.js', '!node_modules/**/*.js' ],
                tasks: [ 'tdd_rerun' ],
                options: {
                    nospawn: true
                }
            }
        },
        bower: {
            install: {
                options: {
                    copy: false
                }
            }
        },
        vanilli: {
            options: {
                port: 14000,
                logLevel: "info"
            },
            start: {},
            stop: {}
        }
    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-bower-task');
    grunt.loadNpmTasks('grunt-vanilli');
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-bump');
    grunt.loadNpmTasks('grunt-bunyan');

    grunt.registerTask('tdd', [ 'jshint', 'karma:tdd:start', 'watch' ]);
    grunt.registerTask('tdd_rerun', [ 'jshint', 'karma:tdd:run' ]);

    grunt.registerTask('build', [ 'jshint', 'bunyan', 'vanilli:start', 'karma:ci', 'vanilli:stop', 'uglify', 'copy' ]);
    grunt.registerTask('ci', [ 'bower', 'build' ]);
    grunt.registerTask('release' [ 'build', 'bump' ]);

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


<commit_before>var exec = require('child_process').exec,
	path = require('path');

module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		manifest: grunt.file.readJSON('extension/manifest.json'),

		jshint: {
			extension: [
				'Gruntfile.js',
				'extension/js/**/*.js',
				'!extension/js/templates/**'
			]
		},

		clean: {
			build: ['build'],
			assets: [
				'extension/pages',
				'extension/styles',
				'extension/vendor'
			]
		},

		zip: {
			// zip for uploading to Google Web Store Dashboard
			chrome: {
				router: function (filepath) {
					var filename = path.basename(filepath);

					return filename === 'key.pem' ? 'extension/key.pem' : filepath;
				},

				src: ['extension/**', 'key.pem'],
				dest: 'build/chime.zip'
			},

			extension: {
				cwd: 'extension/',
				src: ['extension/**'],
				dest: 'build/chime.crx.zip'
			}
		},

		crx: {
			extension: {
				src: 'build/chime.crx.zip',
				dest: 'build/chime.crx'
			}
		},

		stylus: {
			styles: {
				files: [{
					expand: true,
					src: '**/*.styl',
					dest: 'extension/styles',
					cwd: 'src/styles',
					ext: '.css'
				}]
			}
		},

		jade: {
			pages: {
				files: [{
					expand: true,
					src: '**/*.jade',
					dest: 'extension/pages',
					cwd: 'src/pages',
					ext: '.html'
				}]
			},

			templates: {
				files: {
					'extension/js/templates/options.js': ['src/templates/options/**/*.jade'],
					'extension/js/templates/content.js': ['src/templates/content/**/*.jade']
				},
				options: {
					client: true,
					amd: true,
					processName: function (name) {
						return path.basename(name, '.jade');
					}
				}
			}
		},

		watch: {
			stylus: {
				files: ['src/styles/**/*.styl'],
				tasks: ['stylus:styles'],
				options: {
					atBegin: true
				}
			},

			pages: {
				files: ['src/pages/**/*.jade', 'src/includes/**/*.jade'],
				tasks: ['jade:pages'],
				options: {
					atBegin: true
				}
			},

			templates: {
				files: ['src/templates/**/*.jade'],
				tasks: ['jade:templates'],
				options: {
					atBegin: true
				}
			}
		},

		bower: {
			install: {
				options: {
					targetDir: './extension/vendor/',
					layout: 'byComponent',
					install: true,
					cleanup: true,
					bowerOptions: {}
				}
			}
		},

		concurrent: {
			watch: {
				tasks: ['watch:stylus', 'watch:pages', 'watch:templates'],
				options: {
					logConcurrentOutput: true
				}
			}
		},

		bump: {
			options: {
				files: [
					'package.json',
					'bower.json',
					'extension/manifest.json'
				],
				pushTo: 'origin',
				commitFiles: ['-a']
			}
		}
	});

	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-jade');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-bump');
	grunt.loadNpmTasks('grunt-bower-task');
	grunt.loadNpmTasks('grunt-concurrent');
	grunt.loadNpmTasks('grunt-zip');
	grunt.loadNpmTasks('grunt-crx');

	grunt.registerTask('check', function () {
		if (grunt.file.exists('key.pem')) {
			grunt.log.ok();
		} else {
			grunt.fail.fatal('File key.pem not found. ');
		}
	});

	grunt.registerTask('test', ['jshint']);
	grunt.registerTask('assets', ['clean:assets', 'bower:install', 'jade:pages', 'jade:templates', 'stylus:styles']);
	grunt.registerTask('prepare', ['clean:build', 'check', 'assets', 'test']);

	grunt.registerTask('crx-extension', ['prepare', 'zip:extension', 'crx:extension']);
	grunt.registerTask('chrome-extension', ['prepare', 'zip:chrome']);

	grunt.registerTask('default', ['chrome-extension']);
};
<commit_msg>Minor improvements<commit_after>var exec = require('child_process').exec,
	path = require('path');

module.exports = function(grunt) {
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		manifest: grunt.file.readJSON('extension/manifest.json'),

		jshint: {
			extension: [
				'Gruntfile.js',
				'extension/js/**/*.js',
				'!extension/js/templates/**'
			]
		},

		clean: {
			build: ['build'],
			assets: [
				'extension/pages',
				'extension/styles',
				'extension/vendor',
				'extension/js/templates'
			]
		},

		zip: {
			// zip for uploading to Google Web Store Dashboard
			chrome: {
				router: function (filepath) {
					var filename = path.basename(filepath);

					return filename === 'key.pem' ? 'extension/key.pem' : filepath;
				},

				src: ['extension/**', 'key.pem'],
				dest: 'build/chime.zip'
			},

			extension: {
				cwd: 'extension/',
				src: ['extension/**'],
				dest: 'build/chime.crx.zip'
			}
		},

		crx: {
			extension: {
				src: 'build/chime.crx.zip',
				dest: 'build/chime.crx'
			}
		},

		stylus: {
			styles: {
				files: [{
					expand: true,
					src: '**/*.styl',
					dest: 'extension/styles',
					cwd: 'src/styles',
					ext: '.css'
				}]
			}
		},

		jade: {
			pages: {
				files: [{
					expand: true,
					src: '**/*.jade',
					dest: 'extension/pages',
					cwd: 'src/pages',
					ext: '.html'
				}]
			},

			templates: {
				files: {
					'extension/js/templates/options.js': ['src/templates/options/**/*.jade'],
					'extension/js/templates/content.js': ['src/templates/content/**/*.jade']
				},
				options: {
					client: true,
					amd: true,
					processName: function (name) {
						return path.basename(name, '.jade');
					}
				}
			}
		},

		watch: {
			stylus: {
				files: ['src/styles/**/*.styl'],
				tasks: ['stylus:styles'],
				options: {
					atBegin: true
				}
			},

			pages: {
				files: ['src/pages/**/*.jade', 'src/includes/**/*.jade'],
				tasks: ['jade:pages'],
				options: {
					atBegin: true
				}
			},

			templates: {
				files: ['src/templates/**/*.jade'],
				tasks: ['jade:templates'],
				options: {
					atBegin: true
				}
			}
		},

		bower: {
			install: {
				options: {
					targetDir: './extension/vendor/',
					layout: 'byComponent',
					install: true,
					cleanup: true,
					bowerOptions: {}
				}
			}
		},

		concurrent: {
			watch: {
				tasks: ['watch:stylus', 'watch:pages', 'watch:templates'],
				options: {
					logConcurrentOutput: true
				}
			}
		},

		bump: {
			options: {
				files: [
					'package.json',
					'bower.json',
					'extension/manifest.json'
				],
				pushTo: 'origin',
				commitFiles: ['-a']
			}
		}
	});

	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-stylus');
	grunt.loadNpmTasks('grunt-contrib-jade');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-bump');
	grunt.loadNpmTasks('grunt-bower-task');
	grunt.loadNpmTasks('grunt-concurrent');
	grunt.loadNpmTasks('grunt-zip');
	grunt.loadNpmTasks('grunt-crx');

	grunt.registerTask('check', function () {
		if (grunt.file.exists('key.pem')) {
			grunt.log.ok();
		} else {
			grunt.fail.fatal('File key.pem not found. ');
		}
	});

	grunt.registerTask('test', ['jshint']);
	grunt.registerTask('assets', ['clean:assets', 'bower:install', 'jade:pages', 'jade:templates', 'stylus:styles']);
	grunt.registerTask('prepare', ['clean:build', 'check', 'assets', 'test']);

	grunt.registerTask('crx-extension', ['prepare', 'zip:extension', 'crx:extension']);
	grunt.registerTask('chrome-extension', ['prepare', 'zip:chrome']);

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