<commit_before>module.exports = function (grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
  banner: '/*!\n * <%= pkg.name %> <%= pkg.version %> | http://fotorama.io/license/\n */\n',
  bannerJs: '<%= meta.banner %>fotoramaVersion = \'<%= pkg.version %>\';\n',
  sass: ['src/scss/*'],
  js: [
    'src/js/intro.js',
    'src/js/css-classes.js',
    'src/js/skip.js',
    'src/js/_.js',
    'src/js/modernizr.js',
    'src/js/fullscreen.js',
    'src/js/spin.js',
    'src/js/bez.js',
    'src/js/basevars.js',
    'src/js/utils.js',
    'src/js/animate.js',
    'src/js/touch.js',
    'src/js/moveontouch.js',
    'src/js/wheel.js',
    'src/js/fotorama.js',
    'src/js/fn-fotorama.js',
    'src/js/instances.js',
    'src/js/cache.js',
    'src/js/measures.js',
    'src/templates/compiled.js',
    'src/js/auto-initialization.js',
    'src/js/outro.js'
  ]
},
jst: {
  compile: {
    options: {
      namespace: '$.Fotorama.jst',
      processName: function (filename) {
        return filename.replace('src/templates/', '').replace(/\.jst$/, '').replace(/\//g, '_');
      },
      templateSettings: {
        variable: 'v'
      }
    },
    files: {
      'src/templates/compiled.js': ['src/templates/*.jst']
    }
  }
},
watch: {
  options: {
    atBegin: true
  },
  jst: {
    files: 'src/templates/*.jst',
    tasks: ['jst', 'replace:jst']
  },
  sass: {
    files: '<%= meta.sass %>',
    tasks: ['sass', 'autoprefixer']
  },
  js: {
    files: '<%= meta.js %>',
    tasks: 'concat:js'
  },
  i: {
    files: 'src/i/*',
    tasks: 'copy:i'
  },
  test: {
    files: ['test/**/*', '!test/index.html', '!test/*/index.html', '!test/*/*/index.html', '!test/*/*/*/index.html'],
    tasks: 'shell:indexes'
  }
},
sass: {
  mixdown: {
    options: {
    },
    files: {
      'out/fotorama.css': 'src/scss/fotorama.scss'
    }
  }
},
autoprefixer: {
  mixdown: {
    options: {
      browsers: ['last 2 version', 'ie 8', 'ie 7']
    },
    files: {
      'out/fotorama.css': 'out/fotorama.css'
    }
  }
},
copy: {
  i: {
    files: [
      {
        expand: true,
        flatten: true,
        src: ['src/i/*.png'],
        dest: 'out/'
      }
    ]
  },
  example: {
    files: [
      {
        src: 'src/example/example.html',
        dest: 'out/example.html'
      }
    ]
  },
  bower: {
    files: [
      {
        src: 'out/fotorama.css',
        dest: '.fotorama-bower/fotorama.css'
      },
        {
        src: 'out/fotorama.png',
        dest: '.fotorama-bower/fotorama.png'
      },
      {
        src: 'out/fotorama@2x.png',
        dest: '.fotorama-bower/fotorama@2x.png'
      },
      {
        src: 'out/fotorama.js',
        dest: '.fotorama-bower/fotorama.js'
      },
      {
        src: 'out/example.html',
        dest: '.fotorama-bower/example.html'
      }
    ]
  },
  npm: {
    files: [
      {
        src: 'out/fotorama.css',
        dest: '.fotorama-npm/dist/fotorama.css'
      },
        {
        src: 'out/fotorama.png',
        dest: '.fotorama-npm/dist/fotorama.png'
      },
      {
        src: 'out/fotorama@2x.png',
        dest: '.fotorama-npm/dist/fotorama@2x.png'
      },
      {
        src: 'out/fotorama.js',
        dest: '.fotorama-npm/dist/fotorama.js'
      }
    ]
  },
  cdnjs: {
    path: '/Users/artpolikarpov/Projects/Clone/cdnjs/ajax/libs/fotorama',
    files: [
      {
        src: 'out/fotorama.css',
        dest: '<%= copy.cdnjs.path %>/<%= pkg.version %>/fotorama.css'
      },
        {
        src: 'out/fotorama.png',
        dest: '<%= copy.cdnjs.path %>/<%= pkg.version %>/fotorama.png'
      },
      {
        src: 'out/fotorama@2x.png',
        dest: '<%= copy.cdnjs.path %>/<%= pkg.version %>/fotorama@2x.png'
      },
      {
        src: 'out/fotorama.js',
        dest: '<%= copy.cdnjs.path %>/<%= pkg.version %>/fotorama.js'
      },
      {
        src: 'fotorama.jquery.json',
        dest: '<%= copy.cdnjs.path %>/package.json'
      }
    ]
  }
},
concat: {
  js: {
    files: {
      'out/fotorama.js': '<%= meta.js %>'
    },
    options: {
      banner: '<%= meta.bannerJs %>'
    }
  },
  css: {
    files: {
      'out/fotorama.dev.css': 'out/fotorama.css'
    },
    options: {
      banner: '<%= meta.banner %>'
    }
  }
},
cssmin: {
  min: {
    files: {
      'out/fotorama.css': 'out/fotorama.css'
    },
    options: {
      banner: '<%= meta.banner.replace(/\\n$/, "") %>',
      report: 'gzip',
      compatibility: 'ie7'
    }
  }
},
replace: {
  jst: {
    files: {
      'src/templates/compiled.js': 'src/templates/compiled.js'
    },
    options: {
      patterns: [
        {
          match: /this\[\"(\$)\"\]/g,
          replacement: "$"
        },
        {
          match: /\[\"([a-z]+)\"\]/gi,
          replacement: ".$1"
        }
      ]
    }
  },
  console: {
    files: {
      'out/fotorama.dev.js': 'out/fotorama.js'
    },
    options: {
      patterns: [
        {
          match: /(console\.)/g,
          replacement: "//$1"
        }
      ]
    }
  },
  version: {
    files: {
      'fotorama.jquery.json': 'fotorama.jquery.json',
      '.fotorama-bower/bower.json': '.fotorama-bower/bower.json',
      '.fotorama-npm/package.json': '.fotorama-npm/package.json'
    },
    options: {
      patterns: [
        {
          match: /(\.?\d+){3,4}/g,
          replacement: '<%= pkg.version %>'
        }
      ]
    }
  },
  history: {
    files: {
      'history.json': 'HISTORY.md'
    },
    options: {
      patterns: [
        {
          match: /[^\r]+/g,
          replacement: function (file) {
            // /<!--(.+)-->([^\r]+)<!--\/\1-->/g
            var json = {};

            file.replace(/<!--(.+)-->([^\r]+?)<!--\/\1-->/g, function (fragment, key, notes) {
              json[key] = notes
                  .replace(/^\n+/, '')
                  .replace(/\n+$/, '');
            });

            console.log('json', json);

            return JSON.stringify(json, null, '  ');
          }
        }
      ]
    }
  }
},
uglify: {
  min: {
    options: {
      banner: '<%= meta.banner %>',
      report: 'gzip'
    },
    files: {
      'out/fotorama.js': 'out/fotorama.dev.js'
    }
  }
},
clean: {
  zip: ['out/fotorama*.zip']
},
compress: {
  dev: {
    options: {
      archive: 'out/fotorama-<%= pkg.version %>.dev.zip'
    },
    files: [
      {expand: true, cwd: 'out/', src: 'fotorama.dev.css', dest: 'fotorama-<%= pkg.version %>.dev/'},
      {expand: true, cwd: 'out/', src: 'fotorama.dev.js', dest: 'fotorama-<%= pkg.version %>.dev/'},
      {expand: true, cwd: 'out/', src: 'fotorama.png', dest: 'fotorama-<%= pkg.version %>.dev/'},
      {expand: true, cwd: 'out/', src: 'fotorama@2x.png', dest: 'fotorama-<%= pkg.version %>.dev/'}
    ]
  },
  min: {
    options: {
      archive: 'out/fotorama-<%= pkg.version %>.zip'
    },
    files: [
      {expand: true, cwd: 'out/', src: 'fotorama.css', dest: 'fotorama-<%= pkg.version %>/'},
      {expand: true, cwd: 'out/', src: 'fotorama.js', dest: 'fotorama-<%= pkg.version %>/'},
      {expand: true, cwd: 'out/', src: 'fotorama.png', dest: 'fotorama-<%= pkg.version %>/'},
      {expand: true, cwd: 'out/', src: 'fotorama@2x.png', dest: 'fotorama-<%= pkg.version %>/'},
      {expand: true, cwd: 'out/', src: 'example.html', dest: 'fotorama-<%= pkg.version %>/'}
    ]
  }
},
s3: {
  options: {
    key: '<%= grunt.file.readJSON("secret.json").s3.key %>',
    secret: '<%= grunt.file.readJSON("secret.json").s3.secret %>',
    bucket: 'fotorama',
    access: 'public-read',
    gzip: true,
    secure: false
  },
  separate: {
    options: {
      headers: {'Cache-Control': 'max-age=2592000'}
    },
    upload: [
        // Separate version to separate folder
      {
        src: 'out/fotorama.*',
        dest: '<%= pkg.version %>/'
      },
      {
        src: 'out/fotorama@2x.png',
        dest: '<%= pkg.version %>/fotorama@2x.png'
      },
      {
        src: 'out/*.zip',
        dest: '<%= pkg.version %>/',
        options: {
          gzip: false
        }
      }

    ]
  },
  edge: {
    // Latest to the root
    options: {
      headers: {'Cache-Control': 'max-age=1'}
    },
    upload: [
      {
        src: 'out/fotorama.*',
        dest: ''
      },
      {
        src: 'out/fotorama@2x.png',
        dest: 'fotorama@2x.png'
      }
    ]
  }
},

connect: {
  server: {
    options: {
      hostname: '*',
      port: 9001,
      keepalive: true
    }
  }
},

shell: {
  options: {
    stdout: true,
    stderr: true,
    failOnError: true
  },
  indexes: {
    command: './test/index.sh'
  },
  cdnjs: {
    command: 'cd ~/Projects/Clone/cdnjs/ ' +
        '&& git add . ' +
        '&& git commit -am \'Update Fotorama to <%= pkg.version %>\' ' +
        '&& git pull cdnjs master ' +
        '&& git push --progress origin master:master'
  },
  commit: {
    command: 'git commit fotorama.jquery.json -m \'Tagging the <%= pkg.version %> release\''
  },
  push: {
    command: 'git push --tags --progress origin master:master'
  },
  bower: {
    command: 'cd .fotorama-bower ' +
        '&& git add . ' +
        '&& git commit -am \'Tagging the <%= pkg.version %> release\' ' +
        '&& git tag <%= pkg.version %> ' +
        '&& git push --tags --progress origin master:master'
  },
  npm: {
    command: 'cd .fotorama-npm ' +
        '&& npm publish'
  },
  heroku: {
    command: 'heroku config:add FOTORAMA_VERSION=<%= pkg.version %> FOTORAMA_NEXT=<%= pkg.version %>'
  }
},

jasmine: grunt.file.readJSON('test/specs/_specs.json'),

tweet: {
  options: {
    consumer_key: '<%= grunt.file.readJSON("secret.json").tweet.consumer_key %>',
    consumer_secret: '<%= grunt.file.readJSON("secret.json").tweet.consumer_secret %>',
    access_token: '<%= grunt.file.readJSON("secret.json").tweet.access_token %>',
    access_token_secret: '<%= grunt.file.readJSON("secret.json").tweet.access_token_secret %>'
  },
  release: {
    options: {
      crop: true
    },
    text: 'Fotorama <%= pkg.version %>',
    url: 'https://github.com/artpolikarpov/fotorama/releases/tag/<%= pkg.version %>'
  }
},

gh_release: {
  options: {
    token: '<%= grunt.file.readJSON("secret.json").github.token %>',
    owner: 'artpolikarpov',
    repo: 'fotorama'
  },
  release: {
    tag_name: '<%= pkg.version %>', // required
    name: '<%= grunt.file.readJSON("history.json")[pkg.version + ":name"] %>',
    body: '<%= grunt.file.readJSON("history.json")[pkg.version + ":notes"] %>',
    asset: [
      {
        name: 'fotorama-<%= pkg.version %>.zip',
        file: 'out/fotorama-<%= pkg.version %>.zip',
        'Content-Type': 'application/zip'
      },
      {
        name: 'fotorama-<%= pkg.version %>.dev.zip',
        file: 'out/fotorama-<%= pkg.version %>.dev.zip',
        'Content-Type': 'application/zip'
      }
    ]
  }
}
});

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jst');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');

