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

var extend = require( 'extend' );
var glob   = require( 'glob' );

var jshintrc = JSON.parse( fs.readFileSync('./.jshintrc').toString() );

// Base paths used by the tasks.
// They always have to finish with a '/'.
//
var SOURCE_PATH = 'sources/';
var BUILD_PATH   = 'builds/';
var DIST_PATH   = BUILD_PATH+'dist/';
var UTILS_PATH  = 'tools/build/';

// Utility functions
//
var find = function ( cwd, pattern ) {

    if ( typeof pattern === 'undefined' ) {
        pattern = cwd;
        cwd = undefined;
    }

    var isEntity = function ( pathname ) {
        if ( cwd ) pathname = path.join( cwd, pathname );
        return ! fs.lstatSync( pathname ).isDirectory( ); };

    var options = { };

    if ( cwd )
        options.cwd = cwd;

    return glob.sync( pattern, options ).filter( isEntity );

};

// get source file once and for all, caching results.
var srcFiles =  find( SOURCE_PATH, '**/*.js' ).map( function ( pathname ) { return pathname; } );

// Used to store all Grunt tasks
//
var gruntTasks = { };

// ## Top-level configurations
//
( function () {

//lint
    gruntTasks.jshint = {
        options: jshintrc
    };

//build/bundle
    gruntTasks.copy = {
        options: {}
    };

    gruntTasks.uglify = {
        options: {}
    };

    gruntTasks.requirejs = {
        options: {
            //optimize : 'uglify2',
            optimize: 'none',
            preserveLicenseComments: false,

            findNestedDependencies: true,
            optimizeAllPluginResources: true,

            baseUrl: SOURCE_PATH
        }
    };

    gruntTasks.clean = {
        options: {}
    };

    gruntTasks.requirejsconfiguration = {
        options: {}
    };

    gruntTasks.watch = {
        options: {}
    };

// docs
    gruntTasks.plato = {};

    gruntTasks.docco = {};

//tests
    gruntTasks.qunit = {};

    gruntTasks.connect = {};

// static website
    gruntTasks.gitclone = {};
    gruntTasks.gitpush = {};
    gruntTasks.shell = {};
    gruntTasks.gitcommit= {};

    gruntTasks.wintersmith= {};
    // duck the camel. (case)
	gruntTasks[ 'wintersmith_compile' ] = gruntTasks.wintersmith;

} )();

// ## JSHint
//
// Will check the Gruntfile and every "*.js" file in the "statics/sources/" folder.
//
( function ( ) {

    gruntTasks.jshint.self = {
        options : { node : true },
        src : [ 'Gruntfile.js' ] };

    gruntTasks.jshint.sources = {
        options : { globals : { define : true, require : true }
                  },
        src : srcFiles.map( function ( pathname ) {
            return path.join( SOURCE_PATH, pathname ); } ) };

    // add another output from envvar to have better error tracking in emacs
    if ( process.env.GRUNT_EMACS_REPORTER !== undefined ) {
        gruntTasks.jshint.sources.options.reporter = process.env.GRUNT_EMACS_REPORTER;
    }

} )( );

// ## Watch

( function ( ) {

    gruntTasks.watch.src = {
        files: [
            'sources/*.js',
            'sources/**/*.js'
        ],
        tasks: [ 'build:sources' ]
    };

} )();

// ## Require.js
//
( function ( ) {

    gruntTasks.requirejs.distSources = { options : {
        name : path.join( path.relative( SOURCE_PATH, UTILS_PATH ), 'almond' ),
        out : path.join( DIST_PATH, 'OSG.js' ),
        include : [ 'OSG' ],
        paths: {
            'Q': 'vendors/Q',
            'Hammer': 'vendors/Hammer',
            'Leap': 'vendors/Leap',
            'vr': 'vendors/vr'
        },
        wrap : {
            startFile : path.join( UTILS_PATH, 'wrap.start' ),
            endFile : path.join( UTILS_PATH, 'wrap.end' ) } } };

} )( );

// ## Clean
//
( function ( ) {

    gruntTasks.clean.distAfterSourcesRjs = {
        src : [ path.join( DIST_PATH, 'build.txt' ) ] };

    gruntTasks.clean.staticWeb = {
        src : [ path.join( BUILD_PATH, 'web' ) ] };

} )( );

// ## Docco
//
( function ( ) {

    // generate a requirejs without anything to build a docco docs
    gruntTasks.requirejs.docsSources = { options : {
        out : path.join( BUILD_PATH, 'docs/OSG.js' ),
        include : [ 'OSG' ],
        paths: {
            'Q': 'vendors/Q',
            'Hammer': 'vendors/Hammer',
            'Leap': 'vendors/Leap',
            'vr': 'vendors/vr'
        }
    } };

    gruntTasks.docco = {
        singleDoc: {
            src: path.join( BUILD_PATH, 'docs/OSG.js' ),
            //src:  find( SOURCE_PATH, '**/*.js' ).map( function ( path ) { return path.join( SOURCE_PATH, path ); } ),
            options: {
                output: 'docs/annotated-source'
            }
        },
        docs: {
            src:  srcFiles.map( function ( pathname ) { return path.join( SOURCE_PATH, pathname ); } ),
            options: {
                layout: 'classic',
                output: 'docs/annotated-source'
            }
        }
    };

} )( );

// ## Plato
( function () {
    gruntTasks.plato = {
        options: {
            // Task-specific options go here.
        },
        main: {
            files: {
                'docs/analysis': srcFiles.map( function ( pathname ) {
                    return path.join( SOURCE_PATH, pathname ); } )
            }
        }
    };
} ) ();

// ## Qunit and connect
//
( function ( ) {

    // qunit using connect
    gruntTasks.qunit = {
        all: {
            options: {
                urls: [
                    'http://localhost:9001/tests/index.html'
                ]
            }
	}
    };

    // will start a server on port 9001 with root directory at the same level of
    // the grunt file
    gruntTasks.connect = {
        server: {
            options: {
                port: 9001,
                base: '.'
            }
        }
    };

} )( );

// ## Symlinks
// (explicit because windows)
( function ( ) {

    gruntTasks.symlink = {
       // Enable overwrite to delete symlinks before recreating them
       options: {
         overwrite: false
        },
        Hammer: {
            src: 'examples/vendors/Hammer-1.0.5.js',
            dest: 'examples/vendors/Hammer.js'
        },
        Require: {
            src: 'examples/vendors/Require-2.1.11.js',
            dest: 'examples/vendors/Require.js'
        },
        RequireText: {
            src: 'examples/vendors/require/Text-2.0.12.js',
            dest: 'examples/vendors/require/Text.js'
        },
        Q: {
            src: 'examples/vendors/Q-0.9.7.js',
            dest: 'examples/vendors/Q.js'
        },
        active: {
            src: DIST_PATH,
            dest: path.join( BUILD_PATH, 'active' )
        }
    };

} )( );

// ## WinterSmith:
// (static site gen for osgjs.org)
( function ( ) {

    gruntTasks.wintersmith = {
        build: {
            options: {
              config: './website/web/config.json',
              output: path.join( BUILD_PATH, 'web' )
            }
        },
        preview: {
            options: {
              action: 'preview',
              config: './website/web/config.json',
              output: path.join( BUILD_PATH, 'web' )
            }
        }
    };

} )( );

( function ( ) {
    gruntTasks.copy = {
        staticWeb: {
            files: [
              {expand: true, src: ['sources/**'], dest: path.join( BUILD_PATH, 'web/' )},
              {expand: true, src: ['docs/**'], dest: path.join( BUILD_PATH, 'web/' ) },
              {expand: true, src: ['examples/**'], dest: path.join( BUILD_PATH, 'web/' ) },
              {expand: true, src: ['tests/**'], dest: path.join( BUILD_PATH, 'web/' ) },
              {expand: true, cwd: 'builds', src: ['dist/**'], dest: path.join( BUILD_PATH, 'web/builds/' ) },
              {expand: true, cwd: 'builds', src: ['active/**'], dest: path.join( BUILD_PATH, 'web/builds/' ) }
            ]
          }
    };
} )( );

// ## git:
// (static site upload)
( function ( ) {
//git clone -b my-branch git@github.com:user/myproject.git
    gruntTasks.gitclone = {
        staticWeb: {
          options: {
            branch: 'gh-pages',
            repository: '../osgjs_refactore',
            directory: path.join( BUILD_PATH, 'web' )
            //, depth: -1 // cannot push from a shallow clone
          }
        }
    };

    // missing add --all
    gruntTasks.shell =  {
        staticWeb: {
            options: {
                execOptions: {
                    cwd: path.join( BUILD_PATH, 'web' )
                }
            },
            command: 'git add -A -v'
        }
    };

    gruntTasks.gitcommit = {
        staticWeb: {
          options: {
            branch: 'gh-pages',
            repository: '../osgjs_refactore',
            message: 'website update to latest develop'
          }
        },
        files: {
            src: ''
        }
    };

    gruntTasks.gitpush = {
        staticWeb: {
          options: {
            branch: 'gh-pages',
            repository: '../osgjs_refactore',
          }
        }
    };

} )( );

module.exports = function ( grunt ) {

    grunt.initConfig( extend( {
        pkg : grunt.file.readJSON( 'package.json' )
    }, gruntTasks ) );

    // grunt.event.on('qunit.testStart', function (name) {
    //     grunt.log.ok("Running test: " + name);
    // });

    // grunt.event.on('qunit.log', function (result, actual, expected, message, source) {
    //     if ( !result ) {
    //         if ( expected !== undefined ) {
    //             grunt.log.error('failed ' + message + ' ' + source );
    //         } else {
    //             grunt.log.error('actual: ' + actual + ' expected: ' + expected + ' ,failed ' + message );
    //         }
    //     }
    // });

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

    grunt.loadNpmTasks( 'grunt-docco' );
    grunt.loadNpmTasks( 'grunt-plato' );
    grunt.loadNpmTasks( 'grunt-contrib-jshint' );
    grunt.loadNpmTasks( 'grunt-contrib-copy' );
    grunt.loadNpmTasks( 'grunt-contrib-requirejs' );
    grunt.loadNpmTasks( 'grunt-contrib-clean' );
    grunt.loadNpmTasks( 'grunt-contrib-watch' );
    // windows
    grunt.loadNpmTasks( 'grunt-contrib-symlink' );
    //static site
    grunt.loadNpmTasks( 'grunt-wintersmith-compile' );
    grunt.loadNpmTasks( 'grunt-git' );
    grunt.loadNpmTasks( 'grunt-shell' );

    grunt.registerTask( 'check', [ 'jshint:self', 'jshint:sources' ] );

    grunt.registerTask( 'test', [ 'connect:server', 'qunit:all' ] );

    grunt.registerTask( 'docs', [ 'requirejs:docsSources', 'docco' ] );

    grunt.registerTask( 'build:sources:dist', [ 'requirejs:distSources', 'clean:distAfterSourcesRjs' ] );
    grunt.registerTask( 'build:sources', [ 'build:sources:dist' ] );

    grunt.registerTask( 'build:dist', [ 'build:sources:dist' ] );
    grunt.registerTask( 'build', [ 'symlink', 'build:dist' ] );

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

    grunt.registerTask( 'website_only', [ 'copy:staticWeb', 'clean:staticWeb', 'gitclone:staticWeb', 'wintersmith:build', 'shell:staticWeb', 'gitcommit:staticWeb', 'gitpush:staticWeb' ] );
    grunt.registerTask( 'website', [ 'default', 'docs', 'website_only' ] );
};
<commit_msg>Enlarges Qunit Timeout<commit_after>var fs     = require( 'fs' );
var path   = require( 'path' );

