<commit_before>module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      all: ['Gruntfile.js', 'server/**/*.js', 'test/**/*.js', 'server/**/*.json', 'test/**/*.json']
    },
    nodeunit: {
      all: ['test/server/**/*.js']
    },
    apidoc: {
      tgio: {
        src: "server/",
        dest: "client/www/apidoc/"
      }
    },
    bower: {
        target: {
            rjsConfig: 'client/www/js/config.js'
        }
    },
    requirejs: {
      compile: {
        options: {
          baseUrl: "client/www",
          mainConfigFile: 'client/www/js/config.js',
          out: 'client/www/js/optimized.js',
          name: 'tgio'
        }
      }
    },
    jsbeautifier: {
      "default": {
        src: ['Gruntfile.js', "server/**/*.js", "test/**/*.js", "server/**/*.json", "test/**/*.json"],
        options: {
          js: {
            indent_size: 2,
            "preserve_newlines": true,
            "max_preserve_newlines": 10,
            "jslint_happy": false,
          }
        }
      },
      "git-pre-commit": {
        src: ['Gruntfile.js', "server/**/*.js", "test/**/*.js", "server/**/*.json", "test/**/*.json"],
        options: {
          mode: "VERIFY_ONLY",
          js: {
            indent_size: 2,
            "preserve_newlines": true,
            "max_preserve_newlines": 10,
            "jslint_happy": false,
          }
        }
      }
    }
  });

  // A very basic default task.
  grunt.registerTask('sample', 'Log some stuff.', function() {
    grunt.log.write('Logging some stuff...').ok();
  });

  grunt.registerTask('default', ['nodeunit', 'jshint', 'jsbeautifier', 'apidoc']);

  grunt.loadNpmTasks('grunt-jsbeautifier');
  grunt.loadNpmTasks('grunt-apidoc');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-nodeunit');
  grunt.loadNpmTasks('grunt-bower-requirejs');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
};
<commit_msg>working on js optimization<commit_after>module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    jshint: {
      all: ['Gruntfile.js', 'server/**/*.js', 'test/**/*.js', 'server/**/*.json', 'test/**/*.json']
    },
    nodeunit: {
      all: ['test/server/**/*.js']
    },
    apidoc: {
      tgio: {
        src: "server/",
        dest: "client/www/apidoc/"
      }
    },
    bower: {
      target: {
        rjsConfig: 'client/www/js/config.js'
      }
    },
    requirejs: {
      compile: {
        options: {
          baseUrl: "client/www/js",
          mainConfigFile: 'client/www/js/config.js',
          out: 'client/www/js/optimized.js',
          name: 'tgio'
        }
      }
    },
    jsbeautifier: {
      "default": {
        src: ['Gruntfile.js', "server/**/*.js", "test/**/*.js", "server/**/*.json", "test/**/*.json"],
        options: {
          js: {
            indent_size: 2,
            "preserve_newlines": true,
            "max_preserve_newlines": 10,
            "jslint_happy": false,
          }
        }
      },
      "git-pre-commit": {
        src: ['Gruntfile.js', "server/**/*.js", "test/**/*.js", "server/**/*.json", "test/**/*.json"],
        options: {
          mode: "VERIFY_ONLY",
          js: {
            indent_size: 2,
            "preserve_newlines": true,
            "max_preserve_newlines": 10,
            "jslint_happy": false,
          }
        }
      }
    }
  });

  // A very basic default task.
  grunt.registerTask('sample', 'Log some stuff.', function() {
    grunt.log.write('Logging some stuff...').ok();
  });

  grunt.registerTask('default', ['nodeunit', 'jshint', 'jsbeautifier', 'apidoc']);

  grunt.loadNpmTasks('grunt-jsbeautifier');
  grunt.loadNpmTasks('grunt-apidoc');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-nodeunit');
  grunt.loadNpmTasks('grunt-bower-requirejs');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
    grunt.initConfig({
        shell: {
            local_js_articles: {
                command: 'node tools/razordoc/bin/app.js --configFile src/config/local_js_articles.json',
                options: {
                    stdout: true
                }
            },
            local_php_articles: {
                command: 'node tools/razordoc/bin/app.js --configFile src/config/local_php_articles.json',
                options: {
                    stdout: true
                }
            },
            local_jsapi: {
                command: 'node tools/razordoc/bin/app.js --configFile src/config/local_js_api.json',
                options: {
                    stdout: true
                }
            },
            local_phpapi: {
                command: 'node tools/razordoc/bin/app.js --configFile src/config/local_php_api.json',
                options: {
                    stdout: true
                }
            },
            copy_images: {
                command: 'cp -r src/examples build/examples && cp -r src/exampleImages build/exampleImages',
                options: {
                    stdout: true
                }
            }
        },
        watch: {
            docs: {
                files: 'src/content/**/*.md',
                tasks: ['compile']
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-shell');

    grunt.registerTask('compile', ['shell:local_js_articles', 'shell:local_php_articles', 'shell:local_jsapi', 'shell:local_phpapi', 'shell:copy_images']);
}<commit_msg>Make it output to website<commit_after>module.exports = function (grunt) {
    grunt.initConfig({
        shell: {
            local_js_articles: {
                command: 'node tools/razordoc/bin/app.js --configFile src/config/local_js_articles.json',
                options: {
                    stdout: true
                }
            },
            local_php_articles: {
                command: 'node tools/razordoc/bin/app.js --configFile src/config/local_php_articles.json',
                options: {
                    stdout: true
                }
            },
            local_jsapi: {
                command: 'node tools/razordoc/bin/app.js --configFile src/config/local_js_api.json',
                options: {
                    stdout: true
                }
            },
            local_phpapi: {
                command: 'node tools/razordoc/bin/app.js --configFile src/config/local_php_api.json',
                options: {
                    stdout: true
                }
            },
            copy_images: {
                command: 'cp -r src/examples build/examples && cp -r src/exampleImages build/exampleImages',
                options: {
                    stdout: true
                }
            },
            web_js_articles: {
                command: 'node tools/razordoc/bin/app.js --configFile src/config/web_js_articles.json',
                options: {
                    stdout: true
                }
            },
            web_php_articles: {
                command: 'node tools/razordoc/bin/app.js --configFile src/config/web_php_articles.json',
                options: {
                    stdout: true
                }
            }
        },
        watch: {
            docs: {
                files: 'src/content/**/*.md',
                tasks: ['compile']
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-shell');

    grunt.registerTask('compile', ['shell:local_js_articles', 'shell:local_php_articles', 'shell:local_jsapi', 'shell:local_phpapi', 'shell:copy_images']);
    grunt.registerTask('webArticles', ['shell:web_js_articles', 'shell:web_php_articles']);
}<|endoftext|>


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

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

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        concat: {
            singleGlobalUseStrict: {
                options: {
                    // Replace all 'use strict' statements in the code with a single one at the top
                    banner: fs.readFileSync('src/module.prefix', 'utf8'),
                    process: function(src) {
                        return src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
                    },
                    footer: fs.readFileSync('src/module.suffix', 'utf8')
                },
                files: {
                    'dist/<%= pkg.name %>-nonAnnotated.js': ['src/module.js', 'src/*.js']
                }
            }
        },
        ngAnnotate: {
            options: {
                ngAnnotateOptions: {}
            },
            default: {
                files: {
                    'dist/<%= pkg.name %>.js': ['dist/<%= pkg.name %>-nonAnnotated.js']
                }
            }
        },
        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
            },
            dist: {
                files: {
                    'dist/<%= pkg.name %>.min.js': ['dist/<%= pkg.name %>.js']
                }
            }
        },
        karma: {
            options: {
                singleRun: true,
                reporters: ['dots', 'coverage'],
                preprocessors: {
                    'src/**/*.js': ['coverage']
                }
            },
            angular_1_2: {
                configFile: 'karma-angular-1.2.conf.js',
                coverageReporter: {
                    type: 'lcov',
                    dir: 'coverage/angular-1.2'
                }
            },
            angular_1_3: {
                configFile: 'karma-angular-1.3.conf.js',
                coverageReporter: {
                    type: 'lcov',
                    dir: 'coverage/angular-1.3'
                }
            },
            angular_1_4: {
                configFile: 'karma-angular-1.4.conf.js',
                coverageReporter: {
                    type: 'lcov',
                    dir: 'coverage/karma-angular-1.4'
                }
            },
            angular_1_5: {
                configFile: 'karma-angular-1.5.conf.js',
                coverageReporter: {
                    type: 'lcov',
                    dir: 'coverage/karma-angular-1.5'
                }
            }
        },
        jshint: {
            files: ['*.js', 'src/**/*.js', 'test/**/*.js'],
            options: {
                jshintrc: true
            }
        },
        watch: {
            files: ['<%= jshint.files %>'],
            tasks: ['jshint', 'karma']
        },
        build: {

        },
        coveralls: {
            'combined-lcov-info': {
                src: 'coverage/combined-lcov.info'
            }
        }
    });

    grunt.registerTask('upload-combined-coverage', ['coveralls:combined-lcov-info']);

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

    grunt.registerTask('default', ['jshint', 'karma', 'concat:singleGlobalUseStrict', 'ngAnnotate', 'uglify']);
};
<commit_msg>Fixed "Gruntfile.js" to use correct karma coverage reporter directory for AngularJS 1.4 and 1.5; this to fix the coverage reported on the GitHub repo.<commit_after>var fs = require('fs');

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

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        concat: {
            singleGlobalUseStrict: {
                options: {
                    // Replace all 'use strict' statements in the code with a single one at the top
                    banner: fs.readFileSync('src/module.prefix', 'utf8'),
                    process: function(src) {
                        return src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
                    },
                    footer: fs.readFileSync('src/module.suffix', 'utf8')
                },
                files: {
                    'dist/<%= pkg.name %>-nonAnnotated.js': ['src/module.js', 'src/*.js']
                }
            }
        },
        ngAnnotate: {
            options: {
                ngAnnotateOptions: {}
            },
            default: {
                files: {
                    'dist/<%= pkg.name %>.js': ['dist/<%= pkg.name %>-nonAnnotated.js']
                }
            }
        },
        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
            },
            dist: {
                files: {
                    'dist/<%= pkg.name %>.min.js': ['dist/<%= pkg.name %>.js']
                }
            }
        },
        karma: {
            options: {
                singleRun: true,
                reporters: ['dots', 'coverage'],
                preprocessors: {
                    'src/**/*.js': ['coverage']
                }
            },
            angular_1_2: {
                configFile: 'karma-angular-1.2.conf.js',
                coverageReporter: {
                    type: 'lcov',
                    dir: 'coverage/angular-1.2'
                }
            },
            angular_1_3: {
                configFile: 'karma-angular-1.3.conf.js',
                coverageReporter: {
                    type: 'lcov',
                    dir: 'coverage/angular-1.3'
                }
            },
            angular_1_4: {
                configFile: 'karma-angular-1.4.conf.js',
                coverageReporter: {
                    type: 'lcov',
                    dir: 'coverage/angular-1.4'
                }
            },
            angular_1_5: {
                configFile: 'karma-angular-1.5.conf.js',
                coverageReporter: {
                    type: 'lcov',
                    dir: 'coverage/angular-1.5'
                }
            }
        },
        jshint: {
            files: ['*.js', 'src/**/*.js', 'test/**/*.js'],
            options: {
                jshintrc: true
            }
        },
        watch: {
            files: ['<%= jshint.files %>'],
            tasks: ['jshint', 'karma']
        },
        build: {

        },
        coveralls: {
            'combined-lcov-info': {
                src: 'coverage/combined-lcov.info'
            }
        }
    });

    grunt.registerTask('upload-combined-coverage', ['coveralls:combined-lcov-info']);

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

    grunt.registerTask('default', ['jshint', 'karma', 'concat:singleGlobalUseStrict', 'ngAnnotate', 'uglify']);
};
<|endoftext|>


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

  var srcFiles = [
    'src/utils/polyfill.js',
    'src/herman.js',
    'src/render/*.js',
    'src/math/*.js',
    'src/tween/*.js',
    'src/scene/*.js',
    'src/experimental/*.js'
  ];

  // Project configuration.
  grunt.initConfig({

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

    jshint: {
      all: ['src/**/*.js']
    },

    concat: {
       dist: {
        src: srcFiles,
        dest: 'build/<%= pkg.name %>.js'
      }
    },

    yuidoc: {
      compile: {
        name: '<%= pkg.name %>',
        description: '<%= pkg.description %>',
        version: '<%= pkg.version %>',
        url: '<%= pkg.homepage %>',
        options: {
          paths: 'build',
          outdir: 'docs'
        }
      }
    },

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

    jasmine: {
      pivotal: {
        src: 'build/<%= pkg.name %>.js',
        options: {
          display: 'short',
          specs: 'spec/*Spec.js',
          helpers: 'spec/*Helper.js'
        }
      }
    }

  });

  // modules
  grunt.loadNpmTasks('grunt-contrib-yuidoc');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-contrib-jshint');

  // tasks
  grunt.registerTask('default', ['concat']);

  grunt.registerTask('test', ['concat','jasmine']);

  grunt.registerTask('deploy', ['jshint','concat','jasmine','uglify','yuidoc']);

};<commit_msg>full spec logging<commit_after>module.exports = function(grunt) {

  var srcFiles = [
    'src/utils/polyfill.js',
    'src/herman.js',
    'src/render/*.js',
    'src/math/*.js',
    'src/tween/*.js',
    'src/scene/*.js',
    'src/experimental/*.js'
  ];

  // Project configuration.
  grunt.initConfig({

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

    jshint: {
      all: ['src/**/*.js']
    },

    concat: {
       dist: {
        src: srcFiles,
        dest: 'build/<%= pkg.name %>.js'
      }
    },

    yuidoc: {
      compile: {
        name: '<%= pkg.name %>',
        description: '<%= pkg.description %>',
        version: '<%= pkg.version %>',
        url: '<%= pkg.homepage %>',
        options: {
          paths: 'build',
          outdir: 'docs'
        }
      }
    },

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

    jasmine: {
      pivotal: {
        src: 'build/<%= pkg.name %>.js',
        options: {
          display: 'full',
          specs: 'spec/*Spec.js',
          helpers: 'spec/*Helper.js'
        }
      }
    }

  });

  // modules
  grunt.loadNpmTasks('grunt-contrib-yuidoc');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-contrib-jshint');

  // tasks
  grunt.registerTask('default', ['concat']);

  grunt.registerTask('test', ['concat','jasmine']);

  grunt.registerTask('deploy', ['jshint','concat','jasmine','uglify','yuidoc']);

};<|endoftext|>