grunt.loadNpmTasks('grunt-s3');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-shell');

grunt.loadNpmTasks('grunt-tweet');
grunt.loadNpmTasks('grunt-gh-release');

var defaultTask = 'copy:i sass autoprefixer jst replace:jst concat:js replace:console concat:css uglify cssmin jasmine clean copy:example compress';
//var build = 'copy:i sass autoprefixer jst replace:jst concat:js replace:console concat:css uglify cssmin clean copy:example compress'.split(' ');

// Compile
grunt.registerTask('default', defaultTask.split(' '));
//grunt.registerTask('build', build);
//grunt.registerTask('look', 'copy:i sass autoprefixer jst replace:jst concat:js watch'.split(' '));

// Publish, will fail without secret details ;-)
grunt.registerTask('cdnjs', (defaultTask + ' s3 replace:version copy:cdnjs shell:cdnjs').split(' '));

// Publish, will fail without secret details ;-)
grunt.registerTask('publish', (defaultTask + ' s3 replace:version copy:bower shell:commit shell:push shell:bower shell:npm shell:heroku').split(' '));
grunt.registerTask('release', ('replace:history gh_release tweet').split(' '));
};<commit_msg>Update Gruntfile.js<commit_after>module.exports = function (grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
  banner: '/*!\n * <%= pkg.name %> <%= pkg.version %> | http://fotorama.io/license/\n */\n',
  bannerJs: '<%= meta.banner %>fotoramaVersion = \'<%= pkg.version %>\';\n',
  sass: ['src/scss/*'],
  js: [
    'src/js/intro.js',
    'src/js/css-classes.js',
    'src/js/skip.js',
    'src/js/_.js',
    'src/js/modernizr.js',
    'src/js/fullscreen.js',
    'src/js/spin.js',
    'src/js/bez.js',
    'src/js/basevars.js',
    'src/js/utils.js',
    'src/js/animate.js',
    'src/js/touch.js',
    'src/js/moveontouch.js',
    'src/js/wheel.js',
    'src/js/fotorama.js',
    'src/js/fn-fotorama.js',
    'src/js/instances.js',
    'src/js/cache.js',
    'src/js/measures.js',
    'src/templates/compiled.js',
    'src/js/auto-initialization.js',
    'src/js/outro.js'
  ]
},
jst: {
  compile: {
    options: {
      namespace: '$.Fotorama.jst',
      processName: function (filename) {
        return filename.replace('src/templates/', '').replace(/\.jst$/, '').replace(/\//g, '_');
      },
      templateSettings: {
        variable: 'v'
      }
    },
    files: {
      'src/templates/compiled.js': ['src/templates/*.jst']
    }
  }
},
watch: {
  options: {
    atBegin: true
  },
  jst: {
    files: 'src/templates/*.jst',
    tasks: ['jst', 'replace:jst']
  },
  sass: {
    files: '<%= meta.sass %>',
    tasks: ['sass', 'autoprefixer']
  },
  js: {
    files: '<%= meta.js %>',
    tasks: 'concat:js'
  },
  i: {
    files: 'src/i/*',
    tasks: 'copy:i'
  },
  test: {
    files: ['test/**/*', '!test/index.html', '!test/*/index.html', '!test/*/*/index.html', '!test/*/*/*/index.html'],
    tasks: 'shell:indexes'
  }
},
sass: {
  mixdown: {
    options: {
    },
    files: {
      'out/fotorama.css': 'src/scss/fotorama.scss'
    }
  }
},
autoprefixer: {
  mixdown: {
    options: {
      browsers: ['last 2 version', 'ie 8', 'ie 7']
    },
    files: {
      'out/fotorama.css': 'out/fotorama.css'
    }
  }
},
copy: {
  i: {
    files: [
      {
        expand: true,
        flatten: true,
        src: ['src/i/*.png'],
        dest: 'out/'
      }
    ]
  },
  example: {
    files: [
      {
        src: 'src/example/example.html',
        dest: 'out/example.html'
      }
    ]
  },
  bower: {
    files: [
      {
        src: 'out/fotorama.css',
        dest: '.fotorama-bower/fotorama.css'
      },
        {
        src: 'out/fotorama.png',
        dest: '.fotorama-bower/fotorama.png'
      },
      {
        src: 'out/fotorama@2x.png',
        dest: '.fotorama-bower/fotorama@2x.png'
      },
      {
        src: 'out/fotorama.js',
        dest: '.fotorama-bower/fotorama.js'
      },
      {
        src: 'out/example.html',
        dest: '.fotorama-bower/example.html'
      }
    ]
  },
  npm: {
    files: [
      {
        src: 'out/fotorama.css',
        dest: '.fotorama-npm/dist/fotorama.css'
      },
        {
        src: 'out/fotorama.png',
        dest: '.fotorama-npm/dist/fotorama.png'
      },
      {
        src: 'out/fotorama@2x.png',
        dest: '.fotorama-npm/dist/fotorama@2x.png'
      },
      {
        src: 'out/fotorama.js',
        dest: '.fotorama-npm/dist/fotorama.js'
      }
    ]
  },
  cdnjs: {
    path: '/Users/artpolikarpov/Projects/Clone/cdnjs/ajax/libs/fotorama',
    files: [
      {
        src: 'out/fotorama.css',
        dest: '<%= copy.cdnjs.path %>/<%= pkg.version %>/fotorama.css'
      },
        {
        src: 'out/fotorama.png',
        dest: '<%= copy.cdnjs.path %>/<%= pkg.version %>/fotorama.png'
      },
      {
        src: 'out/fotorama@2x.png',
        dest: '<%= copy.cdnjs.path %>/<%= pkg.version %>/fotorama@2x.png'
      },
      {
        src: 'out/fotorama.js',
        dest: '<%= copy.cdnjs.path %>/<%= pkg.version %>/fotorama.js'
      },
      {
        src: 'fotorama.jquery.json',
        dest: '<%= copy.cdnjs.path %>/package.json'
      }
    ]
  }
},
concat: {
  js: {
    files: {
      'out/fotorama.js': '<%= meta.js %>'
    },
    options: {
      banner: '<%= meta.bannerJs %>'
    }
  },
  css: {
    files: {
      'out/fotorama.dev.css': 'out/fotorama.css'
    },
    options: {
      banner: '<%= meta.banner %>'
    }
  }
},
cssmin: {
  min: {
    files: {
      'out/fotorama.css': 'out/fotorama.css'
    },
    options: {
      banner: '<%= meta.banner.replace(/\\n$/, "") %>',
      report: 'gzip',
      compatibility: 'ie7'
    }
  }
},
replace: {
  jst: {
    files: {
      'src/templates/compiled.js': 'src/templates/compiled.js'
    },
    options: {
      patterns: [
        {
          match: /this\[\"(\$)\"\]/g,
          replacement: "$"
        },
        {
          match: /\[\"([a-z]+)\"\]/gi,
          replacement: ".$1"
        }
      ]
    }
  },
  console: {
    files: {
      'out/fotorama.dev.js': 'out/fotorama.js'
    },
    options: {
      patterns: [
        {
          match: /(console\.)/g,
          replacement: "//$1"
        }
      ]
    }
  },
  version: {
    files: {
      'fotorama.jquery.json': 'fotorama.jquery.json',
      '.fotorama-bower/bower.json': '.fotorama-bower/bower.json',
      '.fotorama-npm/package.json': '.fotorama-npm/package.json'
    },
    options: {
      patterns: [
        {
          match: /(\.?\d+){3,4}/g,
          replacement: '<%= pkg.version %>'
        }
      ]
    }
  },
  history: {
    files: {
      'history.json': 'HISTORY.md'
    },
    options: {
      patterns: [
        {
          match: /[^\r]+/g,
          replacement: function (file) {
            // /<!--(.+)-->([^\r]+)<!--\/\1-->/g
            var json = {};

            file.replace(/<!--(.+)-->([^\r]+?)<!--\/\1-->/g, function (fragment, key, notes) {
              json[key] = notes
                  .replace(/^\n+/, '')
                  .replace(/\n+$/, '');
            });

            console.log('json', json);

            return JSON.stringify(json, null, '  ');
          }
        }
      ]
    }
  }
},
uglify: {
  min: {
    options: {
      banner: '<%= meta.banner %>',
      report: 'gzip'
    },
    files: {
      'out/fotorama.js': 'out/fotorama.dev.js'
    }
  }
},
clean: {
  zip: ['out/fotorama*.zip']
},
compress: {
  dev: {
    options: {
      archive: 'out/fotorama-<%= pkg.version %>.dev.zip'
    },
    files: [
      {expand: true, cwd: 'out/', src: 'fotorama.dev.css', dest: 'fotorama-<%= pkg.version %>.dev/'},
      {expand: true, cwd: 'out/', src: 'fotorama.dev.js', dest: 'fotorama-<%= pkg.version %>.dev/'},
      {expand: true, cwd: 'out/', src: 'fotorama.png', dest: 'fotorama-<%= pkg.version %>.dev/'},
      {expand: true, cwd: 'out/', src: 'fotorama@2x.png', dest: 'fotorama-<%= pkg.version %>.dev/'}
    ]
  },
  min: {
    options: {
      archive: 'out/fotorama-<%= pkg.version %>.zip'
    },
    files: [
      {expand: true, cwd: 'out/', src: 'fotorama.css', dest: 'fotorama-<%= pkg.version %>/'},
      {expand: true, cwd: 'out/', src: 'fotorama.js', dest: 'fotorama-<%= pkg.version %>/'},
      {expand: true, cwd: 'out/', src: 'fotorama.png', dest: 'fotorama-<%= pkg.version %>/'},
      {expand: true, cwd: 'out/', src: 'fotorama@2x.png', dest: 'fotorama-<%= pkg.version %>/'},
      {expand: true, cwd: 'out/', src: 'example.html', dest: 'fotorama-<%= pkg.version %>/'}
    ]
  }
},
s3: {
  options: {
    key: '<%= grunt.file.readJSON("secret.json").s3.key %>',
    secret: '<%= grunt.file.readJSON("secret.json").s3.secret %>',
    bucket: 'fotorama',
    access: 'public-read',
    gzip: true,
    secure: false
  },
  separate: {
    options: {
      headers: {'Cache-Control': 'max-age=2592000'}
    },
    upload: [
        // Separate version to separate folder
      {
        src: 'out/fotorama.*',
        dest: '<%= pkg.version %>/'
      },
      {
        src: 'out/fotorama@2x.png',
        dest: '<%= pkg.version %>/fotorama@2x.png'
      },
      {
        src: 'out/*.zip',
        dest: '<%= pkg.version %>/',
        options: {
          gzip: false
        }
      }

    ]
  },
  edge: {
    // Latest to the root
    options: {
      headers: {'Cache-Control': 'max-age=1'}
    },
    upload: [
      {
        src: 'out/fotorama.*',
        dest: ''
      },
      {
        src: 'out/fotorama@2x.png',
        dest: 'fotorama@2x.png'
      }
    ]
  }
},

connect: {
  server: {
    options: {
      hostname: '*',
      port: 9001,
      keepalive: true
    }
  }
},

shell: {
  options: {
    stdout: true,
    stderr: true,
    failOnError: true
  },
  indexes: {
    command: './test/index.sh'
  },
  cdnjs: {
    command: 'cd ~/Projects/Clone/cdnjs/ ' +
        '&& git add . ' +
        '&& git commit -am \'Update Fotorama to <%= pkg.version %>\' ' +
        '&& git pull cdnjs master ' +
        '&& git push --progress origin master:master'
  },
  commit: {
    command: 'git commit fotorama.jquery.json -m \'Tagging the <%= pkg.version %> release\''
  },
  push: {
    command: 'git push --tags --progress origin master:master'
  },
  bower: {
    command: 'cd .fotorama-bower ' +
        '&& git add . ' +
        '&& git commit -am \'Tagging the <%= pkg.version %> release\' ' +
        '&& git tag <%= pkg.version %> ' +
        '&& git push --tags --progress origin master:master'
  },
  npm: {
    command: 'cd .fotorama-npm ' +
        '&& npm publish'
  },
  heroku: {
    command: 'heroku config:add FOTORAMA_VERSION=<%= pkg.version %> FOTORAMA_NEXT=<%= pkg.version %>'
  }
},

jasmine: grunt.file.readJSON('test/specs/_specs.json'),

tweet: {
  options: {
    consumer_key: '<%= grunt.file.readJSON("secret.json").tweet.consumer_key %>',
    consumer_secret: '<%= grunt.file.readJSON("secret.json").tweet.consumer_secret %>',
    access_token: '<%= grunt.file.readJSON("secret.json").tweet.access_token %>',
    access_token_secret: '<%= grunt.file.readJSON("secret.json").tweet.access_token_secret %>'
  },
  release: {
    options: {
      crop: true
    },
    text: 'Fotorama <%= pkg.version %>, “<%= grunt.file.readJSON("history.json")[pkg.version + ":name"] %>”',
    url: 'https://github.com/artpolikarpov/fotorama/releases/tag/<%= pkg.version %>'
  }
},

gh_release: {
  options: {
    token: '<%= grunt.file.readJSON("secret.json").github.token %>',
    owner: 'artpolikarpov',
    repo: 'fotorama'
  },
  release: {
    tag_name: '<%= pkg.version %>', // required
    name: '<%= grunt.file.readJSON("history.json")[pkg.version + ":name"] %>',
    body: '<%= grunt.file.readJSON("history.json")[pkg.version + ":notes"] %>',
    asset: [
      {
        name: 'fotorama-<%= pkg.version %>.zip',
        file: 'out/fotorama-<%= pkg.version %>.zip',
        'Content-Type': 'application/zip'
      },
      {
        name: 'fotorama-<%= pkg.version %>.dev.zip',
        file: 'out/fotorama-<%= pkg.version %>.dev.zip',
        'Content-Type': 'application/zip'
      }
    ]
  }
}
});

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jst');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');

