<commit_before>/*global module:false*/

var env = require('./.env.js'),
		s3 = require('./.s3.js');

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		clean: [ "dist/" ],

		aws_s3: {
			release: {
				options: {
					accessKeyId: s3.accessKeyId,
          secretAccessKey: s3.secretAccessKey,
          bucket: env.s3.bucket,
          region: env.s3.region,
          sslEnabled: false
				},
				files: [
          {
            expand: true,
            dest: '.',
            cwd: 'dist/',
            src: ['**'],
            action: 'upload',
            differential: true
          }
        ]
			}
		},

		push: {
			options: { tagName: '%VERSION%' }
		},

		'merge-copy': {
			release: {
				options: {
					destination: 'dist/',
					directories: [ 'main/dist/', 'lab/dist/' ]
				}
			}
		}

  });

  // These plugins provide necessary tasks.

	grunt.loadNpmTasks('grunt-aws-s3');
	grunt.loadNpmTasks('grunt-merge-copy');
	grunt.loadNpmTasks('grunt-push-release');
	grunt.loadNpmTasks('grunt-contrib-clean');

  // Default task.

	grunt.registerTask('deploy', [ 'clean', 'merge-copy:release', 'aws_s3:release', 'push:major', 'clean' ]);

};
<commit_msg>Updated paths to main & lab<commit_after>/*global module:false*/

var env = require('./.env.js'),
		s3 = require('./.s3.js');

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
		pkg: grunt.file.readJSON('package.json'),
		clean: [ "dist/" ],

		aws_s3: {
			release: {
				options: {
					accessKeyId: s3.accessKeyId,
          secretAccessKey: s3.secretAccessKey,
          bucket: env.s3.bucket,
          region: env.s3.region,
          sslEnabled: false
				},
				files: [
          {
            expand: true,
            dest: '.',
            cwd: 'dist/',
            src: ['**'],
            action: 'upload',
            differential: true
          }
        ]
			}
		},

		push: {
			options: { tagName: '%VERSION%' }
		},

		'merge-copy': {
			release: {
				options: {
					destination: 'dist/',
					directories: [ '../main/dist/', '../lab/dist/' ]
				}
			}
		}

  });

  // These plugins provide necessary tasks.

	grunt.loadNpmTasks('grunt-aws-s3');
	grunt.loadNpmTasks('grunt-merge-copy');
	grunt.loadNpmTasks('grunt-push-release');
	grunt.loadNpmTasks('grunt-contrib-clean');

  // Default task.

	grunt.registerTask('deploy', [ 'clean', 'merge-copy:release', 'aws_s3:release', 'push:major', 'clean' ]);

};
<|endoftext|>


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

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

    var mountFolder = function (connect, dir) {
        return connect.static(require('path').resolve(dir));
    };

    var cfg = {
        srcDir: 'source',
        buildDir: 'dist',
        demoDir: 'demo'
    };

    // project configuration
    grunt.initConfig({
        cfg: cfg,

        // watch
        watch: {
            options: {
                livereload: true
            },
            files: [
                '<%= cfg.srcDir %>/**/*.js',
                '<%= cfg.demoDir %>/**/*.js',
                '!<%= cfg.buildDir %>/*.js',
                '!<%= cfg.demoDir %>/dist/*.js',
                '!<%= cfg.demoDir %>/bower_components/**/*'
            ],
            tasks: ['jshint:source', 'clean:build', 'concat:build', 'uglify:build', 'copy']
        },

        // ### Config for grunt-contrib-clean
        // Clean up files as part of other tasks
        clean: {
            build: {
                src: ['<%= cfg.buildDir %>/**']
            },
            demo: {
                src: ['<%= cfg.demoDir %>/dist/**']
            }
        },

        // ### Config for grunt-contrib-copy
        // Prepare files for demo
        copy: {
            demo: {
                files: [{
                    expand: true,
                    src: ['<%= cfg.buildDir %>/*.js'],
                    dest: '<%= cfg.demoDir %>/'
                }]
            }
        },

        // jshint
        jshint: {
            options: {
                'jshintrc': true,
                reporter: require('jshint-stylish')
            },
            source: {
                files: {
                    src: ['<%= cfg.srcDir %>/**/*.js']
                }
            },
            demo: {
                files: {
                    src: [
                        '<%= cfg.demoDir %>/**/*.js',
                        '!<%= cfg.demoDir %>/bower_components/**/*'
                    ]
                }
            }
        },

        // concat
        concat: {
            build: {
                src: [
                    '<%= cfg.srcDir %>/main.js',
                    '<%= cfg.srcDir %>/helper.js',
                    '<%= cfg.srcDir %>/nestedSortableCtrl.js',
                    '<%= cfg.srcDir %>/nestedSortableHandlerCtrl.js',
                    '<%= cfg.srcDir %>/nestedSortableItemCtrl.js',
                    '<%= cfg.srcDir %>/uiNestedSortable.js',
                    '<%= cfg.srcDir %>/uiNestedSortableHandle.js',
                    '<%= cfg.srcDir %>/uiNestedSortableItem.js'
                ],
                dest: '<%= cfg.buildDir %>/angular-nested-sortable.js'
            }
        },

        // uglify
        uglify: {
            options: {
                preserveComments: 'some',
                mangle: false
            },
            build: {
                files: {
                    '<%= cfg.buildDir %>/angular-nested-sortable.min.js': ['<%= cfg.buildDir %>/angular-nested-sortable.js']
                }
            }
        },

        // connect
        connect: {
            options: {
                port: 8080,
                livereload: 35729,
                hostname: '0.0.0.0'
            },
            demo: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '')
                        ];
                    }
                }
            }
        },

        // open
        open: {
            server: {
                path: 'http://localhost:<%= connect.options.port %>/<%= cfg.demoDir %>/'
            }
        },

        // karma
        karma: {
            options: {
                configFile: 'karma.conf.js',
                autoWatch: true
            },

            single: {
                singleRun: true,
                browsers: ['PhantomJS']
            },

            continuous: {
                singleRun: false,
                browsers: ['PhantomJS', 'Firefox']
            }
        }
    });

    // default
    grunt.registerTask('default', ['webserver']);
    grunt.registerTask('build', ['jshint:source', 'karma:single', 'clean:build', 'concat:build', 'uglify:build', 'copy']);
    grunt.registerTask('webserver', ['build', 'open', 'connect:demo', 'watch']);
    grunt.registerTask('test', ['karma:single']);
    grunt.registerTask('test:continuous', ['karma:continuous']);
};
<commit_msg>Cleanup comments<commit_after>'use strict';
module.exports = function (grunt) {

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

    var mountFolder = function (connect, dir) {
        return connect.static(require('path').resolve(dir));
    };

    var cfg = {
        srcDir: 'source',
        buildDir: 'dist',
        demoDir: 'demo'
    };

    // project configuration
    grunt.initConfig({
        cfg: cfg,

        // watch
        watch: {
            options: {
                livereload: true
            },
            files: [
                '<%= cfg.srcDir %>/**/*.js',
                '<%= cfg.demoDir %>/**/*.js',
                '!<%= cfg.buildDir %>/*.js',
                '!<%= cfg.demoDir %>/dist/*.js',
                '!<%= cfg.demoDir %>/bower_components/**/*'
            ],
            tasks: ['jshint:source', 'clean:build', 'concat:build', 'uglify:build', 'copy']
        },

        // clean up files as part of other tasks
        clean: {
            build: {
                src: ['<%= cfg.buildDir %>/**']
            },
            demo: {
                src: ['<%= cfg.demoDir %>/dist/**']
            }
        },

        // prepare files for demo
        copy: {
            demo: {
                files: [{
                    expand: true,
                    src: ['<%= cfg.buildDir %>/*.js'],
                    dest: '<%= cfg.demoDir %>/'
                }]
            }
        },

        // jshint
        jshint: {
            options: {
                'jshintrc': true,
                reporter: require('jshint-stylish')
            },
            source: {
                files: {
                    src: ['<%= cfg.srcDir %>/**/*.js']
                }
            },
            demo: {
                files: {
                    src: [
                        '<%= cfg.demoDir %>/**/*.js',
                        '!<%= cfg.demoDir %>/bower_components/**/*'
                    ]
                }
            }
        },

        // concat
        concat: {
            build: {
                src: [
                    '<%= cfg.srcDir %>/main.js',
                    '<%= cfg.srcDir %>/helper.js',
                    '<%= cfg.srcDir %>/nestedSortableCtrl.js',
                    '<%= cfg.srcDir %>/nestedSortableHandlerCtrl.js',
                    '<%= cfg.srcDir %>/nestedSortableItemCtrl.js',
                    '<%= cfg.srcDir %>/uiNestedSortable.js',
                    '<%= cfg.srcDir %>/uiNestedSortableHandle.js',
                    '<%= cfg.srcDir %>/uiNestedSortableItem.js'
                ],
                dest: '<%= cfg.buildDir %>/angular-nested-sortable.js'
            }
        },

        // uglify
        uglify: {
            options: {
                preserveComments: 'some',
                mangle: false
            },
            build: {
                files: {
                    '<%= cfg.buildDir %>/angular-nested-sortable.min.js': ['<%= cfg.buildDir %>/angular-nested-sortable.js']
                }
            }
        },

        // connect
        connect: {
            options: {
                port: 8080,
                livereload: 35729,
                hostname: '0.0.0.0'
            },
            demo: {
                options: {
                    middleware: function (connect) {
                        return [
                            mountFolder(connect, '')
                        ];
                    }
                }
            }
        },

        // open
        open: {
            server: {
                path: 'http://localhost:<%= connect.options.port %>/<%= cfg.demoDir %>/'
            }
        },

        // karma
        karma: {
            options: {
                configFile: 'karma.conf.js',
                autoWatch: true
            },

            single: {
                singleRun: true,
                browsers: ['PhantomJS']
            },

            continuous: {
                singleRun: false,
                browsers: ['PhantomJS', 'Firefox']
            }
        }
    });

    // default
    grunt.registerTask('default', ['webserver']);
    grunt.registerTask('build', ['jshint:source', 'karma:single', 'clean:build', 'concat:build', 'uglify:build', 'copy']);
    grunt.registerTask('webserver', ['build', 'open', 'connect:demo', 'watch']);
    grunt.registerTask('test', ['karma:single']);
    grunt.registerTask('test:continuous', ['karma:continuous']);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {

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

  // Assemble build
  grunt.loadNpmTasks('assemble');

  // Project configuration.
  grunt.initConfig({

    config: {
      src: 'src',
      dist: 'dist'
    },

    watch: {
      assemble: {
        files: ['<%= config.src %>/{content,data,templates}/{,*/}*.{md,hbs,yml}'],
        tasks: ['assemble']
      },
      compass: {
        files: ['<%= config.src %>/sass/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '.tmp/css/{,*/}*.css',
          '<%= config.dist %>/{,*/}*.html',
          '<%= config.dist %>/assets/{,*/}*.css',
          '<%= config.dist %>/assets/{,*/}*.js',
          '<%= config.dist %>/assets/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    connect: {
      options: {
        port: 9000,
        livereload: 35729,
        // change this to '0.0.0.0' to access the server from outside
        hostname: 'localhost'
      },
      livereload: {
        options: {
          open: true,
          base: [
            '.tmp',
            '<%= config.dist %>'
          ]
        }
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        loadAll: '<%= config.src %>/assets/gumby/sass/extensions',
        sassDir: '<%= config.src %>/sass',
        cssDir: '.tmp/css',
        generatedImagesDir: '.tmp/img/generated',
        imagesDir: '<%= config.src %>/img',
        fontsDir: '<%= config.src %>/fonts',
        importPath: '<%= config.src %>/assets',
        httpImagesPath: '/img',
        httpGeneratedImagesPath: '/img/generated',
        httpFontsPath: '/css/fonts',
        relativeAssets: true,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= config.dist %>/img/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

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

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= config.dist %>/js/{,*/}*.js',
            '<%= config.dist %>/css/{,*/}*.css',
            '<%= config.dist %>/img/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
            '<%= config.dist %>/css/fonts/*'
          ]
        }
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      options: {
        dest: '<%= config.dist %>'
      },
      website: {
        src: ['<%= config.src %>/templates/layouts/default.hbs']
      }
    },

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

    // The following *-min tasks produce minified files in the dist folder
    imagemin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/img',
            src: '{,*/}*.{png,jpg,jpeg,gif}',
            dest: '<%= config.dist %>/img'
          }
        ]
      }
    },
    svgmin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/img',
            src: '{,*/}*.svg',
            dest: '<%= config.dist %>/img'
          }
        ]
      }
    },
    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.dist %>',
            src: ['*.html'],
            dest: '<%= config.dist %>'
          }
        ]
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [
          {
            expand: true,
            dot: true,
            cwd: '<%= config.src %>',
            dest: '<%= config.dist %>',
            src: [
              '*.{ico,png,txt}',
              'img/{,*/}*.{webp}',
              'fonts/*',
              'CNAME'
            ]
          },
          {
            expand: true,
            cwd: '.tmp/img',
            dest: '<%= config.dist %>/img',
            src: ['generated/*']
          },
          {
            expand: true,
            cwd: '<%= config.src %>/assets/gumby/fonts/',
            dest: '<%= config.dist %>/fonts',
            src: '**'
          }
        ]
      },
      dev: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/assets/gumby/fonts/',
            dest: '.tmp/fonts/',
            src: '*'
          }
        ]
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server'
      ],
      dist: [
        'compass:dist',
        'imagemin',
        'svgmin'
      ]
    },

    assemble: {
      pages: {
        options: {
          flatten: true,
          assets: '<%= config.dist %>/assets',
          layout: '<%= config.src %>/templates/layouts/default.hbs',
          data: '<%= config.src %>/data/*.{json,yml}',
          partials: '<%= config.src %>/templates/partials/*.hbs',
          plugins: ['assemble-contrib-permalinks','assemble-contrib-sitemap'],
        },
        files: {
          '<%= config.dist %>/': ['<%= config.src %>/templates/pages/*.hbs']
        }
      }
    },

    // Before generating any new files,
    // remove any previously-created files.

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

    // Automatically create/push gh-pages
    'gh-pages': {
      options: {
        base: 'dist'
      },
      src: ['**']
    }

  });

  grunt.registerTask('server', [
    'clean',
    'assemble',

    'clean:server',
    'copy:dev',
    'concurrent:server',
    'autoprefixer',
    'connect:livereload',
    'watch'
  ]);

  grunt.registerTask('build', [
    'clean',
    'assemble',

    'useminPrepare:website',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'copy:dist',
    'cssmin',
    //'uglify',
    'rev',
    'usemin',
    'htmlmin'
  ]);

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

};
<commit_msg>Fixed build rev and html minification<commit_after>'use strict';