var extend = require( 'extend' );
var glob   = require( 'glob' );

var jshintrc = JSON.parse( fs.readFileSync('./.jshintrc').toString() );

// Base paths used by the tasks.
// They always have to finish with a '/'.
//
var SOURCE_PATH = 'sources/';
var BUILD_PATH   = 'builds/';
var DIST_PATH   = BUILD_PATH+'dist/';
var UTILS_PATH  = 'tools/build/';

// Utility functions
//
var find = function ( cwd, pattern ) {

    if ( typeof pattern === 'undefined' ) {
        pattern = cwd;
        cwd = undefined;
    }

    var isEntity = function ( pathname ) {
        if ( cwd ) pathname = path.join( cwd, pathname );
        return ! fs.lstatSync( pathname ).isDirectory( ); };

    var options = { };

    if ( cwd )
        options.cwd = cwd;

    return glob.sync( pattern, options ).filter( isEntity );

};

// get source file once and for all, caching results.
var srcFiles =  find( SOURCE_PATH, '**/*.js' ).map( function ( pathname ) { return pathname; } );

// Used to store all Grunt tasks
//
var gruntTasks = { };

// ## Top-level configurations
//
( function () {

//lint
    gruntTasks.jshint = {
        options: jshintrc
    };

//build/bundle
    gruntTasks.copy = {
        options: {}
    };

    gruntTasks.uglify = {
        options: {}
    };

    gruntTasks.requirejs = {
        options: {
            //optimize : 'uglify2',
            optimize: 'none',
            preserveLicenseComments: false,

            findNestedDependencies: true,
            optimizeAllPluginResources: true,

            baseUrl: SOURCE_PATH
        }
    };

    gruntTasks.clean = {
        options: {}
    };

    gruntTasks.requirejsconfiguration = {
        options: {}
    };

    gruntTasks.watch = {
        options: {}
    };

// docs
    gruntTasks.plato = {};

    gruntTasks.docco = {};

//tests
    gruntTasks.qunit = {};

    gruntTasks.connect = {};

// static website
    gruntTasks.gitclone = {};
    gruntTasks.gitpush = {};
    gruntTasks.shell = {};
    gruntTasks.gitcommit= {};

    gruntTasks.wintersmith= {};
    // duck the camel. (case)
	gruntTasks[ 'wintersmith_compile' ] = gruntTasks.wintersmith;

} )();

// ## JSHint
//
// Will check the Gruntfile and every "*.js" file in the "statics/sources/" folder.
//
( function ( ) {

    gruntTasks.jshint.self = {
        options : { node : true },
        src : [ 'Gruntfile.js' ] };

    gruntTasks.jshint.sources = {
        options : { globals : { define : true, require : true }
                  },
        src : srcFiles.map( function ( pathname ) {
            return path.join( SOURCE_PATH, pathname ); } ) };

    // add another output from envvar to have better error tracking in emacs
    if ( process.env.GRUNT_EMACS_REPORTER !== undefined ) {
        gruntTasks.jshint.sources.options.reporter = process.env.GRUNT_EMACS_REPORTER;
    }

} )( );

// ## Watch

( function ( ) {

    gruntTasks.watch.src = {
        files: [
            'sources/*.js',
            'sources/**/*.js'
        ],
        tasks: [ 'build:sources' ]
    };

} )();

// ## Require.js
//
( function ( ) {

    gruntTasks.requirejs.distSources = { options : {
        name : path.join( path.relative( SOURCE_PATH, UTILS_PATH ), 'almond' ),
        out : path.join( DIST_PATH, 'OSG.js' ),
        include : [ 'OSG' ],
        paths: {
            'Q': 'vendors/Q',
            'Hammer': 'vendors/Hammer',
            'Leap': 'vendors/Leap',
            'vr': 'vendors/vr'
        },
        wrap : {
            startFile : path.join( UTILS_PATH, 'wrap.start' ),
            endFile : path.join( UTILS_PATH, 'wrap.end' ) } } };

} )( );

// ## Clean
//
( function ( ) {

    gruntTasks.clean.distAfterSourcesRjs = {
        src : [ path.join( DIST_PATH, 'build.txt' ) ] };

    gruntTasks.clean.staticWeb = {
        src : [ path.join( BUILD_PATH, 'web' ) ] };

} )( );

// ## Docco
//
( function ( ) {

    // generate a requirejs without anything to build a docco docs
    gruntTasks.requirejs.docsSources = { options : {
        out : path.join( BUILD_PATH, 'docs/OSG.js' ),
        include : [ 'OSG' ],
        paths: {
            'Q': 'vendors/Q',
            'Hammer': 'vendors/Hammer',
            'Leap': 'vendors/Leap',
            'vr': 'vendors/vr'
        }
    } };

    gruntTasks.docco = {
        singleDoc: {
            src: path.join( BUILD_PATH, 'docs/OSG.js' ),
            //src:  find( SOURCE_PATH, '**/*.js' ).map( function ( path ) { return path.join( SOURCE_PATH, path ); } ),
            options: {
                output: 'docs/annotated-source'
            }
        },
        docs: {
            src:  srcFiles.map( function ( pathname ) { return path.join( SOURCE_PATH, pathname ); } ),
            options: {
                layout: 'classic',
                output: 'docs/annotated-source'
            }
        }
    };

} )( );

// ## Plato
( function () {
    gruntTasks.plato = {
        options: {
            // Task-specific options go here.
        },
        main: {
            files: {
                'docs/analysis': srcFiles.map( function ( pathname ) {
                    return path.join( SOURCE_PATH, pathname ); } )
            }
        }
    };
} ) ();

// ## Qunit and connect
//
( function ( ) {

    // qunit using connect
    gruntTasks.qunit = {
        all: {
            options: {
                timeout: 10000,
                urls: [
                    'http://localhost:9001/tests/index.html'
                ]
            }
	}
    };

    // will start a server on port 9001 with root directory at the same level of
    // the grunt file
    gruntTasks.connect = {
        server: {
            options: {
                port: 9001,
                base: '.'
            }
        }
    };

} )( );

// ## Symlinks
// (explicit because windows)
( function ( ) {

    gruntTasks.symlink = {
       // Enable overwrite to delete symlinks before recreating them
       options: {
         overwrite: false
        },
        Hammer: {
            src: 'examples/vendors/Hammer-1.0.5.js',
            dest: 'examples/vendors/Hammer.js'
        },
        Require: {
            src: 'examples/vendors/Require-2.1.11.js',
            dest: 'examples/vendors/Require.js'
        },
        RequireText: {
            src: 'examples/vendors/require/Text-2.0.12.js',
            dest: 'examples/vendors/require/Text.js'
        },
        Q: {
            src: 'examples/vendors/Q-0.9.7.js',
            dest: 'examples/vendors/Q.js'
        },
        active: {
            src: DIST_PATH,
            dest: path.join( BUILD_PATH, 'active' )
        }
    };

} )( );

// ## WinterSmith:
// (static site gen for osgjs.org)
( function ( ) {

    gruntTasks.wintersmith = {
        build: {
            options: {
              config: './website/web/config.json',
              output: path.join( BUILD_PATH, 'web' )
            }
        },
        preview: {
            options: {
              action: 'preview',
              config: './website/web/config.json',
              output: path.join( BUILD_PATH, 'web' )
            }
        }
    };

} )( );

( function ( ) {
    gruntTasks.copy = {
        staticWeb: {
            files: [
              {expand: true, src: ['sources/**'], dest: path.join( BUILD_PATH, 'web/' )},
              {expand: true, src: ['docs/**'], dest: path.join( BUILD_PATH, 'web/' ) },
              {expand: true, src: ['examples/**'], dest: path.join( BUILD_PATH, 'web/' ) },
              {expand: true, src: ['tests/**'], dest: path.join( BUILD_PATH, 'web/' ) },
              {expand: true, cwd: 'builds', src: ['dist/**'], dest: path.join( BUILD_PATH, 'web/builds/' ) },
              {expand: true, cwd: 'builds', src: ['active/**'], dest: path.join( BUILD_PATH, 'web/builds/' ) }
            ]
          }
    };
} )( );

// ## git:
// (static site upload)
( function ( ) {
//git clone -b my-branch git@github.com:user/myproject.git
    gruntTasks.gitclone = {
        staticWeb: {
          options: {
            branch: 'gh-pages',
            repository: '../osgjs_refactore',
            directory: path.join( BUILD_PATH, 'web' )
            //, depth: -1 // cannot push from a shallow clone
          }
        }
    };

    // missing add --all
    gruntTasks.shell =  {
        staticWeb: {
            options: {
                execOptions: {
                    cwd: path.join( BUILD_PATH, 'web' )
                }
            },
            command: 'git add -A -v'
        }
    };

    gruntTasks.gitcommit = {
        staticWeb: {
          options: {
            branch: 'gh-pages',
            repository: '../osgjs_refactore',
            message: 'website update to latest develop'
          }
        },
        files: {
            src: ''
        }
    };

    gruntTasks.gitpush = {
        staticWeb: {
          options: {
            branch: 'gh-pages',
            repository: '../osgjs_refactore',
          }
        }
    };

} )( );