grunt.loadNpmTasks('grunt-s3');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-shell');

grunt.loadNpmTasks('grunt-tweet');
grunt.loadNpmTasks('grunt-gh-release');

var defaultTask = 'copy:i sass autoprefixer jst replace:jst concat:js replace:console concat:css uglify cssmin jasmine clean copy:example compress';
//var build = 'copy:i sass autoprefixer jst replace:jst concat:js replace:console concat:css uglify cssmin clean copy:example compress'.split(' ');

// Compile
grunt.registerTask('default', defaultTask.split(' '));
//grunt.registerTask('build', build);
//grunt.registerTask('look', 'copy:i sass autoprefixer jst replace:jst concat:js watch'.split(' '));

// Publish, will fail without secret details ;-)
grunt.registerTask('cdnjs', (defaultTask + ' s3 replace:version copy:cdnjs shell:cdnjs').split(' '));

// Publish, will fail without secret details ;-)
grunt.registerTask('publish', (defaultTask + ' s3 replace:version copy:bower shell:commit shell:push shell:bower shell:npm shell:heroku').split(' '));
grunt.registerTask('release', ('replace:history gh_release tweet').split(' '));
};<|endoftext|>


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

	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON( 'package.json' ),
		meta: {
			banner: '/*! Ractive - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
				'* <%= pkg.description %>\n\n' +
				'* <%= pkg.homepage %>\n' +
				'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
				' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n' +
				'\n' +
				'/*jslint eqeq: true, plusplus: true */\n' +
				'/*global document, HTMLElement */\n' +
				'\n\n',
			wrapper: {
				start: '(function ( global ) {\n\n' +
						'\'use strict\';\n\n',
				end: '\n\n// export\n' +
						'if ( typeof module !== "undefined" && module.exports ) module.exports = Ractive // Common JS\n' +
						'else if ( typeof define === "function" && define.amd ) define( function () { return Ractive } ) // AMD\n' +
						'else { global.Ractive = Ractive }\n\n' +
						'}( this ));'
			}
		},
		lint: {
			files: ['grunt.js', 'src/**/*.js'] // TODO add tests
		},
		qunit: {
			files: [ 'test/core.html', 'test/compile.html', 'test/render.html' ]
		},
		clean: {
			files: [ 'build/**/*' ]
		},
		concat: {
			runtime: {
				options: {
					banner: '<%= meta.banner %><%= meta.wrapper.start %>',
					footer: '<%= meta.wrapper.end %>'
				},
				src: [ 'src/Ractive.js', 'src/_internal.js', 'src/types.js', 'src/fragment_utils.js', 'src/events.js', 'src/formatters.js', 'src/dom_fragment.js', 'src/text_fragment.js', 'src/extend.js', 'src/modify_array.js', 'src/easing.js', 'src/animate.js', 'src/interpolators.js', 'src/namespaces.js' ],
				dest: 'build/Ractive.runtime.js'
			},
			full: {
				options: {
					banner: '<%= meta.banner %><%= meta.wrapper.start %>',
					footer: '<%= meta.wrapper.end %>'
				},
				src: [ 'src/Ractive.js', 'src/_internal.js', 'src/types.js', 'src/fragment_utils.js', 'src/events.js', 'src/compile.js', 'src/tokenize.js', 'src/formatters.js', 'src/dom_fragment.js', 'src/text_fragment.js', 'src/extend.js', 'src/modify_array.js', 'src/easing.js', 'src/animate.js', 'src/interpolators.js', 'src/namespaces.js' ],
				dest: 'build/Ractive.js'
			},
			runtime_legacy: {
				src: [ 'src/legacy.js', '<%= concat.runtime.dest %>' ],
				dest: 'build/Ractive-legacy.runtime.js'
			},
			full_legacy: {
				src: [ 'src/legacy.js', '<%= concat.full.dest %>' ],
				dest: 'build/Ractive-legacy.js'
			}
		},
		watch: {
			files: ['<config:lint.files>', 'package.json'],
			tasks: ['concat','min']
		},
		jshint: {
			options: {
				jshintrc: '.jshintrc'
			}
		},
		uglify: {
			runtime: {
				src: ['<%= concat.runtime.dest %>'],
				dest: 'build/Ractive.runtime.min.js'
			},
			full: {
				src: ['<%= concat.full.dest %>'],
				dest: 'build/Ractive.min.js'
			},
			runtime_legacy: {
				src: ['<%= concat.runtime_legacy.dest %>'],
				dest: 'build/Ractive-legacy.runtime.min.js'
			},
			full_legacy: {
				src: ['<%= concat.full_legacy.dest %>'],
				dest: 'build/Ractive-legacy.min.js'
			}
		},
		copy: {
			release: {
				files: [{
					expand: true,
					cwd: 'build/',
					src: [ '**/*' ],
					dest: 'release/<%= pkg.version %>/'
				}]
			},
			link: {
				files: {
					'Ractive.js': 'build/Ractive.js'
				}
			}
		}
	});

	grunt.loadNpmTasks( 'grunt-contrib-jshint' );
	grunt.loadNpmTasks( 'grunt-contrib-clean' );
	grunt.loadNpmTasks( 'grunt-contrib-qunit' );
	grunt.loadNpmTasks( 'grunt-contrib-concat' );
	grunt.loadNpmTasks( 'grunt-contrib-uglify' );
	grunt.loadNpmTasks( 'grunt-contrib-copy' );

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

	grunt.registerTask( 'release', [ 'default', 'copy' ] );

};
<commit_msg>added define_event.js to build process<commit_after>/*global module:false*/
module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON( 'package.json' ),
		meta: {
			banner: '/*! Ractive - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
				'* <%= pkg.description %>\n\n' +
				'* <%= pkg.homepage %>\n' +
				'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
				' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n' +
				'\n' +
				'/*jslint eqeq: true, plusplus: true */\n' +
				'/*global document, HTMLElement */\n' +
				'\n\n',
			wrapper: {
				start: '(function ( global ) {\n\n' +
						'\'use strict\';\n\n',
				end: '\n\n// export\n' +
						'if ( typeof module !== "undefined" && module.exports ) module.exports = Ractive // Common JS\n' +
						'else if ( typeof define === "function" && define.amd ) define( function () { return Ractive } ) // AMD\n' +
						'else { global.Ractive = Ractive }\n\n' +
						'}( this ));'
			}
		},
		lint: {
			files: ['grunt.js', 'src/**/*.js'] // TODO add tests
		},
		qunit: {
			files: [ 'test/core.html', 'test/compile.html', 'test/render.html' ]
		},
		clean: {
			files: [ 'build/**/*' ]
		},
		concat: {
			runtime: {
				options: {
					banner: '<%= meta.banner %><%= meta.wrapper.start %>',
					footer: '<%= meta.wrapper.end %>'
				},
				src: [ 'src/Ractive.js', 'src/_internal.js', 'src/types.js', 'src/fragment_utils.js', 'src/events.js', 'src/define_event.js', 'src/formatters.js', 'src/dom_fragment.js', 'src/text_fragment.js', 'src/extend.js', 'src/modify_array.js', 'src/easing.js', 'src/animate.js', 'src/interpolators.js', 'src/namespaces.js' ],
				dest: 'build/Ractive.runtime.js'
			},
			full: {
				options: {
					banner: '<%= meta.banner %><%= meta.wrapper.start %>',
					footer: '<%= meta.wrapper.end %>'
				},
				src: [ 'src/Ractive.js', 'src/_internal.js', 'src/types.js', 'src/fragment_utils.js', 'src/events.js', 'src/define_event.js', 'src/compile.js', 'src/tokenize.js', 'src/formatters.js', 'src/dom_fragment.js', 'src/text_fragment.js', 'src/extend.js', 'src/modify_array.js', 'src/easing.js', 'src/animate.js', 'src/interpolators.js', 'src/namespaces.js' ],
				dest: 'build/Ractive.js'
			},
			runtime_legacy: {
				src: [ 'src/legacy.js', '<%= concat.runtime.dest %>' ],
				dest: 'build/Ractive-legacy.runtime.js'
			},
			full_legacy: {
				src: [ 'src/legacy.js', '<%= concat.full.dest %>' ],
				dest: 'build/Ractive-legacy.js'
			}
		},
		watch: {
			files: ['<config:lint.files>', 'package.json'],
			tasks: ['concat','min']
		},
		jshint: {
			options: {
				jshintrc: '.jshintrc'
			}
		},
		uglify: {
			runtime: {
				src: ['<%= concat.runtime.dest %>'],
				dest: 'build/Ractive.runtime.min.js'
			},
			full: {
				src: ['<%= concat.full.dest %>'],
				dest: 'build/Ractive.min.js'
			},
			runtime_legacy: {
				src: ['<%= concat.runtime_legacy.dest %>'],
				dest: 'build/Ractive-legacy.runtime.min.js'
			},
			full_legacy: {
				src: ['<%= concat.full_legacy.dest %>'],
				dest: 'build/Ractive-legacy.min.js'
			}
		},
		copy: {
			release: {
				files: [{
					expand: true,
					cwd: 'build/',
					src: [ '**/*' ],
					dest: 'release/<%= pkg.version %>/'
				}]
			},
			link: {
				files: {
					'Ractive.js': 'build/Ractive.js'
				}
			}
		}
	});

	grunt.loadNpmTasks( 'grunt-contrib-jshint' );
	grunt.loadNpmTasks( 'grunt-contrib-clean' );
	grunt.loadNpmTasks( 'grunt-contrib-qunit' );
	grunt.loadNpmTasks( 'grunt-contrib-concat' );
	grunt.loadNpmTasks( 'grunt-contrib-uglify' );
	grunt.loadNpmTasks( 'grunt-contrib-copy' );

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

	grunt.registerTask( 'release', [ 'default', 'copy' ] );

};
<|endoftext|>


