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

  // Project configuration.
  grunt.initConfig({

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

    uglify: {
      options: {
        banner: '/*! build <%= grunt.template.today("yyyy-mm-dd HH:mm:ss") %> */\n/*! rbot.js */\n/*! Copyright Francois Lajoie */\n/*! MIT License */\n'
      },
      my_target: {
        files: {
          'public/assets/js/rbot.min.js': ['resources/js/rbot.js']
        }
      }
    },

    // copy: {
    //   build: {
    //     files: [
    //       {
    //         cwd: 'src/boilerplate',     // set working folder / root to copy
    //         src: '**/*',                // copy all files and subfolders
    //         dest: 'build/boilerplate',  // destination folder
    //         expand: true                // required when using cwd
    //       },
    //     ],
    //   },
    // },

    less: {
      development: {},
      production: {
        options: {
          cleancss: true,
        },
        files: {
          "public/assets/css/rbot.css": "resources/less/rbot.less",
        }
      }
    },

    concat: {
      options: {
        separator: ';',
      },
      dist: {
        src: ['resources/js/angular.min.js'],
        dest: 'public/assets/js/libs.js',
      },
    },

    // clean: {
    //   less: [""],
    // },

    watch: {
      scripts: {
        files: ['resources/js/*.js', 'resources/less/*.less'],
        tasks: ['default'],
        options: {
          spawn: false,
        },
      },
    },
  });

  // Load the plugins
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-less');
  //grunt.loadNpmTasks('grunt-contrib-copy');
  //grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-watch');

  // Default task (AKA BUILD)
  grunt.registerTask('default', ['less', 'concat', 'uglify']);
};<commit_msg>added new resources<commit_after>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({

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

    uglify: {
      options: {
        banner: '/*! build <%= grunt.template.today("yyyy-mm-dd HH:mm:ss") %> */\n/*! rbot.js */\n/*! Copyright Francois Lajoie */\n/*! MIT License */\n'
      },
      my_target: {
        files: {
          'public/assets/js/rbot.min.js': ['resources/js/rbot.js']
        }
      }
    },

    // copy: {
    //   build: {
    //     files: [
    //       {
    //         cwd: 'src/boilerplate',     // set working folder / root to copy
    //         src: '**/*',                // copy all files and subfolders
    //         dest: 'build/boilerplate',  // destination folder
    //         expand: true                // required when using cwd
    //       },
    //     ],
    //   },
    // },

    less: {
      development: {},
      production: {
        options: {
          cleancss: true,
        },
        files: {
          "public/assets/css/rbot.css": "resources/less/rbot.less",
        }
      }
    },

    concat: {
      options: {
        separator: ';',
      },
      dist: {
        src: [
          'resources/js/pretty.js',
          'resources/js/angular.min.js'
        ],
        dest: 'public/assets/js/libs.js',
      },
    },

    // clean: {
    //   less: [""],
    // },

    watch: {
      scripts: {
        files: ['resources/js/*.js', 'resources/less/*.less'],
        tasks: ['default'],
        options: {
          spawn: false,
        },
      },
    },
  });

  // Load the plugins
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-less');
  //grunt.loadNpmTasks('grunt-contrib-copy');
  //grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-watch');

  // Default task (AKA BUILD)
  grunt.registerTask('default', ['less', 'concat', 'uglify']);
};<|endoftext|>


<commit_before>'use strict';

// Directory reference:
//   css: styles
//   sass: _scss
//   javascript: scripts
//   images: images
//   fonts: fonts

module.exports = function (grunt) {
  // Show elapsed time after tasks run
  require('time-grunt')(grunt);
  // Load all Grunt tasks
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    // Configurable paths
    yeoman: {
      app: 'app',
      dist: 'dist'
    },
    devUpdate: {
      check: {
        options: {
          reportUpdated: false,
          updateType: 'report'
        }
      }
    },
    watch: {
      sass: {
        files: ['<%= yeoman.app %>/_scss/**/*.scss'],
        tasks: ['sass:server', 'autoprefixer:dist']
      },
      autoprefixer: {
        files: ['<%= yeoman.app %>/styles/**/*.css'],
        tasks: ['copy:stageCss', 'autoprefixer:dist']
      },
      jekyll: {
        files: [
          '<%= yeoman.app %>/**/*.{html,rb,svg,xml,yml}',
          '!<%= yeoman.app %>/_bower_components/**/*'
        ],
        tasks: ['jekyll:server']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '.jekyll/**/*.{html}',
          '.tmp/styles/**/*.css',
          '{.tmp,<%= yeoman.app %>}/scripts/**/*.js',
          '<%= yeoman.app %>/images/**/*.{gif,jpg,jpeg,png,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',
            '.jekyll',
            '<%= yeoman.app %>'
          ]
        }
      },
      dist: {
        options: {
          open: true,
          base: [
            '<%= yeoman.dist %>'
          ]
        }
      },
      test: {
        options: {
          base: [
            '.tmp',
            '.jekyll',
            'test',
            '<%= yeoman.app %>'
          ]
        }
      }
    },
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '<%= yeoman.dist %>/*',
            // Running Jekyll also cleans the target directory.  Exclude any
            // non-standard `keep_files` here (e.g., the generated files
            // directory from Jekyll Picture Tag).
            '!<%= yeoman.dist %>/.git*',
            '!<%= yeoman.dist %>/generated/*' // Jekyll Picture Tag
          ]
        }]
      },
      server: [
        '.tmp',
        '.jekyll'
      ]
    },
    sass: {
      options: {
        bundleExec: true,
      },
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/_scss',
          src: '**/*.scss',
          dest: '.tmp/styles',
          ext: '.css'
        }]
      },
      server: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/_scss',
          src: '**/*.scss',
          dest: '.tmp/styles',
          ext: '.css'
        }]
      }
    },
    autoprefixer: {
      options: {
        browsers: [
          'last 2 version',
          'safari 6',
          'ie 9',
          'opera 12.1',
          'ios 6',
          'android 4'
        ]
      },
      dist: {
        expand: true,
        cwd: '.tmp',
        src: '**/{styles,concat}/*.css',
        dest: '.tmp'
      }
    },
    jekyll: {
      options: {
        bundleExec: true,
        config: '_config.yml,_config.build.yml',
        src: '<%= yeoman.app %>'
      },
      dist: {
        options: {
          dest: '<%= yeoman.dist %>',
        }
      },
      server: {
        options: {
          config: '_config.yml',
          dest: '.jekyll'
        }
      },
      check: {
        options: {
          doctor: true
        }
      }
    },
    useminPrepare: {
      options: {
        dest: '<%= yeoman.dist %>'
      },
      html: '<%= yeoman.dist %>/index.html'
    },
    usemin: {
      options: {
        assetsDirs: '<%= yeoman.dist %>'
      },
      html: ['<%= yeoman.dist %>/**/*.html'],
      css: ['<%= yeoman.dist %>/styles/**/*.css']
    },
    htmlmin: {
      dist: {
        options: {
          removeComments: true,
          collapseWhitespace: true,
          removeRedundantAttributes: true,
          keepClosingSlash: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: '**/*.html',
          dest: '<%= yeoman.dist %>'
        }]
      }
    },
    // Usemin adds files to concat
    concat: {},
    // Usemin adds files to uglify
    uglify: {},
    // Usemin adds files to cssmin
    cssmin: {
      dist: {
        options: {
          check: 'min'
        }
      }
    },
    imageoptim: {
      options: {
        quitAfter: false
      },
      distLossless: {
        options: {
          jpegMini: false,
          imageAlpha: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['**/*.{gif,png}'],
          dest: '<%= yeoman.dist %>'
        }]
      },
      distLossy: {
        options: {
          jpegMini: true,
          imageAlpha: false
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['**/*.{jpg,jpeg}'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },
    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['**/*.svg',
                '!**/fonts/**'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },
    xmlmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: '**/*.xml',
          dest: '<%= yeoman.dist %>'
        }]
      }
    },
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          src: [
            // Jekyll processes and moves HTML and text files
            // Usemin moves CSS and javascript inside of Usemin blocks
            // Copy moves asset files and directories
            'images/**/*',
            'fonts/**/*',
            // Like Jekyll, exclude files & folders prefixed with an underscore
            '!**/_*{,/**}',
            // Explicitly add any files your site needs for distribution here.
            'favicon.ico',
            'favicon*.png'
          ],
          dest: '<%= yeoman.dist %>'
        }]
      },
      // Copy CSS into .tmp directory for Autoprefixer processing
      stageCss: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>/styles',
          src: '**/*.css',
          dest: '.tmp/styles'
        }]
      }
    },
    buildcontrol: {
      dist: {
        options: {
          remote: 'git@github.com:davidensinger/webworke.rs.git',
          branch: 'gh-pages',
          commit: true,
          push: true
        }
      }
    },
    filerev: {
      options: {
        length: 4
      },
      dist: {
        files: [{
          src: [
            '<%= yeoman.dist %>/scripts/**/*.js',
            '<%= yeoman.dist %>/styles/**/*.css',
            '<%= yeoman.dist %>/images/**/*.{gif,jpg,jpeg,png,svg}',
            '!<%= yeoman.dist %>/images/originals/**/*.{gif,jpg,jpeg,png,svg}',
            '<%= yeoman.dist %>/fonts/**/*.{eot*,otf,svg,ttf,woff}'
          ]
        }]
      }
    },
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: [
        'Gruntfile.js',
        '<%= yeoman.app %>/scripts/**/*.js',
        'test/spec/**/*.js',
        '!<%= yeoman.app %>/scripts/_vendor/**/*'
      ]
    },
    modernizr: {
      dist: {
        devFile: '<%= yeoman.app %>/_bower_components/modernizr/modernizr.js',
        outputFile: '<%= yeoman.dist %>/scripts/vendor/modernizr.js',
        uglify: true,
        files: {
          src: [
            '<%= yeoman.dist %>/scripts/{,*/}*.js',
            '<%= yeoman.dist %>/styles/{,*/}*.css',
            '!<%= yeoman.dist %>/scripts/vendor/*'
          ]
        }
      }
    },
    concurrent: {
      server: [
        'sass:server',
        'copy:stageCss',
        'jekyll:server'
      ],
      dist: [
        'sass:dist',
        'copy:dist'
      ]
    }
  });

  // Define Tasks
  grunt.registerTask('serve', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'concurrent:server',
      'autoprefixer:dist',
      'connect:livereload',
      'watch'
    ]);
  });

  // No real tests yet. Add your own.
  grunt.registerTask('test', [
  //   'clean:server',
  //   'concurrent:test',
  //   'connect:test'
  ]);

  grunt.registerTask('check', [
    'devUpdate',
    'clean:server',
    'jekyll:check',
    'jshint:all'
  ]);

  grunt.registerTask('build', [
    'clean',
    // Jekyll cleans files from the target directory, so must run first
    'jekyll:dist',
    'concurrent:dist',
    'useminPrepare',
    'concat',
    'autoprefixer:dist',
    'cssmin',
    'uglify',
    'modernizr',
    'imageoptim',
    'svgmin',
    'filerev',
    'usemin',
    'htmlmin',
    'xmlmin'
    ]);

  grunt.registerTask('deploy', [
    'build',
    'buildcontrol'
    ]);

  grunt.registerTask('default', [
    'check',
    'test',
    'build'
  ]);
};
<commit_msg>Sort out autoprefixer settings so that we’re no longer autoprefixing extraneous stylesheets in Gruntfile.js.<commit_after>'use strict';