module.exports = function ( grunt ) {

    grunt.initConfig( extend( {
        pkg : grunt.file.readJSON( 'package.json' )
    }, gruntTasks ) );

    // grunt.event.on('qunit.testStart', function (name) {
    //     grunt.log.ok("Running test: " + name);
    // });

    // grunt.event.on('qunit.log', function (result, actual, expected, message, source) {
    //     if ( !result ) {
    //         if ( expected !== undefined ) {
    //             grunt.log.error('failed ' + message + ' ' + source );
    //         } else {
    //             grunt.log.error('actual: ' + actual + ' expected: ' + expected + ' ,failed ' + message );
    //         }
    //     }
    // });

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

    grunt.loadNpmTasks( 'grunt-docco' );
    grunt.loadNpmTasks( 'grunt-plato' );
    grunt.loadNpmTasks( 'grunt-contrib-jshint' );
    grunt.loadNpmTasks( 'grunt-contrib-copy' );
    grunt.loadNpmTasks( 'grunt-contrib-requirejs' );
    grunt.loadNpmTasks( 'grunt-contrib-clean' );
    grunt.loadNpmTasks( 'grunt-contrib-watch' );
    // windows
    grunt.loadNpmTasks( 'grunt-contrib-symlink' );
    //static site
    grunt.loadNpmTasks( 'grunt-wintersmith-compile' );
    grunt.loadNpmTasks( 'grunt-git' );
    grunt.loadNpmTasks( 'grunt-shell' );

    grunt.registerTask( 'check', [ 'jshint:self', 'jshint:sources' ] );

    grunt.registerTask( 'test', [ 'connect:server', 'qunit:all' ] );

    grunt.registerTask( 'docs', [ 'requirejs:docsSources', 'docco' ] );

    grunt.registerTask( 'build:sources:dist', [ 'requirejs:distSources', 'clean:distAfterSourcesRjs' ] );
    grunt.registerTask( 'build:sources', [ 'build:sources:dist' ] );

    grunt.registerTask( 'build:dist', [ 'build:sources:dist' ] );
    grunt.registerTask( 'build', [ 'symlink', 'build:dist' ] );

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

    grunt.registerTask( 'website_only', [ 'copy:staticWeb', 'clean:staticWeb', 'gitclone:staticWeb', 'wintersmith:build', 'shell:staticWeb', 'gitcommit:staticWeb', 'gitpush:staticWeb' ] );
    grunt.registerTask( 'website', [ 'default', 'docs', 'website_only' ] );
};
<|endoftext|>


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

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

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		sass: {
			task: {
				files: {
					'styles/screen.css': 'styles/screen.scss'
				}
			}
		},
		autoprefixer: {
			task: {
				src: 'styles/screen.css'
			}
		},
		csso: {
			task: {
				files: {
					'styles/screen.css': 'styles/screen.css'
				}
			}
		},
		usebanner: {
			task: {
				options: {
					banner: '/**\n * <%= pkg.description %>\n * <%= pkg.name %> v<%= pkg.version %>, <%= pkg.homepage %>\n * Copyright © 2010–<%= grunt.template.today("yyyy") %> Vadim Makeev, http://pepelsbey.net\n * Licensed under MIT license: <%= pkg.licenses[0].url %>\n */'
				},
				files: {
					'styles/screen.css': 'styles/screen.css'
				}
			}
		},
		connect: {
			task: {
				options: {
					base: ['../shower-core', '.'],
					port: 0,
					livereload: true,
					open: true
				}
			}
		},
		watch: {
			styles: {
				files: 'styles/*.scss',
				tasks: 'styles'
			},
			livereload: {
				options: {
					livereload: 0
				},
				files: [
					'fonts/*',
					'images/*',
					'pictures/*',
					'styles/screen.css',
					'index.html'
				]
			}
		},
		bump: {
			options: {
				files: ['package.json', 'bower.json'],
				commitFiles: ['package.json', 'bower.json'],
				pushTo: 'origin'
			}
		}
	});

	grunt.registerTask('styles', [
		'sass',
		'autoprefixer',
		'csso',
		'usebanner'
	]);

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

};
<commit_msg>Fixing livereload<commit_after>module.exports = function(grunt) {

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

	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		sass: {
			task: {
				files: {
					'styles/screen.css': 'styles/screen.scss'
				}
			}
		},
		autoprefixer: {
			task: {
				src: 'styles/screen.css'
			}
		},
		csso: {
			task: {
				files: {
					'styles/screen.css': 'styles/screen.css'
				}
			}
		},
		usebanner: {
			task: {
				options: {
					banner: '/**\n * <%= pkg.description %>\n * <%= pkg.name %> v<%= pkg.version %>, <%= pkg.homepage %>\n * Copyright © 2010–<%= grunt.template.today("yyyy") %> Vadim Makeev, http://pepelsbey.net\n * Licensed under MIT license: <%= pkg.licenses[0].url %>\n */'
				},
				files: {
					'styles/screen.css': 'styles/screen.css'
				}
			}
		},
		connect: {
			task: {
				options: {
					base: ['../shower-core', '.'],
					port: 0,
					livereload: true,
					open: true
				}
			}
		},
		watch: {
			styles: {
				files: 'styles/*.scss',
				tasks: 'styles'
			},
			livereload: {
				options: {
					livereload: true
				},
				files: [
					'fonts/*',
					'images/*',
					'pictures/*',
					'styles/screen.css',
					'index.html'
				]
			}
		},
		bump: {
			options: {
				files: ['package.json', 'bower.json'],
				commitFiles: ['package.json', 'bower.json'],
				pushTo: 'origin'
			}
		}
	});

	grunt.registerTask('styles', [
		'sass',
		'autoprefixer',
		'csso',
		'usebanner'
	]);

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

};
<|endoftext|>


<commit_before>/**
 * TreeFramework Gruntfile
 * @author Ilia Kolev
 */

'use strict';

/**
 * Grunt module
 */