<commit_before>var grunt = require('grunt');
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.initConfig({
  '6to5': {
    options: {
      sourceMap: true,
      modules: 'ignore'
    },
    dist: {
      files:  [{
        expand: true,
        cwd: 'src',
        src: ['**/*.js', '!intro.js', '!outro.js'],
        dest: '.tmp/es5',
        ext: '.js'
      }]
    }
  },
  concat: {
    options: {
      separator: ''
    },
    dist: {
      src: [
        'src/intro.js',
        '.tmp/es5/**/*.js',
        'node_modules/gl-matrix/src/gl-matrix/common.js',
        'node_modules/gl-matrix/src/gl-matrix/mat3.js',
        'node_modules/gl-matrix/src/gl-matrix/mat4.js',
        'node_modules/gl-matrix/src/gl-matrix/vec4.js',
        'node_modules/gl-matrix/src/gl-matrix/vec3.js',
        'src/outro.js'
      ],
      dest: 'dist/lithree.js'
    }
  },
  uglify: {
    my_target: {
      files: {
        'dist/lithree.min.js': ['dist/lithree.js']
      }
    }
  },
  watch: {
    scripts: {
      files: ['src/**/*.js'],
      tasks: ['default'],
      options: {
        spawn: false
      }
    }
  }
});

grunt.registerTask('default', ['6to5', 'concat']);
grunt.registerTask('compress', ['uglify']);

grunt.registerTask('build', ['default', 'compress']);<commit_msg>Remove `compress` alias<commit_after>var grunt = require('grunt');
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.initConfig({
  '6to5': {
    options: {
      sourceMap: true,
      modules: 'ignore'
    },
    dist: {
      files:  [{
        expand: true,
        cwd: 'src',
        src: ['**/*.js', '!intro.js', '!outro.js'],
        dest: '.tmp/es5',
        ext: '.js'
      }]
    }
  },
  concat: {
    options: {
      separator: ''
    },
    dist: {
      src: [
        'src/intro.js',
        '.tmp/es5/**/*.js',
        'node_modules/gl-matrix/src/gl-matrix/common.js',
        'node_modules/gl-matrix/src/gl-matrix/mat3.js',
        'node_modules/gl-matrix/src/gl-matrix/mat4.js',
        'node_modules/gl-matrix/src/gl-matrix/vec4.js',
        'src/outro.js'
      ],
      dest: 'dist/lithree.js'
    }
  },
  uglify: {
    my_target: {
      files: {
        'dist/lithree.min.js': ['dist/lithree.js']
      }
    }
  },
  watch: {
    scripts: {
      files: ['src/**/*.js'],
      tasks: ['default'],
      options: {
        spawn: false
      }
    }
  }
});

grunt.registerTask('default', ['6to5', 'concat']);

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


<commit_before>/*
 * grunt
 * http://gruntjs.com/
 *
 * Copyright (c) 2012 "Cowboy" Ben Alman
 * Licensed under the MIT license.
 * http://benalman.com/about/license/
 */

'use strict';

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    nodeunit: {
      all: ['test/{grunt,tasks,util}/**/*.js']
    },
    jshint: {
      all: [
        'Gruntfile.js',
        'lib/**/*.js',
        'tasks/*.js',
        'tasks/*/*.js',
        'test/**/*.js',
        '!test/fixtures/**/*.js'
      ],
      options: {
        options: {
          curly: true,
          eqeqeq: true,
          immed: true,
          latedef: true,
          newcap: true,
          noarg: true,
          sub: true,
          undef: true,
          boss: true,
          eqnull: true,
          node: true,
          es5: true
        }
      }
    },
    watch: {
      scripts: {
        files: ['<%= jshint.all %>'],
        tasks: ['jshint', 'nodeunit']
      }
    }
  });

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

  // Unregister unused tasks.
  grunt.unregisterTasks('concat', 'uglify', 'init', 'server', 'qunit');
};
<commit_msg>Minor gruntfile tweak.<commit_after>/*
 * grunt
 * http://gruntjs.com/
 *
 * Copyright (c) 2012 "Cowboy" Ben Alman
 * Licensed under the MIT license.
 * http://benalman.com/about/license/
 */

'use strict';

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    nodeunit: {
      all: ['test/{grunt,tasks,util}/**/*.js']
    },
    jshint: {
      all: [
        'Gruntfile.js',
        'lib/**/*.js',
        'tasks/*.js',
        'tasks/*/*.js',
        'tasks/lib/**/*.js',
        '<%= nodeunit.all %>'
      ],
      options: {
        options: {
          curly: true,
          eqeqeq: true,
          immed: true,
          latedef: true,
          newcap: true,
          noarg: true,
          sub: true,
          undef: true,
          boss: true,
          eqnull: true,
          node: true,
          es5: true
        }
      }
    },
    watch: {
      scripts: {
        files: ['<%= jshint.all %>'],
        tasks: ['jshint', 'nodeunit']
      }
    }
  });

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

  // Unregister unused tasks.
  grunt.unregisterTasks('concat', 'uglify', 'init', 'server', 'qunit');
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('bower.json'),
    jshint: {
      grunt: {
        src: ['Gruntfile.js']
      },
      main: {
        src: ['tock.js']
      },
    },
    uglify: {
      options: {
        banner: '// Tock.js (version <%= pkg.version %>) <%= pkg.homepage %>\n// License: <%= pkg.license %>\n'
      },
      main: {
        src: '<%= jshint.main.src %>',
        dest: 'tock.min.js'
      }
    },
    watch: {
      main: {
        files: '<%= jshint.main.src %>',
        tasks: ['jshint:main', 'uglify:main']
      }
    }
  });

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

  grunt.registerTask('default', ['jshint', 'uglify']);
};
<commit_msg>Configure some jshint options.<commit_after>module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('bower.json'),
    jshint: {
      grunt: {
        src: ['Gruntfile.js']
      },
      main: {
        src: ['tock.js'],
        options: {
          'browser': true,
          'camelcase': true,
          'curly': true,
          'eqeqeq': true,
          'indent': 2,
          'newcap': true,
          'quotmark': 'single',
          'unused': true
        }
      },
    },
    uglify: {
      options: {
        banner: '// Tock.js (version <%= pkg.version %>) <%= pkg.homepage %>\n// License: <%= pkg.license %>\n'
      },
      main: {
        src: '<%= jshint.main.src %>',
        dest: 'tock.min.js'
      }
    },
    watch: {
      main: {
        files: '<%= jshint.main.src %>',
        tasks: ['jshint:main', 'uglify:main']
      }
    }
  });

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

  grunt.registerTask('default', ['jshint', 'uglify']);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
	var pkg, taskName, ect_var;
	pkg = grunt.file.readJSON('package.json');
	grunt.initConfig({
		// bannerの調整
		replace: {
			banner: {
				src: ['dist/bootstrap.min.css'],
				dest: 'dist/bootstrap.min.css',
				replacements: [{
					from: '@charset "UTF-8";/*!',
					to: '@charset "UTF-8";\n/*!',
				},
				{
					from: 'Based on Bootstrap\n */',
					to: 'Based on Bootstrap\n */\n'
				}]
			}
		},
		// cssmin
		cssmin: {
			minify: {
				expand: true,
				cwd: 'dist/',
				src: ['bootstrap.css'],
				dest: 'dist/',
				ext: '.min.css',
				options: {
					noAdvanced: true
				}
			}
		},
		// compassのコンパイル
		compass: {
			dist: {
				options: {
					sassDir: 'src/compass',
					config: 'src/config.rb'
				}
			}
		},
		clean: {
			build: {
				src: ['dist/bootstrap**.css']
			}
		},
		// ファイル更新監視
		watch: {
			// compassの自動コンパイル
			compass: {
				files: ['src/compass/**/*.scss'],
				tasks: ['compass:dist'],
			}
		},
		// テストサーバ
		connect: {
			server: {
				options: {
					port: 8000,
					hostname: '*',
					base: 'dist'
				}
			}
		}
	});

	// GruntFile.jsに記載されているパッケージを自動読み込み
	for(taskName in pkg.devDependencies) {
		if(taskName.substring(0, 6) == 'grunt-') {
			grunt.loadNpmTasks(taskName);
		}
	}

	// 通常 (compass/connect/watch)
	grunt.registerTask('default', ['compass:dist', 'connect', 'watch']);

	// ミニファイ
	grunt.registerTask('build', ['clean:build', 'compass:dist', 'cssmin:minify', 'replace:banner']);

	grunt.registerTask('eatwarnings', function() {
		grunt.warn = grunt.fail.warn = function(warning) {
			grunt.log.error(warning);
		};
	});

};
<commit_msg>gruntデフォルトコマンドをserverに変更<commit_after>'use strict';

