<commit_before>module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            main: {
                files: [
                    {expand: true, cwd: '<%= pkg.sourcePath %>/', src: ['**'], dest: '<%= pkg.buildPath %>/'}
                ]
            },
            bower: {
                files: [
                    {src: '<%= pkg.libPath %>/jquery/dist/jquery.min.js', dest: '<%= pkg.buildPath %>/scripts/jquery.min.js'},

                    {src: '<%= pkg.libPath %>/webextension-polyfill/dist/browser-polyfill.min.js', dest: '<%= pkg.buildPath %>/scripts/browser-polyfill.min.js'},

                    {src: '<%= pkg.libPath %>/mustache/mustache.min.js', dest: '<%= pkg.buildPath %>/scripts/mustache.min.js'},

                    {src: '<%= pkg.libPath %>/dompurify/dist/purify.min.js', dest: '<%= pkg.buildPath %>/scripts/purify.min.js'},

                    {src: '<%= pkg.libPath %>/timeago.js/dist/timeago.min.js', dest: '<%= pkg.buildPath %>/scripts/timeago.min.js'},
                    {src: '<%= pkg.libPath %>/timeago.js/dist/timeago.locales.min.js', dest: '<%= pkg.buildPath %>/scripts/timeago.locales.min.js'},
                ]
            }
        },
        "string-replace": {
            keys: {
                files: {
                    "<%= pkg.buildPath %>/scripts/core.js": "<%= pkg.buildPath %>/scripts/core.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: 'clientSecret: ""',
                            replacement: 'clientSecret: "' + grunt.option("clientSecret") + '"'
                        },
                        {
                            pattern: 'clientId: ""',
                            replacement: 'clientId: "' + grunt.option("clientId") + '"'
                        }
                    ]
                }
            },
            sandboxApi: {
                files: {
                    "<%= pkg.buildPath %>/scripts/feedly.api.js": "<%= pkg.buildPath %>/scripts/feedly.api.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: /http(?:s)?:\/\/(?:www\.)?cloud\.feedly\.com/gi,
                            replacement: "http://sandbox7.feedly.com"
                        }
                    ]
                }
            },
            sandboxLink: {
                files: {
                    "<%= pkg.buildPath %>/scripts/core.js": "<%= pkg.buildPath %>/scripts/core.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: /http(?:s)?:\/\/(?:www\.)?feedly\.com/gi,
                            replacement: "http://sandbox7.feedly.com"
                        },
                        {
                            pattern: /var\s+redirectUri\s+=\s+[^;]*/gi,
                            replacement: "var redirectUri = 'http://localhost'"
                        }
                    ]
                }
            }
        },
        uglify: {
            dist: {
                files: {
                    "<%= pkg.buildPath %>/scripts/core.js": ["<%= pkg.buildPath %>/scripts/core.js"],
                    "<%= pkg.buildPath %>/scripts/feedly.api.js": ["<%= pkg.buildPath %>/scripts/feedly.api.js"],
                    "<%= pkg.buildPath %>/scripts/options.js": ["<%= pkg.buildPath %>/scripts/options.js"],
                    "<%= pkg.buildPath %>/scripts/popup.js": ["<%= pkg.buildPath %>/scripts/popup.js"]
                }
            }
        },
        zip: {
            build: {
                cwd: "<%= pkg.buildPath %>/",
                src: ["<%= pkg.buildPath %>/**"],
                dest: '<%= pkg.buildPath %>/feedly-notifier.zip',
                compression: 'DEFLATE'
            }
        },
        clean: {
            "pre-build": ["<%= pkg.buildPath %>"],
            build: {
                files: [
                    {expand: true, cwd: "<%= pkg.buildPath %>", src: ["*", "!*.zip"]}
                ]
            }
        },
        preprocess: {
            js: {
                files: [
                    {src: ["<%= pkg.buildPath %>/scripts/*.js"]},
                    {src: ["<%= pkg.buildPath %>/*.json"]}
                ],
                options: {
                    inline: true,
                    context: {
                        BROWSER: grunt.option("browser")
                    },
                    type: "js"
                }
            },
            html: {
                files: [
                    {src: ["<%= pkg.buildPath %>/*.html"]}
                ],
                options: {
                    inline: true,
                    context: {
                        BROWSER: grunt.option("browser")
                    }
                }
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-copy");
    grunt.loadNpmTasks('grunt-string-replace');
    grunt.loadNpmTasks('grunt-zip');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-preprocess');

    grunt.registerTask("build", ["clean:pre-build", "copy", "string-replace:keys", "preprocess", "zip", "clean:build"]);
    grunt.registerTask("sandbox", ["copy", "string-replace", "preprocess"]);
    grunt.registerTask("default", ["copy", "string-replace:keys", "preprocess"]);
};
<commit_msg>Fixed build for sandbox<commit_after>module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        copy: {
            main: {
                files: [
                    {expand: true, cwd: '<%= pkg.sourcePath %>/', src: ['**'], dest: '<%= pkg.buildPath %>/'}
                ]
            },
            bower: {
                files: [
                    {src: '<%= pkg.libPath %>/jquery/dist/jquery.min.js', dest: '<%= pkg.buildPath %>/scripts/jquery.min.js'},

                    {src: '<%= pkg.libPath %>/webextension-polyfill/dist/browser-polyfill.min.js', dest: '<%= pkg.buildPath %>/scripts/browser-polyfill.min.js'},

                    {src: '<%= pkg.libPath %>/mustache/mustache.min.js', dest: '<%= pkg.buildPath %>/scripts/mustache.min.js'},

                    {src: '<%= pkg.libPath %>/dompurify/dist/purify.min.js', dest: '<%= pkg.buildPath %>/scripts/purify.min.js'},

                    {src: '<%= pkg.libPath %>/timeago.js/dist/timeago.min.js', dest: '<%= pkg.buildPath %>/scripts/timeago.min.js'},
                    {src: '<%= pkg.libPath %>/timeago.js/dist/timeago.locales.min.js', dest: '<%= pkg.buildPath %>/scripts/timeago.locales.min.js'},
                ]
            }
        },
        "string-replace": {
            keys: {
                files: {
                    "<%= pkg.buildPath %>/scripts/core.js": "<%= pkg.buildPath %>/scripts/core.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: 'clientSecret: ""',
                            replacement: 'clientSecret: "' + grunt.option("clientSecret") + '"'
                        },
                        {
                            pattern: 'clientId: ""',
                            replacement: 'clientId: "' + grunt.option("clientId") + '"'
                        }
                    ]
                }
            },
            sandboxApi: {
                files: {
                    "<%= pkg.buildPath %>/scripts/feedly.api.js": "<%= pkg.buildPath %>/scripts/feedly.api.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: /http(?:s)?:\/\/(?:www\.)?cloud\.feedly\.com/gi,
                            replacement: "http://sandbox7.feedly.com"
                        }
                    ]
                }
            },
            sandboxLink: {
                files: {
                    "<%= pkg.buildPath %>/scripts/core.js": "<%= pkg.buildPath %>/scripts/core.js"
                },
                options: {
                    replacements: [
                        {
                            pattern: /http(?:s)?:\/\/(?:www\.)?feedly\.com/gi,
                            replacement: "http://sandbox7.feedly.com"
                        },
                        {
                            pattern: /let\s+redirectUri\s+=\s+[^;]*/gi,
                            replacement: "let redirectUri = 'http://localhost'"
                        }
                    ]
                }
            }
        },
        uglify: {
            dist: {
                files: {
                    "<%= pkg.buildPath %>/scripts/core.js": ["<%= pkg.buildPath %>/scripts/core.js"],
                    "<%= pkg.buildPath %>/scripts/feedly.api.js": ["<%= pkg.buildPath %>/scripts/feedly.api.js"],
                    "<%= pkg.buildPath %>/scripts/options.js": ["<%= pkg.buildPath %>/scripts/options.js"],
                    "<%= pkg.buildPath %>/scripts/popup.js": ["<%= pkg.buildPath %>/scripts/popup.js"]
                }
            }
        },
        zip: {
            build: {
                cwd: "<%= pkg.buildPath %>/",
                src: ["<%= pkg.buildPath %>/**"],
                dest: '<%= pkg.buildPath %>/feedly-notifier.zip',
                compression: 'DEFLATE'
            }
        },
        clean: {
            "pre-build": ["<%= pkg.buildPath %>"],
            build: {
                files: [
                    {expand: true, cwd: "<%= pkg.buildPath %>", src: ["*", "!*.zip"]}
                ]
            }
        },
        preprocess: {
            js: {
                files: [
                    {src: ["<%= pkg.buildPath %>/scripts/*.js"]},
                    {src: ["<%= pkg.buildPath %>/*.json"]}
                ],
                options: {
                    inline: true,
                    context: {
                        BROWSER: grunt.option("browser")
                    },
                    type: "js"
                }
            },
            html: {
                files: [
                    {src: ["<%= pkg.buildPath %>/*.html"]}
                ],
                options: {
                    inline: true,
                    context: {
                        BROWSER: grunt.option("browser")
                    }
                }
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-copy");
    grunt.loadNpmTasks('grunt-string-replace');
    grunt.loadNpmTasks('grunt-zip');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-preprocess');

    grunt.registerTask("build", ["clean:pre-build", "copy", "string-replace:keys", "preprocess", "zip", "clean:build"]);
    grunt.registerTask("sandbox", ["copy", "string-replace", "preprocess"]);
    grunt.registerTask("default", ["copy", "string-replace:keys", "preprocess"]);
};
<|endoftext|>


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

    grunt.initConfig({
        hub: {
            all: {
                src: ['subprojects/com.toedter.chatty.client.web/Gruntfile.js'],
                tasks: ['distBoot']
            }
        }
    });

    grunt.loadNpmTasks('grunt-hub');

    grunt.registerTask('heroku', ['hub']);
}
<commit_msg>for heroku copy node_modules to sub project<commit_after>module.exports = function (grunt) {
    'use strict';

    grunt.initConfig({
        hub: {
            all: {
                src: ['subprojects/com.toedter.chatty.client.web/Gruntfile.js'],
                tasks: ['distBoot']
            }
        },
        copy: {
            node_modules: {
                expand: true,
                src: 'node_modules/**/*',
                dest: 'subprojects/com.toedter.chatty.client.web/'
            }
        }
    });

    grunt.loadNpmTasks('grunt-hub');
    grunt.loadNpmTasks('grunt-contrib-copy');

    grunt.registerTask('heroku', ['copy:node_modules', 'hub']);
}
<|endoftext|>