module.exports = function (grunt) {

    /**
     * Displays the elapsed execution time of grunt tasks
     */
    require('time-grunt')(grunt);

    /**
     * JIT plugin loader for Grunt
     * https://github.com/shootaroo/jit-grunt
     */
    require('jit-grunt')(grunt, {
        scsslint: 'grunt-scss-lint'
    });

    /**
     * Project configuration
     */
    grunt.initConfig({

        /**
         * Store your Package file so you can reference its specific data whenever necessary
         */
        pkg: grunt.file.readJSON('package.json'),

        /**
         * Set project info
         */
        project: {
            www: 'www',
            js: [
                '<%= project.www %>/assets/js/vendor/*.js',
                '<%= project.www %>/assets/js/src/*.js'
            ],
            css: '<%= project.www %>/assets/css/'
        },

        /**
         * Bowercopy
         * https://npmjs.org/package/grunt-bowercopy
         * Scrupulously manage file locations for bower dependencies.
         */
        bowercopy: {
            options: {
                srcPrefix: 'bower_components',
                clean: true
            },
            treeDefaults: {
                options: {
                    destPrefix: 'www/assets/sass/settings'
                },
                files: {
                    '_defaults.scss': 'tree-defaults/_defaults.scss'
                }
            },
            treeResponsiveSettings: {
                options: {
                    destPrefix: 'www/assets/sass/settings'
                },
                files: {
                    '_responsive.scss': 'tree-responsive-settings/_responsive.scss'
                }
            },
            treeFunctions: {
                options: {
                    destPrefix: 'www/assets/sass/tools'
                },
                files: {
                    '_functions.scss': 'tree-functions/_functions.scss'
                }
            },
            treeAliases: {
                options: {
                    destPrefix: 'www/assets/sass/tools'
                },
                files: {
                    '_aliases.scss': 'tree-aliases/_aliases.scss'
                }
            },
            treeMixins: {
                options: {
                    destPrefix: 'www/assets/sass/tools'
                },
                files: {
                    '_mixins.scss': 'tree-mixins/_mixins.scss'
                }
            },
            treeResponsiveTools: {
                options: {
                    destPrefix: 'www/assets/sass/tools'
                },
                files: {
                    '_responsive.scss': 'tree-responsive-tools/_responsive.scss'
                }
            },
            treeNormalizer: {
                options: {
                    destPrefix: 'www/assets/sass/generic'
                },
                files: {
                    '_normalize.scss': 'tree-normalize/_normalize.scss'
                }
            },
            treeReset: {
                options: {
                    destPrefix: 'www/assets/sass/generic'
                },
                files: {
                    '_reset.scss': 'tree-reset/_reset.scss'
                }
            },
            treeBoxSizing: {
                options: {
                    destPrefix: 'www/assets/sass/generic'
                },
                files: {
                    '_box-sizing.scss': 'tree-box-sizing/_box-sizing.scss'
                }
            },
            treeShared: {
                options: {
                    destPrefix: 'www/assets/sass/generic'
                },
                files: {
                    '_shared.scss': 'tree-shared/_shared.scss'
                }
            },
            treePage: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_page.scss': 'tree-page/_page.scss'
                }
            },
            treeParagraphs: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_paragraphs.scss': 'tree-paragraphs/_paragraphs.scss'
                }
            },
            treeHeadings: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_headings.scss': 'treeframework-headings/_headings.scss'
                }
            },
            treeLinks: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_links.scss': 'tree-links/_links.scss'
                }
            },
            treeLists: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_lists.scss': 'tree-lists/_lists.scss'
                }
            },
            treeImages: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_images.scss': 'tree-images/_images.scss'
                }
            },
            treeLayout: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_layout.scss': 'tree-layout/_layout.scss'
                }
            },
            treeNav: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_nav.scss': 'tree-nav/_nav.scss'
                }
            },
            treeListBare: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_list-bare.scss': 'tree-list-bare/_list-bare.scss'
                }
            },
            treeListInline: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_list-inline.scss': 'tree-list-inline/_list-inline.scss'
                }
            },
            treeListBlock: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_list-block.scss': 'tree-list-block/_list-block.scss'
                }
            },
            treeListUi: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_list-ui.scss': 'tree-list-ui/_list-ui.scss'
                }
            },
            treeLinkBlock: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_link-block.scss': 'tree-link-block/_link-block.scss'
                }
            },
            treeLinkClean: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_link-clean.scss': 'tree-link-clean/_link-clean.scss'
                }
            },
            treeTables: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_tables.scss': 'tree-tables/_tables.scss'
                }
            },
            treeMedia: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_media.scss': 'tree-media/_media.scss'
                }
            },
            treeFlag: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_flag.scss': 'tree-flag/_flag.scss'
                }
            },
            treeBox: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_box.scss': 'tree-box/_box.scss'
                }
            },
            treeSprite: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_sprite.scss': 'tree-sprite/_sprite.scss'
                }
            },
            treeButtons: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_buttons.scss': 'tree-buttons/_buttons.scss'
                }
            },
            treePack: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_pack.scss': 'tree-pack/_pack.scss'
                }
            },
            treeTabs: {
                options: {
                    destPrefix: 'www/assets/sass/objects'
                },
                files: {
                    '_tabs.scss': 'tree-tabs/_tabs.scss'
                }
            },
            treeClearfix: {
                options: {
                    destPrefix: 'www/assets/sass/trumps'
                },
                files: {
                    '_clearfix.scss': 'tree-clearfix/_clearfix.scss'
                }
            },
            treeWidths: {
                options: {
                    destPrefix: 'www/assets/sass/trumps'
                },
                files: {
                    '_widths.scss': 'tree-widths/_widths.scss'
                }
            },
            treeWidthsResponsive: {
                options: {
                    destPrefix: 'www/assets/sass/trumps'
                },
                files: {
                    '_widths-responsive.scss': 'tree-responsive-widths/_widths-responsive.scss'
                }
            },
            treeSpacing: {
                options: {
                    destPrefix: 'www/assets/sass/trumps'
                },
                files: {
                    '_spacing.scss': 'tree-spacing/_spacing.scss'
                }
            },
            treeSpacingResponsive: {
                options: {
                    destPrefix: 'www/assets/sass/trumps'
                },
                files: {
                    '_spacing-responsive.scss': 'tree-responsive-spacing/_spacing-responsive.scss'
                }
            },
            jquery: {
                options: {
                    destPrefix: 'www/assets/js/vendor'
                },
                files: {
                    'jquery.min.js': 'jquery/dist/jquery.min.js'
                }
            }
        },

        /**
         * JSHint
         * https://github.com/gruntjs/grunt-contrib-jshint
         * Manage the options inside .jshintrc file
         */
        jshint: {
            files: [
                'www/assets/js/src/*.js',
                'Gruntfile.js'
            ],
            options: {
                jshintrc: '.jshintrc',
                ignores: [
                    'www/assets/js/scripts.js',
                    'www/assets/js/scripts.min.js',
                    'www/assets/js/vendor/*.js'
                ]
            }
        },

        /**
         * Concatenate JavaScript files
         * https://github.com/gruntjs/grunt-contrib-concat
         * Imports all .js files
         */
        concat: {
            dist: {
                src: '<%= project.js %>',
                dest:'www/assets/js/scripts.js'
            }
        },

        /**
         * Uglify (minify) JavaScript files
         * https://github.com/gruntjs/grunt-contrib-uglify
         * Compresses and minifies all JavaScript files into one
         */
        uglify: {
            dist: {
                files: {
                    'www/assets/js/scripts.min.js': 'www/assets/js/scripts.js'
                }
            }
        },

        /**
         * A Grunt task to lint your SCSS
         * https://github.com/ahmednuaman/grunt-scss-lint
         */
        scsslint: {
            files: [
                '<%= project.www %>/assets/sass/{,*/}*.scss'
            ],
            options: {
                config: '.scss-lint.yml',
                reporterOutput: null
            }
        },

        /**
         * Compile Sass to CSS using Compass
         * https://github.com/gruntjs/grunt-contrib-compass
         */
        compass: {
            dist: {
                options: {
                    config: 'config.rb'
                }
            }
        },

        /**
         * Autoprefixer
         * Adds vendor prefixes automatically
         * https://github.com/nDmitry/grunt-autoprefixer
         */
        autoprefixer: {
            dist: {
                options: {
                    browsers: [
                        'last 3 version',
                        'ie 8',
                        'ie 9'
                    ]
                },
                src: '<%= project.css %>screen.css'
            }
        },

        /**
         * CSSO
         * Minify CSS files
         * https://github.com/t32k/grunt-csso
         */
        csso: {
            options: {
                restructure: false,
                report: 'min'
            },
            dist: {
                files: {
                    '<%= project.css %>screen.min.css': ['<%= project.css %>screen.css']
                }
            }
        },

        /**
         * Browser sync
         * Keep multiple browsers & devices in sync
         * https://github.com/shakyShane/grunt-browser-sync
         */
        browserSync: {
            dev: {
                files: {
                    src : [
                        '<%= project.css %>screen.min.css',
                        '<%= project.www %>/{,*/}*.{html,php}'
                    ]
                },
                options: {
                    watchTask: true,
                    debugInfo: true,
                    server: {
                        baseDir: 'www'
                    }
                }
            }
        },

        /**
         * Runs tasks against changed watched files
         * https://github.com/gruntjs/grunt-contrib-watch
         */
        watch: {
            options: {
                livereload: true
            },
            js: {
                files: '<%= project.js %>',
                tasks: ['concat', 'jshint', 'uglify'],
                options: {
                    spawn: false
                }
            },
            sass: {
                files: 'www/assets/sass/{,*/}*.{scss,sass}',
                tasks: ['compass', 'autoprefixer', 'csso'],
                options: {
                    spawn: false
                }
            },
            pages: {
                files: '<%= project.www %>/{,*/}*.{html,php}'
            },
            images: {
                files: '<%= project.www %>/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
            }
        }
    });

    /**
     * Default task
     * Run 'grunt' on the command line
     */
    grunt.registerTask('default', [
        'compass',
        'autoprefixer',
        'csso',
        'scsslint',
        'jshint',
        'watch'
    ]);

    /**
     * Build task
     * Run 'grunt build' on the command line
     * Then compress all JS/CSS files
     */
    grunt.registerTask('build', [
        'compass',
        'autoprefixer',
        'csso',
        'scsslint',
        'jshint',
        'uglify'
    ]);

    /**
     * Sync task
     * Run 'grunt sync' on the command line
     * Alias sync to browserSync + watch
     */
    grunt.registerTask('sync', [
        'browserSync',
        'watch'
    ]);

    /**
     * Bower task
     * Alias bower to bowercopy
     * Run 'grunt bower' on the command line
     *
     * When updating a bower dependency, update the version in bower.json, run
     * 'grunt bower', and then commit the result. When adding a dependency,
     * update the bowercopy task accordingly.
     */
    grunt.registerTask('bower', 'bowercopy');
};
<commit_msg>Refactor Gruntfile.js.<commit_after>/**
 * TreeFramework Gruntfile
 * @author Ilia Kolev
 */

'use strict';

/**
 * Grunt module
 */