module.exports = function(grunt) {
	var pkg, taskName, ect_var;
	pkg = grunt.file.readJSON('package.json');
	grunt.initConfig({
		// bannerの調整
		replace: {
			banner: {
				src: ['dist/bootstrap.min.css'],
				dest: 'dist/bootstrap.min.css',
				replacements: [{
					from: '@charset "UTF-8";/*!',
					to: '@charset "UTF-8";\n/*!',
				},
				{
					from: 'Based on Bootstrap\n */',
					to: 'Based on Bootstrap\n */\n'
				}]
			}
		},
		// cssmin
		cssmin: {
			minify: {
				expand: true,
				cwd: 'dist/',
				src: ['bootstrap.css'],
				dest: 'dist/',
				ext: '.min.css',
				options: {
					noAdvanced: true
				}
			}
		},
		// compassのコンパイル
		compass: {
			dist: {
				options: {
					sassDir: 'src/compass',
					config: 'src/config.rb'
				}
			}
		},
		clean: {
			build: {
				src: ['dist/bootstrap**.css']
			}
		},
		// ファイル更新監視
		watch: {
			// compassの自動コンパイル
			compass: {
				files: ['src/compass/**/*.scss'],
				tasks: ['compass:dist'],
			}
		},
		// テストサーバ
		connect: {
			server: {
				options: {
					port: 8000,
					hostname: '*',
					base: 'dist'
				}
			}
		}
	});

	// GruntFile.jsに記載されているパッケージを自動読み込み
	for(taskName in pkg.devDependencies) {
		if(taskName.substring(0, 6) == 'grunt-') {
			grunt.loadNpmTasks(taskName);
		}
	}

	// 通常 (compass/connect/watch)
	grunt.registerTask('server', ['compass:dist', 'connect', 'watch']);

	// ミニファイ
	grunt.registerTask('build', ['clean:build', 'compass:dist', 'cssmin:minify', 'replace:banner']);

	grunt.registerTask('eatwarnings', function() {
		grunt.warn = grunt.fail.warn = function(warning) {
			grunt.log.error(warning);
		};
	});

};
<|endoftext|>


<commit_before>/*
 * grunt-mokuai-coffee
 * https://github.com/JimRobs/grunt-mokuai-coffee
 *
 * Copyright (c) 2015 JimRobs
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function (grunt) {

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

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

        // Configuration to be run (and then tested).
        'mokuai-coffee': {
            simple: {
                files: {
                    'test/tmp/simple.js': [
                        'test/fixtures/modules/window.coffee',
                        'test/fixtures/modules/Horse.coffee',
                        'test/fixtures/modules/Animal.coffee',
                        'test/fixtures/modules/Snake.coffee'
                    ]
                },
                options: {
                    prepend: 'test/fixtures/prepend/window.coffee',
                    append: [
                        'test/fixtures/append/instances.coffee',
                        'test/fixtures/append/move.coffee'
                    ]
                }
            },
            'simple.partial': {
                files: {
                    'test/tmp/simple.partial.js': [
                        'test/fixtures/modules/window.coffee',
                        'test/fixtures/modules/Horse.coffee',
                        'test/fixtures/modules/Animal.coffee',
                        'test/fixtures/modules/Snake.coffee'
                    ]
                },
                options: {
                    prepend: 'test/fixtures/prepend/window.coffee',
                    append: [
                        'test/fixtures/append/instances.coffee',
                        'test/fixtures/append/move.coffee'
                    ],
                    partial: true
                }
            },
            'simple.autoexports': {
                files: {
                    'test/tmp/simple.autoexports.js': [
                        'test/fixtures/modules/autoexports/window.coffee',
                        'test/fixtures/modules/autoexports/Horse.coffee',
                        'test/fixtures/modules/autoexports/Animal.coffee',
                        'test/fixtures/modules/autoexports/Snake.coffee'
                    ]
                },
                options: {
                    prepend: [ 'test/fixtures/prepend/window.coffee' ],
                    append: [
                        'test/fixtures/append/instances.coffee',
                        'test/fixtures/append/move.coffee'
                    ],
                    autoexports: true,
                    exports: true
                }
            },
            'custom': {
                dest: 'test/tmp/custom.js',
                src: [
                    'test/fixtures/modules/Horse.coffee',
                    'test/fixtures/modules/Animal.coffee',
                    'test/fixtures/modules/Snake.coffee'
                ],
                options: {
                    exports: true,
                    name: function(filepath, filename){
                        switch(filename){
                            case 'Horse': return 'JollyJumper';
                            case 'Snake': return 'Kaa';
                            default: return filename;
                        }
                    }
                }
            },
            'custom.jollyjumper': {
                dest: 'test/tmp/custom.jollyjumper.js',
                src: [
                    'test/fixtures/modules/Horse.coffee',
                    'test/fixtures/modules/Animal.coffee'
                ],
                options: {
                    exports: 'JollyJumper',
                    name: function(filepath, filename){
                        switch(filename){
                            case 'Horse': return 'JollyJumper';
                            default: return filename;
                        }
                    }
                }
            },
            'custom.besthorse': {
                dest: 'test/tmp/custom.besthorse.js',
                src: [
                    'test/fixtures/modules/Horse.coffee',
                    'test/fixtures/modules/Animal.coffee'
                ],
                options: {
                    exports: 'JollyJumper',
                    exportsname: 'BestHorseEver',
                    name: function(filepath, filename){
                        switch(filename){
                            case 'Horse': return 'JollyJumper';
                            default: return filename;
                        }
                    }
                }
            }
        },

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

    });

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

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

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

};
<commit_msg>Remove blank lines<commit_after>/*
 * grunt-mokuai-coffee
 * https://github.com/JimRobs/grunt-mokuai-coffee
 *
 * Copyright (c) 2015 JimRobs
 * Licensed under the MIT license.
 */

'use strict';

module.exports = function (grunt) {

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

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

        // Configuration to be run (and then tested).
        'mokuai-coffee': {
            simple: {
                files: {
                    'test/tmp/simple.js': [
                        'test/fixtures/modules/window.coffee',
                        'test/fixtures/modules/Horse.coffee',
                        'test/fixtures/modules/Animal.coffee',
                        'test/fixtures/modules/Snake.coffee'
                    ]
                },
                options: {
                    prepend: 'test/fixtures/prepend/window.coffee',
                    append: [
                        'test/fixtures/append/instances.coffee',
                        'test/fixtures/append/move.coffee'
                    ]
                }
            },
            'simple.partial': {
                files: {
                    'test/tmp/simple.partial.js': [
                        'test/fixtures/modules/window.coffee',
                        'test/fixtures/modules/Horse.coffee',
                        'test/fixtures/modules/Animal.coffee',
                        'test/fixtures/modules/Snake.coffee'
                    ]
                },
                options: {
                    prepend: 'test/fixtures/prepend/window.coffee',
                    append: [
                        'test/fixtures/append/instances.coffee',
                        'test/fixtures/append/move.coffee'
                    ],
                    partial: true
                }
            },
            'simple.autoexports': {
                files: {
                    'test/tmp/simple.autoexports.js': [
                        'test/fixtures/modules/autoexports/window.coffee',
                        'test/fixtures/modules/autoexports/Horse.coffee',
                        'test/fixtures/modules/autoexports/Animal.coffee',
                        'test/fixtures/modules/autoexports/Snake.coffee'
                    ]
                },
                options: {
                    prepend: [ 'test/fixtures/prepend/window.coffee' ],
                    append: [
                        'test/fixtures/append/instances.coffee',
                        'test/fixtures/append/move.coffee'
                    ],
                    autoexports: true,
                    exports: true
                }
            },
            'custom': {
                dest: 'test/tmp/custom.js',
                src: [
                    'test/fixtures/modules/Horse.coffee',
                    'test/fixtures/modules/Animal.coffee',
                    'test/fixtures/modules/Snake.coffee'
                ],
                options: {
                    exports: true,
                    name: function(filepath, filename){
                        switch(filename){
                            case 'Horse': return 'JollyJumper';
                            case 'Snake': return 'Kaa';
                            default: return filename;
                        }
                    }
                }
            },
            'custom.jollyjumper': {
                dest: 'test/tmp/custom.jollyjumper.js',
                src: [
                    'test/fixtures/modules/Horse.coffee',
                    'test/fixtures/modules/Animal.coffee'
                ],
                options: {
                    exports: 'JollyJumper',
                    name: function(filepath, filename){
                        switch(filename){
                            case 'Horse': return 'JollyJumper';
                            default: return filename;
                        }
                    }
                }
            },
            'custom.besthorse': {
                dest: 'test/tmp/custom.besthorse.js',
                src: [
                    'test/fixtures/modules/Horse.coffee',
                    'test/fixtures/modules/Animal.coffee'
                ],
                options: {
                    exports: 'JollyJumper',
                    exportsname: 'BestHorseEver',
                    name: function(filepath, filename){
                        switch(filename){
                            case 'Horse': return 'JollyJumper';
                            default: return filename;
                        }
                    }
                }
            }
        },

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

    });

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

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

    // Whenever the "test" task is run, first clean the "tmp" dir, then run this
    // plugin's task(s), then test the result.
    grunt.registerTask('test', [
        'clean',
        'mokuai-coffee',
        'nodeunit',
        'clean'
    ]);
};<|endoftext|>