module.exports = function(grunt) {

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

  // Assemble build
  grunt.loadNpmTasks('assemble');

  // Project configuration.
  grunt.initConfig({

    config: {
      src: 'src',
      dist: 'dist'
    },

    watch: {
      assemble: {
        files: ['<%= config.src %>/{content,data,templates}/{,*/}*.{md,hbs,yml}'],
        tasks: ['assemble']
      },
      compass: {
        files: ['<%= config.src %>/sass/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '.tmp/*.html',
          '.tmp/css/{,*/}*.css',
          '<%= config.dist %>/{,*/}*.html',
          '<%= config.dist %>/assets/{,*/}*.css',
          '<%= config.dist %>/assets/{,*/}*.js',
          '<%= config.dist %>/assets/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    connect: {
      options: {
        port: 9000,
        livereload: 35729,
        // change this to '0.0.0.0' to access the server from outside
        hostname: 'localhost'
      },
      livereload: {
        options: {
          open: true,
          base: [
            '.tmp',
            '<%= config.dist %>'
          ]
        }
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        loadAll: '<%= config.src %>/assets/gumby/sass/extensions',
        sassDir: '<%= config.src %>/sass',
        cssDir: '.tmp/css',
        generatedImagesDir: '.tmp/img/generated',
        imagesDir: '<%= config.src %>/img',
        fontsDir: '<%= config.src %>/fonts',
        importPath: '<%= config.src %>/assets',
        httpImagesPath: '/img',
        httpGeneratedImagesPath: '/img/generated',
        httpFontsPath: '/css/fonts',
        relativeAssets: true,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= config.dist %>/img/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

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

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= config.dist %>/js/{,*/}*.js',
            '<%= config.dist %>/css/{,*/}*.css',
            '<%= config.dist %>/img/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
            '<%= config.dist %>/css/fonts/*'
          ]
        }
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '.tmp/index.html',
      options: {
        dest: '<%= config.dist %>'
      }
    },

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

    // The following *-min tasks produce minified files in the dist folder
    imagemin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/img',
            src: '{,*/}*.{png,jpg,jpeg,gif}',
            dest: '<%= config.dist %>/img'
          }
        ]
      }
    },
    svgmin: {
      dist: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/img',
            src: '{,*/}*.svg',
            dest: '<%= config.dist %>/img'
          }
        ]
      }
    },
    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [
          {
            expand: true,
            cwd: '<%= config.dist %>',
            src: '*.html',
            dest: '<%= config.dist %>'
          }
        ]
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [
          {
            expand: true,
            dot: true,
            cwd: '<%= config.src %>',
            dest: '<%= config.dist %>',
            src: [
              '*.{ico,png,txt}',
              'img/{,*/}*.{webp}',
              'fonts/*',
              'CNAME'
            ]
          },
          {
            expand: true,
            cwd: '.tmp',
            dest: '<%= config.dist %>',
            src: '*.html'
          },
          {
            expand: true,
            cwd: '.tmp/img',
            dest: '<%= config.dist %>/img',
            src: ['generated/*']
          },
          {
            expand: true,
            cwd: '<%= config.src %>/assets/gumby/fonts/',
            dest: '<%= config.dist %>/fonts',
            src: '**'
          }
        ]
      },
      dev: {
        files: [
          {
            expand: true,
            cwd: '<%= config.src %>/assets/gumby/fonts/',
            dest: '.tmp/fonts/',
            src: '**'
          }
        ]
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server',
        'assemble'
      ],
      dist: [
        'compass:dist',
        'assemble',
        'imagemin',
        'svgmin'
      ]
    },

    assemble: {
      pages: {
        options: {
          flatten: true,
          layout: 'default.hbs',
          layoutdir: '<%= config.src %>/templates/layouts',
          assets: '<%= config.dist %>/assets',
          partials: '<%= config.src %>/templates/partials/*.hbs',
          plugins: ['assemble-contrib-permalinks','assemble-contrib-sitemap'],
        },
        files: {
          '.tmp/': ['<%= config.src %>/templates/pages/*.hbs']
        }
      }
    },

    // Before generating any new files,
    // remove any previously-created files.

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

    // Automatically create/push gh-pages
    'gh-pages': {
      options: {
        base: 'dist'
      },
      src: ['**']
    }

  });

  grunt.registerTask('server', [
    'clean',
    'concurrent:server',
    'copy:dev',
    'autoprefixer',
    'connect:livereload',
    'watch'
  ]);

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

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

};
<|endoftext|>


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

  var helpers = require('./.grunt/helpers')(grunt);
  var CONTEXT = process.env.CONTEXT || 'prod';
  var clone = grunt.util._.clone;

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

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

  var port = 3001;

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

  // Lookup of the available libs and injects them for the build
  // in the requirejs conf
  var clientLibs = helpers.getBuiltFilenames('src/client/**/*.coffee');
  var remoteLibs = helpers.getBuiltFilenames('src/remote/**/*.coffee');

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

  //Augment the require.js configuation with some computed elements
  var clientRJSConfig = (function () {
    var _c = clientConfig.requireJS;
    _c.include = _c.include.concat(auraExtensions).concat(clientLibs);
    _c.optimize = CONTEXT !== "prod" ? "none" : "uglify";
    return _c;
  })();

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

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

  helpers.appendAWSConfig(gruntConfig);

  grunt.initConfig(gruntConfig);

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

  //custom Tasks
  require('./.grunt/customTasks')(grunt);
};
<commit_msg>Activates the new flavours<commit_after>module.exports = function (grunt) {
  'use strict';

  var helpers = require('./.grunt/helpers')(grunt);
  var CONTEXT = process.env.CONTEXT || 'prod';
  var clone = grunt.util._.clone;

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

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

  var port = 3001;

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

  // Lookup of the available libs and injects them for the build
  // in the requirejs conf
  var clientLibs = helpers.getBuiltFilenames('src/client/**/*.coffee');
  var remoteLibs = helpers.getBuiltFilenames('src/remote/**/*.coffee');

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

  //Augment the require.js configuation with some computed elements
  var clientRJSConfig = (function () {
    var _c = clientConfig.requireJS;
    _c.include = _c.include.concat(auraExtensions).concat(clientLibs);
    _c.optimize = CONTEXT !== "prod" ? "none" : "uglify";
    return _c;
  })();

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

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

  helpers.appendAWSConfig(gruntConfig);

  grunt.initConfig(gruntConfig);

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

  //custom Tasks
  require('./.grunt/customTasks')(grunt);
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
    grunt.initConfig({
        'saucelabs-mocha': {
            all: {
                options: {
                    build: process.env.TRAVIS_JOB_ID,
                    urls: ['http://zordius.github.io/with-promise/'],
                    testname: 'Mocha Unit Test for with-promise',
                    sauceConfig: {
                        tags: [process.env.TRAVIS_JOB_ID, process.env.TRAVIS_COMMIT, 'withPromise', 'mocha'],
                        public: 'public'
                    },
                    tunneled: false,
                    detailedError: true,
                    concurrency: 4,
                    pollInterval: 5000,
                    throttled: 4,
                    maxPollRetries: 3,
                    maxRetries: 2,
                    'max-duration': 300,
                    browsers: [
                        {browserName: 'chrome'},
                        {browserName: 'firefox', platform: 'Linux'},
                        {browserName: 'safari', version: 10, platform: 'OS X 10.12'},
                        {browserName: 'safari', version: 9, platform: 'OS X 10.11'},
                        {browserName: 'safari', version: 8, platform: 'OS X 10.10'},
                        {browserName: 'MicrosoftEdge', version: 14, platform: 'Windows 10'},
                        {browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'},
                        {browserName: 'internet explorer', version: 10, platform: 'Windows 8'},
                        {browserName: 'internet explorer', version: 9, platform: 'Windows 7'},
                        {browserName: 'Android', version:'5.1', platform: 'Linux'},
                        {browserName: 'Android', version:'4.4', platform: 'Linux'},
                        {browserName: 'ipad', version:'10.2', platform: 'OS X 10.10'},
                        {browserName: 'ipad', version:'9.3', platform: 'OS X 10.10'},
                        {browserName: 'ipad', version:'8.4', platform: 'OS X 10.10'},
                        {browserName: 'iphone', version:'10.2', platform: 'OS X 10.10'},
                        {browserName: 'iphone', version:'9.3', platform: 'OS X 10.10'},
                        {browserName: 'iphone', version:'8.4', platform: 'OS X 10.10'}
                    ]
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-saucelabs');
    grunt.registerTask('default', ['saucelabs-mocha']);
};
<commit_msg>longer time<commit_after>module.exports = function (grunt) {
    grunt.initConfig({
        'saucelabs-mocha': {
            all: {
                options: {
                    build: process.env.TRAVIS_JOB_ID,
                    urls: ['http://zordius.github.io/with-promise/'],
                    testname: 'Mocha Unit Test for with-promise',
                    sauceConfig: {
                        tags: [process.env.TRAVIS_JOB_ID, process.env.TRAVIS_COMMIT, 'withPromise', 'mocha'],
                        public: 'public'
                    },
                    tunneled: false,
                    detailedError: true,
                    concurrency: 4,
                    pollInterval: 5000,
                    statusCheckAttempts: 100,
                    throttled: 4,
                    maxPollRetries: 3,
                    maxRetries: 2,
                    'max-duration': 300,
                    browsers: [
                        {browserName: 'chrome'},
                        {browserName: 'firefox', platform: 'Linux'},
                        {browserName: 'safari', version: 10, platform: 'OS X 10.12'},
                        {browserName: 'safari', version: 9, platform: 'OS X 10.11'},
                        {browserName: 'safari', version: 8, platform: 'OS X 10.10'},
                        {browserName: 'MicrosoftEdge', version: 14, platform: 'Windows 10'},
                        {browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'},
                        {browserName: 'internet explorer', version: 10, platform: 'Windows 8'},
                        {browserName: 'internet explorer', version: 9, platform: 'Windows 7'},
                        {browserName: 'Android', version:'5.1', platform: 'Linux'},
                        {browserName: 'Android', version:'4.4', platform: 'Linux'},
                        {browserName: 'ipad', version:'10.2', platform: 'OS X 10.10'},
                        {browserName: 'ipad', version:'9.3', platform: 'OS X 10.10'},
                        {browserName: 'ipad', version:'8.4', platform: 'OS X 10.10'},
                        {browserName: 'iphone', version:'10.2', platform: 'OS X 10.10'},
                        {browserName: 'iphone', version:'9.3', platform: 'OS X 10.10'},
                        {browserName: 'iphone', version:'8.4', platform: 'OS X 10.10'}
                    ]
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-saucelabs');
    grunt.registerTask('default', ['saucelabs-mocha']);
};
<|endoftext|>


<commit_before>/* jshint: node:true */
module.exports = function (grunt) {
    'use strict';

    grunt.initConfig({
        phplint: {
            application: ["lib/*.php", "tests/**/*.php"]
        },
        phpcs: {
            application: {
                src: 'lib/*.php'
            },
            options: {
                bin: 'vendor/bin/phpcs',
                standard: 'PSR1',
                showSniffCodes: true,
                verbose: true
            }
        },
        phpunit: {
            application: {
                dir: 'tests/'
            },
            options: {
                bin: 'vendor/bin/phpunit',
                colors: true,
                coverage: true
            }
        },
        phpcpd: {
            application: {
                dir: 'lib/'
            },
            options: {
                bin: 'vendor/bin/phpcpd',
                quiet: true
            }
        },
        phpmd: {
            application: {
                dir: 'lib/'
            },
            options: {
                bin: 'vendor/bin/phpmd',
                rulesets: 'codesize,unusedcode,naming,design'
            }
        },
        phpdcd: {
            application: {
                dir: 'lib/'
            },
            options: {
                bin: 'vendor/bin/phpdcd',
                verbose: 2
            }
        }
    });

    grunt.loadNpmTasks('grunt-phpcs');
    grunt.loadNpmTasks('grunt-phplint');
    grunt.loadNpmTasks('grunt-phpunit');
    grunt.loadNpmTasks('grunt-phpcpd');
    grunt.loadNpmTasks('grunt-phpdcd');
    grunt.loadNpmTasks('grunt-phpmd');

    grunt.registerTask("default", [
        "phplint",
        "phpunit",
        "phpcpd"
    ]);

    grunt.registerTask('travis', [
        "phplint",
        "phpunit",
        "phpcpd"
    ]);
};<commit_msg>Run PHPMD as part of build tests<commit_after>/* jshint: node:true */
module.exports = function (grunt) {
    'use strict';

    grunt.initConfig({
        phplint: {
            application: ["lib/*.php", "tests/**/*.php"]
        },
        phpcs: {
            application: {
                src: 'lib/*.php'
            },
            options: {
                bin: 'vendor/bin/phpcs',
                standard: 'PSR1',
                showSniffCodes: true,
                verbose: true
            }
        },
        phpunit: {
            application: {
                dir: 'tests/'
            },
            options: {
                bin: 'vendor/bin/phpunit',
                colors: true,
                coverage: true
            }
        },
        phpcpd: {
            application: {
                dir: 'lib/'
            },
            options: {
                bin: 'vendor/bin/phpcpd',
                quiet: true
            }
        },
        phpmd: {
            application: {
                dir: 'lib/'
            },
            options: {
                bin: 'vendor/bin/phpmd',
                reportFormat: 'text',
                rulesets: 'codesize,unusedcode,naming,design'
            }
        },
        phpdcd: {
            application: {
                dir: 'lib/'
            },
            options: {
                bin: 'vendor/bin/phpdcd',
                verbose: 2
            }
        }
    });

    grunt.loadNpmTasks('grunt-phpcs');
    grunt.loadNpmTasks('grunt-phplint');
    grunt.loadNpmTasks('grunt-phpunit');
    grunt.loadNpmTasks('grunt-phpcpd');
    grunt.loadNpmTasks('grunt-phpdcd');
    grunt.loadNpmTasks('grunt-phpmd');

    grunt.registerTask("default", [
        "phplint",
        "phpunit",
        "phpcpd",
        "phpmd"
    ]);

    grunt.registerTask('travis', [
        "phplint",
        "phpunit",
        "phpcpd",
        "phpmd"
    ]);
};<|endoftext|>


<commit_before>'use strict';

module.exports = function (grunt) {
    // show elapsed time at the end
    require('time-grunt')(grunt);
    // load all grunt tasks
    require('load-grunt-tasks')(grunt);

    grunt.initConfig({

        // Watch Config
        watch: {
            files: ['views/**/*'],
            options: {
                livereload: true
            },
            scripts: {
                files: [
                    'assets/scripts/**/*.js',
                ],
            },
            css: {
                files: [
                    'assets/styles/**/*.css',
                ],
            },
            sass: {
                files: ['assets/styles/**/*.scss'],
                tasks: ['sass:dev']
            },
            images: {
                files: [
                    'assets/images/**/*.{png,jpg,jpeg,webp}'
                ],
            },
            express: {
                files:  [ 'app.js', '!**/node_modules/**', '!Gruntfile.js' ],
                tasks:  [ 'express:dev' ],
                options: {
                    nospawn: true // Without this option specified express won't be reloaded
                }
            },
        },

        // Clean Config
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        'dist/*',
                        '!dist/.git*'
                    ]
                }]
            },
            server: ['.tmp'],
        },

        // Hint Config
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                'assets/scripts/**/*.js',
                '!assets/scripts/vendor/*',
                'test/spec/**/*.js'
            ]
        },

        // Sass Config
        sass: {
            options: {
                cacheLocation: '.tmp/.sass-cache'
            },
            dev: {
                options: {
                    style: 'expanded',
                    lineComments: true
                },
                files: [{
                    expand: true,
                    cwd: 'assets/styles/sass',
                    dest: 'assets/styles',
                    src: ['screen.scss'],
                    ext: '.css'
                }]
            }
        },

        // Express Config
        express: {
            options: {
              // Override defaults here
            },
            dev: {
                options: {
                    script: 'app.js'
                }
            }
        },

        // Open Config
        open: {
            site: {
                path: 'http://localhost:3000',
                app: ''
            }
        },

        // Rev Config
        rev: {
            dist: {
                files: {
                    src: [
                        'dist/assets/scripts/**/*.js',
                        'dist/assets/styles/**/*.css',
                        'dist/assets/images/**/*.{png,jpg,jpeg,gif,webp}',
                        'dist/assets/styles/fonts/**/*.*'
                    ]
                }
            }
        },

        // Usemin Config
        useminPrepare: {
            options: {
                dest: 'dist/assets'
            },
            html: ['assets/{,*/}*.html', 'views/**/*.handlebars']
        },
        usemin: {
            options: {
                dirs: ['dist/assets'],
                basedir: 'dist/assets',
            },
            html: ['dist/assets/{,*/}*.html', 'dist/views/**/*.handlebars'],
            css: ['dist/assets/styles/{,*/}*.css']
        },

        // Imagemin Config
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: 'assets/images',
                    src: '**/*.{png,jpg,jpeg}',
                    dest: 'dist/assets/images'
                }]
            }
        },

        // SVGmin Config
        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: 'assets/images',
                    src: '{,*/}*.svg',
                    dest: 'dist/assets/images'
                }]
            }
        },

        // CSSmin config
        cssmin: {
            // This task is pre-configured if you do not wish to use Usemin
            // blocks for your CSS. By default, the Usemin block from your
            // `index.html` will take care of minification, e.g.
            //
            //     <!-- build:css({.tmp,app}) styles/main.css -->
            //
            // dist: {
            //     files: {
            //         'dist/assets/styles/main.css': [
            //             '.tmp/styles/{,*/}*.css',
            //             'assets/styles/{,*/}*.css'
            //         ]
            //     }
            // }
        },

        // HTML Config
        htmlmin: {
            dist: {
                options: {
                    /*removeCommentsFromCDATA: true,
                    // https://github.com/yeoman/grunt-usemin/issues/44
                    //collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeAttributeQuotes: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: 'assets',
                    src: '*.html',
                    dest: 'dist/assets'
                }]
            }
        },

        // Copy Config
        // Put files not handled in other tasks here
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: 'assets',
                    dest: 'dist/assets',
                    src: [
                        '*.{ico,png,txt}',
                        '.htaccess',
                        'images/**/*.{webp,gif}',
                        'styles/fonts/{,*/}*.*',
                    ]
                }, {
                    expand: true,
                    dot: true,
                    cwd: 'views',
                    dest: 'dist/views/',
                    src: '**/*.handlebars',
                }]
            },
            styles: {
                expand: true,
                dot: true,
                cwd: 'assets/styles',
                dest: '.tmp/styles/',
                src: '{,*/}*.css'
            },
        },

        // Concurrent Config
        concurrent: {
            dist: [
                'copy:styles',
                'svgmin',
                'htmlmin'
            ]
        },
    });

    // Register Tasks
    // Workon
    grunt.registerTask('workon', 'Start working on this project.', [
        'jshint',
        'sass:dev',
        'express:dev',
        'open:site',
        'watch'
    ]);

    // Restart
    grunt.registerTask('restart', 'Restart the server.', [
        'express:dev',
        'watch'
    ]);

    // Build
    grunt.registerTask('build', 'Build production ready assets and views.', [
        'clean:dist',
        'concurrent:dist',
        'useminPrepare',
        'imagemin',
        'concat',
        'cssmin',
        'uglify',
        'copy:dist',
        'rev',
        'usemin',
    ]);

};
<commit_msg>Changed the localhost path to the heroku path<commit_after>'use strict';