// Directory reference:
//   css: styles
//   sass: _scss
//   javascript: scripts
//   images: images
//   fonts: fonts

module.exports = function (grunt) {
  // Show elapsed time after tasks run
  require('time-grunt')(grunt);
  // Load all Grunt tasks
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    // Configurable paths
    yeoman: {
      app: 'app',
      dist: 'dist'
    },
    devUpdate: {
      check: {
        options: {
          reportUpdated: false,
          updateType: 'report'
        }
      }
    },
    watch: {
      sass: {
        files: ['<%= yeoman.app %>/_scss/**/*.scss'],
        tasks: ['sass:server', 'autoprefixer:server']
      },
      autoprefixer: {
        files: ['<%= yeoman.app %>/styles/**/*.css'],
        tasks: ['copy:stageCss', 'autoprefixer:server']
      },
      jekyll: {
        files: [
          '<%= yeoman.app %>/**/*.{html,rb,svg,xml,yml}',
          '!<%= yeoman.app %>/_bower_components/**/*'
        ],
        tasks: ['jekyll:server']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '.jekyll/**/*.{html}',
          '.tmp/styles/**/*.css',
          '{.tmp,<%= yeoman.app %>}/scripts/**/*.js',
          '<%= yeoman.app %>/images/**/*.{gif,jpg,jpeg,png,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',
            '.jekyll',
            '<%= yeoman.app %>'
          ]
        }
      },
      dist: {
        options: {
          open: true,
          base: [
            '<%= yeoman.dist %>'
          ]
        }
      },
      test: {
        options: {
          base: [
            '.tmp',
            '.jekyll',
            'test',
            '<%= yeoman.app %>'
          ]
        }
      }
    },
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '<%= yeoman.dist %>/*',
            // Running Jekyll also cleans the target directory.  Exclude any
            // non-standard `keep_files` here (e.g., the generated files
            // directory from Jekyll Picture Tag).
            '!<%= yeoman.dist %>/.git*',
            '!<%= yeoman.dist %>/generated/*' // Jekyll Picture Tag
          ]
        }]
      },
      server: [
        '.tmp',
        '.jekyll'
      ]
    },
    sass: {
      options: {
        bundleExec: true,
      },
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/_scss',
          src: '**/*.scss',
          dest: '.tmp/styles',
          ext: '.css'
        }]
      },
      server: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/_scss',
          src: '**/*.scss',
          dest: '.tmp/styles',
          ext: '.css'
        }]
      }
    },
    autoprefixer: {
      options: {
        browsers: [
          'last 2 version',
          'safari 6',
          'ie 9',
          'opera 12.1',
          'ios 6',
          'android 4'
        ]
      },
      dist: {
        expand: true,
        cwd: '.tmp',
        src: 'concat/styles/*.css',
        dest: '.tmp'
      },
      server: {
        expand: true,
        cwd: '.tmp',
        src: 'styles/*.css',
        dest: '.tmp'
      }
    },
    jekyll: {
      options: {
        bundleExec: true,
        config: '_config.yml,_config.build.yml',
        src: '<%= yeoman.app %>'
      },
      dist: {
        options: {
          dest: '<%= yeoman.dist %>',
        }
      },
      server: {
        options: {
          config: '_config.yml',
          dest: '.jekyll'
        }
      },
      check: {
        options: {
          doctor: true
        }
      }
    },
    useminPrepare: {
      options: {
        dest: '<%= yeoman.dist %>'
      },
      html: '<%= yeoman.dist %>/index.html'
    },
    usemin: {
      options: {
        assetsDirs: '<%= yeoman.dist %>'
      },
      html: ['<%= yeoman.dist %>/**/*.html'],
      css: ['<%= yeoman.dist %>/styles/**/*.css']
    },
    htmlmin: {
      dist: {
        options: {
          removeComments: true,
          collapseWhitespace: true,
          removeRedundantAttributes: true,
          keepClosingSlash: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: '**/*.html',
          dest: '<%= yeoman.dist %>'
        }]
      }
    },
    // Usemin adds files to concat
    concat: {},
    // Usemin adds files to uglify
    uglify: {},
    // Usemin adds files to cssmin
    cssmin: {
      dist: {
        options: {
          check: 'min'
        }
      }
    },
    imageoptim: {
      options: {
        quitAfter: false
      },
      distLossless: {
        options: {
          jpegMini: false,
          imageAlpha: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['**/*.{gif,png}'],
          dest: '<%= yeoman.dist %>'
        }]
      },
      distLossy: {
        options: {
          jpegMini: true,
          imageAlpha: false
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['**/*.{jpg,jpeg}'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },
    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['**/*.svg',
                '!**/fonts/**'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },
    xmlmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: '**/*.xml',
          dest: '<%= yeoman.dist %>'
        }]
      }
    },
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          src: [
            // Jekyll processes and moves HTML and text files
            // Usemin moves CSS and javascript inside of Usemin blocks
            // Copy moves asset files and directories
            'images/**/*',
            'fonts/**/*',
            // Like Jekyll, exclude files & folders prefixed with an underscore
            '!**/_*{,/**}',
            // Explicitly add any files your site needs for distribution here.
            'favicon.ico',
            'favicon*.png'
          ],
          dest: '<%= yeoman.dist %>'
        }]
      },
      // Copy CSS into .tmp directory for Autoprefixer processing
      stageCss: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>/styles',
          src: '**/*.css',
          dest: '.tmp/styles'
        }]
      }
    },
    buildcontrol: {
      dist: {
        options: {
          remote: 'git@github.com:davidensinger/webworke.rs.git',
          branch: 'gh-pages',
          commit: true,
          push: true
        }
      }
    },
    filerev: {
      options: {
        length: 4
      },
      dist: {
        files: [{
          src: [
            '<%= yeoman.dist %>/scripts/**/*.js',
            '<%= yeoman.dist %>/styles/**/*.css',
            '<%= yeoman.dist %>/images/**/*.{gif,jpg,jpeg,png,svg}',
            '!<%= yeoman.dist %>/images/originals/**/*.{gif,jpg,jpeg,png,svg}',
            '<%= yeoman.dist %>/fonts/**/*.{eot*,otf,svg,ttf,woff}'
          ]
        }]
      }
    },
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: [
        'Gruntfile.js',
        '<%= yeoman.app %>/scripts/**/*.js',
        'test/spec/**/*.js',
        '!<%= yeoman.app %>/scripts/_vendor/**/*'
      ]
    },
    modernizr: {
      dist: {
        devFile: '<%= yeoman.app %>/_bower_components/modernizr/modernizr.js',
        outputFile: '<%= yeoman.dist %>/scripts/vendor/modernizr.js',
        uglify: true,
        files: {
          src: [
            '<%= yeoman.dist %>/scripts/**/*.js',
            '<%= yeoman.dist %>/styles/**/*.css',
            '!<%= yeoman.dist %>/scripts/vendor/*'
          ]
        }
      }
    },
    concurrent: {
      server: [
        'sass:server',
        'copy:stageCss',
        'jekyll:server'
      ],
      dist: [
        'sass:dist',
        'copy:dist'
      ]
    }
  });

  // Define Tasks
  grunt.registerTask('serve', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'concurrent:server',
      'autoprefixer:server',
      'connect:livereload',
      'watch'
    ]);
  });

  // No real tests yet. Add your own.
  grunt.registerTask('test', [
  //   'clean:server',
  //   'concurrent:test',
  //   'connect:test'
  ]);

  grunt.registerTask('check', [
    'devUpdate',
    'clean:server',
    'jekyll:check',
    'jshint:all'
  ]);

  grunt.registerTask('build', [
    'clean',
    // Jekyll cleans files from the target directory, so must run first
    'jekyll:dist',
    'concurrent:dist',
    'useminPrepare',
    'concat',
    'autoprefixer:dist',
    'cssmin',
    'uglify',
    'modernizr',
    'imageoptim',
    'svgmin',
    'filerev',
    'usemin',
    'htmlmin',
    'xmlmin'
    ]);

  grunt.registerTask('deploy', [
    'build',
    'buildcontrol'
    ]);

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