<commit_before>module.exports = function(grunt) {
    var BASE_URL = 'http://localhost:8000/mocha/';

    /*
     * To add a new app to test, add the app name to this test and create
     * a test runner view at:
     *
     * corehq/apps/<app>/templates/<app>/spec/mocha.html
     *
     * You can view an example in the app_manager
     */
    var apps = [
        'app_manager',
        'app_manager#b3',
    ];

    var mochaConfig = {},
        watchConfig = {};

    apps.forEach(function(app) {
        var parts = app.split('#');
        var appName = parts[0];
        var config = parts[1];

        mochaConfig[app] = {
            options: {
                urls: [BASE_URL + appName + '/' + (config ? config : '')],
                run: true
            }
        };
        watchConfig[app] = {
            files: [
                'corehq/apps/' + appName + '/static/' + appName + '/js/**/*.js',
                'corehq/apps/' + appName + '/static/' + appName + '/spec/**/*.js',
            ],
            tasks: ['mocha:' + app]
        };
    });

    grunt.initConfig({
        mocha: mochaConfig,
        watch: watchConfig,
    });

    grunt.loadNpmTasks('grunt-mocha');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.registerTask('default', ['mocha']);
    grunt.registerTask('list', 'Lists all available apps to test', function() {
        apps.forEach(function(app) { console.log(app); });
    });
};
<commit_msg>update mocha settings<commit_after>module.exports = function(grunt) {
    var BASE_URL = 'http://localhost:8000/mocha/';

    /*
     * To add a new app to test, add the app name to this test and create
     * a test runner view at:
     *
     * corehq/apps/<app>/templates/<app>/spec/mocha.html
     *
     * You can view an example in the app_manager
     */
    var apps = [
        'app_manager',
        'app_manager#b3',
    ];

    var mochaConfig = {},
        watchConfig = {};

    apps.forEach(function(app) {
        var parts = app.split('#');
        var appName = parts[0];
        var config = parts[1];

        mochaConfig[app] = {
            options: {
                urls: [BASE_URL + appName + '/' + (config ? config : '')],
                run: true,
                log: true,
                logErrors: true,
                reporter: 'Nyan'
            }
        };
        watchConfig[app] = {
            files: [
                'corehq/apps/' + appName + '/static/' + appName + '/js/**/*.js',
                'corehq/apps/' + appName + '/static/' + appName + '/spec/**/*.js',
            ],
            tasks: ['mocha:' + app]
        };
    });

    grunt.initConfig({
        mocha: mochaConfig,
        watch: watchConfig,
    });

    grunt.loadNpmTasks('grunt-mocha');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.registerTask('default', ['mocha']);
    grunt.registerTask('list', 'Lists all available apps to test', function() {
        apps.forEach(function(app) { console.log(app); });
    });
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function (grunt) {

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

  var config = {

    babel: {
      options: {
        plugins: ['uglify:after'],
        sourceMap: true
      },
      dist: {
        files: [{
          expand: true,
          cwd: './src',
          src: '**/*.js',
          dest: './dist',
          ext: '.js'
        }]
      }
    },

    copy: {
      main: {
        files: [
          {
            expand: true,
            cwd: 'src/',
            src: ['**/*.json', '**/*.html', '**/*.png'],
            dest: 'dist/'
          }
        ],
      },
    },

    run: {
      npm_local_install: {
        cmd: 'npm',
        args: [ 'install' ]
      }
    },

    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            './dist/*',
            './*.tgz',
            './node_modules/local-node-candy-*'
          ]
        }]
      }
    },

    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: [
        './*.js',
        './test/src/**/*.js',
        './src/**/*.js'
      ]
    },
    mochaTest: {
      all: {
        options: {
          require: 'babel/register'
        },
        src: ['./test/src/**/*.js']
      }
    },
  };

  var fs = require('fs');
  try {
    fs.readdirSync('./dist/nodes/').forEach(function(f) {
      if (f.indexOf('local-node-candy-') === 0) {
        config.run.npm_local_install.args.push('./dist/nodes/' + f);
      }
    });
  } catch (e) { /* pass */ }

  grunt.initConfig(config);

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-babel');
  grunt.loadNpmTasks('grunt-mocha-test');
  grunt.loadNpmTasks('grunt-run');

  grunt.registerTask('test', [
    'babel',
    'copy',
    'run',
    'jshint',
    'mochaTest'
  ]);

  grunt.registerTask('build', [
    'clean',
    'babel',
    'copy',
    'run',
  ]);

  grunt.registerTask('default', [
    'test',
    'build'
  ]);
};
<commit_msg>Modify the local node name convention in order to include generic modules<commit_after>'use strict';

module.exports = function (grunt) {

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

  var config = {

    babel: {
      options: {
        plugins: ['uglify:after'],
        sourceMap: true
      },
      dist: {
        files: [{
          expand: true,
          cwd: './src',
          src: '**/*.js',
          dest: './dist',
          ext: '.js'
        }]
      }
    },

    copy: {
      main: {
        files: [
          {
            expand: true,
            cwd: 'src/',
            src: ['**/*.json', '**/*.html', '**/*.png'],
            dest: 'dist/'
          }
        ],
      },
    },

    run: {
      npm_local_install: {
        cmd: 'npm',
        args: [ 'install' ]
      }
    },

    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            './dist/*',
            './*.tgz',
            './node_modules/local-node-*'
          ]
        }]
      }
    },

    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: [
        './*.js',
        './test/src/**/*.js',
        './src/**/*.js'
      ]
    },
    mochaTest: {
      all: {
        options: {
          require: 'babel/register'
        },
        src: ['./test/src/**/*.js']
      }
    },
  };

  var fs = require('fs');
  try {
    fs.readdirSync('./dist/nodes/').forEach(function(f) {
      if (f.indexOf('local-node-') === 0) {
        config.run.npm_local_install.args.push('./dist/nodes/' + f);
      }
    });
  } catch (e) { /* pass */ }

  grunt.initConfig(config);

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-babel');
  grunt.loadNpmTasks('grunt-mocha-test');
  grunt.loadNpmTasks('grunt-run');

  grunt.registerTask('test', [
    'babel',
    'copy',
    'run',
    'jshint',
    'mochaTest'
  ]);

  grunt.registerTask('build', [
    'clean',
    'babel',
    'copy',
    'run',
  ]);

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