module.exports = function (grunt) {
    // show elapsed time at the end
    require('time-grunt')(grunt);
    // load all grunt tasks
    require('load-grunt-tasks')(grunt);

    grunt.initConfig({

        // Watch Config
        watch: {
            files: ['views/**/*'],
            options: {
                livereload: true
            },
            scripts: {
                files: [
                    'assets/scripts/**/*.js',
                ],
            },
            css: {
                files: [
                    'assets/styles/**/*.css',
                ],
            },
            sass: {
                files: ['assets/styles/**/*.scss'],
                tasks: ['sass:dev']
            },
            images: {
                files: [
                    'assets/images/**/*.{png,jpg,jpeg,webp}'
                ],
            },
            express: {
                files:  [ 'app.js', '!**/node_modules/**', '!Gruntfile.js' ],
                tasks:  [ 'express:dev' ],
                options: {
                    nospawn: true // Without this option specified express won't be reloaded
                }
            },
        },

        // Clean Config
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        'dist/*',
                        '!dist/.git*'
                    ]
                }]
            },
            server: ['.tmp'],
        },

        // Hint Config
        jshint: {
            options: {
                jshintrc: '.jshintrc'
            },
            all: [
                'Gruntfile.js',
                'assets/scripts/**/*.js',
                '!assets/scripts/vendor/*',
                'test/spec/**/*.js'
            ]
        },

        // Sass Config
        sass: {
            options: {
                cacheLocation: '.tmp/.sass-cache'
            },
            dev: {
                options: {
                    style: 'expanded',
                    lineComments: true
                },
                files: [{
                    expand: true,
                    cwd: 'assets/styles/sass',
                    dest: 'assets/styles',
                    src: ['screen.scss'],
                    ext: '.css'
                }]
            }
        },

        // Express Config
        express: {
            options: {
              // Override defaults here
            },
            dev: {
                options: {
                    script: 'app.js'
                }
            }
        },

        // Open Config
        open: {
            site: {
                path: 'https://dailymumm.herokuapp.com:3000',
                app: ''
            }
        },

        // Rev Config
        rev: {
            dist: {
                files: {
                    src: [
                        'dist/assets/scripts/**/*.js',
                        'dist/assets/styles/**/*.css',
                        'dist/assets/images/**/*.{png,jpg,jpeg,gif,webp}',
                        'dist/assets/styles/fonts/**/*.*'
                    ]
                }
            }
        },

        // Usemin Config
        useminPrepare: {
            options: {
                dest: 'dist/assets'
            },
            html: ['assets/{,*/}*.html', 'views/**/*.handlebars']
        },
        usemin: {
            options: {
                dirs: ['dist/assets'],
                basedir: 'dist/assets',
            },
            html: ['dist/assets/{,*/}*.html', 'dist/views/**/*.handlebars'],
            css: ['dist/assets/styles/{,*/}*.css']
        },

        // Imagemin Config
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: 'assets/images',
                    src: '**/*.{png,jpg,jpeg}',
                    dest: 'dist/assets/images'
                }]
            }
        },

        // SVGmin Config
        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: 'assets/images',
                    src: '{,*/}*.svg',
                    dest: 'dist/assets/images'
                }]
            }
        },

        // CSSmin config
        cssmin: {
            // This task is pre-configured if you do not wish to use Usemin
            // blocks for your CSS. By default, the Usemin block from your
            // `index.html` will take care of minification, e.g.
            //
            //     <!-- build:css({.tmp,app}) styles/main.css -->
            //
            // dist: {
            //     files: {
            //         'dist/assets/styles/main.css': [
            //             '.tmp/styles/{,*/}*.css',
            //             'assets/styles/{,*/}*.css'
            //         ]
            //     }
            // }
        },

        // HTML Config
        htmlmin: {
            dist: {
                options: {
                    /*removeCommentsFromCDATA: true,
                    // https://github.com/yeoman/grunt-usemin/issues/44
                    //collapseWhitespace: true,
                    collapseBooleanAttributes: true,
                    removeAttributeQuotes: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true*/
                },
                files: [{
                    expand: true,
                    cwd: 'assets',
                    src: '*.html',
                    dest: 'dist/assets'
                }]
            }
        },

        // Copy Config
        // Put files not handled in other tasks here
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: 'assets',
                    dest: 'dist/assets',
                    src: [
                        '*.{ico,png,txt}',
                        '.htaccess',
                        'images/**/*.{webp,gif}',
                        'styles/fonts/{,*/}*.*',
                    ]
                }, {
                    expand: true,
                    dot: true,
                    cwd: 'views',
                    dest: 'dist/views/',
                    src: '**/*.handlebars',
                }]
            },
            styles: {
                expand: true,
                dot: true,
                cwd: 'assets/styles',
                dest: '.tmp/styles/',
                src: '{,*/}*.css'
            },
        },

        // Concurrent Config
        concurrent: {
            dist: [
                'copy:styles',
                'svgmin',
                'htmlmin'
            ]
        },
    });

    // Register Tasks
    // Workon
    grunt.registerTask('workon', 'Start working on this project.', [
        'jshint',
        'sass:dev',
        'express:dev',
        'open:site',
        'watch'
    ]);

    // Restart
    grunt.registerTask('restart', 'Restart the server.', [
        'express:dev',
        'watch'
    ]);

    // Build
    grunt.registerTask('build', 'Build production ready assets and views.', [
        'clean:dist',
        'concurrent:dist',
        'useminPrepare',
        'imagemin',
        'concat',
        'cssmin',
        'uglify',
        'copy:dist',
        'rev',
        'usemin',
    ]);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
    grunt.initConfig({
        clean: {
            build: [
                "bundles/patterns*.js",
                "bundles/patterns*.map"
            ],
            test: [
                "_SpecRunner.html"
            ]
        },

        requirejs: {
            options: {
                baseUrl: "src",
                insertRequire: ["main"],
                mainConfigFile: "src/main.js",
                name: "main",
                optimize: "none"
            },
            build: {
                options: {
                    out: "bundles/patterns.js"
                }
            },
            standalone: {
                options: {
                    name: "../lib/almond",
                    include: "main",
                    wrap: true,
                    out: "bundles/patterns-standalone.js",
                    almond: true
                }
            }
        },

        jasmine: {
            src: [],
            options: {
                template: "tests/runner.tmpl",
                vendor: [
                    "lib/requireHelper.js"
                ],
                specs: [
                    "tests/*.js"
                ]
            }
        },

        uglify: {
            build: {
                files: {
                    "bundles/patterns.min.js": ["bundles/patterns.js"]
                },
                options: {
                    preserveComments: false,
                    sourceMap: "bundles/patterns.min.map",
                    sourceMapRoot: "http://patterslib.com"
                }
            },
            standalone: {
                files: {
                    "bundles/patterns-standalone.min.js": ["bundles/patterns-standalone.js"]
                },
                options: {
                    preserveComments: false,
                    sourceMap: "bundles/patterns-standalone.min.map",
                    sourceMapRoot: "http://patterslib.com"
                }
            }
        },

        jshint: {
            sources: [
                "Gruntfile.js",
                "src/*.js",
                "src/core/.js",
                "src/patterns/*.js"
            ],
            tests: {
                src: ["tests/*.js"],
                options: {
                    jquery: true,
                    predef: [
                        "define",
                        "module",
                        "describe",
                        "it",
                        "expect",
                        "spyOn",
                        "beforeEach",
                        "afterEach",
                        "requireDependencies",
                        "jasmine"
                    ]
                }
            },
            options: {
                indent: 4,
                eqeqeq: true,
                browser: true,
                devel: true,
                jquery: false,
                quotmark: "double",
                smarttabs: true,
                trailing: true,
                undef: true,
                unused: true,
                white: false,
                predef: [
                    "requirejs",
                    "require",
                    "define",
                    "module",
                    "Markdown",
                    "Modernizr",
                    "tinyMCE"
                ]
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-clean");
    grunt.loadNpmTasks("grunt-contrib-jasmine");
    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-requirejs");
    grunt.loadNpmTasks("grunt-contrib-uglify");
    grunt.registerTask("test", ["jasmine", "jshint"]);
    grunt.registerTask("build", ["clean", "requirejs", "uglify"]);
    grunt.registerTask("default", ["jasmine", "jshint", "clean", "requirejs", "uglify"]);
};

<commit_msg>disable jshint quotmark check for now<commit_after>module.exports = function(grunt) {
    grunt.initConfig({
        clean: {
            build: [
                "bundles/patterns*.js",
                "bundles/patterns*.map"
            ],
            test: [
                "_SpecRunner.html"
            ]
        },

        requirejs: {
            options: {
                baseUrl: "src",
                insertRequire: ["main"],
                mainConfigFile: "src/main.js",
                name: "main",
                optimize: "none"
            },
            build: {
                options: {
                    out: "bundles/patterns.js"
                }
            },
            standalone: {
                options: {
                    name: "../lib/almond",
                    include: "main",
                    wrap: true,
                    out: "bundles/patterns-standalone.js",
                    almond: true
                }
            }
        },

        jasmine: {
            src: [],
            options: {
                template: "tests/runner.tmpl",
                vendor: [
                    "lib/requireHelper.js"
                ],
                specs: [
                    "tests/*.js"
                ]
            }
        },

        uglify: {
            build: {
                files: {
                    "bundles/patterns.min.js": ["bundles/patterns.js"]
                },
                options: {
                    preserveComments: false,
                    sourceMap: "bundles/patterns.min.map",
                    sourceMapRoot: "http://patterslib.com"
                }
            },
            standalone: {
                files: {
                    "bundles/patterns-standalone.min.js": ["bundles/patterns-standalone.js"]
                },
                options: {
                    preserveComments: false,
                    sourceMap: "bundles/patterns-standalone.min.map",
                    sourceMapRoot: "http://patterslib.com"
                }
            }
        },

        jshint: {
            sources: [
                "Gruntfile.js",
                "src/*.js",
                "src/core/.js",
                "src/patterns/*.js"
            ],
            tests: {
                src: ["tests/*.js"],
                options: {
                    jquery: true,
                    predef: [
                        "define",
                        "module",
                        "describe",
                        "it",
                        "expect",
                        "spyOn",
                        "beforeEach",
                        "afterEach",
                        "requireDependencies",
                        "jasmine"
                    ]
                }
            },
            options: {
                indent: 4,
                eqeqeq: true,
                browser: true,
                devel: true,
                jquery: false,
                // disputable
                //quotmark: "double",
                smarttabs: true,
                trailing: true,
                undef: true,
                unused: true,
                white: false,
                predef: [
                    "requirejs",
                    "require",
                    "define",
                    "module",
                    "Markdown",
                    "Modernizr",
                    "tinyMCE"
                ]
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-clean");
    grunt.loadNpmTasks("grunt-contrib-jasmine");
    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-requirejs");
    grunt.loadNpmTasks("grunt-contrib-uglify");
    grunt.registerTask("test", ["jasmine", "jshint"]);
    grunt.registerTask("build", ["clean", "requirejs", "uglify"]);
    grunt.registerTask("default", ["jasmine", "jshint", "clean", "requirejs", "uglify"]);
};

<|endoftext|>


<commit_before>'use strict';

var

  _URL__ECMASCRIPT_BANNER_FILE = './config/banner.es',
  _URL__GRUNT_CONFIG_FILE = './config/grunt.json',
  _URL__MUSTACHE_BANNER_FILE = './config/banner.mustache',
  _URL__NPM_MANIFEST_FILE = './package.json',

  _gruntRegisterTasks = require('grunt-register-tasks'),
  _loadGruntTasks = require('load-grunt-tasks'),
  _timeGrunt = require('time-grunt');

module.exports = function ( $grunt ) {

    var

      _$grunt__file = $grunt.file,
      _$grunt__file__readJSON = _$grunt__file.readJSON,

      _TEMPLATE__ECMASCRIPT_BANNER
        = _$grunt__file.read( _URL__ECMASCRIPT_BANNER_FILE )
          + '\n',

      _plugins = [
          'grunt-bump',
          'grunt-contrib-*',
          'grunt-exec',
          'grunt-jsonlint',
          'grunt-modify-json',
          'grunt-string-replace',
          'grunt-ts*'
        ],

      _config = {
          'bump': {
              'options': {
                  'commit': true,
                  'commitFiles': [
                      '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__MANIFESTS %>'
                    ],
                  'commitMessage': 'bump(version): %VERSION% [ci skip]',
                  'createTag': false,
                  'files': '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__MANIFESTS %>',
                  'push': true,
                  'pushTo': 'origin',
                  'updateConfigs': [
                      null,
                      'pkg',
                      null
                    ]
                }
            },
          'cfg': _$grunt__file__readJSON( _URL__GRUNT_CONFIG_FILE ),
          'clean': {
              'dist': '<%= cfg.PATH__DIST %>',
              'root': [
                  '<%= cfg.PATH__ROOT %>/<%= cfg.FILE__DS_STORE %>',
                  '<%= cfg.PATH__ROOT %>/<%= cfg.FILE__NPM_DEBUG_LOG %>',
                  '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__ANY_BASEDIR %>',
                  '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__ANY_INDEX %>',
                  '<%= cfg.PATH__TSCACHE %>'
                ]
            },
          'concat': {
              'src.mustache': {
                  'cwd': '<%= cfg.PATH__SRC__MUSTACHE %>',
                  'dest': '<%= cfg.PATH__DIST %>',
                  'expand': true,
                  'options': {
                      'banner': _$grunt__file.read( _URL__MUSTACHE_BANNER_FILE )
                        + '\n'
                    },
                  'src': '<%= cfg.FILE__TEMPLATE_MUSTACHE %>'
                },
              'src.ts': {
                  'cwd': '<%= cfg.PATH__SRC__TS %>',
                  'dest': '<%= cfg.PATH__ROOT %>',
                  'expand': true,
                  'options': {
                      'banner': _TEMPLATE__ECMASCRIPT_BANNER
                    },
                  'src': '<%= cfg.FILE__INDEX_D_TS %>'
                }
            },
          'exec': {
              'commit': 'git commit -m "release(v<%= pkg.version %>): distribute [ci skip]"',
              'tag': 'git tag -a v<%= pkg.version %> -m "<%= grunt.option(\'message\') %>"'
            },
          'jsonlint': {
              'config': '<%= cfg.PATH__CONFIG %>/<%= cfg.GLOB__JSON__RECURSIVE %>',
              'manifests': '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__MANIFESTS %>'
            },
          'modify_json': {
              'manifests': {
                  'files': {
                      '<%= cfg.PATH__ROOT %>': '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__MANIFESTS %>'
                    },
                  'options': {
                      'fields': {
                          'private': false
                        }
                    }
                },
              'options': {
                  'indent': 2
                },
              'pkg': {
                  'files': {
                      '<%= cfg.PATH__ROOT %>': _URL__NPM_MANIFEST_FILE
                    },
                  'options': {
                      'fields': {
                          'devDependencies': {},
                          'scripts': {}
                        }
                    }
                }
            },
          'pkg': _$grunt__file__readJSON( _URL__NPM_MANIFEST_FILE ),
          'string-replace': {
              'readme': {
                  'files': [
                      {
                        'cwd': '<%= cfg.PATH__ROOT %>',
                        'dest': '<%= cfg.PATH__ROOT %>',
                        'expand': true,
                        'src': '<%= cfg.FILE__README_MD %>'
                      }
                    ],
                  'options': {
                      'replacements': [
                          {
                            'pattern': '<%= cfg.URL__RAWGIT_COM %>/<%= pkg.name %>/develop/<%= cfg.FILE__LOGO_SVG %>',
                            'replacement': '<%= cfg.URL__CDN_RAWGIT_COM %>/<%= pkg.name %>/v<%= pkg.version %>/<%= cfg.FILE__LOGO_SVG %>'
                          }
                        ]
                    }
                }
            },
          'ts': {
              'options': {
                  'fast': 'never',
                  'rootDir': '<%= cfg.PATH__SRC__TS %>'
                },
              'src': {
                  'outDir': '<%= cfg.PATH__ROOT %>',
                  'src': '<%= cfg.PATH__SRC__TS %>/<%= cfg.FILE__INDEX_TS %>',
                  'tsconfig': '<%= cfg.PATH__CONFIG %>/<%= cfg.FILE__TSCONFIG_JSON %>'
                }
            },
          'tslint': {
              'options': {
                  'configuration': '<%= cfg.PATH__CONFIG %>/<%= cfg.FILE__TSLINT_JSON %>'
                },
              'src': '<%= cfg.PATH__SRC__TS %>/<%= cfg.FILE__INDEX_TS %>'
            },
          'uglify': {
              'options': {
                  'banner': _TEMPLATE__ECMASCRIPT_BANNER,
                  'beautify': {
                      'beautify': true,
                      'indent_level': 2,
                      'quote_keys': true,
                      'semicolons': false
                    },
                  'compress': false,
                  'footer': '\n',
                  'mangle': false,
                  'preserveComments': 'all',
                  'quoteStyle': 1
                },
              'root': {
                  'cwd': '<%= cfg.PATH__ROOT %>',
                  'dest': '<%= cfg.PATH__ROOT %>',
                  'expand': true,
                  'src': '<%= cfg.FILE__INDEX_JS %>'
                }
            }
        },

      _tasks = {
          'build': [
              'default',
              'clean',
              'concat',
              'ts',
              'uglify'
            ],
          'default': [
              'jsonlint',
              'tslint'
            ]
        };

    _timeGrunt( $grunt ),

    $grunt.initConfig( _config ),

    _loadGruntTasks(
      $grunt,
      {
        'pattern': _plugins,
        'scope': 'devDependencies'
      }
    ),

    _gruntRegisterTasks(
      $grunt,
      _tasks
    );

  };
<commit_msg>chore(grunt): update `tslint` task<commit_after>'use strict';

var

  _URL__ECMASCRIPT_BANNER_FILE = './config/banner.es',
  _URL__GRUNT_CONFIG_FILE = './config/grunt.json',
  _URL__MUSTACHE_BANNER_FILE = './config/banner.mustache',
  _URL__NPM_MANIFEST_FILE = './package.json',

  _gruntRegisterTasks = require('grunt-register-tasks'),
  _loadGruntTasks = require('load-grunt-tasks'),
  _timeGrunt = require('time-grunt');

module.exports = function ( $grunt ) {

    var

      _$grunt__file = $grunt.file,
      _$grunt__file__readJSON = _$grunt__file.readJSON,

      _TEMPLATE__ECMASCRIPT_BANNER
        = _$grunt__file.read( _URL__ECMASCRIPT_BANNER_FILE )
          + '\n',

      _plugins = [
          'grunt-bump',
          'grunt-contrib-*',
          'grunt-exec',
          'grunt-jsonlint',
          'grunt-modify-json',
          'grunt-string-replace',
          'grunt-ts*'
        ],

      _config = {
          'bump': {
              'options': {
                  'commit': true,
                  'commitFiles': [
                      '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__MANIFESTS %>'
                    ],
                  'commitMessage': 'bump(version): %VERSION% [ci skip]',
                  'createTag': false,
                  'files': '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__MANIFESTS %>',
                  'push': true,
                  'pushTo': 'origin',
                  'updateConfigs': [
                      null,
                      'pkg',
                      null
                    ]
                }
            },
          'cfg': _$grunt__file__readJSON( _URL__GRUNT_CONFIG_FILE ),
          'clean': {
              'dist': '<%= cfg.PATH__DIST %>',
              'root': [
                  '<%= cfg.PATH__ROOT %>/<%= cfg.FILE__DS_STORE %>',
                  '<%= cfg.PATH__ROOT %>/<%= cfg.FILE__NPM_DEBUG_LOG %>',
                  '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__ANY_BASEDIR %>',
                  '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__ANY_INDEX %>',
                  '<%= cfg.PATH__TSCACHE %>'
                ]
            },
          'concat': {
              'src.mustache': {
                  'cwd': '<%= cfg.PATH__SRC__MUSTACHE %>',
                  'dest': '<%= cfg.PATH__DIST %>',
                  'expand': true,
                  'options': {
                      'banner': _$grunt__file.read( _URL__MUSTACHE_BANNER_FILE )
                        + '\n'
                    },
                  'src': '<%= cfg.FILE__TEMPLATE_MUSTACHE %>'
                },
              'src.ts': {
                  'cwd': '<%= cfg.PATH__SRC__TS %>',
                  'dest': '<%= cfg.PATH__ROOT %>',
                  'expand': true,
                  'options': {
                      'banner': _TEMPLATE__ECMASCRIPT_BANNER
                    },
                  'src': '<%= cfg.FILE__INDEX_D_TS %>'
                }
            },
          'exec': {
              'commit': 'git commit -m "release(v<%= pkg.version %>): distribute [ci skip]"',
              'tag': 'git tag -a v<%= pkg.version %> -m "<%= grunt.option(\'message\') %>"'
            },
          'jsonlint': {
              'config': '<%= cfg.PATH__CONFIG %>/<%= cfg.GLOB__JSON__RECURSIVE %>',
              'manifests': '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__MANIFESTS %>'
            },
          'modify_json': {
              'manifests': {
                  'files': {
                      '<%= cfg.PATH__ROOT %>': '<%= cfg.PATH__ROOT %>/<%= cfg.GLOB__MANIFESTS %>'
                    },
                  'options': {
                      'fields': {
                          'private': false
                        }
                    }
                },
              'options': {
                  'indent': 2
                },
              'pkg': {
                  'files': {
                      '<%= cfg.PATH__ROOT %>': _URL__NPM_MANIFEST_FILE
                    },
                  'options': {
                      'fields': {
                          'devDependencies': {},
                          'scripts': {}
                        }
                    }
                }
            },
          'pkg': _$grunt__file__readJSON( _URL__NPM_MANIFEST_FILE ),
          'string-replace': {
              'readme': {
                  'files': [
                      {
                        'cwd': '<%= cfg.PATH__ROOT %>',
                        'dest': '<%= cfg.PATH__ROOT %>',
                        'expand': true,
                        'src': '<%= cfg.FILE__README_MD %>'
                      }
                    ],
                  'options': {
                      'replacements': [
                          {
                            'pattern': '<%= cfg.URL__RAWGIT_COM %>/<%= pkg.name %>/develop/<%= cfg.FILE__LOGO_SVG %>',
                            'replacement': '<%= cfg.URL__CDN_RAWGIT_COM %>/<%= pkg.name %>/v<%= pkg.version %>/<%= cfg.FILE__LOGO_SVG %>'
                          }
                        ]
                    }
                }
            },
          'ts': {
              'options': {
                  'fast': 'never',
                  'rootDir': '<%= cfg.PATH__SRC__TS %>'
                },
              'src': {
                  'outDir': '<%= cfg.PATH__ROOT %>',
                  'src': '<%= cfg.PATH__SRC__TS %>/<%= cfg.FILE__INDEX_TS %>',
                  'tsconfig': '<%= cfg.PATH__CONFIG %>/<%= cfg.FILE__TSCONFIG_JSON %>'
                }
            },
          'tslint': {
              'options': {
                  'configuration': '<%= cfg.PATH__CONFIG %>/<%= cfg.FILE__TSLINT_JSON %>'
                },
              'src': '<%= cfg.PATH__SRC__TS %>/<%= cfg.GLOB__TS__RECURSIVE %>'
            },
          'uglify': {
              'options': {
                  'banner': _TEMPLATE__ECMASCRIPT_BANNER,
                  'beautify': {
                      'beautify': true,
                      'indent_level': 2,
                      'quote_keys': true,
                      'semicolons': false
                    },
                  'compress': false,
                  'footer': '\n',
                  'mangle': false,
                  'preserveComments': 'all',
                  'quoteStyle': 1
                },
              'root': {
                  'cwd': '<%= cfg.PATH__ROOT %>',
                  'dest': '<%= cfg.PATH__ROOT %>',
                  'expand': true,
                  'src': '<%= cfg.FILE__INDEX_JS %>'
                }
            }
        },

      _tasks = {
          'build': [
              'default',
              'clean',
              'concat',
              'ts',
              'uglify'
            ],
          'default': [
              'jsonlint',
              'tslint'
            ]
        };

    _timeGrunt( $grunt ),

    $grunt.initConfig( _config ),

    _loadGruntTasks(
      $grunt,
      {
        'pattern': _plugins,
        'scope': 'devDependencies'
      }
    ),

    _gruntRegisterTasks(
      $grunt,
      _tasks
    );

  };
<|endoftext|>


<commit_before>/*
 * grunt-proxy
 *
 *
 * Copyright (c) 2012 Andrei V. Toutoukine
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

	grunt.initConfig({
		jshint: {
			gruntfile	: {
				src	: 'Gruntfile.js'
			},

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

			tests		: {
				src	: ['test/*.js'],
				options : {jshintrc:'test/.jshintrc'}
			},

			options: {
				jshintrc: '.jshintrc',
			},
		},

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

		// Configuration to be run (and then tested).
		proxy: {
			simple : {
				options : {
					target : {
						host: 'localhost',
						port: 8011
					},
					port : 8050
				}
			},
			table : {
				options : {
					router : {
						'localhost/host1' : 'localhost:8011',
						'localhost/host2' : 'localhost:8012'
					},
					port	: 8051
				}
			}
		},

		// Test servers
		connect: {
			host1:	{
				options : {
					port : 8011,
					base : "test/hosts/1"
				}
			},
			host2:	{
				options : {
					port : 8012,
					base : "test/hosts/2"
				}
			}
		},

		// Unit tests.
		mochaTest : {
			all : { src : '<%= jshint.tests.src %>' },
			unit: { src : 'test/unit_test.js'}
		},

		watch : {
			gruntfile	: {
				files		: '<%= jshint.gruntfile.src %>',
				tasks		: ['jshint:gruntfile']
			},

			tasks		: {
				files		: '<%= jshint.tasks.src %>',
				tasks		: ['jshint:tasks','mochaTest:unit']
			},

			tests		: {
				files		: '<%= jshint.tests.src %>',
				tasks		: ['jshint:tests','mochaTest:unit']
			}
		}

	});

	// 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-connect');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-mocha-test');

	// 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', 'connect', 'proxy', 'mochaTest:unit']);

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

};
<commit_msg>Fix: Replace incorrect mochaTest:all target with :integr (integration test)<commit_after>/*
 * grunt-proxy
 *
 *
 * Copyright (c) 2012 Andrei V. Toutoukine
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function(grunt) {

	grunt.initConfig({
		jshint: {
			gruntfile	: {
				src	: 'Gruntfile.js'
			},

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

			tests		: {
				src	: ['test/*.js'],
				options : {jshintrc:'test/.jshintrc'}
			},

			options: {
				jshintrc: '.jshintrc',
			},
		},

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

		// Configuration to be run (and then tested).
		proxy: {
			simple : {
				options : {
					target : {
						host: 'localhost',
						port: 8011
					},
					port : 8050
				}
			},
			table : {
				options : {
					router : {
						'localhost/host1' : 'localhost:8011',
						'localhost/host2' : 'localhost:8012'
					},
					port	: 8051
				}
			}
		},

		// Test servers
		connect: {
			host1:	{
				options : {
					port : 8011,
					base : "test/hosts/1"
				}
			},
			host2:	{
				options : {
					port : 8012,
					base : "test/hosts/2"
				}
			}
		},

		// Unit tests.
		mochaTest : {
			integr	: { src : 'test/proxy_test.js' },
			unit	: { src : 'test/unit_test.js'}
		},

		watch : {
			gruntfile	: {
				files		: '<%= jshint.gruntfile.src %>',
				tasks		: ['jshint:gruntfile']
			},

			tasks		: {
				files		: '<%= jshint.tasks.src %>',
				tasks		: ['jshint:tasks','mochaTest:unit']
			},

			tests		: {
				files		: '<%= jshint.tests.src %>',
				tasks		: ['jshint:tests','mochaTest']
			}
		}

	});

	// 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-connect');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-mocha-test');

	// 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', 'connect', 'proxy', 'mochaTest:unit']);

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

};
<|endoftext|>


<commit_before>'use strict';

var fs = require('fs');

module.exports = function(grunt) {

    // Project configuration.
    var gruntConf = {
        watch: {
            options: {
                nospawn: true
            },
            src: {
                files: ['src/**/*.coffee'],
                tasks: ['coffee:src']
            },
            static: {
                files: ['src/**/*.png', 'src/**/*.less', 'src/**/*.html', 'src/**/*.css', 'src/**/*.js', 'src/**/*.eot', 'src/**/*.otf', 'src/**/*.svg', 'src/**/*.ttf', 'src/**/*.woff', '**/*.ico'],
                tasks: ['copy']
            }
        },
        coffee: {
            src: {
                expand: true,
                cwd: 'src',
                src: ['**/*.coffee'],
                dest: 'bin',
                ext: '.js',
                options: {
                    bare: true
                }
            }
        },
        copy: {
            main: {
                files: [{
                    expand: true,
                    src: ['**', '!**/*.coffee'],
                    dest: 'bin',
                    cwd: 'src'
                }, ]
            }
        },
        subgrunt: {},
        jasmine_node: {
            options: {
                forceExit: true,
                match: '.',
                matchall: false,
                extensions: 'js',
                specNameMatcher: 'spec',
            },
            all: ['./tests/spec/']
        }
    };

    var tasks = [];
    // var default_plg = fs.readdirSync(__dirname + '/default_plugins');
    // for (var i in default_plg) {
    //     var plugin = default_plg[i];
    //     if (fs.existsSync(__dirname + '/default_plugins/' + plugin + '/gruntConfig.js')) {
    //         var task = require('./default_plugins/' + plugin + '/gruntConfig').call(this, gruntConf);
    //         if (task)
    //             tasks.push(task);
    //     }

    //     if (fs.existsSync(__dirname + '/default_plugins/' + plugin + '/Gruntfile.js')) {
    //         gruntConf.subgrunt[plugin] = {
    //             options: {},
    //             projects: {}
    //         };
    //         gruntConf.subgrunt[plugin].projects['./default_plugins/' + plugin] =  'default';
    //     }
    // }

    grunt.initConfig(gruntConf);

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-coffee');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-jasmine-node');
    grunt.loadNpmTasks('grunt-subgrunt');

    // Default task.
    grunt.registerTask('default', ['coffee', 'copy']);
    grunt.registerTask('test', ['jasmine_node:all']);
};<commit_msg>Removed jasmine-node grunt contrib (unused)<commit_after>'use strict';

var fs = require('fs');

module.exports = function(grunt) {

    // Project configuration.
    var gruntConf = {
        watch: {
            options: {
                nospawn: true
            },
            src: {
                files: ['src/**/*.coffee'],
                tasks: ['coffee:src']
            },
            static: {
                files: ['src/**/*.png', 'src/**/*.less', 'src/**/*.html', 'src/**/*.css', 'src/**/*.js', 'src/**/*.eot', 'src/**/*.otf', 'src/**/*.svg', 'src/**/*.ttf', 'src/**/*.woff', '**/*.ico'],
                tasks: ['copy']
            }
        },
        coffee: {
            src: {
                expand: true,
                cwd: 'src',
                src: ['**/*.coffee'],
                dest: 'bin',
                ext: '.js',
                options: {
                    bare: true
                }
            }
        },
        copy: {
            main: {
                files: [{
                    expand: true,
                    src: ['**', '!**/*.coffee'],
                    dest: 'bin',
                    cwd: 'src'
                }, ]
            }
        },
        subgrunt: {},
        jasmine_node: {
            options: {
                forceExit: true,
                match: '.',
                matchall: false,
                extensions: 'js',
                specNameMatcher: 'spec',
            },
            all: ['./tests/spec/']
        }
    };

    var tasks = [];
    // var default_plg = fs.readdirSync(__dirname + '/default_plugins');
    // for (var i in default_plg) {
    //     var plugin = default_plg[i];
    //     if (fs.existsSync(__dirname + '/default_plugins/' + plugin + '/gruntConfig.js')) {
    //         var task = require('./default_plugins/' + plugin + '/gruntConfig').call(this, gruntConf);
    //         if (task)
    //             tasks.push(task);
    //     }

    //     if (fs.existsSync(__dirname + '/default_plugins/' + plugin + '/Gruntfile.js')) {
    //         gruntConf.subgrunt[plugin] = {
    //             options: {},
    //             projects: {}
    //         };
    //         gruntConf.subgrunt[plugin].projects['./default_plugins/' + plugin] =  'default';
    //     }
    // }

    grunt.initConfig(gruntConf);

    // These plugins provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-coffee');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-subgrunt');

    // Default task.
    grunt.registerTask('default', ['coffee', 'copy']);
    grunt.registerTask('test', ['jasmine_node:all']);
};<|endoftext|>


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

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

  grunt.registerTask('default', 'test')

  grunt.registerTask('test', 'mocha');
  grunt.registerTask('mocha', 'simplemocha');

  grunt.initConfig({

    simplemocha: {
      options: {
        globals: ['should'],
        timeout: 3000,
        ignoreLeaks: false,
        ui: 'bdd',
        reporter: 'tap'
      },

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

    watch: {
      test: {
        files: ['src/**/*', 'test/**/*'],
        tasks: 'test'
      }
    }

  });

};
<commit_msg>grunt watch atBegin true<commit_after>module.exports = function (grunt) {

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

  grunt.registerTask('default', 'test')

  grunt.registerTask('test', 'mocha');
  grunt.registerTask('mocha', 'simplemocha');

  grunt.initConfig({

    simplemocha: {
      options: {
        globals: ['should'],
        timeout: 3000,
        ignoreLeaks: false,
        ui: 'bdd',
        reporter: 'tap'
      },

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

    watch: {
      test: {
        options: {
          atBegin: true
        },
        files: ['src/**/*', 'test/**/*'],
        tasks: 'test'
      }
    }

  });

};
<|endoftext|>