<commit_before>/**
 * The MIT License (MIT)
 *
 * Copyright (c) 2015-2019 Yegor Bugayenko
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

const fs = require('fs')
const child_process = require('child_process')

module.exports = function (grunt) {
  'use strict';
  grunt.util.linefeed = '\n';
  grunt.initConfig(
    {
      pkg: grunt.file.readJSON('package.json'),
      sass: {
        dev: {
          options: {
            sourceMap: true,
            outputStyle: 'compressed'
          },
          files: {
            'tacit.min.css': 'scss/main.scss'
          }
        },
        dist: {
          options: {
            sourceMap: true,
            outputStyle: 'compressed'
          },
          files: {
            'dist/<%= pkg.name %>-<%= pkg.version %>.min.css': 'scss/main.scss'
          }
        },
        uncompressed: {
          options: {
            sourceMap: false,
            outputStyle: 'expanded'
          },
          files: {
            'dist/<%= pkg.name %>-<%= pkg.version %>.css': 'scss/main.scss'
          }
        }
      },
      watch: {
        sass: {
          files: 'scss/{,*/}*.scss',
          tasks: ['sass:dev']
        }
      },
      sasslint: {
        allFiles: [
          'scss/*.scss'
        ]
      }
    }
  );
  require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });

  grunt.registerTask('checkYear', 'Checks the year patterns in copyright lines in source files.', () => {
    const pattern = `2015-${new Date().getFullYear()}`
    const invalidFiles = child_process.execSync('git ls-files LICENSE "*.scss" "*.html" "*.js"').toString().trim().split('\n').filter(file => {
      return !fs.readFileSync(file).toString().includes(pattern)
    })
    invalidFiles.forEach(file => {
      grunt.log.error(`The file, ${file}, does not include the pattern: ${pattern}`)
    })
    return invalidFiles.length === 0
  })

  grunt.registerTask('validate', 'validate css bundle with W3C Jigsaw', function () {

    const path = require('path');
    var validate = require('css-validator');

    const glob = require('glob');

    let srcPath = '';
    let css = '';
    glob("*.css", {}, function (err, files) {

      files.map(file => {
        srcPath = path.join(__dirname + '/dist', file);
        css = grunt.file.read(srcPath);
        var done = this.async();
        validate({ text: `${css}` }, function (error, data) {
          if (data.validity) {
            done(true);
          } else {
            done(false);
          }

        });
      })

    })

  })

  grunt.registerTask('default', ['sasslint', 'sass:dist', 'checkYear', 'validate']);
  grunt.registerTask('rultor', ['sasslint', 'sass:dist', 'sass:uncompressed', 'checkYear', 'validate']);
  grunt.registerTask('dev', ['sasslint', 'sass:dev', 'watch']);
}
<commit_msg>remove empty lines<commit_after>/**
 * The MIT License (MIT)
 *
 * Copyright (c) 2015-2019 Yegor Bugayenko
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

const fs = require('fs')
const child_process = require('child_process')

module.exports = function (grunt) {
  'use strict';
  grunt.util.linefeed = '\n';
  grunt.initConfig(
    {
      pkg: grunt.file.readJSON('package.json'),
      sass: {
        dev: {
          options: {
            sourceMap: true,
            outputStyle: 'compressed'
          },
          files: {
            'tacit.min.css': 'scss/main.scss'
          }
        },
        dist: {
          options: {
            sourceMap: true,
            outputStyle: 'compressed'
          },
          files: {
            'dist/<%= pkg.name %>-<%= pkg.version %>.min.css': 'scss/main.scss'
          }
        },
        uncompressed: {
          options: {
            sourceMap: false,
            outputStyle: 'expanded'
          },
          files: {
            'dist/<%= pkg.name %>-<%= pkg.version %>.css': 'scss/main.scss'
          }
        }
      },
      watch: {
        sass: {
          files: 'scss/{,*/}*.scss',
          tasks: ['sass:dev']
        }
      },
      sasslint: {
        allFiles: [
          'scss/*.scss'
        ]
      }
    }
  );
  require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });

  grunt.registerTask('checkYear', 'Checks the year patterns in copyright lines in source files.', () => {
    const pattern = `2015-${new Date().getFullYear()}`
    const invalidFiles = child_process.execSync('git ls-files LICENSE "*.scss" "*.html" "*.js"').toString().trim().split('\n').filter(file => {
      return !fs.readFileSync(file).toString().includes(pattern)
    })
    invalidFiles.forEach(file => {
      grunt.log.error(`The file, ${file}, does not include the pattern: ${pattern}`)
    })
    return invalidFiles.length === 0
  })
  grunt.registerTask('validate', 'validate css bundle with W3C Jigsaw', function () {
    const path = require('path');
    var validate = require('css-validator');
    const glob = require('glob');
    let srcPath = '';
    let css = '';
    glob("*.css", {}, function (err, files) {
      files.map(file => {
        srcPath = path.join(__dirname + '/dist', file);
        css = grunt.file.read(srcPath);
        var done = this.async();
        validate({ text: `${css}` }, function (error, data) {
          if (data.validity) {
            done(true);
          } else {
            done(false);
          }
        });
      })

    })
  })
  grunt.registerTask('default', ['sasslint', 'sass:dist', 'checkYear', 'validate']);
  grunt.registerTask('rultor', ['sasslint', 'sass:dist', 'sass:uncompressed', 'checkYear', 'validate']);
  grunt.registerTask('dev', ['sasslint', 'sass:dev', 'watch']);
}
<|endoftext|>


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

  'use strict';

  grunt.initConfig({

    /**
     * Pull in the package.json file so we can read its metadata.
     */
    pkg: grunt.file.readJSON('package.json'),

    /**
     *
     *  Pull in environment-specific vars
     *
     */
    env: grunt.file.readJSON('config.json'),

    /**
     * https://github.com/gruntjs/grunt-contrib-less
     */
    less: {
        development: {
            options: {
                paths: ['front_end/css/less', 'front_end/css/less/module'],
                yuicompress: true
            },
            files: {
                "front_end/css/style.min.css": "front_end/css/less/main.less"
            }
        }
    },

    /**
     * JSHint: https://github.com/gruntjs/grunt-contrib-jshint
     *
     * Validate files with JSHint.
     * Below are options that conform to idiomatic.js standards.
     * Feel free to add/remove your favorites: http://www.jshint.com/docs/#options
     */
    jshint: {
      options: {
        camelcase: true,
        curly: true,
        eqeqeq: true,
        forin: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        quotmark: true,
        undef: true,
        strict: true,
        unused: true,
        boss: true,
        browser: true,
        globalstrict: true,
        sub: true,
        globals: {
          jQuery: true,
          $: true,
          Backbone: true,
          _: true,
          require: true,
          define: true,
          subhead: true,
          toc: true,
          sidebar: true,
          regContent: true
        }
      },
      all: ['front_end/js/source/*.js', 'front_end/js/source/views/*.js', '!front_end/js/source/build.js', '!front_end/js/source/require.config.js']
    },

    /**
     * Jasmine: https://github.com/gruntjs/grunt-contrib-jasmine
     *
     * Run jasmine specs headlessly through PhantomJS.
     * jQuery and Jasmine jQuery is included for your pleasure: https://github.com/velesin/jasmine-jquery
     */
    jasmine: {
      all: {
        src: 'front_end/js/source',
        options: {
          template: require('grunt-template-jasmine-requirejs'),
          specs: 'front_end/js/tests/specs/*.js',
          templateOptions: {
            requireConfig: {
              baseUrl: 'front_end/js/source',
              paths: {
                underscore: './lib/underscore',
                backbone: './lib/backbone',
                jquery: './lib/jquery-1.9.1',
                samplejson: '../tests/grunt/js/fixtures/sample-json',
                'jquery-scrollstop': './lib/jquery.scrollstop',
                'jquery-hoverIntent': './lib/jquery.hoverIntent',
                'definition-view': './views/definition-view',
                'interpretation-view': './views/interpretation-view',
                'regs-fixed-el-view': './views/regs-fixed-el-view',
                'sub-head-view': './views/sub-head-view',
                'regs-view': './views/regs-view',
                'toc-view': './views/toc-view',
                'sidebar-view': './views/sidebar-view',
                'sidebar-head-view': './views/sidebar-head-view',
                'content-view': './views/content-view',
                'konami': './lib/konami'
              },
              shim: {
                underscore: {
                  exports: '_'
                },
                backbone: {
                  deps: ['underscore'],
                  exports: 'Backbone'
                },
                konami: {
                    exports: 'Konami'
                }
              }
            }
          }
        }
      }
    },

    /**
     * Watch: https://github.com/gruntjs/grunt-contrib-watch
     *
     * Run predefined tasks whenever watched file patterns are added, changed or deleted.
     * Add files to monitor below.
     */
    watch: {
      gruntfile: {
        files: ['Gruntfile.js', '<%= recess.dist.src %>', 'front_end/css/*.less', '<%= jasmine.options.specs %>'],
        tasks: ['build']
      }
    },

    /**
     *
     * https://npmjs.org/package/grunt-ghost
     *
     * Functional testing w/ Phantom, Casper
     *
     */
    ghost: {
        dist: {
            filesSrc: ['front_end/js/tests/functional/*.js'],
            options: {
                args: {
                    testUrl: '<%= env.testUrl %>'
                },
                direct: true,
                verbose: true,
                logLevel: 'debug'
            }
        }
    },

    requirejs: {
        compile: {
            options: {
                baseUrl: 'front_end/js/source',
                mainConfigFile: 'front_end/js/source/build.js',
                dir: "front_end/js/built",
                modules: [ {name: "regulations"} ],
                paths: {
                    jquery: './lib/jquery-1.9.1',
                    underscore: './lib/underscore',
                    backbone: './lib/backbone',
                    'jquery-scrollstop': './lib/jquery.scrollstop',
                    'definition-view': './views/definition-view',
                    'interpretation-view': './views/interpretation-view',
                    'regs-fixed-el-view': './views/regs-fixed-el-view',
                    'sub-head-view': './views/sub-head-view',
                    'regs-view': './views/regs-view',
                    'toc-view': './views/toc-view',
                    'sidebar-view': './views/sidebar-view',
                    'sidebar-head-view': './views/sidebar-head-view',
                    'content-view': './views/content-view',
                    'konami': './lib/konami'
                },
                shim: {
                    underscore: {
                        deps: ['jquery'],
                        exports: '_'
                    },
                    backbone: {
                        deps: ['underscore', 'jquery'],
                        exports: 'Backbone'
                    },
                    konami: {
                        exports: 'Konami'
                    }
                }
            }
        }
    }
  });

  /**
   * The above tasks are loaded here.
   */
    grunt.loadNpmTasks('grunt-contrib-jasmine');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-notify');
    grunt.loadNpmTasks('grunt-contrib-requirejs');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-ghost');

    /**
    * Create task aliases by registering new tasks
    */
    grunt.registerTask('test', ['jshint', 'jasmine']);
    grunt.registerTask('build', ['test', 'ghost', 'requirejs', 'less']);
    grunt.registerTask('squish', ['requirejs', 'less']);
};
<commit_msg>removing ghost from build<commit_after>module.exports = function(grunt) {

  'use strict';

  grunt.initConfig({

    /**
     * Pull in the package.json file so we can read its metadata.
     */
    pkg: grunt.file.readJSON('package.json'),

    /**
     *
     *  Pull in environment-specific vars
     *
     */
    env: grunt.file.readJSON('config.json'),

    /**
     * https://github.com/gruntjs/grunt-contrib-less
     */
    less: {
        development: {
            options: {
                paths: ['front_end/css/less', 'front_end/css/less/module'],
                yuicompress: true
            },
            files: {
                "front_end/css/style.min.css": "front_end/css/less/main.less"
            }
        }
    },

    /**
     * JSHint: https://github.com/gruntjs/grunt-contrib-jshint
     *
     * Validate files with JSHint.
     * Below are options that conform to idiomatic.js standards.
     * Feel free to add/remove your favorites: http://www.jshint.com/docs/#options
     */
    jshint: {
      options: {
        camelcase: true,
        curly: true,
        eqeqeq: true,
        forin: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        quotmark: true,
        undef: true,
        strict: true,
        unused: true,
        boss: true,
        browser: true,
        globalstrict: true,
        sub: true,
        globals: {
          jQuery: true,
          $: true,
          Backbone: true,
          _: true,
          require: true,
          define: true,
          subhead: true,
          toc: true,
          sidebar: true,
          regContent: true
        }
      },
      all: ['front_end/js/source/*.js', 'front_end/js/source/views/*.js', '!front_end/js/source/build.js', '!front_end/js/source/require.config.js']
    },

    /**
     * Jasmine: https://github.com/gruntjs/grunt-contrib-jasmine
     *
     * Run jasmine specs headlessly through PhantomJS.
     * jQuery and Jasmine jQuery is included for your pleasure: https://github.com/velesin/jasmine-jquery
     */
    jasmine: {
      all: {
        src: 'front_end/js/source',
        options: {
          template: require('grunt-template-jasmine-requirejs'),
          specs: 'front_end/js/tests/specs/*.js',
          templateOptions: {
            requireConfig: {
              baseUrl: 'front_end/js/source',
              paths: {
                underscore: './lib/underscore',
                backbone: './lib/backbone',
                jquery: './lib/jquery-1.9.1',
                samplejson: '../tests/grunt/js/fixtures/sample-json',
                'jquery-scrollstop': './lib/jquery.scrollstop',
                'jquery-hoverIntent': './lib/jquery.hoverIntent',
                'definition-view': './views/definition-view',
                'interpretation-view': './views/interpretation-view',
                'regs-fixed-el-view': './views/regs-fixed-el-view',
                'sub-head-view': './views/sub-head-view',
                'regs-view': './views/regs-view',
                'toc-view': './views/toc-view',
                'sidebar-view': './views/sidebar-view',
                'sidebar-head-view': './views/sidebar-head-view',
                'content-view': './views/content-view',
                'konami': './lib/konami'
              },
              shim: {
                underscore: {
                  exports: '_'
                },
                backbone: {
                  deps: ['underscore'],
                  exports: 'Backbone'
                },
                konami: {
                    exports: 'Konami'
                }
              }
            }
          }
        }
      }
    },

    /**
     * Watch: https://github.com/gruntjs/grunt-contrib-watch
     *
     * Run predefined tasks whenever watched file patterns are added, changed or deleted.
     * Add files to monitor below.
     */
    watch: {
      gruntfile: {
        files: ['Gruntfile.js', '<%= recess.dist.src %>', 'front_end/css/*.less', '<%= jasmine.options.specs %>'],
        tasks: ['build']
      }
    },

    /**
     *
     * https://npmjs.org/package/grunt-ghost
     *
     * Functional testing w/ Phantom, Casper
     *
     */
    ghost: {
        dist: {
            filesSrc: ['front_end/js/tests/functional/*.js'],
            options: {
                args: {
                    testUrl: '<%= env.testUrl %>'
                },
                direct: true,
                verbose: true,
                logLevel: 'debug'
            }
        }
    },

    requirejs: {
        compile: {
            options: {
                baseUrl: 'front_end/js/source',
                mainConfigFile: 'front_end/js/source/build.js',
                dir: "front_end/js/built",
                modules: [ {name: "regulations"} ],
                paths: {
                    jquery: './lib/jquery-1.9.1',
                    underscore: './lib/underscore',
                    backbone: './lib/backbone',
                    'jquery-scrollstop': './lib/jquery.scrollstop',
                    'definition-view': './views/definition-view',
                    'interpretation-view': './views/interpretation-view',
                    'regs-fixed-el-view': './views/regs-fixed-el-view',
                    'sub-head-view': './views/sub-head-view',
                    'regs-view': './views/regs-view',
                    'toc-view': './views/toc-view',
                    'sidebar-view': './views/sidebar-view',
                    'sidebar-head-view': './views/sidebar-head-view',
                    'content-view': './views/content-view',
                    'konami': './lib/konami'
                },
                shim: {
                    underscore: {
                        deps: ['jquery'],
                        exports: '_'
                    },
                    backbone: {
                        deps: ['underscore', 'jquery'],
                        exports: 'Backbone'
                    },
                    konami: {
                        exports: 'Konami'
                    }
                }
            }
        }
    }
  });

  /**
   * The above tasks are loaded here.
   */
    grunt.loadNpmTasks('grunt-contrib-jasmine');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-notify');
    grunt.loadNpmTasks('grunt-contrib-requirejs');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-ghost');

    /**
    * Create task aliases by registering new tasks
    */
    grunt.registerTask('test', ['jshint', 'jasmine']);
    grunt.registerTask('build', ['test', 'requirejs', 'less']);
    grunt.registerTask('squish', ['requirejs', 'less']);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
	var hatemileDirectory = 'dist/content/scripts/hatemile/';

	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		copy: {
			main: {
				files: [
					// includes files within path and its sub-directories
					{expand: true, cwd: 'src/', src: ['**'], dest: 'dist/'},
				],
			},
		},
		clean: {
			remove_dist_files: ['dist/'],
			remove_unused_files: [hatemileDirectory + '.github/', hatemileDirectory + 'bower.json', hatemileDirectory + 'CODE_OF_CONDUCT.md', hatemileDirectory + 'README.md', hatemileDirectory + 'README.md', hatemileDirectory + '.git', hatemileDirectory + 'coffee/', hatemileDirectory + 'js/hatemile/AccessibleAssociation.js', hatemileDirectory + 'js/hatemile/AccessibleCSS.js', hatemileDirectory + 'js/hatemile/AccessibleDisplay.js', hatemileDirectory + 'js/hatemile/AccessibleEvent.js', hatemileDirectory + 'js/hatemile/AccessibleForm.js', hatemileDirectory + 'js/hatemile/AccessibleNavigation.js', hatemileDirectory + 'js/hatemile/util/html/HTMLDOMElement.js', hatemileDirectory + 'js/hatemile/util/html/HTMLDOMNode.js', hatemileDirectory + 'js/hatemile/util/html/HTMLDOMParser.js', hatemileDirectory + 'js/hatemile/util/html/HTMLDOMTextNode.js', hatemileDirectory + '_locales/', hatemileDirectory + 'js/hatemile/util/html/jquery/', hatemileDirectory + 'js/hatemile/util/css/', hatemileDirectory + 'js/hatemile/implementation/AccessibleCSSImplementation.js'],
			remove_source_files: ['dist/content/', 'dist/defaults/', 'dist/locale/', 'dist/skin/', 'dist/chrome.manifest', 'dist/install.rdf']
		},
		comments: {
			hatemile_for_javascript: {
				options: {
					singleline: true,
					multiline: true,
					keepSpecialComments: false
				},
				src: [hatemileDirectory + '**/*.js']
			},
		},
		'regex-replace': {
			main: {
				src: [hatemileDirectory + 'js/hatemile/util/html/vanilla/VanillaHTMLDOMElement.js'],
				actions: [
					{
						name: 'bar',
						search: 'VanillaHTMLDOMElement\\.prototype\\.getInnerHTML = function\\(\\) {[\\n\\r\\t\\s]*return this\\.data\\.innerHTML;[\\n\\r\\t\\s]*};',
						replace: '',
						flags: 'g'
					},
					{
						name: 'foo',
						search: 'VanillaHTMLDOMElement\\.prototype\\.setInnerHTML = function\\(html\\) {[\\n\\r\\t\\s]*this\\.data\\.innerHTML = html;[\\n\\r\\t\\s]*};',
						replace: '',
						flags: 'g'
					}
					,{
						name: 'foobar',
						search: 'VanillaHTMLDOMElement\\.prototype\\.getOuterHTML = function\\(\\) {[\\n\\r\\t\\s]*return this\\.data\\.outerHTML;[\\n\\r\\t\\s]*};',
						replace: '',
						flags: 'g'
					}
					,{
						name: 'baz',
						search: 'VanillaHTMLDOMElement\\.prototype\\.cloneElement = function\\(\\) {[\\n\\r\\t\\s]*var div;[\\n\\r\\t\\s]*div = this\\.data\\.ownerDocument\\.createElement\\(\'div\'\\);[\\n\\r\\t\\s]*div\\.innerHTML = this\\.getOuterHTML\\(\\);[\\n\\r\\t\\s]*return new exports\\.hatemile\\.util\\.html\\.vanilla\\.VanillaHTMLDOMElement\\(div\\.firstElementChild\\);[\\n\\r\\t\\s]*};',
						replace: '',
						flags: 'g'
					}
				]
			}
		},
		compress: {
			main: {
				options: {
					archive: 'dist/firefox-hatemile-for-browser.xpi',
					mode: 'zip'
				},
				files: [{
					expand: true,
					cwd: 'dist/',
					src: ['**'],
					dest: '/'
				}]
			}
		}
	});

	// Load dependencies.
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-stripcomments');
	grunt.loadNpmTasks('grunt-regex-replace');
	grunt.loadNpmTasks('grunt-contrib-compress');

	// Default task(s).
	grunt.registerTask('default', ['clean:remove_dist_files', 'copy', 'clean:remove_unused_files', 'comments', 'regex-replace', 'compress', 'clean:remove_source_files']);
};
<commit_msg>:bug: Remove cloneElement method on XPInstall file<commit_after>module.exports = function(grunt) {
	var hatemileDirectory = 'dist/content/scripts/hatemile/';

	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		copy: {
			main: {
				files: [
					// includes files within path and its sub-directories
					{expand: true, cwd: 'src/', src: ['**'], dest: 'dist/'},
				],
			},
		},
		clean: {
			remove_dist_files: ['dist/'],
			remove_unused_files: [hatemileDirectory + '.github/', hatemileDirectory + 'bower.json', hatemileDirectory + 'CODE_OF_CONDUCT.md', hatemileDirectory + 'README.md', hatemileDirectory + 'README.md', hatemileDirectory + '.git', hatemileDirectory + 'coffee/', hatemileDirectory + 'js/hatemile/AccessibleAssociation.js', hatemileDirectory + 'js/hatemile/AccessibleCSS.js', hatemileDirectory + 'js/hatemile/AccessibleDisplay.js', hatemileDirectory + 'js/hatemile/AccessibleEvent.js', hatemileDirectory + 'js/hatemile/AccessibleForm.js', hatemileDirectory + 'js/hatemile/AccessibleNavigation.js', hatemileDirectory + 'js/hatemile/util/html/HTMLDOMElement.js', hatemileDirectory + 'js/hatemile/util/html/HTMLDOMNode.js', hatemileDirectory + 'js/hatemile/util/html/HTMLDOMParser.js', hatemileDirectory + 'js/hatemile/util/html/HTMLDOMTextNode.js', hatemileDirectory + '_locales/', hatemileDirectory + 'js/hatemile/util/html/jquery/', hatemileDirectory + 'js/hatemile/util/css/', hatemileDirectory + 'js/hatemile/implementation/AccessibleCSSImplementation.js'],
			remove_source_files: ['dist/content/', 'dist/defaults/', 'dist/locale/', 'dist/skin/', 'dist/chrome.manifest', 'dist/install.rdf']
		},
		comments: {
			hatemile_for_javascript: {
				options: {
					singleline: true,
					multiline: true,
					keepSpecialComments: false
				},
				src: [hatemileDirectory + '**/*.js']
			},
		},
		'regex-replace': {
			main: {
				src: [hatemileDirectory + 'js/hatemile/util/html/vanilla/VanillaHTMLDOMElement.js'],
				actions: [
					{
						name: 'remove_get_inner_html',
						search: 'VanillaHTMLDOMElement\\.prototype\\.getInnerHTML = function\\(\\) {[\\n\\r\\t\\s]*return this\\.data\\.innerHTML;[\\n\\r\\t\\s]*};',
						replace: '',
						flags: 'g'
					},
					{
						name: 'remove_set_inner_html',
						search: 'VanillaHTMLDOMElement\\.prototype\\.setInnerHTML = function\\(html\\) {[\\n\\r\\t\\s]*this\\.data\\.innerHTML = html;[\\n\\r\\t\\s]*};',
						replace: '',
						flags: 'g'
					}
					,{
						name: 'remove_get_outer_html',
						search: 'VanillaHTMLDOMElement\\.prototype\\.getOuterHTML = function\\(\\) {[\\n\\r\\t\\s]*return this\\.data\\.outerHTML;[\\n\\r\\t\\s]*};',
						replace: '',
						flags: 'g'
					}
					,{
						name: 'remove_clone_element',
						search: 'VanillaHTMLDOMElement\\.prototype\\.cloneElement = function\\(\\) {[\\n\\r\\t\\s]*var div;[\\n\\r\\t\\s]*div = this\\.data\\.ownerDocument\\.createElement\\(\'div\'\\);[\\n\\r\\t\\s]*div\\.innerHTML = this\\.getOuterHTML\\(\\);[\\n\\r\\t\\s]*return new __exports\\.hatemile\\.util\\.html\\.vanilla\\.VanillaHTMLDOMElement\\(div\\.firstElementChild\\);[\\n\\r\\t\\s]*};',
						replace: '',
						flags: 'g'
					}
				]
			}
		},
		compress: {
			main: {
				options: {
					archive: 'dist/firefox-hatemile-for-browser.xpi',
					mode: 'zip'
				},
				files: [{
					expand: true,
					cwd: 'dist/',
					src: ['**'],
					dest: '/'
				}]
			}
		}
	});

	// Load dependencies.
	grunt.loadNpmTasks('grunt-contrib-copy');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-stripcomments');
	grunt.loadNpmTasks('grunt-regex-replace');
	grunt.loadNpmTasks('grunt-contrib-compress');

	// Default task(s).
	grunt.registerTask('default', ['clean:remove_dist_files', 'copy', 'clean:remove_unused_files', 'comments', 'regex-replace', 'compress', 'clean:remove_source_files']);
};
<|endoftext|>