<commit_before>module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt);

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

        sass: {
            options: {
                style: 'expanded',
                loadPath: [
                    './'
                ]
            },
            compile_tests: {
                files: [{
                    expand: true,
                    src: 'tests/**/*.scss',
                    dest: '.',
                    ext: '.css'
                }]
            }
        },

        autoprefixer: {
            options: {
                browsers: [
                    'iOS >= 6.0',
                    'Android >= 2.3',
                    'last 4 ChromeAndroid versions'
                ]
            },
            prefix_tests: {
                files: [{
                    expand: true,
                    src: 'tests/**/*.css' // Overwrite compiled css.
                }]
            },
        },

        watch: {
            scss: {
                files: [
                    'dist/**/*.scss',
                    'tests/**/*.scss'
                ],
                tasks: ['default']
            }
        },

        shell: {
            test: {
                command: function(scope, verbosity) {
                    var cmd = [
                        'casperjs test test-suite.js',
                        '--pre=_pre-roll.js --post=_post-roll.js',
                        '--log-level=info'
                    ];

                    if (scope) {
                        cmd.push('--scope=' + scope);
                    }

                    if (verbosity !== 'terse') {
                        cmd.push('--verbose');
                    }

                    return cmd.join(' ');
                },
                options: {
                    // Prevent phantomcss raising a grunt error on first run.
                    failOnError: false,
                    execOptions: {
                        cwd: 'tests/regression'
                    }
                }
            }
        },
        connect: {
            server: {
                options: {
                    hostname: '0.0.0.0',
                    port: 3000,
                    base: '.'
                }
            }
        }
    });
    // Default task
    grunt.registerTask('default', ['sass', 'autoprefixer']);
    grunt.registerTask('serve', ['default', 'connect:server', 'watch']);

    // Run all tests or only one. Examples:
    //
    // $ `grunt test` // run all tests.
    // $ `grunt test:all` // ditto
    // $ `grunt test:all:terse` // prevent verbose output
    // $ `grunt test:components/arrange` // only test the arrange component
    // $ `grunt test:utils/layout:terse` // only test layout utils (terse mode)

    grunt.registerTask('test', function(scope, verbosity) {
            var task = 'shell:test';

            task = scope ? (task + ':' + scope) : task;
            task = verbosity ? (task + ':' + verbosity) : task;

            grunt.task.run(['default', task]);
    });
};
<commit_msg>add break lines<commit_after>module.exports = function(grunt) {
    require('load-grunt-tasks')(grunt);

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

        sass: {
            options: {
                style: 'expanded',
                loadPath: [
                    './'
                ]
            },
            compile_tests: {
                files: [{
                    expand: true,
                    src: 'tests/**/*.scss',
                    dest: '.',
                    ext: '.css'
                }]
            }
        },

        autoprefixer: {
            options: {
                browsers: [
                    'iOS >= 6.0',
                    'Android >= 2.3',
                    'last 4 ChromeAndroid versions'
                ]
            },
            prefix_tests: {
                files: [{
                    expand: true,
                    src: 'tests/**/*.css' // Overwrite compiled css.
                }]
            },
        },

        watch: {
            scss: {
                files: [
                    'dist/**/*.scss',
                    'tests/**/*.scss'
                ],
                tasks: ['default']
            }
        },

        shell: {
            test: {
                command: function(scope, verbosity) {
                    var cmd = [
                        'casperjs test test-suite.js',
                        '--pre=_pre-roll.js --post=_post-roll.js',
                        '--log-level=info'
                    ];

                    if (scope) {
                        cmd.push('--scope=' + scope);
                    }

                    if (verbosity !== 'terse') {
                        cmd.push('--verbose');
                    }

                    return cmd.join(' ');
                },
                options: {
                    // Prevent phantomcss raising a grunt error on first run.
                    failOnError: false,
                    execOptions: {
                        cwd: 'tests/regression'
                    }
                }
            }
        },

        connect: {
            server: {
                options: {
                    hostname: '0.0.0.0',
                    port: 3000,
                    base: '.'
                }
            }
        }
    });

    // Default task
    grunt.registerTask('default', ['sass', 'autoprefixer']);
    grunt.registerTask('serve', ['default', 'connect:server', 'watch']);

    // Run all tests or only one. Examples:
    //
    // $ `grunt test` // run all tests.
    // $ `grunt test:all` // ditto
    // $ `grunt test:all:terse` // prevent verbose output
    // $ `grunt test:components/arrange` // only test the arrange component
    // $ `grunt test:utils/layout:terse` // only test layout utils (terse mode)

    grunt.registerTask('test', function(scope, verbosity) {
            var task = 'shell:test';

            task = scope ? (task + ':' + scope) : task;
            task = verbosity ? (task + ':' + verbosity) : task;

            grunt.task.run(['default', task]);
    });
};
<|endoftext|>


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

    // helper function to load task configs

    function loadConfig( path, config ) {
        var glob = require( 'glob' )
          , object = {}
          , key;

        glob.sync('*', { cwd: path })
            .forEach(function( option ) {
                key = option.replace( /\.js$/, '' );
                object[key] = require( path + option )( config );
            });

        return object;
    }

    // actual config

    var config = {

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

      , env: process.env

    };

    grunt.util._.extend(config, loadConfig( './tasks/options/', config ));

    grunt.initConfig(config);

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

    // local tasks
    grunt.loadTasks('tasks');

    // clean
    // grunt.registerTask('clean'     , [ 'clean' ]);

    // test
    grunt.registerTask('coverage'     , [ 'clean:coverage', 'blanket', 'copy:coverage', 'mochaTest:instrumented', 'mochaTest:coverage', 'mochaTest:lcov']);
    grunt.registerTask('featurecoverage'      , [ 'mochaTest:instrumented', 'mochaTest:coverage', 'mochaTest:lcov']);
    grunt.registerTask('test'         , [ 'jshint', 'mochaTest:test' ]);

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

    // travis-ci

    grunt.registerTask('ci'     , [ 'test', 'coverage', 'mochaTest:travis-cov', 'coveralls']);

};
<commit_msg>run script change<commit_after>module.exports = function( grunt )
{
    "use strict";

    // helper function to load task configs

    function loadConfig( path, config ) {
        var glob = require( 'glob' )
          , object = {}
          , key;

        glob.sync('*', { cwd: path })
            .forEach(function( option ) {
                key = option.replace( /\.js$/, '' );
                object[key] = require( path + option )( config );
            });

        return object;
    }

    // actual config

    var config = {

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

      , env: process.env

    };

    grunt.util._.extend(config, loadConfig( './tasks/options/', config ));

    grunt.initConfig(config);

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

    // local tasks
    grunt.loadTasks('tasks');

    // clean
    // grunt.registerTask('clean'     , [ 'clean' ]);

    // test
    grunt.registerTask('coverage'     , [ 'clean:coverage', 'blanket', 'copy:coverage', 'mochaTest:instrumented', 'mochaTest:coverage', 'mochaTest:lcov']);
    grunt.registerTask('test'         , [ 'jshint', 'mochaTest:test' ]);

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

    // travis-ci

    grunt.registerTask('ci'     , [ 'test', 'coverage', 'mochaTest:travis-cov', 'coveralls']);

};
<|endoftext|>


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

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

    grunt.initConfig({

        less: {
            compileless: {
                options: {
                    paths: ["less"]
                },
                files: {
                    "dist/css/material.css": "less/material.less",
                    "dist/css/material-wfont.css": "less/material-wfont.less",
                    "dist/css/ripples.css": "less/ripples.less"
                }
            }
        },

        /*githooks: {
            all: {
                // Will run the jshint and test:unit tasks at every commit
                "pre-commit": "less autoprefixer cssmin uglify copy newer:jshint jasmine:scripts"
            }
        }, */

        sass: {
            compilesass: {
                files: {
                    "dist/css/material.css": "sass/material.scss",
                    "dist/css/material-wfont.css": "sass/material-wfont.scss",
                    "dist/css/ripples.css": "sass/ripples.scss"
                }
            }
        },

        autoprefixer: {
            options: {
                browsers: ["last 3 versions", "ie 8", "ie 9", "ie 10", "ie 11"]
            },
            prefix: {
                files: {
                    "dist/css/material.css": "dist/css/material.css",
                    "dist/css/material-wfont.css": "dist/css/material-wfont.css",
                    "dist/css/ripples.css": "dist/css/ripples.css"
                }
            }
        },

        cssmin: {
            minifycss: {
                expand: true,
                cwd: "dist/css/",
                src: ["*.css", "!*.min.css"],
                dest: "dist/css/",
                ext: ".min.css"
            }
        },

        clean: {
            css: [
                "dist/css/material.css",
                "dist/css/material-wfont.css",
                "dist/css/ripples.css"
            ]
        },

        uglify: {
            minifyjs: {
                files: {
                    "dist/js/material.min.js": "scripts/material.js",
                    "dist/js/ripples.min.js": "scripts/ripples.js"
                }
            }
        },

        copy: {
            distjs: {
                expand: true,
                cwd: "scripts/",
                src: "**.min.js",
                dest: "dist/js/",
                flatten: true,
                filter: "isFile"
            },
            distfonts: {
                expand: true,
                cwd: "fonts/",
                src: "**",
                dest: "dist/fonts/",
                flatten: true,
                filter: "isFile"
            }
        },

        connect: {
            options: {
                port: 8040,
                hostname: "localhost",
                livereload: 35729

            },
            livereload: {
                options: {
                    open: true,
                    base: "."
                }
            },
            test: {
                options: {
                    port: 8041,
                    open: "http://localhost:8041/_SpecRunner.html",
                    base: "."
                }
            }
        },

        jasmine: {
            scripts: "scripts/**/*.js",
            options: {
                build: true,
                specs: "test/*Spec.js",
                helpers: "test/*Helper.js",
                vendor: [
                    "https://code.jquery.com/jquery-1.10.2.min.js",
                    "https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"
                ]
            }
        },

        jshint: {
            options: {
                jshintrc: ".jshintrc",
                reporter: require("jshint-stylish")
            },
            all: [
                "Gruntfile.js",
                "scripts/**/*.js",
                "template/**/*.js",
                "!template/**/*.min.js"
            ],
            test: {
                options: {
                    jshintrc: "test/.jshintrc",
                    src: ["test/**/*.js"]
                }
            }
        },

        watch: {
            js: {
                files: ["Gruntfile.js", "scripts/**/*.js", "template/**/*.js"],
                tasks: ["newer:jshint:all"]
            },
            jsTest: {
                files: ["test/**/*.js"],
                tasks: ["newer:jshint:test", "jasmine"]
            },
            less: {
                files:["less/**/*.less"],
                tasks: ["default"]
            },
            sass: {
                files: ["sass/**/*.scss", "sass/**/*.sass"],
                tasks: ["scss"]
            },
            livereload: {
                options: {
                    livereload: "<%= connect.options.livereload %>"
                },
                files: [
                    "index.html",
                    "dist/css/**/*.css",
                    "**/*.{png,jpg,jpeg,gif,webp,svg}"
                ]
            }
        }

    });

    grunt.registerTask("default", ["less", "autoprefixer", "cssmin", "uglify", "clean", "copy"]);

    grunt.registerTask("scss", ["sass", "autoprefixer", "cssmin", "uglify", "clean", "copy"]);

    grunt.registerTask("build", function(target) {
        var buildType = "default";
        if (target && target === "scss") {
            buildType = "scss";
        }

        grunt.task.run(["newer:jshint", "jasmine:scripts", buildType]);
    });

    grunt.registerTask("test", [
        "jasmine:scripts:build",
        "connect:test:keepalive"
    ]);

    grunt.registerTask("serve", function(target){
        var buildTarget = "default";
        if(target && target === "scss") {
            buildTarget = "scss";
        }
        grunt.task.run([
            "build:"+ buildTarget,
            "connect:livereload",
            "watch"
        ]);
    });

    grunt.registerTask("cibuild",["newer:jshint", "jasmine:scripts"]);
};
<commit_msg>removed duplicated files, move test.html to dist dir, improved workflow<commit_after>module.exports = function(grunt) {
    "use strict";

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

    grunt.initConfig({

        less: {
            compileless: {
                options: {
                    paths: ["less"]
                },
                files: {
                    "dist/css/material.css": "less/material.less",
                    "dist/css/material-wfont.css": "less/material-wfont.less",
                    "dist/css/ripples.css": "less/ripples.less"
                }
            }
        },

        sass: {
            compilesass: {
                files: {
                    "dist/css/material.css": "sass/material.scss",
                    "dist/css/material-wfont.css": "sass/material-wfont.scss",
                    "dist/css/ripples.css": "sass/ripples.scss"
                }
            }
        },

        autoprefixer: {
            options: {
                browsers: ["last 3 versions", "ie 8", "ie 9", "ie 10", "ie 11"]
            },
            prefix: {
                files: {
                    "dist/css/material.css": "dist/css/material.css",
                    "dist/css/material-wfont.css": "dist/css/material-wfont.css",
                    "dist/css/ripples.css": "dist/css/ripples.css"
                }
            }
        },

        cssmin: {
            minifycss: {
                expand: true,
                cwd: "dist/css/",
                src: ["*.css", "!*.min.css"],
                dest: "dist/css/",
                ext: ".min.css"
            }
        },

        clean: {
            css: [
                "dist/css/material.css",
                "dist/css/material-wfont.css",
                "dist/css/ripples.css"
            ]
        },

        uglify: {
            minifyjs: {
                files: {
                    "dist/js/material.min.js": "scripts/material.js",
                    "dist/js/ripples.min.js": "scripts/ripples.js"
                }
            }
        },

        copy: {
            distjs: {
                expand: true,
                cwd: "scripts/",
                src: "**.min.js",
                dest: "dist/js/",
                flatten: true,
                filter: "isFile"
            },
            distfonts: {
                expand: true,
                cwd: "fonts/",
                src: "**",
                dest: "dist/fonts/",
                flatten: true,
                filter: "isFile"
            }
        },

        connect: {
            options: {
                port: 8040,
                hostname: "localhost",
                livereload: 35729

            },
            livereload: {
                options: {
                    open: true,
                    base: "."
                }
            },
            test: {
                options: {
                    port: 8041,
                    open: "http://localhost:8041/_SpecRunner.html",
                    base: "."
                }
            }
        },

        jasmine: {
            scripts: "scripts/**/*.js",
            options: {
                build: true,
                specs: "test/*Spec.js",
                helpers: "test/*Helper.js",
                vendor: [
                    "https://code.jquery.com/jquery-1.10.2.min.js",
                    "https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"
                ]
            }
        },

        jshint: {
            options: {
                jshintrc: ".jshintrc",
                reporter: require("jshint-stylish")
            },
            all: [
                "Gruntfile.js",
                "scripts/**/*.js",
                "template/**/*.js",
                "!template/**/*.min.js"
            ],
            test: {
                options: {
                    jshintrc: "test/.jshintrc",
                    src: ["test/**/*.js"]
                }
            }
        },

        watch: {
            js: {
                files: ["Gruntfile.js", "scripts/**/*.js", "template/**/*.js"],
                tasks: ["newer:jshint:all"]
            },
            jsTest: {
                files: ["test/**/*.js"],
                tasks: ["newer:jshint:test", "jasmine"]
            },
            less: {
                files:["less/**/*.less"],
                tasks: ["default"]
            },
            sass: {
                files: ["sass/**/*.scss", "sass/**/*.sass"],
                tasks: ["scss"]
            },
            livereload: {
                options: {
                    livereload: "<%= connect.options.livereload %>"
                },
                files: [
                    "index.html",
                    "dist/css/**/*.css",
                    "**/*.{png,jpg,jpeg,gif,webp,svg}"
                ]
            }
        }

    });

    grunt.registerTask("default", ["less", "autoprefixer", "cssmin", "uglify", "clean", "copy"]);

    grunt.registerTask("scss", ["sass", "autoprefixer", "cssmin", "uglify", "clean", "copy"]);

    grunt.registerTask("build", function(target) {
        var buildType = "default";
        if (target && target === "scss") {
            buildType = "scss";
        }

        grunt.task.run(["newer:jshint", "jasmine:scripts", buildType]);
    });

    grunt.registerTask("test", [
        "jasmine:scripts:build",
        "connect:test:keepalive"
    ]);

    grunt.registerTask("serve", function(target){
        var buildTarget = "default";
        if(target && target === "scss") {
            buildTarget = "scss";
        }
        grunt.task.run([
            "build:"+ buildTarget,
            "connect:livereload",
            "watch"
        ]);
    });

    grunt.registerTask("cibuild",["newer:jshint", "jasmine:scripts"]);
};
<|endoftext|>


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

	grunt.initConfig({
		pkg : grunt.file.readJSON('package.json'),
		jshint : {
			files : ['gruntfile.js', 'js/*.js'],
			options : {
				globals : {
					jQuery : true
				}
			}
		},
		csslint: {
			standard: {
				src: "css/jquery.multiDialog.css"
			}
		},
		concat : {
			options : {
				banner : '/*! v<%= pkg.version %> - <%= grunt.template.today("dd-mm-yyyy HH:MM") %> */\n'
			},
			standard : {
				src : [ 'js/jquery.multiDialog.js', 'js/jquery.ui.dialog.extended-*.js' ],
				dest : 'compiled/js/<%= pkg.name %>-<%= pkg.version %>.js'
			},
			standalone : {
				src : [ 'js/jquery.multiDialog.js', 'js/jquery/jquery-ui-*.custom.js', 'js/jquery.ui.dialog.extended-*.js' ],
				dest : 'compiled/js/<%= pkg.name %>-<%= pkg.version %>_standalone.js'
			}
		},
		uglify : {
			options: {
				report: 'min',
				preserveComments : 'some'
			},
			standard : {
				src : [ 'compiled/js/<%= pkg.name %>-<%= pkg.version %>.js' ],
				dest : 'compiled/js/<%= pkg.name %>-<%= pkg.version %>.min.js'
			},
			standalone : {
				src : [ 'compiled/js/<%= pkg.name %>-<%= pkg.version %>_standalone.js' ],
				dest : 'compiled/js/<%= pkg.name %>-<%= pkg.version %>_standalone.min.js'
			}
		},
		cssmin: {
			options: {
				report: 'min'
			},
			standard : {
				src: ['css/jquery.multiDialog.css'],
				dest: 'compiled/css/<%= pkg.name %>.css'
			},
			standalone : {
				src: ['css/*.css'],
				dest: 'compiled/css/<%= pkg.name %>_standalone.css'
			}
		},
		compress: {
			main: {
				options: {
					archive: '<%= pkg.name %>-<%= pkg.version %>.zip'
				},
				files: [
					{ src: ['./**', '!./node_modules/**', '!./*.zip'], dest: '<%= pkg.name %>-<%= pkg.version %>/' }
				]
			}
		},
		watch : {
			files : ['<%= jshint.files %>'],
			tasks : ['jshint']
		}
	});

	grunt.loadNpmTasks('grunt-contrib-uglify');
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-csslint');
	grunt.loadNpmTasks('grunt-contrib-cssmin');
	grunt.loadNpmTasks('grunt-contrib-watch');
	grunt.loadNpmTasks('grunt-contrib-concat');
	grunt.loadNpmTasks('grunt-contrib-compress');

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

	grunt.registerTask('watch', ['watch']);

	// grunt.registerTask('default', ['jshint', 'csslint', 'concat', 'uglify', 'copy', 'cssmin', 'compress']);
	grunt.registerTask('default', ['concat', 'uglify', 'cssmin', 'compress']);

};<commit_msg>use lint options from jquery ui<commit_after>module.exports = function (grunt) {

	grunt.initConfig({
		pkg : grunt.file.readJSON("package.json"),
		jshint : {
			files : ["gruntfile.js", "js/*.js"],
			options : {
				"boss": true,
				"curly": true,
				"eqeqeq": true,
				"eqnull": true,
				"expr": true,
				"immed": true,
				"noarg": true,
				"onevar": true,
				"quotmark": "double",
				"smarttabs": true,
				"trailing": true,
				"undef": true,
				"unused": true,
				"node": true
			}
		},
		csslint: {
			options: {
				"adjoining-classes": false,
				"box-model": false,
				"compatible-vendor-prefixes": false,
				"duplicate-background-images": false,
				"import": false,
				"important": false,
				"outline-none": false,
				"overqualified-elements": false,
				"text-indent": false
			},
			standard: {
				src: "css/jquery.multiDialog.css"
			}
		},
		concat : {
			options : {
				banner : "/*! v<%= pkg.version %> - <%= grunt.template.today('dd-mm-yyyy HH:MM') %> */\n"
			},
			standard : {
				src : [ "js/jquery.multiDialog.js", "js/jquery.ui.dialog.extended-*.js" ],
				dest : "compiled/js/<%= pkg.name %>-<%= pkg.version %>.js"
			},
			standalone : {
				src : [ "js/jquery.multiDialog.js", "js/jquery/jquery-ui-*.custom.js", "js/jquery.ui.dialog.extended-*.js" ],
				dest : "compiled/js/<%= pkg.name %>-<%= pkg.version %>_standalone.js"
			}
		},
		uglify : {
			options: {
				report: "min",
				preserveComments : "some"
			},
			standard : {
				src : [ "compiled/js/<%= pkg.name %>-<%= pkg.version %>.js" ],
				dest : "compiled/js/<%= pkg.name %>-<%= pkg.version %>.min.js"
			},
			standalone : {
				src : [ "compiled/js/<%= pkg.name %>-<%= pkg.version %>_standalone.js" ],
				dest : "compiled/js/<%= pkg.name %>-<%= pkg.version %>_standalone.min.js"
			}
		},
		cssmin: {
			options: {
				report: "min"
			},
			standard : {
				src: ["css/jquery.multiDialog.css"],
				dest: "compiled/css/<%= pkg.name %>.css"
			},
			standalone : {
				src: ["css/*.css"],
				dest: "compiled/css/<%= pkg.name %>_standalone.css"
			}
		},
		compress: {
			main: {
				options: {
					archive: "<%= pkg.name %>-<%= pkg.version %>.zip"
				},
				files: [
					{ src: ["./**", "!./node_modules/**", "!./*.zip"], dest: "<%= pkg.name %>-<%= pkg.version %>/" }
				]
			}
		},
		watch : {
			files : ["<%= jshint.files %>"],
			tasks : ["jshint"]
		}
	});

	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-csslint");
	grunt.loadNpmTasks("grunt-contrib-cssmin");
	grunt.loadNpmTasks("grunt-contrib-watch");
	grunt.loadNpmTasks("grunt-contrib-concat");
	grunt.loadNpmTasks("grunt-contrib-compress");

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

	grunt.registerTask("watch", ["watch"]);

	grunt.registerTask("default", ["jshint", "csslint", "concat", "uglify", "cssmin", "compress"]);

};<|endoftext|>