<commit_before>/**
 * Created by bantonides on 11/27/13.
 */
module.exports = function(grunt) {

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

  grunt.initConfig({
    /**
     * We read in our `package.json` file so we can access the package name and
     * version. It's already there, so we don't repeat ourselves here.
     */
    pkg: grunt.file.readJSON('package.json'),
    sass: {
      dist: {
        files: {
          'public/assets/css/app.css': 'public/assets/css/app.scss'
        }
      }
    },
    watch: {
      css: {
        files: '**/*.scss',
        tasks: ['sass'],
        options: {
          livereload: true
        }
      },
      html: {
        files: '**/*.html',
        options: {
          livereload: true
        }
      },
      js: {
        files: 'public/**/*.js'
      }

    },
    gjslint: {
      options: {
        flags: [
          '--disable 220', //ignore error code 220 from gjslint
          '--max_line_length 120'//,
          //'--jslint_error all'
        ],
        reporter: {
          name: 'console'
        }
      },
      all: {
        src: ['*.js',
          'public/assets/js/app/**/*.js']
      }
    },
    // start the app, instead of typing `node app.js`
    nodemon: {
      dev: {
        options: {
          file: 'app.js',
          ignoredFiles: ['public/**', '.sass-cache/**', '.git/**', 'newrelic_agent.log', 'sessions/*']
        }
      },
      prod_like: {
        options: {
          file: 'app.js',
          ignoredFiles: ['*']
        }
      }
    },
    bower: {
      install: {
        // copy dependent packages from bower.json
      }
    },
    replace: {
      auth0: {
        src: ['public/assets/js/app/config.js.template'],
        dest: 'public/assets/js/app/config.js',
        replacements: [{
          from: 'AUTH0_CLIENT_ID_DASHBOARD',
          to: process.env.AUTH0_CLIENT_ID_DASHBOARD
        },
        {
          from: 'AUTH0_DOMAIN_DASHBOARD',
          to: process.env.AUTH0_DOMAIN_DASHBOARD
        },
        {
          from: 'AUTH0_REDIRECT_URI_DASHBOARD',
          to: process.env.AUTH0_REDIRECT_URI_DASHBOARD
        },
        {
          from: 'AUTH0_AUDIENCE_DASHBOARD',
          to: process.env.AUTH0_AUDIENCE_DASHBOARD
        }]
      }
    },
    run: {
      production: {
        cmd: 'node',
        args: ['app.js']
      },
      migrate: {
        cmd: 'node_modules/.bin/db-migrate',
        args: ['up']
      }
    },
    // Run blocking grunt tasks concurrently
    concurrent: {
      dev_configure: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['bower:install', 'replace:auth0']
      },
      dev_run: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['watch', 'nodemon:dev']
      },
      migrate: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['run:migrate']
      },
      prod_like_configure: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['sass', 'replace:auth0']
      },
      prod_like_run: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['run:production']
      }
    }
  });

  grunt.loadNpmTasks('grunt-bower-task');

  grunt.registerTask('default', ['concurrent:dev_configure', 'concurrent:migrate', 'concurrent:dev_run']);
  grunt.registerTask('staging', ['concurrent:prod_like_configure','concurrent:migrate','concurrent:prod_like_run'])
  grunt.registerTask('production', ['concurrent:prod_like_configure','concurrent:migrate','concurrent:prod_like_run'])
};
<commit_msg>try node user alone again<commit_after>/**
 * Created by bantonides on 11/27/13.
 */
module.exports = function(grunt) {

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

  grunt.initConfig({
    /**
     * We read in our `package.json` file so we can access the package name and
     * version. It's already there, so we don't repeat ourselves here.
     */
    pkg: grunt.file.readJSON('package.json'),
    sass: {
      dist: {
        files: {
          'public/assets/css/app.css': 'public/assets/css/app.scss'
        }
      }
    },
    watch: {
      css: {
        files: '**/*.scss',
        tasks: ['sass'],
        options: {
          livereload: true
        }
      },
      html: {
        files: '**/*.html',
        options: {
          livereload: true
        }
      },
      js: {
        files: 'public/**/*.js'
      }

    },
    gjslint: {
      options: {
        flags: [
          '--disable 220', //ignore error code 220 from gjslint
          '--max_line_length 120'//,
          //'--jslint_error all'
        ],
        reporter: {
          name: 'console'
        }
      },
      all: {
        src: ['*.js',
          'public/assets/js/app/**/*.js']
      }
    },
    // start the app, instead of typing `node app.js`
    nodemon: {
      dev: {
        options: {
          file: 'app.js',
          ignoredFiles: ['public/**', '.sass-cache/**', '.git/**', 'newrelic_agent.log', 'sessions/*']
        }
      },
      prod_like: {
        options: {
          file: 'app.js',
          ignoredFiles: ['*']
        }
      }
    },
    bower: {
      install: {
        // copy dependent packages from bower.json
      }
    },
    replace: {
      auth0: {
        src: ['public/assets/js/app/config.js.template'],
        dest: 'public/assets/js/app/config.js',
        replacements: [{
          from: 'AUTH0_CLIENT_ID_DASHBOARD',
          to: process.env.AUTH0_CLIENT_ID_DASHBOARD
        },
        {
          from: 'AUTH0_DOMAIN_DASHBOARD',
          to: process.env.AUTH0_DOMAIN_DASHBOARD
        },
        {
          from: 'AUTH0_REDIRECT_URI_DASHBOARD',
          to: process.env.AUTH0_REDIRECT_URI_DASHBOARD
        },
        {
          from: 'AUTH0_AUDIENCE_DASHBOARD',
          to: process.env.AUTH0_AUDIENCE_DASHBOARD
        }]
      }
    },
    run: {
      production: {
        cmd: 'node',
        args: ['-u', '"node"', 'app.js']
      },
      migrate: {
        cmd: 'node_modules/.bin/db-migrate',
        args: ['up']
      }
    },
    // Run blocking grunt tasks concurrently
    concurrent: {
      dev_configure: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['bower:install', 'replace:auth0']
      },
      dev_run: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['watch', 'nodemon:dev']
      },
      migrate: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['run:migrate']
      },
      prod_like_configure: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['sass', 'replace:auth0']
      },
      prod_like_run: {
        options: {
          logConcurrentOutput: true
        },
        tasks: ['run:production']
      }
    }
  });

  grunt.loadNpmTasks('grunt-bower-task');

  grunt.registerTask('default', ['concurrent:dev_configure', 'concurrent:migrate', 'concurrent:dev_run']);
  grunt.registerTask('staging', ['concurrent:prod_like_configure','concurrent:migrate','concurrent:prod_like_run'])
  grunt.registerTask('production', ['concurrent:prod_like_configure','concurrent:migrate','concurrent:prod_like_run'])
};
<|endoftext|>