<commit_before>/*!
 * FastGap's Gruntfile
 * http://fastgap.mobi/
 * Licensed under MIT
 */

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

  var appConfig = {

    // Default Paths
    paths: {
      src: 'src',
      dist: 'dist',
      bower: 'bower_components'
    },

    // Assets directory
    dirs: {
      sass: "<%= paths.src %>/assets/scss",
      css: "<%= paths.src %>/assets/css",
      img: "<%= paths.src %>/assets/images",
      vendor: "<%= paths.src %>/vendor",
      pages: "<%= paths.src %>/pages",
      fonts: "<%= paths.src %>/vendor/topcoat/font"
    },

    // Load package.json
    pkg: grunt.file.readJSON("package.json"),

    // Banner
    banner: '/*!\n' +
            " * FastGap v<%= pkg.version %> (<%= pkg.homepage %>)\n" +
            " * Author: <%= pkg.author.name %>\n" +
            " * Maintainers: https://github.com/orgs/FastGap/members\n" +
            " * Copyright (c) <%= grunt.template.today(\"yyyy\") %>\n" +
            ' * Licensed under <%= pkg.license %>\n' +
            ' */\n',

    /************************************
     * grunt-contrib-clean
     * Clean files and folders
     ************************************/
    clean: {
      dist: 'dist/{css,js}'
    },

    /************************************
     * grunt-sass
     * Compile SCSS to CSS using node-sass
     ************************************/
    sass: {
      development: {
        options: {
          includePaths: ['<%= paths.src %>/scss/base/'],
          outputStyle: 'nested'
        },
        files: {
          '<%= paths.dist %>/css/fastgap.css': '<%= paths.src %>/scss/build.scss'
        }
      },
      production: {
        options: {
          includePaths: ['<%= paths.src %>/scss/base/'],
          outputStyle: 'compressed'
        },
        files: {
          '<%= paths.dist %>/css/fastgap.min.css': '<%= paths.src %>/scss/build.scss'
        }
      }
    },

    // Watch files
    watch: {
      options: {
        livereload: true
      },
      css: {
        files: ["<%= dirs.sass %>/{,*/}*.{scss,sass}"],
        tasks: ["compass", "notify:compass"]
      },
      js: {
        files: ["<%= jshint.all %>"],
        tasks: ["jshint", "uglify", "notify:js"]
      },
      html: {
        files: [
          // carregamento automático do browser para as atualizações das extensões abaixo
          "/*.{html,htm,shtml,shtm,xhtml,php,jsp,asp,aspx,erb,ctp}"
        ]
      }
    },

    // Files Validation
    jshint: {
      options: {
          jshintrc: ".jshintrc"
      },
      all: [
          "Gruntfile.js",
          "<%= dirs.js %>/main.js"
      ]
    },

    /************************************
     * grunt-contrib-concat
     * Concatenate files
     ************************************/
    concat: {
      controllers: {
        src: [
          // Main
          '<%= paths.src %>/js/controllers/AppController.js',
          '<%= paths.src %>/js/controllers/HomeController.js',
          // Custom
          '<%= paths.src %>/js/controllers/Page1Controller.js',
          '<%= paths.src %>/js/controllers/Page2Controller.js',
          '<%= paths.src %>/js/controllers/Page3Controller.js',
          '<%= paths.src %>/js/controllers/Page4Controller.js',
          '<%= paths.src %>/js/controllers/Page5Controller.js'
        ],
        dest: '<%= paths.dist %>/js/fastgap.controllers.js'
      },
      libraries: {
        src: [
          // Main
          '<%= paths.bower %>/zepto/zepto.js',
          '<%= paths.bower %>/fastclick/lib/fastclick.js',
          // Scroll
          '<%= paths.bower %>/overthrow-dist/overthrow.js',
          // Snap.js (menu)
          '<%= paths.bower %>/snapjs/snap.js'
        ],
        dest: '<%= paths.dist %>/js/fastgap.libs.js'
      },
      core: {
        src: [
          // Main
          '<%= paths.src %>/js/History.js',
          '<%= paths.src %>/js/FG.js',
          '<%= paths.src %>/js/Navigator.js',
          '<%= paths.src %>/js/Transition.js',
          '<%= paths.src %>/js/PageLoad.js',
          '<%= paths.src %>/js/index.js'
        ],
        dest: '<%= paths.dist %>/js/fastgap.core.js'
      },
      fastgap: {
        src: [
          '<%= paths.dist %>/js/fastgap.controllers.js',
          '<%= paths.dist %>/js/fastgap.libs.js',
          '<%= paths.dist %>/js/fastgap.core.js'
        ],
        dest: '<%= paths.dist %>/js/fastgap.js'
      }
    },

    /************************************
     * grunt-contrib-uglify
     * Minify files
     ************************************/
    uglify: {
      js: {
        src: '<%= paths.dist %>/js/fastgap.js',
        dest: '<%= paths.dist %>/js/fastgap.min.js'
      }
    },

    // Notificações
    notify: {
      compass: {
        options: {
          title: "SASS - <%= pkg.title %>",
          message: "Build with success!"
        }
      },
      js: {
        options: {
          title: "Javascript - <%= pkg.title %>",
          message: "Minified and validated with success!"
        }
      }
    },

    /************************************
     * grunt-contrib-imagemin
     * Minify PNG, JPEG and GIF images
     ************************************/
    imagemin: {                          // Task
      dynamic: {
        options: {                       // Target options
          optimizationLevel: 3
        },                        // Another target
        files: [{
          expand: true,                  // Enable dynamic expansion
          cwd: '<%= paths.src %>/',                   // Src matches are relative to this path
          src: ['**/*.{png,jpg,gif}'],   // Actual patterns to match
          dest: '<%= paths.dist %>/'                  // Destination path prefix
        }]
      }
    },

    /************************************
     * grunt-contrib-copy
     * Copy files and folders to a specific path
     ************************************/
    copy: {
      imagesToDemo: {
        expand: true,
        cwd: '<%= paths.dist %>/img',
        src: ['*.png', '*.jpg', '*.gif'],
        dest: 'demo/assets/img'
      },
      fastgapJs: {
        expand: true,
        cwd: '<%= paths.dist %>/js',
        src: ['*.js'],
        dest: 'demo/assets/js'
      },
      snapCSS: {
        expand: true,
        cwd: '<%= paths.bower %>/snapjs',
        src: ['snap.css'],
        dest: 'demo/assets/css'
      },
      topcoatCSS: {
        expand: true,
        cwd: '<%= paths.bower %>/topcoat/css',
        src: ['topcoat-mobile-light.min.css'],
        dest: 'demo/assets/css'
      },
      fastgapCSS: {
        expand: true,
        cwd: '<%= paths.dist %>/css',
        src: ['fastgap.min.css'],
        dest: 'demo/assets/css'
      }
    },

    /************************************
     * grunt-banner
     * Adds a simple banner to files
     ************************************/
    usebanner: {
      options: {
        position: 'top',
        banner: '<%= banner %>'
      },
      files: {
        src: '<%= paths.dist %>/{css,js}/{*.css,*.js}'
      }
    },

    /************************************
     * grunt-bump
     * Bump package version, create tag, commit, push...
     ************************************/
    bump: {
      options: {
        files: ['package.json', 'bower.json'],
        updateConfigs: [],
        commit: true,
        commitMessage: '%VERSION%',
        commitFiles: ['package.json', 'bower.json', 'dist/', 'demo/'], // '-a' for all files
        createTag: true,
        tagName: '%VERSION%',
        tagMessage: '%VERSION%',
        push: true,
        pushTo: 'master',
        gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
      }
    }

  };

  // Init grunt configurations
  grunt.initConfig(appConfig);

  // Tasks
  // --------------------------

  // load all grunt tasks matching the `grunt-*` pattern
  require('load-grunt-tasks')(grunt);

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

  // Dist JS
  grunt.registerTask('dist-js', ['concat', 'uglify']);
  // Dist CSS
  grunt.registerTask('dist-css', ['sass']);
  // Dist IMG
  grunt.registerTask('dist-img', ['imagemin']);

  // Watch Task
  grunt.registerTask('w', ['watch']);

  // Default task
  grunt.registerTask('dist', ['clean', 'dist-js', 'dist-css', 'dist-img', 'copy', 'usebanner']);
  grunt.registerTask('build', ['dist']);
  grunt.registerTask('default', ['dist']);

};
<commit_msg>Update Gruntfile.js<commit_after>/*!
 * FastGap's Gruntfile
 * http://fastgap.mobi/
 * Licensed under MIT
 */

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

  var appConfig = {

    // Default Paths
    paths: {
      src: 'src',
      dist: 'dist',
      bower: 'bower_components'
    },

    // Assets directory
    dirs: {
      sass: "<%= paths.src %>/assets/scss",
      css: "<%= paths.src %>/assets/css",
      img: "<%= paths.src %>/assets/images",
      vendor: "<%= paths.src %>/vendor",
      pages: "<%= paths.src %>/pages",
      fonts: "<%= paths.src %>/vendor/topcoat/font"
    },

    // Load package.json
    pkg: grunt.file.readJSON("package.json"),

    // Banner
    banner: '/*!\n' +
            " * FastGap v<%= pkg.version %> (<%= pkg.homepage %>)\n" +
            " * Author: <%= pkg.author.name %>\n" +
            " * Maintainers: https://github.com/orgs/FastGap/members\n" +
            " * Copyright (c) <%= grunt.template.today(\"yyyy\") %>\n" +
            ' * Licensed under <%= pkg.license %>\n' +
            ' */\n',

    /************************************
     * grunt-contrib-clean
     * Clean files and folders
     ************************************/
    clean: {
      dist: 'dist/{css,js}'
    },

    /************************************
     * grunt-sass
     * Compile SCSS to CSS using node-sass
     ************************************/
    sass: {
      development: {
        options: {
          includePaths: ['<%= paths.src %>/scss/base/'],
          outputStyle: 'nested'
        },
        files: {
          '<%= paths.dist %>/css/fastgap.css': '<%= paths.src %>/scss/build.scss'
        }
      },
      production: {
        options: {
          includePaths: ['<%= paths.src %>/scss/base/'],
          outputStyle: 'compressed'
        },
        files: {
          '<%= paths.dist %>/css/fastgap.min.css': '<%= paths.src %>/scss/build.scss'
        }
      }
    },

    // Watch files
    watch: {
      options: {
        livereload: true
      },
      css: {
        files: ["<%= dirs.sass %>/{,*/}*.{scss,sass}"],
        tasks: ["compass", "notify:compass"]
      },
      js: {
        files: ["<%= jshint.all %>"],
        tasks: ["jshint", "uglify", "notify:js"]
      },
      html: {
        files: [
          // carregamento automático do browser para as atualizações das extensões abaixo
          "/*.{html,htm,shtml,shtm,xhtml,php,jsp,asp,aspx,erb,ctp}"
        ]
      }
    },

    // Files Validation
    jshint: {
      options: {
          jshintrc: ".jshintrc"
      },
      all: [
          "Gruntfile.js",
          "<%= dirs.js %>/main.js"
      ]
    },

    /************************************
     * grunt-contrib-concat
     * Concatenate files
     ************************************/
    concat: {
      controllers: {
        src: [
          // Main
          '<%= paths.src %>/js/controllers/AppController.js',
          '<%= paths.src %>/js/controllers/HomeController.js',
          // Custom
          '<%= paths.src %>/js/controllers/Page1Controller.js',
          '<%= paths.src %>/js/controllers/Page2Controller.js',
          '<%= paths.src %>/js/controllers/Page3Controller.js',
          '<%= paths.src %>/js/controllers/Page4Controller.js',
          '<%= paths.src %>/js/controllers/Page5Controller.js'
        ],
        dest: '<%= paths.dist %>/js/fastgap.controllers.js'
      },
      libraries: {
        src: [
          // Main
          '<%= paths.bower %>/zepto/zepto.js',
          '<%= paths.bower %>/fastclick/lib/fastclick.js',
          // Scroll
          '<%= paths.bower %>/overthrow-dist/overthrow.js',
          // Snap.js (menu)
          '<%= paths.bower %>/snapjs/snap.js'
        ],
        dest: '<%= paths.dist %>/js/fastgap.libs.js'
      },
      core: {
        src: [
          // Main
          '<%= paths.src %>/js/History.js',
          '<%= paths.src %>/js/FG.js',
          '<%= paths.src %>/js/Navigator.js',
          '<%= paths.src %>/js/Transition.js',
          '<%= paths.src %>/js/PageLoad.js',
          '<%= paths.src %>/js/index.js'
        ],
        dest: '<%= paths.dist %>/js/fastgap.core.js'
      },
      fastgap: {
        src: [
          '<%= paths.dist %>/js/fastgap.controllers.js',
          '<%= paths.dist %>/js/fastgap.libs.js',
          '<%= paths.dist %>/js/fastgap.core.js'
        ],
        dest: '<%= paths.dist %>/js/fastgap.js'
      }
    },

    /************************************
     * grunt-contrib-uglify
     * Minify files
     ************************************/
    uglify: {
      js: {
        src: '<%= paths.dist %>/js/fastgap.js',
        dest: '<%= paths.dist %>/js/fastgap.min.js'
      }
    },

    // Notificações
    notify: {
      compass: {
        options: {
          title: "SASS - <%= pkg.title %>",
          message: "Build with success!"
        }
      },
      js: {
        options: {
          title: "Javascript - <%= pkg.title %>",
          message: "Minified and validated with success!"
        }
      }
    },

    /************************************
     * grunt-contrib-imagemin
     * Minify PNG, JPEG and GIF images
     ************************************/
    imagemin: {                          // Task
      dynamic: {
        options: {                       // Target options
          optimizationLevel: 3
        },                        // Another target
        files: [{
          expand: true,                  // Enable dynamic expansion
          cwd: '<%= paths.src %>/',                   // Src matches are relative to this path
          src: ['**/*.{png,jpg,gif}'],   // Actual patterns to match
          dest: '<%= paths.dist %>/'                  // Destination path prefix
        }]
      }
    },

    /************************************
     * grunt-contrib-copy
     * Copy files and folders to a specific path
     ************************************/
    copy: {
      imagesToDemo: {
        expand: true,
        cwd: '<%= paths.dist %>/img',
        src: ['*.png', '*.jpg', '*.gif'],
        dest: 'demo/assets/img'
      },
      fastgapJs: {
        expand: true,
        cwd: '<%= paths.dist %>/js',
        src: ['*.js'],
        dest: 'demo/assets/js'
      },
      snapCSS: {
        expand: true,
        cwd: '<%= paths.bower %>/snapjs',
        src: ['snap.css'],
        dest: 'demo/assets/css'
      },
      topcoatCSS: {
        expand: true,
        cwd: '<%= paths.bower %>/topcoat/css',
        src: ['topcoat-mobile-light.min.css'],
        dest: 'demo/assets/css'
      },
      fastgapCSS: {
        expand: true,
        cwd: '<%= paths.dist %>/css',
        src: ['fastgap.min.css'],
        dest: 'demo/assets/css'
      }
    },

    /************************************
     * grunt-banner
     * Adds a simple banner to files
     ************************************/
    usebanner: {
      options: {
        position: 'top',
        banner: '<%= banner %>'
      },
      files: {
        src: '<%= paths.dist %>/{css,js}/{*.css,*.js}'
      }
    },

    /************************************
     * grunt-bump
     * Bump package version, create tag, commit, push...
     ************************************/
    bump: {
      options: {
        files: ['package.json', 'bower.json'],
        updateConfigs: [],
        commit: true,
        commitMessage: '%VERSION%',
        commitFiles: ['package.json', 'bower.json', 'dist/', 'demo/'], // '-a' for all files
        createTag: true,
        tagName: '%VERSION%',
        tagMessage: '%VERSION%',
        push: true,
        pushTo: 'master',
        gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
      }
    }

  };

  // Init grunt configurations
  grunt.initConfig(appConfig);

  // Tasks
  // --------------------------

  // load all grunt tasks matching the `grunt-*` pattern
  require('load-grunt-tasks')(grunt);

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

  // Dist JS
  grunt.registerTask('dist-js', ['concat', 'uglify']);
  // Dist CSS
  grunt.registerTask('dist-css', ['sass']);
  // Dist IMG
  grunt.registerTask('dist-img', ['imagemin']);

  // Watch Task
  grunt.registerTask('w', ['watch']);

  // Default task
  grunt.registerTask('dist', ['clean', 'dist-js', 'dist-css', 'dist-img', 'usebanner', 'copy']);
  grunt.registerTask('build', ['dist']);
  grunt.registerTask('default', ['dist']);

};
<|endoftext|>