<commit_before>module.exports = function(grunt) {
	var
		pkg = grunt.file.readJSON('package.json')
	;

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

		jshint: {
			all: [
				'Gruntfile.js',
				'src/**/*.js'
			],
			options: {
				'boss': true,
				'curly': true,
				'eqeqeq': true,
				'eqnull': true,
				'expr': true,
				'globals': {
					'define': true,
					'require': true,
					'module': true,
					'window': true
				},
				'immed': true,
				'noarg': true,
				'onevar': true,
				'quotmark': 'single',
				'smarttabs': true,
				'trailing': true,
				'undef': true,
				'unused': true
			}
		},

		jscs: {
			main: [
				'Gruntfile.js',
				'src/**/*.js'
			]
		},

		connect: {
			dev: {
				options: {
					port: 8000,
					base: '.',
					keepalive: true,
					hostname: '0.0.0.0'
				}
			}
		},

		lintspaces: {
			all: {
				src: [
					'Gruntfile.js',
					'src/**/*',
					'tests/**/*'
				],
				options: {
					newline: true,
					trailingspaces: true,
					indentation: 'tabs'
				}
			}
		}
	});

	// load tasks
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-jscs-checker');
	grunt.loadNpmTasks('grunt-lintspaces');

	// define tasks
	grunt.registerTask('validate', [
		'jshint',
		'lintspaces'
	]);

	grunt.registerTask('default', [
		'validate'
	]);
};
<commit_msg>Update validation tasks<commit_after>module.exports = function(grunt) {
	var
		pkg = grunt.file.readJSON('package.json')
	;

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

		jshint: {
			all: [
				'Gruntfile.js',
				'src/**/*.js',
				'tests/**/*.js'
			],
			options: {
				'boss': true,
				'curly': true,
				'eqeqeq': true,
				'eqnull': true,
				'expr': true,
				'globals': {
					'define': true,
					'require': true,
					'module': true,
					'window': true
				},
				'immed': true,
				'noarg': true,
				'onevar': true,
				'quotmark': 'single',
				'smarttabs': true,
				'trailing': true,
				'undef': true,
				'unused': true
			}
		},

		jscs: {
			main: [
				'Gruntfile.js',
				'src/**/*.js',
				'tests/**/*.js'
			]
		},

		connect: {
			dev: {
				options: {
					port: 8000,
					base: '.',
					keepalive: true,
					hostname: '0.0.0.0'
				}
			}
		},

		lintspaces: {
			all: {
				src: [
					'Gruntfile.js',
					'src/**/*',
					'tests/**/*'
				],
				options: {
					newline: true,
					trailingspaces: true,
					indentation: 'tabs'
				}
			}
		}
	});

	// load tasks
	grunt.loadNpmTasks('grunt-contrib-jshint');
	grunt.loadNpmTasks('grunt-contrib-connect');
	grunt.loadNpmTasks('grunt-jscs-checker');
	grunt.loadNpmTasks('grunt-lintspaces');

	// define tasks
	grunt.registerTask('validate', [
		'jshint',
		'jscs',
		'lintspaces'
	]);

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