<commit_before>/*
 * assembleTest
 *
 * Ryan Parsley
 * https://github.com/ryan.parsley/assembleTest
 *
 * Copyright (c) 2014
 * Licensed under the MIT license.
 */

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

  // Project configuration.
  grunt.initConfig({

    // Project metadata
    pkg   : grunt.file.readJSON('package.json'),
    vendor: grunt.file.readJSON('.bowerrc').directory,
    site  : grunt.file.readYAML('_config.yml'),

    // Before generating any new files, remove files from previous build.
    clean: {
      example: ['<%= site.dest %>/*.html'],
      // Delete this target after first run!!!
    },

    // Lint JavaScript
    jshint: {
      all: ['Gruntfile.js', 'templates/helpers/*.js'],
      options: {
        jshintrc: '.jshintrc'
      }
    },

    // Build HTML from templates and data
    assemble: {
      options: {
        flatten: true,
        production: false,
        assets: '<%= site.assets %>',
        postprocess: require('pretty'),

        // Metadata
        pkg: '<%= pkg %>',
        site: '<%= site %>',
        data: ['<%= site.data %>'],

        // Templates
        partials: '<%= site.includes %>',
        layoutdir: '<%= site.layouts %>',
        layout: '<%= site.layout %>',

        // Extensions
        helpers: '<%= site.helpers %>',
        plugins: '<%= site.plugins %>'
      },
      example: {
        files: {'<%= site.dest %>/': ['<%= site.templates %>/*.hbs']}
      }
    },

    // Compile SASS to CSS
    sass: {                              // Task
      dist: {                            // Target
        options: {                       // Target options
          style: 'expanded'
        },
        files: {                         // Dictionary of files
          '<%= site.assets %>/style/style.css': 'style/style.scss'       // 'destination': 'source'
        }
      }
    },
    compass: {                  // Task
      dist: {                   // Target
        options: {              // Target options
          sassDir: 'style',
          cssDir: '<%= site.assets %>/style',
          environment: 'production'
        }
      },
    },

    watch: {
      all: {
        files: ['<%= jshint.all %>'],
        tasks: ['jshint'],
      },
      site: {
        files: ['Gruntfile.js', 'style/style.scss', 'templates/**/*.hbs'],
        tasks: ['design'],
        options: {
          livereload: true
        }
      },
      livereload: {
        // Here we watch the files the sass task will compile to
        // These files are sent to the live reload server after sass compiles to them
        options: { livereload: true },
        files: ['<%= site.dest %>/*.html', 'style/{,*/}*.{scss,sass}'],
      },
    }
  });

  // Load npm plugins to provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-readme');
  grunt.loadNpmTasks('grunt-sync-pkg');
  grunt.loadNpmTasks('grunt-contrib-sass');
  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('assemble');

  // Build HTML, compile LESS and watch for changes. You must first run "bower install"
  // or install Bootstrap to the "vendor" directory before running this command.
  grunt.registerTask('design', ['clean', 'assemble', 'compass', 'watch:site']);

  grunt.registerTask('docs', ['readme', 'sync']);

  grunt.registerTask('default', ['clean', 'jshint', 'assemble', 'compass', 'docs']);
};
<commit_msg>added githubPages deploy task<commit_after>/*
 * assembleTest
 *
 * Ryan Parsley
 * https://github.com/ryan.parsley/assembleTest
 *
 * Copyright (c) 2014
 * Licensed under the MIT license.
 */

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

  // Project configuration.
  grunt.initConfig({

    // Project metadata
    pkg   : grunt.file.readJSON('package.json'),
    vendor: grunt.file.readJSON('.bowerrc').directory,
    site  : grunt.file.readYAML('_config.yml'),

    // Before generating any new files, remove files from previous build.
    clean: {
      example: ['<%= site.dest %>/*.html'],
      // Delete this target after first run!!!
    },

    // Lint JavaScript
    jshint: {
      all: ['Gruntfile.js', 'templates/helpers/*.js'],
      options: {
        jshintrc: '.jshintrc'
      }
    },

    // Build HTML from templates and data
    assemble: {
      options: {
        flatten: true,
        production: false,
        assets: '<%= site.assets %>',
        postprocess: require('pretty'),

        // Metadata
        pkg: '<%= pkg %>',
        site: '<%= site %>',
        data: ['<%= site.data %>'],

        // Templates
        partials: '<%= site.includes %>',
        layoutdir: '<%= site.layouts %>',
        layout: '<%= site.layout %>',

        // Extensions
        helpers: '<%= site.helpers %>',
        plugins: '<%= site.plugins %>'
      },
      example: {
        files: {'<%= site.dest %>/': ['<%= site.templates %>/*.hbs']}
      }
    },
    githubPages: {
      target: {
        options: {
          // The default commit message for the gh-pages branch
          commitMessage: 'push'
        },
        // The folder where your gh-pages repo is
        src: '_gh_pages'
      }
    },

    // Compile SASS to CSS
    sass: {                              // Task
      dist: {                            // Target
        options: {                       // Target options
          style: 'expanded'
        },
        files: {                         // Dictionary of files
          '<%= site.assets %>/style/style.css': 'style/style.scss'       // 'destination': 'source'
        }
      }
    },
    compass: {                  // Task
      dist: {                   // Target
        options: {              // Target options
          sassDir: 'style',
          cssDir: '<%= site.assets %>/style',
          environment: 'production'
        }
      },
    },

    watch: {
      all: {
        files: ['<%= jshint.all %>'],
        tasks: ['jshint'],
      },
      site: {
        files: ['Gruntfile.js', 'style/style.scss', 'templates/**/*.hbs'],
        tasks: ['design'],
        options: {
          livereload: true
        }
      },
      livereload: {
        // Here we watch the files the sass task will compile to
        // These files are sent to the live reload server after sass compiles to them
        options: { livereload: true },
        files: ['<%= site.dest %>/*.html', 'style/{,*/}*.{scss,sass}'],
      },
    }
  });

  // Load npm plugins to provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-readme');
  grunt.loadNpmTasks('grunt-sync-pkg');
  grunt.loadNpmTasks('grunt-contrib-sass');
  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('assemble');

  // Build HTML, compile LESS and watch for changes. You must first run "bower install"
  // or install Bootstrap to the "vendor" directory before running this command.
  grunt.registerTask('design', ['clean', 'assemble', 'compass', 'watch:site']);

  grunt.registerTask('docs', ['readme', 'sync']);

  grunt.registerTask('default', ['clean', 'jshint', 'assemble', 'compass', 'docs']);

  grunt.registerTask('deploy', ['githubPages:target']);
};
<|endoftext|>