<commit_before>// To use this file in WebStorm, right click on the file name in the Project Panel (normally left) and select "Open Grunt Console"

/** @namespace __dirname */
/* jshint -W097 */// jshint strict:false
/*jslint node: true */
"use strict";

module.exports = function (grunt) {

    var srcDir    = __dirname + '/';
    var dstDir    = srcDir + '.build/';
    var pkg       = grunt.file.readJSON('package.json');
    var iopackage = grunt.file.readJSON('io-package.json');
    var version   = (pkg && pkg.version) ? pkg.version : iopackage.common.version;

    // Project configuration.
    grunt.initConfig({
        pkg: pkg,
        replace: {
            core: {
                options: {
                    patterns: [
                        {
                            match: /var version = *'[\.0-9]*';/g,
                            replacement: "var version = '" + version + "';"
                        },
                        {
                            match: /"version"\: *"[\.0-9]*",/g,
                            replacement: '"version": "' + version + '",'
                        }
                    ]
                },
                files: [
                    {
                        expand:  true,
                        flatten: true,
                        src:     [
                                srcDir + 'controller.js',
                                srcDir + 'package.json',
                                srcDir + 'io-package.json'
                        ],
                        dest:    srcDir
                    }
                ]
            }
        },
        // Javascript code styler
        jscs:   require(__dirname + '/tasks/jscs.js'),
        // Lint
        jshint: require(__dirname + '/tasks/jshint.js'),
        http: {
            get_hjscs: {
                options: {
                    url: 'https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/tasks/jscs.js'
                },
                dest: 'tasks/jscs.js'
            },
            get_jshint: {
                options: {
                    url: 'https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/tasks/jshint.js'
                },
                dest: 'tasks/jshint.js'
            },
            get_gruntfile: {
                options: {
                    url: 'https://raw.githubusercontent.com/ioBroker/ioBroker.build/master/adapters/Gruntfile.js'
                },
                dest: 'Gruntfile.js'
            },
            get_utilsfile: {
                options: {
                    url: 'https://raw.githubusercontent.com/ioBroker/ioBroker.build/master/adapters/utils.js'
                },
                dest: 'lib/utils.js'
            },
            get_jscsRules: {
                options: {
                    url: 'https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/tasks/jscsRules.js'
                },
                dest: 'tasks/jscsRules.js'
            }
        }
    });

    grunt.registerTask('updateReadme', function () {
        var readme = grunt.file.read('README.md');
        var pos = readme.indexOf('## Changelog\n');
        if (pos != -1) {
            var readmeStart = readme.substring(0, pos + '## Changelog\n'.length);
            var readmeEnd   = readme.substring(pos + '## Changelog\n'.length);

            if (readme.indexOf(version) == -1) {
                var timestamp = new Date();
                var date = timestamp.getFullYear() + '-' +
                    ("0" + (timestamp.getMonth() + 1).toString(10)).slice(-2) + '-' +
                    ("0" + (timestamp.getDate()).toString(10)).slice(-2);

                var news = "";
                if (iopackage.common.whatsNew) {
                    for (var i = 0; i < iopackage.common.whatsNew.length; i++) {
                        if (typeof iopackage.common.whatsNew[i] == 'string') {
                            news += '* ' + iopackage.common.whatsNew[i] + '\n';
                        } else {
                            news += '* ' + iopackage.common.whatsNew[i].en + '\n';
                        }
                    }
                }

                grunt.file.write('README.md', readmeStart + '### ' + version + ' (' + date + ')\n' + (news ? news + '\n\n' : '\n') + readmeEnd);
            }
        }
    });

    grunt.loadNpmTasks('grunt-replace');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-jscs');
    grunt.loadNpmTasks('grunt-http');

    grunt.registerTask('default', [
        'http',
        'replace',
        'updateReadme',
        'jshint',
        'jscs'
    ]);
	grunt.registerTask('p', [
        'replace',
        'updateReadme'
    ]);
};<commit_msg>(bluefox) improve renaming<commit_after>// To use this file in WebStorm, right click on the file name in the Project Panel (normally left) and select "Open Grunt Console"

/** @namespace __dirname */
/* jshint -W097 */// jshint strict:false
/*jslint node: true */
"use strict";

function getAppName() {
    var parts = __dirname.replace(/\\/g, '/').split('/');
    return parts[parts.length - 1].split('.')[0].toLowerCase();
}

module.exports = function (grunt) {

    var srcDir    = __dirname + '/';
    var pkg       = grunt.file.readJSON('package.json');
    var iopackage = grunt.file.readJSON('io-package.json');
    var version   = (pkg && pkg.version) ? pkg.version : iopackage.common.version;
    var appName   = getAppName();

    // Project configuration.
    grunt.initConfig({
        pkg: pkg,
        replace: {
            core: {
                options: {
                    patterns: [
                        {
                            match: /var version = *'[\.0-9]*';/g,
                            replacement: "var version = '" + version + "';"
                        },
                        {
                            match: /"version"\: *"[\.0-9]*",/g,
                            replacement: '"version": "' + version + '",'
                        }
                    ]
                },
                files: [
                    {
                        expand:  true,
                        flatten: true,
                        src:     [
                                srcDir + 'controller.js',
                                srcDir + 'package.json',
                                srcDir + 'io-package.json'
                        ],
                        dest:    srcDir
                    }
                ]
            },
            name: {
                options: {
                    patterns: [
                        {
                            match:       /iobroker/gi,
                            replacement: appName
                        }
                    ]
                },
                files: [
                    {
                        expand:  true,
                        flatten: true,
                        src:     [
                            srcDir + '*.*',
                            srcDir + '.travis.yml'
                        ],
                        dest:    srcDir
                    },
                    {
                        expand:  true,
                        flatten: true,
                        src:     [
                            srcDir + 'admin/*.*',
                            '!' + srcDir + 'admin/*.png'
                        ],
                        dest:    srcDir + 'admin'
                    },
                    {
                        expand:  true,
                        flatten: true,
                        src:     [
                            srcDir + 'lib/*.*'
                        ],
                        dest:    srcDir + 'lib'
                    },
                    {
                        expand:  true,
                        flatten: true,
                        src:     [
                            srcDir + 'example/*.*'
                        ],
                        dest:    srcDir + 'example'
                    },
                    {
                        expand:  true,
                        flatten: true,
                        src:     [
                            srcDir + 'www/*.*'
                        ],
                        dest:    srcDir + 'www'
                    }
                ]
            }
        },
        // Javascript code styler
        jscs:   require(__dirname + '/tasks/jscs.js'),
        // Lint
        jshint: require(__dirname + '/tasks/jshint.js'),
        http: {
            get_hjscs: {
                options: {
                    url: 'https://raw.githubusercontent.com/' + appName + '/' + appName + '.js-controller/master/tasks/jscs.js'
                },
                dest: 'tasks/jscs.js'
            },
            get_jshint: {
                options: {
                    url: 'https://raw.githubusercontent.com/' + appName + '/' + appName + '.js-controller/master/tasks/jshint.js'
                },
                dest: 'tasks/jshint.js'
            },
            get_utilsfile: {
                options: {
                    url: 'https://raw.githubusercontent.com/' + appName + '/' + appName + '.build/master/adapters/utils.js'
                },
                dest: 'lib/utils.js'
            },
            get_jscsRules: {
                options: {
                    url: 'https://raw.githubusercontent.com/' + appName + '/' + appName + '.js-controller/master/tasks/jscsRules.js'
                },
                dest: 'tasks/jscsRules.js'
            }
        }
    });

    grunt.registerTask('updateReadme', function () {
        var readme = grunt.file.read('README.md');
        var pos = readme.indexOf('## Changelog\n');
        if (pos != -1) {
            var readmeStart = readme.substring(0, pos + '## Changelog\n'.length);
            var readmeEnd   = readme.substring(pos + '## Changelog\n'.length);

            if (readme.indexOf(version) == -1) {
                var timestamp = new Date();
                var date = timestamp.getFullYear() + '-' +
                    ('0' + (timestamp.getMonth() + 1).toString(10)).slice(-2) + '-' +
                    ('0' + (timestamp.getDate()).toString(10)).slice(-2);

                var news = "";
                if (iopackage.common.whatsNew) {
                    for (var i = 0; i < iopackage.common.whatsNew.length; i++) {
                        if (typeof iopackage.common.whatsNew[i] == 'string') {
                            news += '* ' + iopackage.common.whatsNew[i] + '\n';
                        } else {
                            news += '* ' + iopackage.common.whatsNew[i].en + '\n';
                        }
                    }
                }

                grunt.file.write('README.md', readmeStart + '### ' + version + ' (' + date + ')\n' + (news ? news + '\n\n' : '\n') + readmeEnd);
            }
        }
    });

    grunt.loadNpmTasks('grunt-replace');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-jscs');
    grunt.loadNpmTasks('grunt-http');

    grunt.registerTask('default', [
        'http',
        'replace:core',
        'updateReadme',
        'jshint',
        'jscs'
    ]);

    grunt.registerTask('p', [
        'replace:core',
        'updateReadme'
    ]);
    grunt.registerTask('rename', [
        'replace:name'
    ]);
};<|endoftext|>