module.exports = function (grunt) {

    /**
     * Displays the elapsed execution time of grunt tasks
     */
    require('time-grunt')(grunt);

    /**
     * Jit-grunt
     *
     * Plugin loader for Grunt.
     * https://github.com/shootaroo/jit-grunt
     */
    require('jit-grunt')(grunt, {
        scsslint: 'grunt-scss-lint'
    });

    /**
     * Project configuration
     */
    grunt.initConfig({

        /**
         * Store your Package file so you can reference its specific data
         * whenever necessary.
         */
        pkg: grunt.file.readJSON('package.json'),

        /**
         * Set project info.
         */
        project: {
            www: 'www',
            js: [
                '<%= project.www %>/assets/js/vendor/*.js',
                '<%= project.www %>/assets/js/src/*.js'
            ],
            sass: '<%= project.www %>/assets/sass/',
            css: '<%= project.www %>/assets/css/'
        },

        /**
         * Bowercopy
         *
         * Scrupulously manage file locations for bower dependencies.
         * https://npmjs.org/package/grunt-bowercopy
         */
        bowercopy: {
            options: {
                srcPrefix: 'bower_components'
            },

            treeDefaults: {
                options: {
                    destPrefix: 'www/assets/sass/settings'
                },
                files: {
                    '_defaults.scss': 'tree-defaults/_settings.defaults.scss'
                }
            },

            treeResponsiveSettings: {
                options: {
                    destPrefix: 'www/assets/sass/settings'
                },
                files: {
                    '_responsive.scss': 'tree-responsive-settings/_settings.responsive.scss'
                }
            },

            treeFunctions: {
                options: {
                    destPrefix: 'www/assets/sass/tools'
                },
                files: {
                    '_functions.scss': 'tree-functions/_tools.functions.scss'
                }
            },

            treeMixins: {
                options: {
                    destPrefix: 'www/assets/sass/tools'
                },
                files: {
                    '_mixins.scss': 'tree-mixins/_tools.mixins.scss'
                }
            },

            treeResponsiveTools: {
                options: {
                    destPrefix: 'www/assets/sass/tools'
                },
                files: {
                    '_responsive.scss': 'tree-responsive-tools/_tools.responsive.scss'
                }
            },

            treeAliases: {
                options: {
                    destPrefix: 'www/assets/sass/tools'
                },
                files: {
                    '_aliases.scss': 'tree-aliases/_tools.aliases.scss'
                }
            },

            treeNormalizer: {
                options: {
                    destPrefix: 'www/assets/sass/generic'
                },
                files: {
                    '_normalize.scss': 'tree-normalize/_generic.normalize.scss'
                }
            },

            treeReset: {
                options: {
                    destPrefix: 'www/assets/sass/generic'
                },
                files: {
                    '_reset.scss': 'tree-reset/_generic.reset.scss'
                }
            },

            treeBoxSizing: {
                options: {
                    destPrefix: 'www/assets/sass/generic'
                },
                files: {
                    '_box-sizing.scss': 'tree-box-sizing/_generic.box-sizing.scss'
                }
            },

            treeShared: {
                options: {
                    destPrefix: 'www/assets/sass/generic'
                },
                files: {
                    '_shared.scss': 'tree-shared/_generic.shared.scss'
                }
            },

            treePage: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_page.scss': 'tree-page/_base.page.scss'
                }
            },

            treeHeadings: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_headings.scss': 'treeframework-headings/_base.headings.scss'
                }
            },

            treeParagraphs: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_paragraphs.scss': 'tree-paragraphs/_base.paragraphs.scss'
                }
            },

            treeLinks: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_links.scss': 'tree-links/_base.links.scss'
                }
            },

            treeLists: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_lists.scss': 'tree-lists/_base.lists.scss'
                }
            },

            treeImages: {
                options: {
                    destPrefix: 'www/assets/sass/base'
                },
                files: {
                    '_images.scss': 'tree-images/_base.images.scss'
                }
            },

            treeLayout: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_layout.scss': 'tree-layout/_object.layout.scss'
                }
            },

            treeNav: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_nav.scss': 'tree-nav/_object.nav.scss'
                }
            },

            treeListBare: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_list-bare.scss': 'tree-list-bare/_object.list-bare.scss'
                }
            },

            treeListInline: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_list-inline.scss': 'tree-list-inline/_object.list-inline.scss'
                }
            },

            treeListBlock: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_list-block.scss': 'tree-list-block/_object.list-block.scss'
                }
            },

            treeListUi: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_list-ui.scss': 'tree-list-ui/_object.list-ui.scss'
                }
            },

            treeLinkBlock: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_link-block.scss': 'tree-link-block/_object.link-block.scss'
                }
            },

            treeLinkClean: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_link-clean.scss': 'tree-link-clean/_object.link-clean.scss'
                }
            },

            treeTables: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_tables.scss': 'tree-tables/_object.tables.scss'
                }
            },

            treeMedia: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_media.scss': 'tree-media/_object.media.scss'
                }
            },

            treeFlag: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_flag.scss': 'tree-flag/_object.flag.scss'
                }
            },

            treeBox: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_box.scss': 'tree-box/_object.box.scss'
                }
            },

            treeSprite: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_sprite.scss': 'tree-sprite/_object.sprite.scss'
                }
            },

            treeButtons: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_buttons.scss': 'tree-buttons/_object.buttons.scss'
                }
            },

            treePack: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_pack.scss': 'tree-pack/_object.pack.scss'
                }
            },

            treeTabs: {
                options: {
                    destPrefix: 'www/assets/sass/object'
                },
                files: {
                    '_tabs.scss': 'tree-tabs/_object.tabs.scss'
                }
            },

            treeClearfix: {
                options: {
                    destPrefix: 'www/assets/sass/trump'
                },
                files: {
                    '_clearfix.scss': 'tree-clearfix/_trump.clearfix.scss'
                }
            },

            treeWidths: {
                options: {
                    destPrefix: 'www/assets/sass/trump'
                },
                files: {
                    '_widths.scss': 'tree-widths/_trump.widths.scss'
                }
            },

            treeWidthsResponsive: {
                options: {
                    destPrefix: 'www/assets/sass/trump'
                },
                files: {
                    '_widths-responsive.scss': 'tree-widths-responsive/_trump.widths-responsive.scss'
                }
            },

            treeSpacing: {
                options: {
                    destPrefix: 'www/assets/sass/trump'
                },
                files: {
                    '_spacing.scss': 'tree-spacing/_trump.spacing.scss'
                }
            },

            treeSpacingResponsive: {
                options: {
                    destPrefix: 'www/assets/sass/trump'
                },
                files: {
                    '_spacing-responsive.scss': 'tree-spacing-responsive/_trump.spacing-responsive.scss'
                }
            },

            jquery: {
                options: {
                    destPrefix: 'www/assets/js/vendor'
                },
                files: {
                    'jquery.min.js': 'jquery/dist/jquery.min.js'
                }
            }
        },

        /**
         * JSHint
         *
         * Detect errors and potential problems in your JavaScript code.
         * https://github.com/gruntjs/grunt-contrib-jshint
         */
        jshint: {
            files: [
                'www/assets/js/src/*.js',
                'Gruntfile.js'
            ],
            options: {
                jshintrc: '.jshintrc',
                ignores: [
                    'www/assets/js/scripts.js',
                    'www/assets/js/scripts.min.js',
                    'www/assets/js/vendor/*.js'
                ]
            }
        },

        /**
         * Concat
         *
         * Concatenate JavaScript files.
         * https://github.com/gruntjs/grunt-contrib-concat
         */
        concat: {
            dist: {
                src: '<%= project.js %>',
                dest:'www/assets/js/scripts.js'
            }
        },

        /**
         * Uglify
         *
         * Minify files with UglifyJS.
         * https://github.com/gruntjs/grunt-contrib-uglify
         */
        uglify: {
            javascript: {
                files: {
                    'www/assets/js/scripts.min.js': 'www/assets/js/scripts.js'
                }
            }
        },

        /**
         * Scss-lint
         *
         * Lint your .scss files.
         * https://github.com/ahmednuaman/grunt-scss-lint
         */
        scsslint: {
            files: [
                '<%= project.sass %>{,*/}*.scss'
            ],
            options: {
                config: '.scss-lint.yml',
                reporterOutput: null
            }
        },

        /**
         * Compass
         *
         * Compile Sass to CSS using Compass.
         * https://github.com/gruntjs/grunt-contrib-compass
         */
        compass: {
            dist: {
                options: {
                    config: 'config.rb'
                }
            }
        },

        /**
         * Autoprefixer
         *
         * Adds vendor prefixes automatically.
         * https://github.com/nDmitry/grunt-autoprefixer
         */
        autoprefixer: {
            dist: {
                options: {
                    browsers: [
                        'last 3 version',
                        'ie 8',
                        'ie 9'
                    ],
                },
                src: '<%= project.css %>main.css'
            }
        },

        /**
         * CSSO
         *
         * Minify CSS files.
         * https://github.com/t32k/grunt-csso
         */
        csso: {
            options: {
                restructure: false,
                report: 'min'
            },
            dist: {
                files: {
                    '<%= project.css %>main.min.css': ['<%= project.css %>main.css']
                }
            }
        },

        /**
         * Browser sync
         *
         * Keep multiple browsers & devices in sync.
         * https://github.com/shakyShane/grunt-browser-sync
         */
        browserSync: {
            dev: {
                files: {
                    src : [
                        '<%= project.css %>main.min.css',
                        '<%= project.www %>/{,*/}*.{html,php}'
                    ]
                },
                options: {
                    watchTask: true,
                    debugInfo: true,
                    server: {
                        baseDir: 'www'
                    }
                }
            }
        },

        /**
         * Watch
         *
         * Runs tasks against changed watched files
         * https://github.com/gruntjs/grunt-contrib-watch
         */
        watch: {
            options: {
                livereload: true
            },
            js: {
                files: '<%= project.js %>',
                tasks: ['concat', 'jshint', 'uglify'],
                options: {
                    spawn: false
                }
            },
            sass: {
                files: '<%= project.sass %>{,*/}*.scss',
                tasks: ['compass', 'autoprefixer', 'csso'],
                options: {
                    spawn: false
                }
            },
            pages: {
                files: '<%= project.www %>/{,*/}*.{html,php}'
            },
            images: {
                files: '<%= project.www %>/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
            }
        }
    });

    /**
     * Default task
     * Run 'grunt' on the command line.
     */
    grunt.registerTask('default', [
        'compass',
        'autoprefixer',
        'csso',
        'scsslint',
        'jshint',
        'watch'
    ]);

    /**
     * Build task
     * Run 'grunt build' on the command line.
     */
    grunt.registerTask('build', [
        'compass',
        'autoprefixer',
        'csso',
        'scsslint',
        'jshint',
        'uglify'
    ]);

    /**
     * Sync task
     * Run 'grunt sync' on the command line
     * Alias sync to browserSync + watch
     */
    grunt.registerTask('sync', [
        'browserSync',
        'watch'
    ]);

    /**
     * Bower task
     * Alias bower to bowercopy
     * Run 'grunt bower' on the command line
     *
     * When updating a bower dependency, update the version in bower.json, run
     * 'grunt bower', and then commit the result. When adding a dependency,
     * update the bowercopy task accordingly.
     */
    grunt.registerTask('bower', 'bowercopy');
};
<|endoftext|>


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

    grunt.initConfig({
        paths: {
            scss: './scss',
            css: './css'
        },
        buildType: 'Build',
        pkg: grunt.file.readJSON('package.json'),

        clean: ['dist/', 'build/'],

        compress: {
            main: {
                options: {
                    archive: 'linen.zip'
                },
                expand: true,
                cwd: 'dist/',
                src: ['**/*'],
                dest: ''
            }
        },

        copy: {
            main: {
                files: [
                    {expand: true, src: ['css/**'], dest: 'dist/'},
                    {expand: true, src: ['fonts/**'], dest: 'dist/'},
                    {expand: true, src: ['images/**'], dest: 'dist/'},
                    {expand: true, src: ['js/**'], dest: 'dist/'},
                    {expand: true, src: ['partials/**'], dest: 'dist/'},
                    {expand: true, src: ['scss/**'], dest: 'dist/'},
                    {expand: true, src: ['*', '!.gitignore', '!.DS_Store'], dest: 'dist/'},
                ]
            },
            archive: {
                files: [
                    {expand: true, src: ['linen.zip'], dest: 'build/'}
                ]
            }
        },

        sass: {
            admin: {
                options : {
                    // Only enable sourcemaps if you have Sass 3.3 installed.
                    // sourcemap: true
                },
                files: {
                    '<%= paths.css %>/style.css': '<%= paths.scss %>/style.scss',
                    '<%= paths.css %>/ie.css': '<%= paths.scss %>/ie.scss'
                }
            }
        },

        watch: {
            sass: {
                files: './scss/**/*.scss',
                tasks: ['sass:admin']
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.registerTask('default', ['sass:admin']);
    grunt.registerTask('bundle', ['clean', 'copy:main', 'compress', 'copy:archive']);
};
<commit_msg>added task to clean archive in root, pulled archive name out into config<commit_after>module.exports = function(grunt) {

    grunt.initConfig({
        paths: {
            scss: './scss',
            css: './css'
        },
        buildType: 'Build',
        pkg: grunt.file.readJSON('package.json'),
        archive_name: 'linen',

        clean: {
            pre: ['dist/', 'build/'],
            post: ['<%= archive_name %>.zip']
        },

        compress: {
            main: {
                options: {
                    archive: '<%= archive_name %>.zip'
                },
                expand: true,
                cwd: 'dist/',
                src: ['**/*'],
                dest: ''
            }
        },

        copy: {
            main: {
                files: [
                    {expand: true, src: ['css/**'], dest: 'dist/'},
                    {expand: true, src: ['fonts/**'], dest: 'dist/'},
                    {expand: true, src: ['images/**'], dest: 'dist/'},
                    {expand: true, src: ['js/**'], dest: 'dist/'},
                    {expand: true, src: ['partials/**'], dest: 'dist/'},
                    {expand: true, src: ['scss/**'], dest: 'dist/'},
                    {expand: true, src: ['*', '!.gitignore', '!.DS_Store'], dest: 'dist/'},
                ]
            },
            archive: {
                files: [
                    {expand: true, src: [global['name'] + '.zip'], dest: 'build/'}
                ]
            }
        },

        sass: {
            admin: {
                options : {
                    // Only enable sourcemaps if you have Sass 3.3 installed.
                    // sourcemap: true
                },
                files: {
                    '<%= paths.css %>/style.css': '<%= paths.scss %>/style.scss',
                    '<%= paths.css %>/ie.css': '<%= paths.scss %>/ie.scss'
                }
            }
        },

        watch: {
            sass: {
                files: './scss/**/*.scss',
                tasks: ['sass:admin']
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.registerTask('default', ['sass:admin']);
    grunt.registerTask('bundle', ['clean:pre', 'copy:main', 'compress', 'copy:archive', 'clean:post']);
};
<|endoftext|>


<commit_before>var fs   = require('fs')
    sass = require('component-sass');

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    meta: {
      banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
              '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
              '<%= pkg.homepage ? "* " + pkg.homepage : "" %>\n' +
              '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
              ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n\n',

      minibanner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
                  '<%= grunt.template.today("yyyy-mm-dd") %> - ' +
                  '<%= pkg.homepage ? "* " + pkg.homepage + " - " : "" %>' +
                  'Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
                  ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */ '
    },
    uglify: {
      options: {
        banner: '<%= meta.minibanner %>\n'
      },
      build: {
        src: 'build/<%= pkg.name %>.js',
        dest: 'build/<%= pkg.name %>.min.js'
      }
    },
    cssmin: {
      compress: {
        options: {
          keepSpecialComments: 0,
          banner: '<%= meta.minibanner %>\n'
        },
        files: {
          "build/<%= pkg.name %>.min.css": ["build/<%= pkg.name %>.css"]
        }
      }
    },
    component_build: {
      "ui-checkbox": {
        output: './build/',
        styles: true,
        scripts: true,
        verbose: true,
        configure: function(builder) {
          builder.use(sass);
        }
        // , noRequire: true
      }
    },
    watch: {
      files: ['index.js', 'templates/*.html', 'index.scss', 'Gruntfile.js'],
      tasks: ['component_build', 'uglify', 'cssmin']
    }
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-component-build');

  // Default task(s).
  grunt.registerTask('default', ['component_build', 'uglify', 'cssmin']);
  // grunt.registerTask('watch', ['watch']);

};<commit_msg>gruntfile using uick-grunt npm package<commit_after>module.exports = require('uick-grunt').gruntfile;<|endoftext|>


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

    var sourceFiles = [
        "lib/capstone.js", // capstone.js must be listed first or docs fail
        "lib/arm.js",
        "lib/arm64.js",
        "lib/mips.js",
        "lib/ppc.js",
        "lib/sparc.js",
        "lib/systemz.js",
        "lib/x86.js",
    ];
    var specFiles = grunt.file.expand("spec/**/*.js");
    var docsDir = "./docs"

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

        "jshint" : {
            "options" : {
                "jshintrc" : ".jshintrc",
            },

            "files" : {
                "src" : sourceFiles.concat(specFiles),
            }
        },

        "clean" : {
            "docs" : {
                "src" : [ docsDir + "/**/*" ],
            }
        },

        "doxdot" : {
            "options" : {
                "views" : "views",
                "readme" : "README.md",
                "project" : "node-capstone",
                "links" : {
                    "blog" : "http://blog.kodewerx.org/",
                    "twitter" : "kodewerx",
                }
            },

            "src" : sourceFiles,
            "dest" : docsDir,
        },

        "jasmine_node" : {
            "all" : [ "spec/" ],
        },
    });

    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-clean");
    grunt.loadNpmTasks("grunt-jasmine-node");

    // Custom Tasks
    grunt.loadTasks("tasks");

    // Default task.
    grunt.registerTask("default", [ "test" ]);

    grunt.registerTask("test", [ "jshint", "jasmine_node" ]);
    grunt.registerTask("lint", [ "jshint" ]);
    grunt.registerTask("docs", [ "jshint", "clean:docs", "doxdot" ]);
};
<commit_msg>Grunt: Auto generate source files list with correct sorting for docs<commit_after>/*global module:false*/
module.exports = function (grunt) {
    "use strict";

    var sourceFiles = grunt.file.expand("lib/**/*.js");
    var specFiles = grunt.file.expand("spec/**/*.js");
    var docsDir = "./docs"

    // capstone.js must be listed first or docs fail
    sourceFiles = sourceFiles.sort(function (a, b) {
        return (
            a === "lib/capstone.js" ? -1 :
            b === "lib/capstone.js" ? 1 :
            a < b ? -1 :
            a > b ? 1 :
            0
        );
    });
    console.log("source files:", sourceFiles);

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

        "jshint" : {
            "options" : {
                "jshintrc" : ".jshintrc",
            },

            "files" : {
                "src" : sourceFiles.concat(specFiles),
            }
        },

        "clean" : {
            "docs" : {
                "src" : [ docsDir + "/**/*" ],
            }
        },

        "doxdot" : {
            "options" : {
                "views" : "views",
                "readme" : "README.md",
                "project" : "node-capstone",
                "links" : {
                    "blog" : "http://blog.kodewerx.org/",
                    "twitter" : "kodewerx",
                }
            },

            "src" : sourceFiles,
            "dest" : docsDir,
        },

        "jasmine_node" : {
            "all" : [ "spec/" ],
        },
    });

    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-clean");
    grunt.loadNpmTasks("grunt-jasmine-node");

    // Custom Tasks
    grunt.loadTasks("tasks");

    // Default task.
    grunt.registerTask("default", [ "test" ]);

    grunt.registerTask("test", [ "jshint", "jasmine_node" ]);
    grunt.registerTask("lint", [ "jshint" ]);
    grunt.registerTask("docs", [ "jshint", "clean:docs", "doxdot" ]);
};
<|endoftext|>


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

  'use strict';

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

  var additionalCSS = [
    '.navbar { display: none; }',
    '#toc { top: 0; }'
  ];

  grunt.initConfig({

    pkg: pkg,

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

    jsdoc: {
      dist: {
        src: [pkg.main],
        options: {
          destination: 'doc/' + pkg.version,
          private: false,
          template: './node_modules/jsdoc-oblivion/template',
          configure: 'conf.json'
        }
      }
    },

    closurecompiler: {
      minify: {
        files: {
          'idbstore.min.js': [pkg.main]
        },
        options: {
          'compilation_level': 'SIMPLE_OPTIMIZATIONS'
        }
      }
    },

    karma: {
      postbuild: {
        configFile: 'karma.conf.js'
      },
      dev: {
        configFile: 'karma.conf.js',
        files: {
          src: [
            'idbstore.js',
            'test/**/*spec.js'
          ]
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-jsdoc');
  grunt.loadNpmTasks('grunt-closurecompiler');
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('modifyDocs', function () {
    var docPath = 'doc/' + pkg.version,
      styleSheet = docPath + '/styles/site.oblivion.css',
      css = grunt.file.read(styleSheet);

    css += additionalCSS.join('\n') + '\n';
    grunt.file.write(styleSheet, css);
  });

  grunt.registerTask('copyLatestDocs', function () {
    grunt.config.set('copy.docs', {
      cwd: 'doc/' + pkg.version,
      src: '**/*',
      dest: 'doc/latest/',
      expand: true
    });
    grunt.task.run('copy:docs');
  });

  /* Main Tasks */

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

  grunt.registerTask('docs', [
    'jsdoc:dist',
    'modifyDocs',
    'copyLatestDocs'
  ]);

  grunt.registerTask('build', [
    'jshint',
    'karma:dev',
    'closurecompiler',
    'karma:postbuild'
  ]);
};
<commit_msg>Awwww<commit_after>/*global module:false*/
module.exports = function (grunt) {

  'use strict';

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

  var additionalCSS = [
    '.navbar { display: none; }',
    '#toc { top: 0; }'
  ];

  grunt.initConfig({

    pkg: pkg,

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

    jsdoc: {
      dist: {
        src: [pkg.main],
        options: {
          destination: 'doc/' + pkg.version,
          private: false,
          template: './node_modules/jsdoc-oblivion/template',
          configure: 'conf.json'
        }
      }
    },

    closurecompiler: {
      minify: {
        files: {
          'idbstore.min.js': [pkg.main]
        },
        options: {
          'compilation_level': 'SIMPLE_OPTIMIZATIONS'
        }
      }
    },

    karma: {
      postbuild: {
        configFile: 'karma.conf.js'
      },
      dev: {
        configFile: 'karma.conf.js',
        files: {
          src: [
            'idbstore.js',
            'test/**/*spec.js'
          ]
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-jsdoc');
  grunt.loadNpmTasks('grunt-closurecompiler');
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('modifyDocs', function () {
    var docPath = 'doc/' + pkg.version,
      styleSheet = docPath + '/styles/site.oblivion.css',
      css = grunt.file.read(styleSheet);

    css += additionalCSS.join('\n') + '\n';
    grunt.file.write(styleSheet, css);
  });

  grunt.registerTask('copyLatestDocs', function () {
    grunt.config.set('copy.docs', {
      cwd: 'doc/' + pkg.version,
      src: '**/*',
      dest: 'doc/latest/',
      expand: true
    });
    grunt.task.run('copy:docs');
  });

  //################//
  //   Main Tasks   //
  //################//

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

  grunt.registerTask('docs', [
    'jsdoc:dist',
    'modifyDocs',
    'copyLatestDocs'
  ]);

  grunt.registerTask('build', [
    'jshint',
    'karma:dev',
    'closurecompiler',
    'karma:postbuild'
  ]);
};
<|endoftext|>


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

   grunt.initConfig({
      pkg: grunt.file.readJSON('package.json'),
      dist: 'dist',
      filename: '<%= pkg.name %>',
      karma: {
         options: {
            configFile: 'karma.conf.js'
         }
         unit: {
            autoWatch: true
         },
         travis: {
            singleRun: true,
            reporters: ['dots']
            browsers: ['Firefox']
         }
      },
      clean: {
         dist: ['<%= dist %>']
      },
      concat: {
         dist: {
            options: {
               banner: 'angular.module(\'charts\', [\'piechart\', \'linechart\']);\n\n'
            },
            src: ['src/piechart.js', 'src/linechart.js'],
            dest: '<%= dist %>/<%= filename %>-<%= pkg.version %>.js'
         }
      },
      uglify: {
         dist: {
            src: ['<%= concat.dist.dest %>'],
            dest: '<%= dist %>/<%= filename %>-<%= pkg.version %>.min.js'
         }
      }
   });

   grunt.loadNpmTasks('grunt-karma');
   grunt.loadNpmTasks('grunt-contrib-clean');
   grunt.loadNpmTasks('grunt-contrib-concat');
   grunt.loadNpmTasks('grunt-contrib-uglify');

   grunt.registerTask('default', ['karma:unit']);
   grunt.registerTask('build', ['clean', 'concat', 'uglify']);

   return grunt;
};
<commit_msg>Gruntfile errors<commit_after>module.exports = function(grunt) {

   grunt.initConfig({
      pkg: grunt.file.readJSON('package.json'),
      dist: 'dist',
      filename: '<%= pkg.name %>',
      karma: {
         options: {
            configFile: 'karma.conf.js'
         },
         unit: {
            autoWatch: true
         },
         travis: {
            singleRun: true,
            reporters: ['dots'],
            browsers: ['Firefox']
         }
      },
      clean: {
         dist: ['<%= dist %>']
      },
      concat: {
         dist: {
            options: {
               banner: 'angular.module(\'charts\', [\'piechart\', \'linechart\']);\n\n'
            },
            src: ['src/piechart.js', 'src/linechart.js'],
            dest: '<%= dist %>/<%= filename %>-<%= pkg.version %>.js'
         }
      },
      uglify: {
         dist: {
            src: ['<%= concat.dist.dest %>'],
            dest: '<%= dist %>/<%= filename %>-<%= pkg.version %>.min.js'
         }
      }
   });

   grunt.loadNpmTasks('grunt-karma');
   grunt.loadNpmTasks('grunt-contrib-clean');
   grunt.loadNpmTasks('grunt-contrib-concat');
   grunt.loadNpmTasks('grunt-contrib-uglify');

   grunt.registerTask('default', ['karma:unit']);
   grunt.registerTask('build', ['clean', 'concat', 'uglify']);

   return grunt;
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

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

  /* global process */

  // configures browsers to run test against
  // any of [ 'PhantomJS', 'Chrome', 'Firefox', 'IE']
  var TEST_BROWSERS = ((process.env.TEST_BROWSERS || '').replace(/^\s+|\s+$/, '') || 'PhantomJS').split(/\s*,\s*/g);

  // project configuration
  grunt.initConfig({

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

    eslint: {
      client: [ 'client/{lib,test}/**/*.js' ],
      app: [ 'app/{lib,test,develop}/**/*.js' ]
    },

    release: {
      options: {
        tagName: 'v<%= version %>',
        commitMessage: 'chore(project): release v<%= version %>',
        tagMessage: 'chore(project): tag v<%= version %>',
        npm: false
      }
    },

    clean: {
      client: [ 'public' , 'distro']
    },

    karma: {
      options: {
        configFile: 'client/test/config/karma.unit.js'
      },
      single: {
        singleRun: true,
        autoWatch: false,

        browsers: TEST_BROWSERS
      },
      unit: {
        browsers: TEST_BROWSERS
      }
    },

    browserify: {
      client: {
        src: 'client/lib/index.js',
        target: 'public/index.js'
      }
    },

    copy: {
      html: {
        files: [
          { src: 'client/lib/index.html', dest: 'public/index.html' }
        ]
      },
      fonts: {
        files: [
          {
            src: [
              'client/fonts/{app,bpmn}.*',
              'node_modules/dmn-js/fonts/dmn-js.*'
            ],
            dest: 'public/fonts',
            expand: true,
            flatten: true
          }
        ]
      }
    },

    less: {
      app: {
        options: {
          paths: [
            'client/lib',
            'client/styles',
            'node_modules'
          ]
        },
        files: {
          'public/css/style.css': 'client/styles/app.less'
        }
      }
    },

    distro: {
      darwin: {
        platform: 'darwin'
      },
      windows: {
        platform: 'win32'
      },
      linux: {
        platform: 'linux'
      }
    },

    watch: {
      less: {
        files: 'client/{lib,styles}/**/*.less',
        tasks: [ 'less' ]
      },
      copy: {
        files: 'client/lib/index.html',
        tasks: [ 'copy' ]
      },
      client: {
        files: 'public/**/*',
        tasks: [ 'app:reload' ],
        options: {
          spawn: false
        }
      },
      app: {
        files: 'app/**/*',
        tasks: [ 'app:restart' ],
        options: {
          spawn: false
        }
      }
    },

    mochaTest: {
      app: {
        src: ['./app/test/spec/**/*.js'],
        options: {
          reporter: 'spec',
          require: [ './app/test/expect' ]
        }
      }
    }
  });

  grunt.loadTasks('tasks');

  // tasks

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

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

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

  grunt.registerTask('auto-test-app', [ 'mochaTest', 'watch:app' ]);

  grunt.registerTask('package', [ 'distro:darwin', 'distro:windows', 'distro:linux' ]);

  grunt.registerTask('build-client', [
    'clean',
    'browserify:client',
    'less',
    'copy'
  ]);

  grunt.registerTask('default', [ 'lint', 'test', 'build-client', 'package' ]);

  // Development setup tasks
  var server = require('electron-connect').server.create({ path: 'app/develop' });
  grunt.registerTask('app:start', function() {
    server.start(__dirname + '/resources/diagram/simple.bpmn');
  });

  grunt.registerTask('app:restart', server.restart);

  grunt.registerTask('app:reload', server.reload);

  grunt.registerTask('auto-build', [
    'clean',
    'browserify:client:watch',
    'less',
    'copy',
    'app:start',
    'watch'
  ]);
};
<commit_msg>chore(build): add dev task<commit_after>'use strict';

module.exports = function(grunt) {

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

  /* global process */

  // configures browsers to run test against
  // any of [ 'PhantomJS', 'Chrome', 'Firefox', 'IE']
  var TEST_BROWSERS = ((process.env.TEST_BROWSERS || '').replace(/^\s+|\s+$/, '') || 'PhantomJS').split(/\s*,\s*/g);

  // project configuration
  grunt.initConfig({

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

    eslint: {
      client: [ 'client/{lib,test}/**/*.js' ],
      app: [ 'app/{lib,test,develop}/**/*.js' ]
    },

    release: {
      options: {
        tagName: 'v<%= version %>',
        commitMessage: 'chore(project): release v<%= version %>',
        tagMessage: 'chore(project): tag v<%= version %>',
        npm: false
      }
    },

    clean: {
      client: [ 'public' , 'distro']
    },

    karma: {
      options: {
        configFile: 'client/test/config/karma.unit.js'
      },
      single: {
        singleRun: true,
        autoWatch: false,

        browsers: TEST_BROWSERS
      },
      unit: {
        browsers: TEST_BROWSERS
      }
    },

    browserify: {
      client: {
        src: 'client/lib/index.js',
        target: 'public/index.js'
      }
    },

    copy: {
      html: {
        files: [
          { src: 'client/lib/index.html', dest: 'public/index.html' }
        ]
      },
      fonts: {
        files: [
          {
            src: [
              'client/fonts/{app,bpmn}.*',
              'node_modules/dmn-js/fonts/dmn-js.*'
            ],
            dest: 'public/fonts',
            expand: true,
            flatten: true
          }
        ]
      }
    },

    less: {
      app: {
        options: {
          paths: [
            'client/lib',
            'client/styles',
            'node_modules'
          ]
        },
        files: {
          'public/css/style.css': 'client/styles/app.less'
        }
      }
    },

    distro: {
      darwin: {
        platform: 'darwin'
      },
      windows: {
        platform: 'win32'
      },
      linux: {
        platform: 'linux'
      }
    },

    watch: {
      less: {
        files: 'client/{lib,styles}/**/*.less',
        tasks: [ 'less' ]
      },
      copy: {
        files: 'client/lib/index.html',
        tasks: [ 'copy' ]
      },
      client: {
        files: 'public/**/*',
        tasks: [ 'app:reload' ],
        options: {
          spawn: false
        }
      },
      app: {
        files: 'app/**/*',
        tasks: [ 'app:restart' ],
        options: {
          spawn: false
        }
      }
    },

    mochaTest: {
      app: {
        src: ['./app/test/spec/**/*.js'],
        options: {
          reporter: 'spec',
          require: [ './app/test/expect' ]
        }
      }
    }
  });

  grunt.loadTasks('tasks');

  // tasks

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

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

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

  grunt.registerTask('auto-test-app', [ 'mochaTest', 'watch:app' ]);

  grunt.registerTask('package', [ 'distro:darwin', 'distro:windows', 'distro:linux' ]);

  grunt.registerTask('build-client', [
    'clean',
    'browserify:client',
    'less',
    'copy'
  ]);

  grunt.registerTask('dev', [ 'lint', 'test', 'build-client' ]);

  grunt.registerTask('default', [ 'lint', 'test', 'build-client', 'package' ]);

  // Development setup tasks
  var server = require('electron-connect').server.create({ path: 'app/develop' });

  grunt.registerTask('app:start', function() {
    server.start(__dirname + '/resources/diagram/simple.bpmn');
  });

  grunt.registerTask('app:restart', server.restart);

  grunt.registerTask('app:reload', server.reload);

  grunt.registerTask('auto-build', [
    'clean',
    'browserify:client:watch',
    'less',
    'copy',
    'app:start',
    'watch'
  ]);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
    grunt.initConfig({
        jshint: {
            options: {
                node: true
            },
            all: ['Gruntfile.js', 'lib/**/*.js', 'examples/**/*.js']
        }
    });
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.registerTask('default', ['jshint']);
};
<commit_msg>JSHint files only directly under /lib and /examples<commit_after>'use strict';

module.exports = function(grunt) {
    grunt.initConfig({
        jshint: {
            options: {
                node: true
            },
            all: ['Gruntfile.js', 'lib/*.js', 'examples/*.js']
        }
    });
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.registerTask('default', ['jshint']);
};
<|endoftext|>


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

	'use strict';

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

		// JSHint
		jshint: {
			all: [
				'Gruntfile.js',
				'modal.js',
				'site/js/main.js',
				'tests/spec/modal.js'
			],
			options: {
				jshintrc: '.jshintrc'
			}
		},

		// Building CSS
		sass: {
			dev: {
				options: {
					unixNewlines: true,
					style: 'expanded'
				},
				files: {
					'site/css/main.css': 'site/scss/page.scss',
					'tests/modal.css': 'tests/modal.scss'
				}
			},

			dist: {
				options: {
					unixNewlines: true,
					style: 'expanded'
				},
				files: {
					'download/modal.css': 'modal.scss'
				}
			}
		},

		// Copy
		copy: {
			dist: {
				files: [{
					src: [
						'modal.scss',
						'modal.js'
					],
					dest: 'download/'
				}]
			}
		},

		jasmine: {
			src: 'modal.js',
			options: {
				outfile: 'tests/_SpecRunner.html',
				template: 'tests/index.html'
			}
		},

		// Watch that stuff
		watch: {
			scss: {
				files: ['modal.scss', 'site/scss/**/*.scss', 'tests/*.scss'],
				tasks: 'sass:dev'
			},

			hint: {
				files: [
					'modal.js',
					'site/js/main.js',
					'tests/spec/modal.js'
				],
				tasks: 'jshint'
			},

			test: {
				files: ['modal.js'],
				tasks: 'jasmine'
			}
		},

		// Server config
		connect: {
			server: {
				options: {
					port: 9001,
					keepalive: true
				}
			}
		}
	});

	// Load some stuff
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-sass');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-jasmine');

	// Default task
	grunt.registerTask('default', ['sass', 'jshint', 'jasmine']);

	// Building a new version
	grunt.registerTask('dist', ['sass:dist', 'copy:dist', 'jasmine']);

	// Travis CI task
	grunt.registerTask('travis', ['jshint', 'jasmine']);

};
<commit_msg>Run Jasmine tests before creating download files in grunt dist<commit_after>module.exports = function (grunt) {

	'use strict';

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

		// JSHint
		jshint: {
			all: [
				'Gruntfile.js',
				'modal.js',
				'site/js/main.js',
				'tests/spec/modal.js'
			],
			options: {
				jshintrc: '.jshintrc'
			}
		},

		// Building CSS
		sass: {
			dev: {
				options: {
					unixNewlines: true,
					style: 'expanded'
				},
				files: {
					'site/css/main.css': 'site/scss/page.scss',
					'tests/modal.css': 'tests/modal.scss'
				}
			},

			dist: {
				options: {
					unixNewlines: true,
					style: 'expanded'
				},
				files: {
					'download/modal.css': 'modal.scss'
				}
			}
		},

		// Copy
		copy: {
			dist: {
				files: [{
					expand: true,
					src: [
						'modal.scss',
						'modal.js'
					],
					dest: 'download/'
				}]
			}
		},

		jasmine: {
			src: 'modal.js',
			options: {
				outfile: 'tests/_SpecRunner.html',
				template: 'tests/index.html'
			}
		},

		// Watch that stuff
		watch: {
			scss: {
				files: ['modal.scss', 'site/scss/**/*.scss', 'tests/*.scss'],
				tasks: 'sass:dev'
			},

			hint: {
				files: [
					'modal.js',
					'site/js/main.js',
					'tests/spec/modal.js'
				],
				tasks: 'jshint'
			},

			test: {
				files: ['modal.js'],
				tasks: 'jasmine'
			}
		},

		// Server config
		connect: {
			server: {
				options: {
					port: 9001,
					keepalive: true
				}
			}
		}
	});

	// Load some stuff
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-sass');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-jasmine');

	// Default task
	grunt.registerTask('default', ['sass', 'jshint', 'jasmine']);

	// Building a new version
	grunt.registerTask('dist', ['jasmine', 'sass:dist', 'copy:dist']);

	// Travis CI task
	grunt.registerTask('travis', ['jshint', 'jasmine']);

};
<|endoftext|>


<commit_before>/*jshint multistr: true */
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Default package configuration.
    pkg: grunt.file.readJSON('package.json'),
    aws: grunt.file.exists('aws.json') ? grunt.file.readJSON('aws.json') : {}, // Optional file required for deployment.

    // Define a banner to added to the compiled assets.
    banner: "/* <%= pkg.name %> v<%= pkg.version %> | " +
            "(c) <%= grunt.template.today('yyyy') %> <%= pkg.author %>. | " +
            "http://www.apache.org/licenses/LICENSE-2.0.html */",

    // Javascript validation.
    jshint: {
      all: ['Gruntfile.js', 'src/javascripts/*.js']
    },

    // Release & Deployment Tasks.
    release: {
      options: {
        npm: false, // Don't deploy to NPM as we don't want to release like that.
        tagName: 'status-page-link-<%= version %>', // TODO: We can't use a variable for the package name.
        afterBump: ['default'] // Rebuild the libs after version number bumped.
      }
    },

    // Minify Stylesheet Assets.
    cssmin: {
      minify: {
        src: 'src/stylesheets/<%= pkg.name %>.css',
        dest: 'dist/<%= pkg.name %>.min.css',
      },
      options: {
        sourceMap: true // Help with debugging errors.
      }
    },

    // Bundle dependancies into a single package.
    browserify: {
      build: {
        src: 'src/javascripts/<%= pkg.name %>.js', // Take temporary pre-compiled asset.
        dest: 'dist/<%= pkg.name %>.js', // Plop it in the distribution folder.
        options: {
          alias: {
            'sorry-api': './src/javascripts/lib/sorry-api' // Not available as its own NPM yet.
          }
        }
      }
    },

    // Minify Javascript Assets.
    uglify: {
      build: {
        src: 'dist/<%= pkg.name %>.js', // Take temporary pre-compiled asset.
        dest: 'dist/<%= pkg.name %>.min.js' // Plop it in the distribution folder.
      },
      options: {
        banner: '<%= banner %>',
        sourceMap: true // Help with debugging errors.
      }
    },

    // Local demo / development site.
    connect: {
      server: {
        options: {
          port: 9001,
          keepalive: true
        }
      }
    },

    // Deployment.
    aws_s3: {
      options: {
        accessKeyId: '<%= aws.key %>', // Use the variables
        secretAccessKey: '<%= aws.secret %>', // You can also use env variables
        region: 'eu-west-1',
        bucket: 'sorry-assets-production',
        access: 'public-read'
      },
      dev: {
        files: [
          // Upload this version of the plugin.
          {expand: true, cwd: 'dist/', src: ['**'], dest: '<%= pkg.name %>/<%= pkg.version %>/'},
          // Also deploy a bleeding edge version on the major number.
          {expand: true, cwd: 'dist/', src: ['**'], dest: '<%= pkg.name %>/<%= pkg.version.split(".")[0] %>.latest/'},
          // And also a bleeding edge minor release.
          {expand: true, cwd: 'dist/', src: ['**'], dest: '<%= pkg.name %>/<%= pkg.version.split(".")[0] %>.<%= pkg.version.split(".")[1] %>.latest/'}
        ]
      }
    }
  });

  // Load the plugin that validates the JS markup.
  grunt.loadNpmTasks('grunt-contrib-jshint');
  // Connect to the test / demo page.
  grunt.loadNpmTasks('grunt-contrib-connect');
  // Bundle dependany modules together for distribution.
  grunt.loadNpmTasks('grunt-browserify');
  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-uglify');
  // Load the plugin for minifys CSS.
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  // Release tasks to manage version number bump, tag etc.
  grunt.loadNpmTasks('grunt-release');
  // AWS/S3 deployment tools.
  grunt.loadNpmTasks('grunt-aws-s3');

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

};
<commit_msg>Added cache control headers to the deployed versions.<commit_after>/*jshint multistr: true */
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Default package configuration.
    pkg: grunt.file.readJSON('package.json'),
    aws: grunt.file.exists('aws.json') ? grunt.file.readJSON('aws.json') : {}, // Optional file required for deployment.

    // Define a banner to added to the compiled assets.
    banner: "/* <%= pkg.name %> v<%= pkg.version %> | " +
            "(c) <%= grunt.template.today('yyyy') %> <%= pkg.author %>. | " +
            "http://www.apache.org/licenses/LICENSE-2.0.html */",

    // Javascript validation.
    jshint: {
      all: ['Gruntfile.js', 'src/javascripts/*.js']
    },

    // Release & Deployment Tasks.
    release: {
      options: {
        npm: false, // Don't deploy to NPM as we don't want to release like that.
        tagName: 'status-page-link-<%= version %>', // TODO: We can't use a variable for the package name.
        afterBump: ['default'] // Rebuild the libs after version number bumped.
      }
    },

    // Minify Stylesheet Assets.
    cssmin: {
      minify: {
        src: 'src/stylesheets/<%= pkg.name %>.css',
        dest: 'dist/<%= pkg.name %>.min.css',
      },
      options: {
        sourceMap: true // Help with debugging errors.
      }
    },

    // Bundle dependancies into a single package.
    browserify: {
      build: {
        src: 'src/javascripts/<%= pkg.name %>.js', // Take temporary pre-compiled asset.
        dest: 'dist/<%= pkg.name %>.js', // Plop it in the distribution folder.
        options: {
          alias: {
            'sorry-api': './src/javascripts/lib/sorry-api' // Not available as its own NPM yet.
          }
        }
      }
    },

    // Minify Javascript Assets.
    uglify: {
      build: {
        src: 'dist/<%= pkg.name %>.js', // Take temporary pre-compiled asset.
        dest: 'dist/<%= pkg.name %>.min.js' // Plop it in the distribution folder.
      },
      options: {
        banner: '<%= banner %>',
        sourceMap: true // Help with debugging errors.
      }
    },

    // Local demo / development site.
    connect: {
      server: {
        options: {
          port: 9001,
          keepalive: true
        }
      }
    },

    // Deployment.
    aws_s3: {
      options: {
        accessKeyId: '<%= aws.key %>', // Use the variables
        secretAccessKey: '<%= aws.secret %>', // You can also use env variables
        region: 'eu-west-1',
        bucket: 'sorry-assets-production',
        access: 'public-read'
      },
      dev: {
        files: [
          // Upload this version of the plugin.
          {expand: true, cwd: 'dist/', src: ['**'], dest: '<%= pkg.name %>/<%= pkg.version %>/', params: { CacheControl: 'public, max-age=31536000' }},
          // Also deploy a bleeding edge version on the major number.
          {expand: true, cwd: 'dist/', src: ['**'], dest: '<%= pkg.name %>/<%= pkg.version.split(".")[0] %>.latest/', params: { CacheControl: 'public, max-age=3600' }},
          // And also a bleeding edge minor release.
          {expand: true, cwd: 'dist/', src: ['**'], dest: '<%= pkg.name %>/<%= pkg.version.split(".")[0] %>.<%= pkg.version.split(".")[1] %>.latest/', params: { CacheControl: 'public, max-age=3600' }}
        ]
      }
    }
  });

  // Load the plugin that validates the JS markup.
  grunt.loadNpmTasks('grunt-contrib-jshint');
  // Connect to the test / demo page.
  grunt.loadNpmTasks('grunt-contrib-connect');
  // Bundle dependany modules together for distribution.
  grunt.loadNpmTasks('grunt-browserify');
  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-uglify');
  // Load the plugin for minifys CSS.
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  // Release tasks to manage version number bump, tag etc.
  grunt.loadNpmTasks('grunt-release');
  // AWS/S3 deployment tools.
  grunt.loadNpmTasks('grunt-aws-s3');

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

};
<|endoftext|>