<commit_before>/*
 * grunt-html-head-urls-min-toggle
 * https://github.com/pinestec/html-head-urls-min-toggle
 *
 * Copyright (c) 2017 Michael Hartung
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
	  jshint : {
	    all : [ 'Gruntfile.js', 'tasks/*.js', '<%= nodeunit.tests %>' ],
	    options : {
	      jshintrc : '.jshintrc',
	      reporterOutput : ""
	    }
	  },

	  // Before generating any new files, remove any previously-created files.
	  clean : {
		  tests : [ 'tmp' ]
	  },

	  // Configuration to be run (and then tested).
	  html_head_urls_min_toggle : {
	    default_options : {
	      options : {},
	      files : {
		      'tmp/default_options' : [ 'test/fixtures/testing', 'test/fixtures/123' ]
	      }
	    },
	    custom_options : {
	      options : {
	        separator : ': ',
	        punctuation : ' !!!'
	      },
	      files : {
		      'tmp/custom_options' : [ 'test/fixtures/testing', 'test/fixtures/123' ]
	      }
	    },
	    targets : {
	      min_targets : [ './bash_sed_perl.max.html', './ctos_np.max.html' ],
	      regular_targets : [ './bash_sed_perl.max.html', './ctos_np.max.html', './current_commented_places.max.html',
	          './eclipse_related.max.html', './git_files__get_prepare.max.html', './graphicsWorkCurrentMemory.max.html',
	          './index.max.html', './jquery_pearls.max.html', './linksys_quick_rebirth.max.html', './linux.max.html',
	          './loginBasedPrivacyKeyManagement.max.html', './mp4todvd.max.html', './node_js_with_grunt.max.html',
	          './quickcmds.max.html', './regular_expression_snippets.max.html', './ssh_key_generation.max.html',
	          './ssh_pearls.max.html', './tiny_test.max.html', './useful_apps_steppingstone.max.html',
	          './windows_certificate_related.max.html' ],
	    }
	  },

	  // Unit tests.
	  nodeunit : {
		  tests : [ 'test/*_test.js' ]
	  }

	});

	// Actually load this plugin's task(s).
	grunt.loadTasks('tasks');

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-nodeunit');

	// Whenever the "test" task is run, first clean the "tmp" dir, then run this
	// plugin's task(s), then test the result.
	grunt.registerTask('test', [ 'clean', 'html_head_urls_min_toggle', 'nodeunit' ]);

	// By default, lint and run all tests.
	grunt.registerTask('default', [ 'jshint', 'test' ]);
	grunt.registerTask('dt', 'html_head_urls_min_toggle');

};
<commit_msg>Seems to work nicely... - MH - PT<commit_after>// './bash_sed_perl.max.html', './ctos_np.max.html', './current_commented_places.max.html', './eclipse_related.max.html', './git_files__get_prepare.max.html', './graphicsWorkCurrentMemory.max.html', './index.max.html', './jquery_pearls.max.html', './linksys_quick_rebirth.max.html', './linux.max.html', './loginBasedPrivacyKeyManagement.max.html', './mp4todvd.max.html', './node_js_with_grunt.max.html', './quickcmds.max.html', './regular_expression_snippets.max.html', './ssh_key_generation.max.html', './ssh_pearls.max.html', './tiny_test.max.html', './useful_apps_steppingstone.max.html', './windows_certificate_related.max.html'

/*
 * grunt-html-head-urls-min-toggle
 * https://github.com/pinestec/html-head-urls-min-toggle
 *
 * Copyright (c) 2017 Michael Hartung
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
	  jshint : {
	    all : [ 'Gruntfile.js', 'tasks/*.js', '<%= nodeunit.tests %>' ],
	    options : {
	      jshintrc : '.jshintrc',
	      reporterOutput : ""
	    }
	  },

	  // Before generating any new files, remove any previously-created files.
	  clean : {
		  tests : [ 'tmp' ]
	  },

	  // Configuration to be run (and then tested).
	  html_head_urls_min_toggle : {
	    default_options : {
	      options : {},
	      files : {
		      'tmp/default_options' : [ 'test/fixtures/testing', 'test/fixtures/123' ]
	      }
	    },
	    custom_options : {
	      options : {
	        separator : ': ',
	        punctuation : ' !!!'
	      },
	      files : {
		      'tmp/custom_options' : [ 'test/fixtures/testing', 'test/fixtures/123' ]
	      }
	    },
	    targets : {
	      min_targets : [ './git_files__get_prepare.max.html', './graphicsWorkCurrentMemory.max.html', './index.max.html',
	          './jquery_pearls.max.html', './linksys_quick_rebirth.max.html' ],
	      regular_targets : [ './bash_sed_perl.max.html', './ctos_np.max.html', './current_commented_places.max.html' ],
	    }
	  },

	  // Unit tests.
	  nodeunit : {
		  tests : [ 'test/*_test.js' ]
	  }

	});

	// Actually load this plugin's task(s).
	grunt.loadTasks('tasks');

	// These plugins provide necessary tasks.
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-clean');
	grunt.loadNpmTasks('grunt-contrib-nodeunit');

	// Whenever the "test" task is run, first clean the "tmp" dir, then run this
	// plugin's task(s), then test the result.
	grunt.registerTask('test', [ 'clean', 'html_head_urls_min_toggle', 'nodeunit' ]);

	// By default, lint and run all tests.
	grunt.registerTask('default', [ 'jshint', 'test' ]);
	grunt.registerTask('dt', 'html_head_urls_min_toggle');

};
<|endoftext|>


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

    grunt.initConfig({

        jshint: {
            options: {
                bitwise: true,
                //camelcase: true,
                curly: true,
                eqeqeq: true,
                forin: true,
                immed: true,
                indent: 4,
                latedef: true,
                newcap: true,
                noarg: true,
                noempty: true,
                quotmark: "double",
                trailing: true,
                maxlen: 120,
                undef: true,
                unused: true,
                boss: true,
                browser: true,
                sub: true,
                globals: {
                    jQuery: true,
                    tiddlyweb: true,
                    ts: true
                }
            },
            gruntfile: {
                src: "Gruntfile.js"
            },
            srcFiles: {
                src: ["src/*.js"]
            },
            testFiles: {
                src: ["test/*.js"]
            }
        },
        jasmine: {
            test: {
                src: ["src/chrjs.identities.js", "src/ts.js"],
                options: {
                    vendor: ["lib/jquery.min.js", "lib/jquery-json.min.js", "lib/chrjs.js", "lib/chrjs-users.js",
                        "lib/chrjs-space.js"],
                    helpers: [],
                    specs: "test/*Spec.js",
                    template: require("grunt-template-jasmine-istanbul"),
                    templateOptions: {
                        coverage: "tmp/coverage/coverage.json",
                        report: "tmp/coverage"
                    },
                    keepRunner: true
                }
            }
        },
        clean: ["lib", "tmp"],
        curl: {
            "lib/chrjs-space.js": "https://raw.github.com/TiddlySpace/tiddlyspace/master/src/lib/chrjs.space.js",
            "lib/chrjs-users.js": "https://raw.github.com/tiddlyweb/chrjs/master/users.js",
            "lib/chrjs.js": "https://raw.github.com/tiddlyweb/chrjs/master/main.js",
            "lib/jquery.min.js": "http://code.jquery.com/jquery-1.6.1.min.js",
            "lib/jquery-json.min.js": "http://jquery-json.googlecode.com/files/jquery.json-2.2.min.js"
        }
    });

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

    grunt.registerTask("test", ["jshint", "jasmine"]);

    grunt.registerTask("default", ["curl", "test"]);
};
<commit_msg>Use jquery version from tiddlyspace.com<commit_after>/*global module:false, require:false*/
module.exports = function (grunt) {

    grunt.initConfig({

        jshint: {
            options: {
                bitwise: true,
                //camelcase: true,
                curly: true,
                eqeqeq: true,
                forin: true,
                immed: true,
                indent: 4,
                latedef: true,
                newcap: true,
                noarg: true,
                noempty: true,
                quotmark: "double",
                trailing: true,
                maxlen: 120,
                undef: true,
                unused: true,
                boss: true,
                browser: true,
                sub: true,
                globals: {
                    jQuery: true,
                    tiddlyweb: true,
                    ts: true
                }
            },
            gruntfile: {
                src: "Gruntfile.js"
            },
            srcFiles: {
                src: ["src/*.js"]
            },
            testFiles: {
                src: ["test/*.js"]
            }
        },
        jasmine: {
            test: {
                src: ["src/chrjs.identities.js", "src/ts.js"],
                options: {
                    vendor: ["lib/jquery.min.js", "lib/jquery-json.min.js", "lib/chrjs.js", "lib/chrjs-users.js",
                        "lib/chrjs-space.js"],
                    helpers: [],
                    specs: "test/*Spec.js",
                    template: require("grunt-template-jasmine-istanbul"),
                    templateOptions: {
                        coverage: "tmp/coverage/coverage.json",
                        report: "tmp/coverage"
                    },
                    keepRunner: true
                }
            }
        },
        clean: ["lib", "tmp"],
        curl: {
            "lib/chrjs-space.js": "https://raw.github.com/TiddlySpace/tiddlyspace/master/src/lib/chrjs.space.js",
            "lib/chrjs-users.js": "https://raw.github.com/tiddlyweb/chrjs/master/users.js",
            "lib/chrjs.js": "https://raw.github.com/tiddlyweb/chrjs/master/main.js",
            "lib/jquery.min.js": "http://tiddlyspace.com/bags/common/tiddlers/jquery.js",
            "lib/jquery-json.min.js": "http://jquery-json.googlecode.com/files/jquery.json-2.2.min.js"
        }
    });

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

    grunt.registerTask("test", ["jshint", "jasmine"]);

    grunt.registerTask("default", ["curl", "test"]);
};
<|endoftext|>


<commit_before>'use strict';

var grunt = require('grunt');
var fs = require('fs');
var babel = require('rollup-plugin-babel');

var version = JSON.parse(fs.readFileSync('./package.json')).version;

// comma separated list of browsers to run tests inside
var browsers = grunt.option('browsers') ? grunt.option('browsers').split(',') : ['Chrome'];
var babelOptions = { exclude: './node_modules/**' };

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jsdoc-to-markdown')
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-shell-spawn');
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-rollup');
grunt.loadNpmTasks('gruntify-eslint');
grunt.loadNpmTasks('grunt-gh-pages');