<commit_before>/*global module:false*/
module.exports = function(grunt) {
    var browsers = [{
        browserName: "firefox",
        version: "19",
        platform: "XP"
    }, {
        browserName: "chrome",
        platform: "XP"
    }, {
        browserName: "chrome",
        platform: "linux"
    }, {
        browserName: "internet explorer",
        platform: "WIN8",
        version: "10"
    }, {
        browserName: "internet explorer",
        platform: "VISTA",
        version: "9"
    }, {
        browserName: "opera",
        platform: "Windows 2008",
        version: "12"
    }]
        ,build_number = process.env.CI_BUILD_NUMBER;
  // Project configuration.
  grunt.initConfig({
    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
      '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
      '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
      ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
    // Task configuration.
    jsdoc : {
      dist : {
          src: ['lib/*.js', 'test/*.js'],
          options: {
              destination: 'doc'
          }
      }
    },
    concat: {
      options: {
        banner: '<%= banner %>',
        stripBanners: true
      },
      dist: {
        src: ['lib/<%= pkg.name %>.js', 'lib/utils.js'],
        dest: 'dist/<%= pkg.name %>.js'
      }
    },
    uglify: {
      options: {
        banner: '<%= banner %>'
      },
      dist: {
        src: '<%= concat.dist.dest %>',
        dest: 'dist/<%= pkg.name %>.min.js'
      }
    },
    bump: {
        options: {
            commitFiles: ['-a'],
            files: ['package.json', 'bower.json'],
            pushTo: 'origin'
        }
    },
    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        unused: true,
        boss: true,
        eqnull: true,
        globals: {}
      },
      gruntfile: {
        src: 'Gruntfile.js'
      }
    },
      karma: {
          unit: {
              configFile: 'karma.config.js'
          }
      },
      coveralls: {
          options: {
              debug: true,
              coverage_dir: 'test/coverage',
              dryRun: true,
              force: true,
              recursive: true
          }
      },
    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile','karma']
      }
    },
      docular: {
          baseUrl: 'http://localhost:8080', //base tag used by Angular
          showAngularDocs: false, //parse and render Angular documentation
          showDocularDocs: false, //parse and render Docular documentation
          docAPIOrder: ['api'], //order to load ui resources
          groups: [
              {
                  groupTitle: 'Angular Sails Bind Library Docs', //Title used in the UI
                  groupId: 'angular-sails-bind', //identifier and determines directory
                  groupIcon: 'icon-book', //Icon to use for this group
                  sections: [
                      {
                          id: "api",
                          title: "angular-sails-bind API",
                          scripts: ["lib/"]
                      }
                  ]
              }
          ] //groups of documentation to parse
      },
      connect: {
          server: {
              options: {
                  base: "",
                  port: 9999
              }
          }
      },
      'saucelabs-mocha': {
          all: {
              options: {
                  urls: ["http://127.0.0.1:9999/test-mocha/test/browser/opts.html"],
                  tunnelTimeout: 5,
                  build: '<%= build_number %>',
                  concurrency: 3,
                  browsers: browsers,
                  testname: "mocha tests",
                  tags: ["master"]
              }
          }
      },
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-bump');
  grunt.loadNpmTasks('grunt-jsdoc');
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-karma-coveralls');
  grunt.loadNpmTasks('grunt-docular');

  // Default task.
  grunt.registerTask('default', ['docular', 'jshint', 'concat', 'uglify', 'karma', 'coveralls']);
  grunt.registerTas('test', ["connect", "saucelabs-mocha"]);
  grunt.registerTask('release', ['default','bump']);
};
<commit_msg>After all, there were a lot of errors.<commit_after>/*global module:false*/
module.exports = function(grunt) {
    var browsers = [{
        browserName: "firefox",
        version: "19",
        platform: "XP"
    }, {
        browserName: "chrome",
        platform: "XP"
    }, {
        browserName: "chrome",
        platform: "linux"
    }, {
        browserName: "internet explorer",
        platform: "WIN8",
        version: "10"
    }, {
        browserName: "internet explorer",
        platform: "VISTA",
        version: "9"
    }, {
        browserName: "opera",
        platform: "Windows 2008",
        version: "12"
    }];
  // Project configuration.
  grunt.initConfig({
    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
      '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
      '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
      ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
    // Task configuration.
    jsdoc : {
      dist : {
          src: ['lib/*.js', 'test/*.js'],
          options: {
              destination: 'doc'
          }
      }
    },
    concat: {
      options: {
        banner: '<%= banner %>',
        stripBanners: true
      },
      dist: {
        src: ['lib/<%= pkg.name %>.js', 'lib/utils.js'],
        dest: 'dist/<%= pkg.name %>.js'
      }
    },
    uglify: {
      options: {
        banner: '<%= banner %>'
      },
      dist: {
        src: '<%= concat.dist.dest %>',
        dest: 'dist/<%= pkg.name %>.min.js'
      }
    },
    bump: {
        options: {
            commitFiles: ['-a'],
            files: ['package.json', 'bower.json'],
            pushTo: 'origin'
        }
    },
    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        unused: true,
        boss: true,
        eqnull: true,
        globals: {}
      },
      gruntfile: {
        src: 'Gruntfile.js'
      }
    },
      karma: {
          unit: {
              configFile: 'karma.config.js'
          }
      },
      coveralls: {
          options: {
              debug: true,
              coverage_dir: 'test/coverage',
              dryRun: true,
              force: true,
              recursive: true
          }
      },
    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile','karma']
      }
    },
      docular: {
          baseUrl: 'http://localhost:8080', //base tag used by Angular
          showAngularDocs: false, //parse and render Angular documentation
          showDocularDocs: false, //parse and render Docular documentation
          docAPIOrder: ['api'], //order to load ui resources
          groups: [
              {
                  groupTitle: 'Angular Sails Bind Library Docs', //Title used in the UI
                  groupId: 'angular-sails-bind', //identifier and determines directory
                  groupIcon: 'icon-book', //Icon to use for this group
                  sections: [
                      {
                          id: "api",
                          title: "angular-sails-bind API",
                          scripts: ["lib/"]
                      }
                  ]
              }
          ] //groups of documentation to parse
      },
      connect: {
          server: {
              options: {
                  base: "",
                  port: 9999
              }
          }
      },
      'saucelabs-mocha': {
          all: {
              options: {
                  urls: ["http://127.0.0.1:9999/test-mocha/test/browser/opts.html"],
                  tunnelTimeout: 5,
                  build: process.env.CI_BUILD_NUMBER,
                  concurrency: 3,
                  browsers: browsers,
                  testname: "mocha tests",
                  tags: ["master"]
              }
          }
      }
  });

  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-bump');
  grunt.loadNpmTasks('grunt-jsdoc');
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-karma-coveralls');
    grunt.loadNpmTasks('grunt-docular');
    grunt.loadNpmTasks('grunt-saucelabs');
  grunt.loadNpmTasks('grunt-contrib-connect');

  // Default task.
  grunt.registerTask('default', ['docular', 'jshint', 'concat', 'uglify', 'karma', 'coveralls']);
  grunt.registerTask('test', ["connect", "saucelabs-mocha"]);
  grunt.registerTask('release', ['default','bump']);
};
<|endoftext|>


<commit_before>/*jshint node:true, es3:false*/
(function () {
    'use strict';
    module.exports = function (grunt) {
        require('load-grunt-tasks')(grunt); // Load grunt tasks automatically
        // Project configuration.
        grunt.initConfig({
            pkg: grunt.file.readJSON('package.json'),
            jshint: {
                options: {
                    esnext: true
                },
                all: ['Gruntfile.js', 'src/**/*.js', 'spec/**/*.js']
            },
            watch: {
                options: {
                    spawn: false
                },
                //watches all scripts an rerun hinting and the tests immediately
                scripts: {
                    files: ['<%= jshint.all %>'],
                    tasks: ['jshint', 'karma:server:run']
                }
            },
            bower: {
                tests: {
                    rjsConfig: 'spec/test-main.js',
                    options: {
                        baseUrl: './'
                    }
                }
            },
            bowerVerify: {
                test: {
                    tasks: ['bower', 'karma:once']
                }
            },
            karma: {
                options: {
                    configFile: 'karma.conf.js'
                },
                //for a single run of test
                once: {
                    singleRun: true,
                },
                //for use while developing and in combination with watch task
                server: {
                    background: true,
                },
            },
            babel: {
                options: {
                    sourceMap: true,
                    presets: ['es2015']
                },
                dist: {
                    files: {
                        'dist/cmdr.js': 'src/cmdr.js'
                    }
                }
            },
            browserify: {
                dist: {
                    options: {
                        transform: [["babelify", {
                            presets: ['es2015']
                        }]],
                        browserifyOptions: {
                            standalone: 'cmdr',
                            debug: true
                        },
                        plugin: [
                            ["browserify-header"]
                        ]
                    },
                    files: {
                        "dist/cmdr.js": "src/cmdr.js"
                    }
                }
            },
            sass: {
                options: {
                    sourceMap: true
                },
                dist: {
                    files: {
                        'dist/cmdr.css': 'src/cmdr.scss'
                    }
                }
            },
            copy: {
                dist: {
                    files: [
                        { expand: true, cwd: 'src/', src: ['cmdr.css'], dest: 'dist/' }
                    ]
                }
            },
            uglify: {
                options: {
                    preserveComments: 'some'
                },
                dist: {
                    files: {
                        'dist/cmdr.min.js': ['dist/cmdr.js']
                    }
                }
            },
            cssmin: {
                dist: {
                    files: {
                        'dist/cmdr.min.css': ['dist/cmdr.css']
                    }
                }
            }
        });

        //development
        grunt.registerTask('dev', ['jshint', 'karma:server', 'watch:scripts']);

        //test
        grunt.registerTask('test', ['jshint', 'karma:once']);
        grunt.registerTask('test:full', ['jshint', 'bowerVerify']);

        //build
        grunt.registerTask('build', ['browserify', 'sass', 'copy', 'uglify', 'cssmin']);
    };
})();
<commit_msg>header breaks debugging / removing<commit_after>/*jshint node:true, es3:false*/
(function () {
    'use strict';
    module.exports = function (grunt) {
        require('load-grunt-tasks')(grunt); // Load grunt tasks automatically
        // Project configuration.
        grunt.initConfig({
            pkg: grunt.file.readJSON('package.json'),
            jshint: {
                options: {
                    esnext: true
                },
                all: ['Gruntfile.js', 'src/**/*.js', 'spec/**/*.js']
            },
            watch: {
                options: {
                    spawn: false
                },
                //watches all scripts an rerun hinting and the tests immediately
                scripts: {
                    files: ['<%= jshint.all %>'],
                    tasks: ['jshint', 'karma:server:run']
                }
            },
            bower: {
                tests: {
                    rjsConfig: 'spec/test-main.js',
                    options: {
                        baseUrl: './'
                    }
                }
            },
            bowerVerify: {
                test: {
                    tasks: ['bower', 'karma:once']
                }
            },
            karma: {
                options: {
                    configFile: 'karma.conf.js'
                },
                //for a single run of test
                once: {
                    singleRun: true,
                },
                //for use while developing and in combination with watch task
                server: {
                    background: true,
                },
            },
            babel: {
                options: {
                    sourceMap: true,
                    presets: ['es2015']
                },
                dist: {
                    files: {
                        'dist/cmdr.js': 'src/cmdr.js'
                    }
                }
            },
            browserify: {
                dist: {
                    options: {
                        transform: [["babelify", {
                            presets: ['es2015']
                        }]],
                        browserifyOptions: {
                            standalone: 'cmdr',
                            debug: true
                        },
                        plugin: [
                            //["browserify-header"]
                        ]
                    },
                    files: {
                        "dist/cmdr.js": "src/cmdr.js"
                    }
                }
            },
            sass: {
                options: {
                    sourceMap: true
                },
                dist: {
                    files: {
                        'dist/cmdr.css': 'src/cmdr.scss'
                    }
                }
            },
            copy: {
                dist: {
                    files: [
                        { expand: true, cwd: 'src/', src: ['cmdr.css'], dest: 'dist/' }
                    ]
                }
            },
            uglify: {
                options: {
                    preserveComments: 'some'
                },
                dist: {
                    files: {
                        'dist/cmdr.min.js': ['dist/cmdr.js']
                    }
                }
            },
            cssmin: {
                dist: {
                    files: {
                        'dist/cmdr.min.css': ['dist/cmdr.css']
                    }
                }
            }
        });

        //development
        grunt.registerTask('dev', ['jshint', 'karma:server', 'watch:scripts']);

        //test
        grunt.registerTask('test', ['jshint', 'karma:once']);
        grunt.registerTask('test:full', ['jshint', 'bowerVerify']);

        //build
        grunt.registerTask('build', ['browserify', 'sass', 'copy', 'uglify', 'cssmin']);
    };
})();
<|endoftext|>