module.exports = function Gruntfile(grunt) {
    // Project configuration.
    grunt.initConfig({
        rollup: {
            options: {
                format: 'umd',
                moduleName: 'Popper',
                plugins: function() {
                    return [
                        babel(babelOptions)
                    ];
                }
            },
            dist: {
                files: {
                    'build/popper.js': ['src/popper.js']
                }
            },
            tmp: {
                files: {
                    '.tmp/popper.js': ['src/popper.js']
                }
            }
        },
        uglify: {
            dist: {
                options: {
                    sourceMap: true,
                    sourceMapName: 'build/popper.min.js.map',
                    preserveComments: /(?:license|version)/,
                    mangleToplevel: true,
                    compress: {
                        sequences: true,
                        dead_code: true,
                        conditionals: true,
                        booleans: true,
                        unused: true,
                        if_return: true,
                        join_vars: true,
                        drop_console: true
                    }
                },
                files: {
                    'build/popper.min.js': ['build/popper.js']
                }
            }
        },
        jsdoc2md : {
            dist : {
                src: '.tmp/popper.js',
                dest: 'doc/_includes/documentation.md'
            }
        },
        'gh-pages': {
            options: {
                base: 'doc',
                branch: 'gh-pages-v1'
            },
            src: ['**']
        },
        karma: {
            options: {
                frameworks: ['jasmine'],
                singleRun: true,
                browsers: browsers,
                customLaunchers: {
                    SLChrome: {
                        base: 'SauceLabs',
                        browserName: 'chrome',
                        platform: 'OS X 10.11'
                    },
                    SLFirefox: {
                        base: 'SauceLabs',
                        browserName: 'firefox',
                        platform: 'OS X 10.11'

                    },
                    SLEdge: {
                        base: 'SauceLabs',
                        browserName: 'microsoftedge'
                    },
                    SLSafari: {
                        base: 'SauceLabs',
                        browserName: 'safari',
                        platform: 'OS X 10.11'
                    }
                },
                preprocessors: {
                    'tests/**/*.js': ['rollup']
                },
                rollupPreprocessor: {
                    plugins: [
                        babel(babelOptions)
                    ],
                    format: 'iife',
                    sourceMap: 'inline'
                },
                files: [
                    'tests/styles/*.css',
                    'tests/setup.js',
                    'tests/functional/*.js'
                ],
                sauceLabs: {
                    testName: 'Popper.js',
                    startConnect: false,
                    tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
                },
                reporters: ['dots', 'saucelabs']
            },
            ci: {},
            local: {
                singleRun: false,
            }
        },
        eslint: {
            src: ['src/**/*.js'],
            test: ['tests/**/*.js']
        },
        usebanner: {
            dist: {
                options: {
                    position: 'top',
                    banner: `
/*
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version ${version}
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* 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 NONINFRINGEMENT. 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.
*/
                    `,
                },
                files: {
                    src: [ 'build/popper.js' ]
                }
            }
        }
    });

    grunt.registerTask('doc', ['eslint', 'rollup:tmp', 'jsdoc2md']);
    grunt.registerTask('dist', [ 'eslint', 'rollup:dist', 'usebanner:dist', 'uglify:dist']);
    grunt.registerTask('test', ['eslint', 'karma:local']);
    grunt.registerTask('test-ci', ['eslint', 'karma:ci']);
};
<commit_msg>removed forgotten loaders<commit_after>'use strict';

var grunt = require('grunt');
var fs = require('fs');
var babel = require('rollup-plugin-babel');

var version = JSON.parse(fs.readFileSync('./package.json')).version;

// comma separated list of browsers to run tests inside
var browsers = grunt.option('browsers') ? grunt.option('browsers').split(',') : ['Chrome'];
var babelOptions = { exclude: './node_modules/**' };

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jsdoc-to-markdown')
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-rollup');
grunt.loadNpmTasks('gruntify-eslint');
grunt.loadNpmTasks('grunt-gh-pages');

module.exports = function Gruntfile(grunt) {
    // Project configuration.
    grunt.initConfig({
        rollup: {
            options: {
                format: 'umd',
                moduleName: 'Popper',
                plugins: function() {
                    return [
                        babel(babelOptions)
                    ];
                }
            },
            dist: {
                files: {
                    'build/popper.js': ['src/popper.js']
                }
            },
            tmp: {
                files: {
                    '.tmp/popper.js': ['src/popper.js']
                }
            }
        },
        uglify: {
            dist: {
                options: {
                    sourceMap: true,
                    sourceMapName: 'build/popper.min.js.map',
                    preserveComments: /(?:license|version)/,
                    mangleToplevel: true,
                    compress: {
                        sequences: true,
                        dead_code: true,
                        conditionals: true,
                        booleans: true,
                        unused: true,
                        if_return: true,
                        join_vars: true,
                        drop_console: true
                    }
                },
                files: {
                    'build/popper.min.js': ['build/popper.js']
                }
            }
        },
        jsdoc2md : {
            dist : {
                src: '.tmp/popper.js',
                dest: 'doc/_includes/documentation.md'
            }
        },
        'gh-pages': {
            options: {
                base: 'doc',
                branch: 'gh-pages-v1'
            },
            src: ['**']
        },
        karma: {
            options: {
                frameworks: ['jasmine'],
                singleRun: true,
                browsers: browsers,
                customLaunchers: {
                    SLChrome: {
                        base: 'SauceLabs',
                        browserName: 'chrome',
                        platform: 'OS X 10.11'
                    },
                    SLFirefox: {
                        base: 'SauceLabs',
                        browserName: 'firefox',
                        platform: 'OS X 10.11'

                    },
                    SLEdge: {
                        base: 'SauceLabs',
                        browserName: 'microsoftedge'
                    },
                    SLSafari: {
                        base: 'SauceLabs',
                        browserName: 'safari',
                        platform: 'OS X 10.11'
                    }
                },
                preprocessors: {
                    'tests/**/*.js': ['rollup']
                },
                rollupPreprocessor: {
                    plugins: [
                        babel(babelOptions)
                    ],
                    format: 'iife',
                    sourceMap: 'inline'
                },
                files: [
                    'tests/styles/*.css',
                    'tests/setup.js',
                    'tests/functional/*.js'
                ],
                sauceLabs: {
                    testName: 'Popper.js',
                    startConnect: false,
                    tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
                },
                reporters: ['dots', 'saucelabs']
            },
            ci: {},
            local: {
                singleRun: false,
            }
        },
        eslint: {
            src: ['src/**/*.js'],
            test: ['tests/**/*.js']
        },
        usebanner: {
            dist: {
                options: {
                    position: 'top',
                    banner: `
/*
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version ${version}
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* 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 NONINFRINGEMENT. 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.
*/
                    `,
                },
                files: {
                    src: [ 'build/popper.js' ]
                }
            }
        }
    });

    grunt.registerTask('doc', ['eslint', 'rollup:tmp', 'jsdoc2md']);
    grunt.registerTask('dist', [ 'eslint', 'rollup:dist', 'usebanner:dist', 'uglify:dist']);
    grunt.registerTask('test', ['eslint', 'karma:local']);
    grunt.registerTask('test-ci', ['eslint', 'karma:ci']);
};
<|endoftext|>


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

    /**
     * Require it at the top and pass in the grunt instance
     */
    require('time-grunt')(grunt);

    /**
     * Setup configuration
     */
    grunt.initConfig({
        pkg: grunt.file.readJSON('config/banner.json'),
        buildTags: "/* Project Name : <%= pkg.application.name %> Release version : <%= pkg.application.version %> */",

        configuredFiles: grunt.file.readJSON('config/servefiles.json'),

        clean: {
            build: ['prod']
        },
        shell: {
            uglify: {
                command: [
                    'node src/bower_components/rjs/dist/r.js -o config/build/optimize-build.js',
                    'node src/bower_components/rjs/dist/r.js -o config/build/copy-build.js',
                    'rm src/main-optimize.js',
                    'rm prod/main.js',
                    'mv prod/main-optimize.js prod/main.js'
                ].join('&&')
            }
        },
        usebanner: {
            buildTags: {
                options: {
                    position: 'top',
                    banner: '<%= buildTags %>',
                    linebreak: true
                },
                files: {
                    src: '<%= configuredFiles.usebanner %>'
                }
            }
        },
        jshint: {
            options: {
                jshintrc: 'config/lints/.jshintrc',
                ignores: '<%= configuredFiles.jshint.ignore %>'
            },
            all: '<%= configuredFiles.jshint.files %>'
        },
        jscs: {
            options: {
                config: 'config/lints/.jscsrc'
            },
            src: '<%= configuredFiles.jscs.files %>',
        },
        jsonlint: {
            files: {
                src: '<%= configuredFiles.jsonlint %>'
            }
        },
        csslint: {
            strict: {
                options: {
                    csslintrc: 'config/lints/.csslintrc',
                    ignores: '<%= configuredFiles.csslint.ignore %>'
                },
                src: '<%= configuredFiles.csslint.files %>'
            }
        },
        htmlhint: {
            Root_HTML_Files: {
                options: {
                    htmlhintrc: 'config/lints/.htmlhint-n-rc',
                    ignores: '<%= configuredFiles.htmlhint.Root_HTML_Files.ignore %>'
                },
                src: '<%= configuredFiles.htmlhint.Root_HTML_Files.files %>'
            },
            Templates: {
                options: {
                    htmlhintrc: 'config/lints/.htmlhint-t-rc',
                    ignores: '<%= configuredFiles.htmlhint.Templates.ignore %>'
                },
                src: '<%= configuredFiles.htmlhint.Templates.files %>'

            }
        },
        less: {
            customMade: {
                options: {
                    compress: false
                },
                files: '<%= configuredFiles.less.customMade.files %>'
            },
            prod: {
                options: {
                    compress: true
                },
                files: '<%= configuredFiles.less.customMade.files %>'
            }
        },
        watch: {
            less: {
                options: {
                    spawn: false
                },
                files: '<%= configuredFiles.watch.less.files %>',
                tasks: ['less:customMade']
            }
        },
        strip: {
            main: {
                src: 'prod/src/apps/**/*.js',
                options: {
                    inline: true,
                    nodes: ['console.log', 'debug']
                }
            }
        },
        autoprefixer: {
            options: {
                'browsers': ['last 2 versions']
            },
            multiple: {
                expand: true,
                flatten: true,
                src: 'src/stylesheets/css/common/*.css',
                dest: 'src/stylesheets/css/common/'
            }
        },
        htmlmin: {
            dist: {
                options: {
                    removeComments: true,
                    collapseWhitespace: true
                },
                files: '<%= configuredFiles.htmlmin.files %>'
            }
        },
        plato: {
            report: {
                files: {
                    'reports': ['src/apps/**/*.js', 'tests/**/*.js']
                }
            }
        }
    });

    /**
     * Load tasks
     */
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-strip');
    grunt.loadNpmTasks('grunt-shell');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-jscs');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-csslint');
    grunt.loadNpmTasks('grunt-htmlhint');
    grunt.loadNpmTasks('grunt-contrib-htmlmin');
    grunt.loadNpmTasks('grunt-autoprefixer');
    grunt.loadNpmTasks('grunt-jsonlint');
    grunt.loadNpmTasks('grunt-banner');
    grunt.loadNpmTasks('grunt-plato');

    /**
     * Define tasks : Tasks for development eco - system.
     */
    grunt.registerTask('default', [
        'htmlhint',
        'jsonlint',
        'jscs',
        'jshint',
        'compileLessDev',
        'autofix',
        'csslint',
        'plato'
    ]);
    grunt.registerTask('dev', ['default']); // Alias for `default`.

    /**
     * Define tasks : Tasks for build eco - system.
     */
    grunt.registerTask('build', [
        'htmlhint',
        'jsonlint',
        'jscs',
        'jshint',
        'compileLessProd',
        'autofix',
        'csslint',
        'plato',
        'clean',
        'strip',
        'shell',
        'htmlmin',
        'usebanner'
    ]);

    /**
     * Define tasks : Tasks for less:compilation watch, Also alias for `watch`
     */
    grunt.registerTask('watchless', ['watch:less']);

    /**
     * Define sub-tasks : Tasks for Less compilation for development.
     */
    grunt.registerTask('compileLessDev', ['less:customMade']);

    /**
     * Define sub-tasks : Tasks for Less compilation for production.
     */
    grunt.registerTask('compileLessProd', ['less:prod']);

    /**
     * Define sub-tasks : Alias for `autofix`
     */
    grunt.registerTask('autofix', ['autoprefixer']);

    /**
     * Define sub-tasks : Alias for `plato`
     */
    grunt.registerTask('analysis', ['plato']);
};<commit_msg>Configs grunt task for markdown lint<commit_after>module.exports = function(grunt) {
    'use strict';

    /**
     * Require it at the top and pass in the grunt instance
     */
    require('time-grunt')(grunt);

    /**
     * Setup configuration
     */
    grunt.initConfig({
        pkg: grunt.file.readJSON('config/banner.json'),
        buildTags: "/* Project Name : <%= pkg.application.name %> Release version : <%= pkg.application.version %> */",

        configuredFiles: grunt.file.readJSON('config/servefiles.json'),

        clean: {
            build: ['prod']
        },
        shell: {
            uglify: {
                command: [
                    'node src/bower_components/rjs/dist/r.js -o config/build/optimize-build.js',
                    'node src/bower_components/rjs/dist/r.js -o config/build/copy-build.js',
                    'rm src/main-optimize.js',
                    'rm prod/main.js',
                    'mv prod/main-optimize.js prod/main.js'
                ].join('&&')
            }
        },
        usebanner: {
            buildTags: {
                options: {
                    position: 'top',
                    banner: '<%= buildTags %>',
                    linebreak: true
                },
                files: {
                    src: '<%= configuredFiles.usebanner %>'
                }
            }
        },
        jshint: {
            options: {
                jshintrc: 'config/lints/.jshintrc',
                ignores: '<%= configuredFiles.jshint.ignore %>'
            },
            all: '<%= configuredFiles.jshint.files %>'
        },
        jscs: {
            options: {
                config: 'config/lints/.jscsrc'
            },
            src: '<%= configuredFiles.jscs.files %>',
        },
        jsonlint: {
            files: {
                src: '<%= configuredFiles.jsonlint %>'
            }
        },
        csslint: {
            strict: {
                options: {
                    csslintrc: 'config/lints/.csslintrc',
                    ignores: '<%= configuredFiles.csslint.ignore %>'
                },
                src: '<%= configuredFiles.csslint.files %>'
            }
        },
        htmlhint: {
            Root_HTML_Files: {
                options: {
                    htmlhintrc: 'config/lints/.htmlhint-n-rc',
                    ignores: '<%= configuredFiles.htmlhint.Root_HTML_Files.ignore %>'
                },
                src: '<%= configuredFiles.htmlhint.Root_HTML_Files.files %>'
            },
            Templates: {
                options: {
                    htmlhintrc: 'config/lints/.htmlhint-t-rc',
                    ignores: '<%= configuredFiles.htmlhint.Templates.ignore %>'
                },
                src: '<%= configuredFiles.htmlhint.Templates.files %>'

            }
        },
        less: {
            customMade: {
                options: {
                    compress: false
                },
                files: '<%= configuredFiles.less.customMade.files %>'
            },
            prod: {
                options: {
                    compress: true
                },
                files: '<%= configuredFiles.less.customMade.files %>'
            }
        },
        watch: {
            less: {
                options: {
                    spawn: false
                },
                files: '<%= configuredFiles.watch.less.files %>',
                tasks: ['less:customMade']
            }
        },
        strip: {
            main: {
                src: 'prod/src/apps/**/*.js',
                options: {
                    inline: true,
                    nodes: ['console.log', 'debug']
                }
            }
        },
        autoprefixer: {
            options: {
                'browsers': ['last 2 versions']
            },
            multiple: {
                expand: true,
                flatten: true,
                src: 'src/stylesheets/css/common/*.css',
                dest: 'src/stylesheets/css/common/'
            }
        },
        htmlmin: {
            dist: {
                options: {
                    removeComments: true,
                    collapseWhitespace: true
                },
                files: '<%= configuredFiles.htmlmin.files %>'
            }
        },
        plato: {
            report: {
                files: {
                    'reports': ['src/apps/**/*.js', 'tests/**/*.js']
                }
            }
        },
        mdlint: ['*.md']
    });

    /**
     * Load tasks
     */
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-strip');
    grunt.loadNpmTasks('grunt-shell');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-jscs');
    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-csslint');
    grunt.loadNpmTasks('grunt-htmlhint');
    grunt.loadNpmTasks('grunt-contrib-htmlmin');
    grunt.loadNpmTasks('grunt-autoprefixer');
    grunt.loadNpmTasks('grunt-jsonlint');
    grunt.loadNpmTasks('grunt-banner');
    grunt.loadNpmTasks('grunt-plato');
    grunt.loadNpmTasks('grunt-mdlint');

    /**
     * Define tasks : Tasks for development eco - system.
     */
    grunt.registerTask('default', [
        'mdlint',
        'htmlhint',
        'jsonlint',
        'jscs',
        'jshint',
        'compileLessDev',
        'autofix',
        'csslint',
        'plato'
    ]);
    grunt.registerTask('dev', ['default']); // Alias for `default`.

    /**
     * Define tasks : Tasks for build eco - system.
     */
    grunt.registerTask('build', [
        'mdlint',
        'htmlhint',
        'jsonlint',
        'jscs',
        'jshint',
        'compileLessProd',
        'autofix',
        'csslint',
        'plato',
        'clean',
        'strip',
        'shell',
        'htmlmin',
        'usebanner'
    ]);

    /**
     * Define tasks : Tasks for less:compilation watch, Also alias for `watch`
     */
    grunt.registerTask('watchless', ['watch:less']);

    /**
     * Define sub-tasks : Tasks for Less compilation for development.
     */
    grunt.registerTask('compileLessDev', ['less:customMade']);

    /**
     * Define sub-tasks : Tasks for Less compilation for production.
     */
    grunt.registerTask('compileLessProd', ['less:prod']);

    /**
     * Define sub-tasks : Alias for `autofix`
     */
    grunt.registerTask('autofix', ['autoprefixer']);

    /**
     * Define sub-tasks : Alias for `plato`
     */
    grunt.registerTask('analysis', ['plato']);
};<|endoftext|>


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

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

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

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

    // Optimise/minify images
    imagemin: {
      build: {
        options: {
          optimizationLevel: 3,
          progressive: true,
          interlaced: true,
          svgoPlugins: [{ removeViewBox: false }]
        },
        files: [{
          expand: true,
          cwd: '_site/assets',
          src: ['**/*.{png,jpg,gif}'],
          dest: '_site/assets'
        }]
      },
    },

    // Lint SCSS files
    scsslint: {
      test: [
        '_scss/**/*.scss',
      ],
      options: {
        bundleExec: true,
        config: '.scss-lint.yml'
      },
    },

    // Builds Jekyll website to `_site` directory
    jekyll: {
      options: {
        bundleExec: true
      },
      drafts: {
        options: {
          drafts: true
        }
      },
      publish: {
        options: {
          drafts: false
        }
      }
    },

    // Starts a local server with LiveReload instance
    connect: {
      server: {
        options: {
          livereload: true,
          open: true,
          base: '_site/',
          hostname: '*',
          port: 9001
        }
      }
    },

    // Watch for changes in files
    watch: {
      options: {
        livereload: true
      },
      jekyll: {
        files: ['**/*', '!_site/**'],
        tasks: ['build']
      }
    },

    // Publish site to GitHub Pages
    buildcontrol: {
      options: {
        dir: '_site',
        commit: true,
        push: true,
        message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
      },
      publish: {
        options: {
          remote: 'git@github.com:resir014/resir014.github.io.git',
          branch: 'master'
        }
      }
    }
  });

  // Default task
  grunt.registerTask('default', ['build']);

  // Manually build page
  grunt.registerTask('build', ['jekyll:drafts', 'postcss']);

  // Lint SCSS files
  grunt.registerTask('test', ['scsslint']);

  // Start a local server
  grunt.registerTask('serve', ['build', 'connect:server', 'watch']);

  // Publish to GitHub
  grunt.registerTask('publish', ['jekyll:publish', 'postcss', 'imagemin', 'buildcontrol']);
};
<commit_msg>Updated Gruntfile<commit_after>module.exports = function(grunt) {

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

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

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

    // Optimise/minify images
    imagemin: {
      publish: {
        options: {
          optimizationLevel: 3,
          progressive: true,
          interlaced: true,
          svgoPlugins: [{ removeViewBox: false }]
        },
        files: [{
          expand: true,
          cwd: '_site/assets',
          src: ['**/*.{png,jpg,gif}'],
          dest: '_site/assets'
        }]
      },
    },

    // Lint SCSS files
    scsslint: {
      test: [
        '_scss/**/*.scss',
      ],
      options: {
        bundleExec: true,
        config: '.scss-lint.yml'
      },
    },

    // Builds Jekyll website to `_site` directory
    jekyll: {
      options: {
        bundleExec: true
      },
      drafts: {
        options: {
          drafts: true
        }
      },
      publish: {
        options: {
          drafts: false
        }
      }
    },

    // Starts a local server with LiveReload instance
    connect: {
      server: {
        options: {
          livereload: true,
          open: true,
          base: '_site/',
          hostname: '*',
          port: 9001
        }
      }
    },

    // Watch for changes in files
    watch: {
      options: {
        livereload: true
      },
      jekyll: {
        files: ['**/*', '!_site/**'],
        tasks: ['build']
      }
    },

    // Publish site to GitHub Pages
    buildcontrol: {
      options: {
        dir: '_site',
        commit: true,
        push: true,
        message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
      },
      publish: {
        options: {
          remote: 'git@github.com:resir014/resir014.github.io.git',
          branch: 'master'
        }
      }
    }
  });

  // Default task
  grunt.registerTask('default', ['build']);

  // Manually build page
  grunt.registerTask('build', ['jekyll:drafts', 'postcss']);

  // Lint SCSS files
  grunt.registerTask('test', ['scsslint']);

  // Start a local server
  grunt.registerTask('serve', ['build', 'connect:server', 'watch']);

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


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

  grunt.initConfig({
    pkg: require("./package.json"),
    watch: {
      scripts: {
        files: ['**/*.js', '*.js', 'test/*.html'],
        tasks: ['default'],
        options: {
          spawn: false,
        },
      },
    },
    shell: {
      install: {
        command: 'component install --dev',
        options: {
          stderr: true
        }
      },
      build: {
        command: 'component build --dev',
        options: {
          stderr: true
        }
      },
      standalone: {
        command: 'component build --standalone List -n list.standalone'
      },
      mkdir: {
        command: 'mkdir -p dist'
      },
      move: {
        command: 'mv build/list.standalone.js dist/list.js'
      },
      remove: {
        command: 'rm -fr build components dist'
      }
    },
    jshint: {
      code: {
        src: ['Gruntfile.js', '*.js', 'src/*.js'],
        options: {
          expr: true,
          multistr: false,
          globals: {
            module: true
          }
        }
      },
      tests: {
        src: ['test/(*|!mocha).js'],
        options: {
          expr: true,
          multistr: true,
          globals: {
            jQuery: true,
            module: true
          }
        }
      }
    },
    uglify: {
      target: {
        files: {
          'dist/list.min.js': ['dist/list.js']
        }
      }
    },
    mocha: {
      cool: {
        src: [ 'test/index.html' ],
        options: {
          run: true,
          timeout: 10000,
          bail: false,
          log: true,
          reporter: 'Nyan',
          mocha: {
            ignoreLeaks: false
          }
        }
      }
    }
  });

  grunt.loadNpmTasks("grunt-contrib-watch");
  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-mocha');

  grunt.registerTask('default', ['jshint:code', 'jshint:tests', 'shell:install', 'shell:build']);
  grunt.registerTask('dist', ['default', 'shell:standalone', 'shell:mkdir', 'shell:move', 'uglify']);
  grunt.registerTask('clean', ['shell:remove']);

  grunt.registerTask('test', ['mocha']);

  return grunt;
};
<commit_msg>Also run tests in default grunt task<commit_after>module.exports = function(grunt) {
  "use strict";

  grunt.initConfig({
    pkg: require("./package.json"),
    watch: {
      scripts: {
        files: ['**/*.js', '*.js', 'test/*.html'],
        tasks: ['default'],
        options: {
          spawn: false,
        },
      },
    },
    shell: {
      install: {
        command: 'component install --dev',
        options: {
          stderr: true
        }
      },
      build: {
        command: 'component build --dev',
        options: {
          stderr: true
        }
      },
      standalone: {
        command: 'component build --standalone List -n list.standalone'
      },
      mkdir: {
        command: 'mkdir -p dist'
      },
      move: {
        command: 'mv build/list.standalone.js dist/list.js'
      },
      remove: {
        command: 'rm -fr build components dist'
      }
    },
    jshint: {
      code: {
        src: ['Gruntfile.js', '*.js', 'src/*.js'],
        options: {
          expr: true,
          multistr: false,
          globals: {
            module: true
          }
        }
      },
      tests: {
        src: ['test/(*|!mocha).js'],
        options: {
          expr: true,
          multistr: true,
          globals: {
            jQuery: true,
            module: true
          }
        }
      }
    },
    uglify: {
      target: {
        files: {
          'dist/list.min.js': ['dist/list.js']
        }
      }
    },
    mocha: {
      cool: {
        src: [ 'test/index.html' ],
        options: {
          run: true,
          timeout: 10000,
          bail: false,
          log: true,
          reporter: 'Nyan',
          mocha: {
            ignoreLeaks: false
          }
        }
      }
    }
  });

  grunt.loadNpmTasks("grunt-contrib-watch");
  grunt.loadNpmTasks('grunt-shell');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-mocha');

  grunt.registerTask('default', ['jshint:code', 'jshint:tests', 'shell:install', 'shell:build', 'mocha']);
  grunt.registerTask('dist', ['default', 'shell:standalone', 'shell:mkdir', 'shell:move', 'uglify']);
  grunt.registerTask('clean', ['shell:remove']);

  grunt.registerTask('test', ['mocha']);

  return grunt;
};
<|endoftext|>


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

  var foundationSource = require('shelljs')
    .exec('bundle show foundation-rails', { async: false, silent: true })
    .output
    .replace('\n', '');

  var version = require('./package.json').version;
  grunt.log.writeln('Building version ' + version + '...');

  grunt.initConfig({

    clean: {

      // Delete the dist directory when the build starts
      start: ['dist']
    },

    copy: {
      main: {
        files: [

          // Copy in our Sass
          {
            expand: true,
            cwd: 'lib/assets/stylesheets',
            src: ['chef.scss', 'chef*/**'],
            dest: distDir('scss')
          },

          // Copy in our images
          {
            expand: true,
            cwd: 'lib/assets/images',
            src: ['*.png', '*.svg'],
            dest: distDir('images')
          },

          // Copy in our fonts
          {
            expand: true,
            cwd: 'lib/assets/fonts',
            src: ['*'],
            dest: distDir('fonts')
          },

          // Copy in vendored stylesheets
          {
            expand: true,
            cwd: 'vendor/assets/stylesheets',
            src: ['csstyle.scss', 'foundation/**'],
            dest: distDir('scss/vendor')
          },
          {
            expand: true,
            cwd: foundationSource + '/vendor/assets/stylesheets',
            src: ['foundation.scss', 'normalize.scss', 'foundation/**'],
            dest: distDir('scss/vendor')
          },

          // Copy in vendored scripts
          {
            expand: true,
            cwd: foundationSource + '/vendor/assets/javascripts/vendor',
            src: ['modernizr.js'],
            dest: distDir('javascripts/vendor')
          }
        ],
      },
    },

    // Concatenate the JS
    mince: {
      main: {
        options: {
          include: [
            'lib/assets/javascripts',
            foundationSource + '/vendor/assets/javascripts'
          ]
        },
        files: [

          // One big JS with everything
          {
            src: 'lib/assets/javascripts/chef.js',
            dest: distDir('javascripts/chef.js')
          },

          // Individual JS components
          {
            src: 'lib/assets/javascripts/chef/components/top-bar.js',
            dest: distDir('javascripts/chef/components/top-bar.js')
          },
          {
            src: 'lib/assets/javascripts/chef/components/side-nav.js',
            dest: distDir('javascripts/chef/components/side-nav.js')
          },
          {
            src: 'lib/assets/javascripts/chef/components/logo.js',
            dest: distDir('javascripts/chef/components/logo.js')
          }
        ]
      }
    },

    // Compile the CSS
    sass: {
      dist: {
        options: {
          style: 'expanded',
          sourcemap: 'none',
          loadPath: [
            './vendor/assets/stylesheets',
            foundationSource + '/vendor/assets/stylesheets'
          ]
        },
        files: sassFiles()
      }
    },

    // Optimize the SVGs
    svgmin: {
      options: {
        plugins: [
          {
            removeViewBox: false
          }, {
            removeUselessStrokeAndFill: false
          }
        ]
      },
      multiple: {
        files: [{
          expand: true,
          cwd: 'lib/assets/images/source/icons/',
          src: ['**/*.svg'],
          dest: 'lib/assets/images/icons/'
        }]
      }
    },

    // Merge all the SVGs into a single sprite
    svgstore: {
      options: {
        svg: {
          xmlns: 'http://www.w3.org/2000/svg',
          'xmlns:xlink': 'http://www.w3.org/1999/xlink',
          viewBox: '0 0 100 100'
        }
      },
      default: {
        files: {
          'lib/assets/images/icons/all.svg': ['lib/assets/images/source/icons/*.svg'],
        },
        options: {
          formatting : {
            indent_size : 2
          },
          cleanup: ['fill'],
          includeTitleElement: false
        }
      }
    },

    // Rebuild when assets change
    watch: {
      scripts: {
        files: [
          'lib/assets/**/*'
        ],
        tasks: [
          'build'
        ],
        options: {
          spawn: false
        }
      }
    }
  });

  function distDir(path) {
    return ['dist', path].join('/');
  }

  function sassFiles() {
    var files = {};

    files[distDir('stylesheets/chef.css')] = './lib/assets/stylesheets/chef.scss';

    [
      'accordion',
      'alert',
      'button',
      'code',
      'dropdown',
      'form',
      'icon',
      'label',
      'logo',
      'modal',
      'side-nav',
      'tab',
      'table',
      'top-bar'
    ].forEach(function(o) {
      files[distDir('stylesheets/chef/components/' + o + '.css')] = './lib/assets/stylesheets/chef/components/' + o + '.scss'
    });

    return files;
  }

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-sass');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-mincer');
  grunt.loadNpmTasks('grunt-svgmin');
  grunt.loadNpmTasks('grunt-svgstore');

  grunt.registerTask('default', ['build']);
  grunt.registerTask('build', ['clean:start', 'copy', 'mince', 'sass']);
  grunt.registerTask('build-svgs', ['svgmin', 'svgstore']);
};
<commit_msg>Include icons in the NPM package<commit_after>module.exports = function(grunt) {

  var foundationSource = require('shelljs')
    .exec('bundle show foundation-rails', { async: false, silent: true })
    .output
    .replace('\n', '');

  var version = require('./package.json').version;
  grunt.log.writeln('Building version ' + version + '...');

  grunt.initConfig({

    clean: {

      // Delete the dist directory when the build starts
      start: ['dist']
    },

    copy: {
      main: {
        files: [

          // Copy in our Sass
          {
            expand: true,
            cwd: 'lib/assets/stylesheets',
            src: ['chef.scss', 'chef*/**'],
            dest: distDir('scss')
          },

          // Copy in our images
          {
            expand: true,
            cwd: 'lib/assets/images',
            src: ['*.png', '*.svg', 'icons/*.svg'],
            dest: distDir('images')
          },

          // Copy in our fonts
          {
            expand: true,
            cwd: 'lib/assets/fonts',
            src: ['*'],
            dest: distDir('fonts')
          },

          // Copy in vendored stylesheets
          {
            expand: true,
            cwd: 'vendor/assets/stylesheets',
            src: ['csstyle.scss', 'foundation/**'],
            dest: distDir('scss/vendor')
          },
          {
            expand: true,
            cwd: foundationSource + '/vendor/assets/stylesheets',
            src: ['foundation.scss', 'normalize.scss', 'foundation/**'],
            dest: distDir('scss/vendor')
          },

          // Copy in vendored scripts
          {
            expand: true,
            cwd: foundationSource + '/vendor/assets/javascripts/vendor',
            src: ['modernizr.js'],
            dest: distDir('javascripts/vendor')
          }
        ],
      },
    },

    // Concatenate the JS
    mince: {
      main: {
        options: {
          include: [
            'lib/assets/javascripts',
            foundationSource + '/vendor/assets/javascripts'
          ]
        },
        files: [

          // One big JS with everything
          {
            src: 'lib/assets/javascripts/chef.js',
            dest: distDir('javascripts/chef.js')
          },

          // Individual JS components
          {
            src: 'lib/assets/javascripts/chef/components/top-bar.js',
            dest: distDir('javascripts/chef/components/top-bar.js')
          },
          {
            src: 'lib/assets/javascripts/chef/components/side-nav.js',
            dest: distDir('javascripts/chef/components/side-nav.js')
          },
          {
            src: 'lib/assets/javascripts/chef/components/logo.js',
            dest: distDir('javascripts/chef/components/logo.js')
          }
        ]
      }
    },

    // Compile the CSS
    sass: {
      dist: {
        options: {
          style: 'expanded',
          sourcemap: 'none',
          loadPath: [
            './vendor/assets/stylesheets',
            foundationSource + '/vendor/assets/stylesheets'
          ]
        },
        files: sassFiles()
      }
    },

    // Optimize the SVGs
    svgmin: {
      options: {
        plugins: [
          {
            removeViewBox: false
          }, {
            removeUselessStrokeAndFill: false
          }
        ]
      },
      multiple: {
        files: [{
          expand: true,
          cwd: 'lib/assets/images/source/icons/',
          src: ['**/*.svg'],
          dest: 'lib/assets/images/icons/'
        }]
      }
    },

    // Merge all the SVGs into a single sprite
    svgstore: {
      options: {
        svg: {
          xmlns: 'http://www.w3.org/2000/svg',
          'xmlns:xlink': 'http://www.w3.org/1999/xlink',
          viewBox: '0 0 100 100'
        }
      },
      default: {
        files: {
          'lib/assets/images/icons/all.svg': ['lib/assets/images/source/icons/*.svg'],
        },
        options: {
          formatting : {
            indent_size : 2
          },
          cleanup: ['fill'],
          includeTitleElement: false
        }
      }
    },

    // Rebuild when assets change
    watch: {
      scripts: {
        files: [
          'lib/assets/**/*'
        ],
        tasks: [
          'build'
        ],
        options: {
          spawn: false
        }
      }
    }
  });

  function distDir(path) {
    return ['dist', path].join('/');
  }

  function sassFiles() {
    var files = {};

    files[distDir('stylesheets/chef.css')] = './lib/assets/stylesheets/chef.scss';

    [
      'accordion',
      'alert',
      'button',
      'code',
      'dropdown',
      'form',
      'icon',
      'label',
      'logo',
      'modal',
      'side-nav',
      'tab',
      'table',
      'top-bar'
    ].forEach(function(o) {
      files[distDir('stylesheets/chef/components/' + o + '.css')] = './lib/assets/stylesheets/chef/components/' + o + '.scss'
    });

    return files;
  }

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-sass');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-mincer');
  grunt.loadNpmTasks('grunt-svgmin');
  grunt.loadNpmTasks('grunt-svgstore');

  grunt.registerTask('default', ['build']);
  grunt.registerTask('build', ['clean:start', 'copy', 'mince', 'sass']);
  grunt.registerTask('build-svgs', ['svgmin', 'svgstore']);
};
<|endoftext|>


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

    // Project configuration.
    grunt.initConfig({
        // Metadata.
        pkg: grunt.file.readJSON('package.json'),
        // Task configuration.
        clean: {
            src: ['src/js/portal/*.min.js', 'src/js/main.min.js'],
            build: ['build/**']
        },
        jshint: {
            all: ['Gruntfile.js', 'src/js/*.js', 'src/js/portal/*.js']
        },
        concat: {
            options: {
                separator: ';'
            },
            build_index: {
                src: ['src/index.html', 'src/templates.html'],
                dest: 'build/index.html'
            }
        },
        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
            },
            build: {
                files: {
                    'src/js/main.min.js': 'src/js/main.js',
                    'src/js/portal/portal.min.js': 'src/js/portal/portal.js',
                    'src/js/portal/util.min.js': 'src/js/portal/util.js'
                }
            }
        },
        copy: {
            main: {
                files: [
                    {expand: true, cwd: 'src/', src: ['assets/**'], dest: 'build/'},
                    {expand: true, cwd: 'src/', src: ['css/**'], dest: 'build/'},
                    {expand: true, cwd: 'src/', src: ['js/*'], dest: 'build/',
                        rename: function(src, dest) {
                            return src + dest.replace('.min', '');
                        }
                    },
                    {expand: true, cwd: 'src/', src: 'js/portal/*', dest: 'build/',
                        rename: function(src, dest) {
                            return src + dest.replace('.min', '');
                        }
                    },
                    {expand: true, cwd: 'src/', src: ['js/lib/**'], dest: 'build/'}
                ]
            }
        },
    });

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');

    // Default task.
    grunt.registerTask('default', ['clean', 'jshint', 'concat', 'uglify', 'copy']);
    grunt.registerTask('cleanup', ['clean']);

};<commit_msg>added explanations to grunt tasks<commit_after>/*global module:false*/
module.exports = function (grunt) {

    // Project configuration.
    grunt.initConfig({
        // Metadata.
        pkg: grunt.file.readJSON('package.json'),
        // Task configuration.
        clean: {
            // Clean up build files.
            src: ['src/js/portal/*.min.js', 'src/js/main.min.js'],
            build: ['build/**']
        },
        jshint: {
            // Validate the javascripts.
            all: ['Gruntfile.js', 'src/js/*.js', 'src/js/portal/*.js']
        },
        concat: {
            // Combine files where it makes sense.
            options: {
                separator: ';'
            },
            build_index: {
                src: ['src/index.html', 'src/templates.html'],
                dest: 'build/index.html'
            }
        },
        uglify: {
            // Minify the javascript files.
            options: {
                banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n'
            },
            build: {
                files: {
                    'src/js/main.min.js': 'src/js/main.js',
                    'src/js/portal/portal.min.js': 'src/js/portal/portal.js',
                    'src/js/portal/util.min.js': 'src/js/portal/util.js'
                }
            }
        },
        copy: {
            // Copy everything to the build directory for testing.
            main: {
                files: [
                    {expand: true, cwd: 'src/', src: ['assets/**'], dest: 'build/'},
                    {expand: true, cwd: 'src/', src: ['css/**'], dest: 'build/'},
                    {expand: true, cwd: 'src/', src: ['js/*'], dest: 'build/',
                        rename: function(src, dest) {
                            return src + dest.replace('.min', '');
                        }
                    },
                    {expand: true, cwd: 'src/', src: 'js/portal/*', dest: 'build/',
                        rename: function(src, dest) {
                            return src + dest.replace('.min', '');
                        }
                    },
                    {expand: true, cwd: 'src/', src: ['js/lib/**'], dest: 'build/'}
                ]
            }
        },
    });

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');

    // Default task.
    grunt.registerTask('default', ['clean', 'jshint', 'concat', 'uglify', 'copy']);
    grunt.registerTask('cleanup', ['clean']);

};<|endoftext|>