<commit_before>
function gruntConfig (grunt) {
    var config = {
        dir: {
            build: 'build',
            dest: {
                client: '<%= dir.build %>/core/client',
                css: '<%= dir.dest.client %>/css',
                theme: '<%= dir.dest.css %>/theme',
                js: '<%= dir.dest.client %>/js',
                views: '<%= dir.build %>/core/server/views'
            },
            src: {
                client: 'core/client',
                css: '<%= dir.src.client %>/css',
                theme: '<%= dir.src.css %>/theme',
                js: '<%= dir.src.client %>/js',
                jslib: '<%= dir.src.js %>/lib',
                views: 'core/server/views'
            }
        },
        pkg: grunt.file.readJSON('package.json'),

        clean: {
            all: {
                src: ['build']
            },
            js: {
                src: [ '<%= dir.dest.js %>/*.js' ]
            }
        },

        copy: {
            // Copy 'content' file tree
            content: {
                src: [ 'content/**', '!content/themes/**', 'content/themes/casper/**'  ],
                dest: '<%= dir.build %>/',
                expand: true
            },
            themes: {
                src: [ 'content/themes/**', '!content/themes/casper/**' ],
                dest: '<%= dir.build %>/',
                expand: true
            },
            // Copy static resources from core/client tree; JS and CSS will be processed in a different task
            client: {
                src: [ 'core/client/**/*.{png,gif,jpg}' ],
                dest: '<%= dir.build %>/',
                expand: true
            },
            server: {
                src: ['*.*', '!config.json', 'core/**', '!core/client/**', '!core/**/*.jade'],
                dest: '<%= dir.build %>/',
                expand: true
            },
            pages: {
                src: ['core/**/*.jade'],
                dest: '<%= dir.build %>/',
                expand: true
            }
        },

        hashres: {
            options: {
                encoding: 'utf8',
                fileNameFormat: '${name}.${hash}.${ext}',
                renameFiles: true
            },
            images: {
                options: {},
                src: [
                    '<%= dir.dest.client %>/**/*.{png,jpg,gif}'
                ],
                dest: ['<%= dir.dest.views %>/admin/login.jade']
            },
            css: {
                options: {},
                src: [
                    '<%= dir.dest.css %>/*.css',
                    '<%= dir.dest.theme %>/*.css'
                ],
                dest: ['<%= dir.dest.views %>/admin/layout.jade']
            },
            js: {
                options: {},
                src: [
                    '<%= dir.dest.js %>/*.js'
                ],
                dest: ['<%= dir.dest.views %>/admin/index.jade']
            }
        },

        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
                    '<%= grunt.template.today("yyyy-mm-dd") %> */'
            },
            client: {
                files: {
                    '<%= dir.dest.js %>/panda.min.js': ['<%= dir.src.js %>/app/*.js']
                }
            },
            vendors: {
                banner: '\n',
                files: {
                    '<%= dir.dest.js %>/vendors.min.js': [
                        '<%= dir.src.jslib %>/lodash/lodash.min.js',
                        '<%= dir.src.jslib %>/underscore/underscore.string-2.3.2.min.js',
                        '<%= dir.src.jslib %>/bootstrap/bootstrap.js',
                        '<%= dir.src.jslib %>/marked/marked.js',
                        '<%= dir.src.jslib %>/nprogress/nprogress.js',
                        '<%= dir.src.jslib %>/moment/moment-2.5.1.min.js',
                        '<%= dir.src.jslib %>/codemirror/codemirror.js',
                        '<%= dir.src.jslib %>/codemirror/mode/markdown/markdown.js'
                    ]
                }
            }
        },

        cssmin: {
            client: {
                files: {
                    '<%= dir.dest.css %>/panda.min.css': [
                        '<%= dir.src.css %>/codemirror/*.css',
                        '<%= dir.src.css %>/nprogress/*.css',
                        '<%= dir.src.css %>/*.css'
                    ]
                }
            },
            themes: {
                files: {
                    '<%= dir.dest.theme %>/default.min.css':['<%= dir.src.theme %>/default/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/flatly.min.css':['<%= dir.src.theme %>/flatly/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/lumen.min.css':['<%= dir.src.theme %>/lumen/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/simplex.min.css':['<%= dir.src.theme %>/simplex/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/slate.min.css':['<%= dir.src.theme %>/slate/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/spacelab.min.css':['<%= dir.src.theme %>/spacelab/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/superhero.min.css':['<%= dir.src.theme %>/superhero/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/united.min.css':['<%= dir.src.theme %>/united/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/yeti.min.css':['<%= dir.src.theme %>/yeti/*.css', '<%= dir.src.theme %>/*.css']
                }
            },
            vendor: {
                files: {
                    '<%= dir.dest.css %>/vendors.min.css': [
                        '<%= dir.src.css %>/**/*.css',
                        '!<%= dir.src.css %>/*.css',
                        '!<%= dir.src.theme %>/**/*.css'
                    ]
                }
            }
        },

        compress: {
            release: {
                options: {
                    archive: '<%= dir.build %>/panda-v<%= pkg.version %>.zip'
                },
                expand: true,
                cwd: 'build',
                src:['**']
            }
        },

        // ### Config for grunt-contrib-jshint
        // JSHint all the things!
        jshint: {
            server: {
                directives: {
                    node: true,
                    browser: false,
                    todo: true
                },
                files: {
                    src: [
                        'core/server/**/*.js', 'core/index.js', 'core/server.js'
                    ]
                }
            },
            client: {
                directives: {
                    node: false,
                    browser: true,
                    nomen: true,
                    todo: true
                },
                options: {
                    globals: {
                        angular:false,  // angular library
                        _:false         // underscore library
                    }
                },
                src: [
                    'core/client/js/app/**/*.js'
                ]
            }
        },

        watch: {
            themeStyles: {
                files: '<%= dir.src.theme %>/**/*.css',
                tasks: ['cssmin:themes']
            },
            clientStyles: {
                files: '<%= dir.src.css %>/*.css',
                tasks: ['cssmin:client']
            },
            clientScript: {
                files: '<%= dir.src.js %>/app/*.js',
                tasks: ['uglify:client']
            },
            pages: {
                files: '<%= dir.src.views %>/**/*.jade',
                tasks: ['copy:pages']
            },
            express: {
                files: 'core/server/**/*.js',
                tasks: [ 'copy:server', 'express:dev' ],
                options: {
                    nospawn: true
                }
            }
        },

        express: {
            options: {
                script: '<%= dir.build %>/index.js',
                output: 'Panda v<%= pkg.version %> server is running'
            },
            dev: {
                options: {
                    node_env: 'development'
                }
            }
        }
    };

    /**
     * GRUNT CONFIG
     * ========================
     */
    grunt.config.init(config);

    // Dynamically load all npm tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    /**
     * TASKS
     * ========================
     */

    grunt.registerTask('help',
        'Outputs help information if you type `grunt help` instead of `grunt --help`',
        function () {
            console.log('Type `grunt --help` to get the details of available grunt tasks');
        }
    );

    grunt.registerTask(
        'stylesheet',
        'Compile the stylesheets.',
        ['cssmin']
    );

    grunt.registerTask(
        'scripts',
        'Compiles the JavaScript files.',
        ['uglify']
    );

    grunt.registerTask(
        'build',
        'Compiles all of the assets and copies the files to the build directory.',
        ['clean:all', 'copy', 'stylesheet', 'scripts']
    );

    grunt.registerTask(
        'release',
        'Compiles all of the assets and copies the files to the build directory.',
        ['build', 'compress', 'hashres']
    );

    grunt.registerTask(
        'default',
        'Watches the project for changes, automatically rebuilds files and runs a server',
        ['build', 'copy:themes', 'express', 'watch']
    );
}

module.exports = gruntConfig;<commit_msg>Build updates<commit_after>
function gruntConfig (grunt) {
    var config = {
        dir: {
            build: 'build',
            dest: {
                client: '<%= dir.build %>/core/client',
                css: '<%= dir.dest.client %>/css',
                theme: '<%= dir.dest.css %>/theme',
                js: '<%= dir.dest.client %>/js',
                views: '<%= dir.build %>/core/server/views'
            },
            src: {
                client: 'core/client',
                css: '<%= dir.src.client %>/css',
                theme: '<%= dir.src.css %>/theme',
                js: '<%= dir.src.client %>/js',
                jslib: '<%= dir.src.js %>/lib',
                views: 'core/server/views'
            }
        },
        pkg: grunt.file.readJSON('package.json'),

        clean: {
            all: {
                src: ['build']
            },
            js: {
                src: [ '<%= dir.dest.js %>/*.js' ]
            }
        },

        copy: {
            // Copy 'content' file tree
            content: {
                src: [ 'content/**', '!content/themes/**', 'content/themes/casper/**'  ],
                dest: '<%= dir.build %>/',
                expand: true
            },
            themes: {
                src: [ 'content/themes/**', '!content/themes/casper/**' ],
                dest: '<%= dir.build %>/',
                expand: true
            },
            config: {
                src: [ 'config.json' ],
                dest: '<%= dir.build %>/',
                expand: true
            },
            // Copy static resources from core/client tree; JS and CSS will be processed in a different task
            client: {
                src: [ 'core/client/**/*.{png,gif,jpg}' ],
                dest: '<%= dir.build %>/',
                expand: true
            },
            server: {
                src: ['*.*', '!config.json', 'core/**', '!core/client/**', '!core/**/*.jade'],
                dest: '<%= dir.build %>/',
                expand: true
            },
            pages: {
                src: ['core/**/*.jade'],
                dest: '<%= dir.build %>/',
                expand: true
            }
        },

        hashres: {
            options: {
                encoding: 'utf8',
                fileNameFormat: '${name}.${hash}.${ext}',
                renameFiles: true
            },
            images: {
                options: {},
                src: [
                    '<%= dir.dest.client %>/**/*.{png,jpg,gif}'
                ],
                dest: ['<%= dir.dest.views %>/admin/login.jade']
            },
            css: {
                options: {},
                src: [
                    '<%= dir.dest.css %>/*.css',
                    '<%= dir.dest.theme %>/*.css'
                ],
                dest: ['<%= dir.dest.views %>/admin/layout.jade']
            },
            js: {
                options: {},
                src: [
                    '<%= dir.dest.js %>/*.js'
                ],
                dest: ['<%= dir.dest.views %>/admin/index.jade']
            }
        },

        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
                    '<%= grunt.template.today("yyyy-mm-dd") %> */'
            },
            client: {
                files: {
                    '<%= dir.dest.js %>/panda.min.js': ['<%= dir.src.js %>/app/*.js']
                }
            },
            vendors: {
                banner: '\n',
                files: {
                    '<%= dir.dest.js %>/vendors.min.js': [
                        '<%= dir.src.jslib %>/lodash/lodash.min.js',
                        '<%= dir.src.jslib %>/underscore/underscore.string-2.3.2.min.js',
                        '<%= dir.src.jslib %>/bootstrap/bootstrap.js',
                        '<%= dir.src.jslib %>/marked/marked.js',
                        '<%= dir.src.jslib %>/nprogress/nprogress.js',
                        '<%= dir.src.jslib %>/moment/moment-2.5.1.min.js',
                        '<%= dir.src.jslib %>/codemirror/codemirror.js',
                        '<%= dir.src.jslib %>/codemirror/mode/markdown/markdown.js'
                    ]
                }
            }
        },

        cssmin: {
            client: {
                files: {
                    '<%= dir.dest.css %>/panda.min.css': [
                        '<%= dir.src.css %>/codemirror/*.css',
                        '<%= dir.src.css %>/nprogress/*.css',
                        '<%= dir.src.css %>/*.css'
                    ]
                }
            },
            themes: {
                files: {
                    '<%= dir.dest.theme %>/default.min.css':['<%= dir.src.theme %>/default/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/flatly.min.css':['<%= dir.src.theme %>/flatly/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/lumen.min.css':['<%= dir.src.theme %>/lumen/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/simplex.min.css':['<%= dir.src.theme %>/simplex/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/slate.min.css':['<%= dir.src.theme %>/slate/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/spacelab.min.css':['<%= dir.src.theme %>/spacelab/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/superhero.min.css':['<%= dir.src.theme %>/superhero/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/united.min.css':['<%= dir.src.theme %>/united/*.css', '<%= dir.src.theme %>/*.css'],
                    '<%= dir.dest.theme %>/yeti.min.css':['<%= dir.src.theme %>/yeti/*.css', '<%= dir.src.theme %>/*.css']
                }
            },
            vendor: {
                files: {
                    '<%= dir.dest.css %>/vendors.min.css': [
                        '<%= dir.src.css %>/**/*.css',
                        '!<%= dir.src.css %>/*.css',
                        '!<%= dir.src.theme %>/**/*.css'
                    ]
                }
            }
        },

        compress: {
            release: {
                options: {
                    archive: '<%= dir.build %>/panda-v<%= pkg.version %>.zip'
                },
                expand: true,
                cwd: 'build',
                src:['**']
            }
        },

        // ### Config for grunt-contrib-jshint
        // JSHint all the things!
        jshint: {
            server: {
                directives: {
                    node: true,
                    browser: false,
                    todo: true
                },
                files: {
                    src: [
                        'core/server/**/*.js', 'core/index.js', 'core/server.js'
                    ]
                }
            },
            client: {
                directives: {
                    node: false,
                    browser: true,
                    nomen: true,
                    todo: true
                },
                options: {
                    globals: {
                        angular:false,  // angular library
                        _:false         // underscore library
                    }
                },
                src: [
                    'core/client/js/app/**/*.js'
                ]
            }
        },

        watch: {
            themeStyles: {
                files: '<%= dir.src.theme %>/**/*.css',
                tasks: ['cssmin:themes']
            },
            clientStyles: {
                files: '<%= dir.src.css %>/*.css',
                tasks: ['cssmin:client']
            },
            clientScript: {
                files: '<%= dir.src.js %>/app/*.js',
                tasks: ['uglify:client']
            },
            pages: {
                files: '<%= dir.src.views %>/**/*.jade',
                tasks: ['copy:pages']
            },
            express: {
                files: 'core/server/**/*.js',
                tasks: [ 'copy:server', 'express:dev' ],
                options: {
                    nospawn: true
                }
            }
        },

        express: {
            options: {
                script: '<%= dir.build %>/index.js',
                output: 'Panda v<%= pkg.version %> server is running'
            },
            dev: {
                options: {
                    node_env: 'development'
                }
            }
        }
    };

    /**
     * GRUNT CONFIG
     * ========================
     */
    grunt.config.init(config);

    // Dynamically load all npm tasks
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

    /**
     * TASKS
     * ========================
     */

    grunt.registerTask('help',
        'Outputs help information if you type `grunt help` instead of `grunt --help`',
        function () {
            console.log('Type `grunt --help` to get the details of available grunt tasks');
        }
    );

    grunt.registerTask(
        'stylesheet',
        'Compile the stylesheets.',
        ['cssmin']
    );

    grunt.registerTask(
        'scripts',
        'Compiles the JavaScript files.',
        ['uglify']
    );

    grunt.registerTask(
        'build',
        'Compiles all of the assets and copies the files to the build directory.',
        ['clean:all', 'copy', 'stylesheet', 'scripts']
    );

    grunt.registerTask(
        'release',
        'Compiles all of the assets and copies the files to the build directory.',
        ['build', 'compress', 'hashres']
    );

    grunt.registerTask(
        'default',
        'Watches the project for changes, automatically rebuilds files and runs a server',
        ['build', 'copy:themes', 'copy:config', 'express', 'watch']
    );
}

module.exports = gruntConfig;<|endoftext|>


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

	var fs, files, opts, spawn, builds = {};

	opts = {
		baseUrl: "src",
		name: "../build/REPLACE",
		out: "dist/REPLACE.js",
		mainConfigFile: "build/config/production.js"
	};

	fs = require( 'fs' );
	files = fs.readdirSync( "build/custom/" );

	files.forEach(function( file ) {
		if( /\.js$/.test(file) ){
			var name = file.replace(/\.js$/, ""),
				o = Object.create(opts);

			builds[name] = {
				options: o
			};

			builds[name].options.name = o.name.replace("REPLACE", "custom/" + name );
			builds[name].options.out = o.out.replace("REPLACE", name );
		}
	});

	builds.production = {
		options: {
			baseUrl: "src",
			name: "../build/production",
			out: "dist/production.js",
			mainConfigFile: "build/config/production.js"
		}
	};

  // NOTE config includes development
	builds.development = {
		options: {
			baseUrl: "src",
			// NOTE uses the same meta-module as production
			name: "../build/development",
			out: "dist/development.js",
			mainConfigFile: "build/config/development.js"
		}
	};

	// Project configuration.
	grunt.initConfig({
		meta: {
			version: '0.1.7',
			banner: '/*! Shoestring - v<%= meta.version %> - ' +
				'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
				'* http://github.com/filamentgroup/shoestring/\n' +
				'* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
				'Scott Jehl, Filament Group, Inc; Licensed MIT & GPLv2 */ \n'
		},

		qunit: {
			files: ['test/unit/*.html']
		},

		requirejs: builds,

		// NOTE purely for the banner
		concat: {
			options: {
				banner: '<%= meta.banner %>',
				stripBanners: true
			},

			production: {
				src: ['dist/production.js'],
				dest: 'dist/shoestring.js'
			},

			development: {
				src: ['dist/development.js'],
				dest: 'dist/shoestring-dev.js'
			}
		},

		uglify: {
			all: {
				options: {
					banner: '<%= meta.banner %>',
					report: 'gzip'
				},

				files: {
					'dist/shoestring.min.js': ['dist/shoestring.js'],
					'dist/shoestring-dev.min.js': ['dist/shoestring-dev.js']
				}
			}
		},

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

				src: ['Gruntfile.js', 'src/shoestring.js', 'src/extensions/**/*.js']
			}
		}
	});

	spawn = require('child_process').spawn;

	grunt.registerTask('docs', function() {
		var doxx, done = this.async();

		doxx = spawn( 'node', ['node_modules/.bin/doxx', '--source', 'src', '--target', 'dist/docs']);

		doxx.on( 'close', function( code ) {
			console.log( "doxx completed with exit code: "	+ code );
			done();
		});
	});

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

	// Default task.
	grunt.registerTask('build', 'requirejs concat uglify'.split(' ') );
	grunt.registerTask('test', 'jshint qunit'.split(' ') );
	grunt.registerTask('default', 'build test'.split(' ') );
};
<commit_msg>gruntfile whitespace<commit_after>/* global module:false */
module.exports = function(grunt) {

	var fs, files, opts, spawn, builds = {};

	opts = {
		baseUrl: "src",
		name: "../build/REPLACE",
		out: "dist/REPLACE.js",
		mainConfigFile: "build/config/production.js"
	};

	fs = require( 'fs' );
	files = fs.readdirSync( "build/custom/" );

	files.forEach(function( file ) {
		if( /\.js$/.test(file) ){
			var name = file.replace(/\.js$/, ""),
				o = Object.create(opts);

			builds[name] = {
				options: o
			};

			builds[name].options.name = o.name.replace("REPLACE", "custom/" + name );
			builds[name].options.out = o.out.replace("REPLACE", name );
		}
	});

	builds.production = {
		options: {
			baseUrl: "src",
			name: "../build/production",
			out: "dist/production.js",
			mainConfigFile: "build/config/production.js"
		}
	};

	// NOTE config includes development
	builds.development = {
		options: {
			baseUrl: "src",
			// NOTE uses the same meta-module as production
			name: "../build/development",
			out: "dist/development.js",
			mainConfigFile: "build/config/development.js"
		}
	};

	// Project configuration.
	grunt.initConfig({
		meta: {
			version: '0.1.7',
			banner: '/*! Shoestring - v<%= meta.version %> - ' +
				'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
				'* http://github.com/filamentgroup/shoestring/\n' +
				'* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
				'Scott Jehl, Filament Group, Inc; Licensed MIT & GPLv2 */ \n'
		},

		qunit: {
			files: ['test/unit/*.html']
		},

		requirejs: builds,

		// NOTE purely for the banner
		concat: {
			options: {
				banner: '<%= meta.banner %>',
				stripBanners: true
			},

			production: {
				src: ['dist/production.js'],
				dest: 'dist/shoestring.js'
			},

			development: {
				src: ['dist/development.js'],
				dest: 'dist/shoestring-dev.js'
			}
		},

		uglify: {
			all: {
				options: {
					banner: '<%= meta.banner %>',
					report: 'gzip'
				},

				files: {
					'dist/shoestring.min.js': ['dist/shoestring.js'],
					'dist/shoestring-dev.min.js': ['dist/shoestring-dev.js']
				}
			}
		},

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

				src: ['Gruntfile.js', 'src/shoestring.js', 'src/extensions/**/*.js']
			}
		}
	});

	spawn = require('child_process').spawn;

	grunt.registerTask('docs', function() {
		var doxx, done = this.async();

		doxx = spawn( 'node', ['node_modules/.bin/doxx', '--source', 'src', '--target', 'dist/docs']);

		doxx.on( 'close', function( code ) {
			console.log( "doxx completed with exit code: "	+ code );
			done();
		});
	});

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

	// Default task.
	grunt.registerTask('build', 'requirejs concat uglify'.split(' ') );
	grunt.registerTask('test', 'jshint qunit'.split(' ') );
	grunt.registerTask('default', 'build test'.split(' ') );
};
<|endoftext|>