<commit_before>module.exports = function (grunt) {
    var fs = require('fs');
    var envPath = './.env.js';
    if (fs.existsSync(envPath)) {
        console.log("Adding environment variables");
        require(envPath);
    }
    var browsers = require('./test/browsers');
    var reporter = require('saucelabs-mocha-reporter');

    var gruntConfig = {
        pkg: grunt.file.readJSON('package.json'),
        jshint: {
            files: ['Gruntfile.js', 'src/*.js', 'test/**.js'],
            options: {
                laxbreak: true
            }
        },
        watch: {
            scripts: {
                files: ['<%= jshint.files %>'],
                tasks: ['jshint']
            }
        },
        connect: {
            server: {
                options: {
                    port: 9000,
                    hostname: '*',
                    base: '.'
                }
            }
        },
        mocha_phantomjs: {
            test: {
                options: {
                    urls: [
                        'http://localhost:9000/test/mocha_test.html'
                    ]
                }
            }
        },
        'saucelabs-mocha': {
            // Settings programatically added below
        }
    };

    var addTag = function(envVar) {
        var ev = process.env[envVar];
        if (ev && ev.length > 0) {
            if (ev === 'false' || ev === 'true') {
                if (ev === 'true') {
                    tags.push(envVar);
                }
            } else {
                tags.push(ev);
            }
        }
    };

    var onTestComplete;
    for (var browser in browsers) {
        var taskBrowsers = browsers[browser];
        var tags = [];
        ['TRAVIS', 'TRAVIS_PULL_REQUEST', 'TRAVIS_BRANCH'].forEach(addTag);
        gruntConfig['saucelabs-mocha'][browser] = {
            options: {
                urls: ["http://127.0.0.1:9000/test/mocha_test.html"],
                tunnelTimeout: 5,
                build: process.env.TRAVIS_JOB_ID,
                tags: tags,
                concurrency: 3,
                browsers: taskBrowsers,
                testname: browser + ' mocha tests',
                'pollInterval': 1000,
                'max-duration': 60
            }
        };
    }
    grunt.initConfig(gruntConfig);
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-mocha-phantomjs');
    grunt.loadNpmTasks('grunt-saucelabs');

    grunt.registerTask('default', ['connect', 'watch']);
    grunt.registerTask('test', 'Run tests', function (type, testType) {
        if(!type) {
            grunt.task.run(['connect', 'mocha_phantomjs']);
        } else if (browsers[type]) {
            var useTests = JSON.parse(testType || null);
            gruntConfig['saucelabs-mocha'][type].options.onTestComplete = reporter.create(useTests);
            if (type === 'ci') {
                grunt.task.run(['connect', 'mocha_phantomjs', 'saucelabs-mocha:' + type]);
            } else {
                grunt.task.run(['connect', 'saucelabs-mocha:' + type]);
            }
        } else {
            // Error!
            console.log("Couldn't find: " + type + " in browser config. Running phantomjs instead");
            grunt.task.run(['connect', 'mocha_phantomjs']);
        }
    });
};
<commit_msg>Increase max-duration for CI tests<commit_after>module.exports = function (grunt) {
    var fs = require('fs');
    var envPath = './.env.js';
    if (fs.existsSync(envPath)) {
        console.log("Adding environment variables");
        require(envPath);
    }
    var browsers = require('./test/browsers');
    var reporter = require('saucelabs-mocha-reporter');

    var gruntConfig = {
        pkg: grunt.file.readJSON('package.json'),
        jshint: {
            files: ['Gruntfile.js', 'src/*.js', 'test/**.js'],
            options: {
                laxbreak: true
            }
        },
        watch: {
            scripts: {
                files: ['<%= jshint.files %>'],
                tasks: ['jshint']
            }
        },
        connect: {
            server: {
                options: {
                    port: 9000,
                    hostname: '*',
                    base: '.'
                }
            }
        },
        mocha_phantomjs: {
            test: {
                options: {
                    urls: [
                        'http://localhost:9000/test/mocha_test.html'
                    ]
                }
            }
        },
        'saucelabs-mocha': {
            // Settings programatically added below
        }
    };

    var addTag = function(envVar) {
        var ev = process.env[envVar];
        if (ev && ev.length > 0) {
            if (ev === 'false' || ev === 'true') {
                if (ev === 'true') {
                    tags.push(envVar);
                }
            } else {
                tags.push(ev);
            }
        }
    };

    var onTestComplete;
    for (var browser in browsers) {
        var taskBrowsers = browsers[browser];
        var tags = [];
        ['TRAVIS', 'TRAVIS_PULL_REQUEST', 'TRAVIS_BRANCH'].forEach(addTag);
        gruntConfig['saucelabs-mocha'][browser] = {
            options: {
                urls: ["http://127.0.0.1:9000/test/mocha_test.html"],
                tunnelTimeout: 5,
                build: process.env.TRAVIS_JOB_ID,
                tags: tags,
                concurrency: 3,
                browsers: taskBrowsers,
                testname: browser + ' mocha tests',
                'pollInterval': 1000,
                'max-duration': 60
            }
        };
    }
    grunt.initConfig(gruntConfig);
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-mocha-phantomjs');
    grunt.loadNpmTasks('grunt-saucelabs');

    grunt.registerTask('default', ['connect', 'watch']);
    grunt.registerTask('test', 'Run tests', function (type, testType) {
        if(!type) {
            grunt.task.run(['connect', 'mocha_phantomjs']);
        } else if (browsers[type]) {
            var useTests = JSON.parse(testType || null);
            gruntConfig['saucelabs-mocha'][type].options.onTestComplete = reporter.create(useTests);
            if (type === 'ci') {
                gruntConfig['saucelabs-mocha'][type].options['max-duration'] = 600;
                grunt.task.run(['connect', 'mocha_phantomjs', 'saucelabs-mocha:' + type]);
            } else {
                grunt.task.run(['connect', 'saucelabs-mocha:' + type]);
            }
        } else {
            // Error!
            console.log("Couldn't find: " + type + " in browser config. Running phantomjs instead");
            grunt.task.run(['connect', 'mocha_phantomjs']);
        }
    });
};
<|endoftext|>