BIG Update -- Moving to Grunt >0.4

This commit is contained in:
Peter Cottle 2013-12-22 14:17:10 -08:00
parent b12fba07a8
commit c5a4106a43
2 changed files with 85 additions and 70 deletions

View file

@ -79,40 +79,15 @@ module.exports = function(grunt) {
});
grunt.initConfig({
lint: {
files: ['grunt.js', 'src/**/*.js', 'spec/*.js']
},
compliment: {
compliments: [
"Wow peter great work!",
"Such a professional dev environment",
"Can't stop the TRAIN",
"git raging"
]
},
hash: {
src: ['build/bundle.min.js', 'src/style/main.css'],
dest: 'build/'
},
watch: {
files: '<config:lint.files>',
tasks: 'watching'
},
min: {
dist: {
src: ['build/bundle.js'],
dest: 'build/bundle.min.js'
}
},
rm: {
build: 'build/*'
},
shell: {
gitAdd: {
command: 'git add build/'
}
},
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
'Gruntfile.js',
'spec/*.js',
'src/js/**/*.js',
'src/js/**/**/*.js',
'src/levels/**/*.js',
],
options: {
curly: true,
// sometimes triple equality is just redundant and unnecessary
@ -142,21 +117,55 @@ module.exports = function(grunt) {
boss: true,
eqnull: true,
browser: true,
debug: true
debug: true,
globals: {
Raphael: true,
require: true,
console: true,
describe: true,
expect: true,
it: true,
runs: true,
waitsFor: true,
exports: true,
module: true,
prompt: true,
process: true
}
},
globals: {
Raphael: true,
require: true,
console: true,
describe: true,
expect: true,
it: true,
runs: true,
waitsFor: true,
exports: true,
module: true,
prompt: true,
process: true
},
compliment: {
compliments: [
"Wow peter great work!",
"Such a professional dev environment",
"Can't stop the TRAIN",
"git raging"
]
},
hash: {
js: {
src: 'build/bundle.min.js',
dest: 'build/'
},
css: {
src: 'src/style/main.css',
dest: 'build/'
}
},
watch: {
files: '<config:lint.files>',
tasks: 'watching'
},
uglify: {
build: {
src: ['build/bundle.js'],
dest: 'build/bundle.min.js'
}
},
clean: ['build/*'],
shell: {
gitAdd: {
command: 'git add build/'
}
},
jasmine_node: {
@ -167,26 +176,30 @@ module.exports = function(grunt) {
requirejs: false
},
browserify: {
'build/bundle.js': {
entries: ['src/**/*.js', 'src/js/**/*.js']
//prepend: ['<banner:meta.banner>'],
dist: {
files: {
'build/bundle.js': ['src/**/*.js', 'src/js/**/*.js'],
},
}
}
});
// all my npm helpers
grunt.loadNpmTasks('grunt-jslint');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-hash');
grunt.loadNpmTasks('grunt-rm');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-shell-spawn');
grunt.loadNpmTasks('grunt-jasmine-node');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('build', 'rm browserify min hash buildIndex shell jasmine_node lint lintStrings compliment');
grunt.registerTask('fastBuild', 'rm browserify hash buildIndex');
grunt.registerTask('watching', 'fastBuild jasmine_node lint lintStrings');
grunt.registerTask('build',
['clean', 'browserify', 'uglify', 'hash', 'buildIndex', 'shell', 'jasmine_node', 'jshint', 'lintStrings', 'compliment']
);
grunt.registerTask('fastBuild', ['clean', 'browserify', 'hash', 'buildIndex']);
grunt.registerTask('watching', ['fastBuild', 'jasmine_node', 'jshint', 'lintStrings']);
grunt.registerTask('default', 'build');
grunt.registerTask('test', 'jasmine_node');
grunt.registerTask('default', ['build']);
grunt.registerTask('test', ['jasmine_node']);
};

View file

@ -1,23 +1,25 @@
{
"name": "LearnGitBranching",
"version": "0.5.0",
"version": "0.8.0",
"devDependencies": {
"grunt": "~0.3.17",
"jasmine-node": "~1.11.0",
"grunt-browserify": "0.1.1",
"grunt-jslint": "~0.2.2-1",
"grunt-jasmine-node": "0.1.0",
"grunt-hash": "0.2.2",
"grunt-rm": "~0.0.3",
"grunt-shell": "0.1.4",
"prompt": "0.2.9"
"grunt": "~0.4.2",
"jasmine-node": "~1.12.0",
"grunt-browserify": "~1.3.0",
"grunt-jasmine-node": "~0.1.0",
"grunt-hash": "~0.5.0",
"prompt": "0.2.9",
"browserify": "~3.14.0",
"grunt-cli": "~0.1.11",
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-jshint": "~0.7.2",
"grunt-contrib-clean": "~0.5.0",
"grunt-shell-spawn": "~0.3.0"
},
"dependencies": {
"backbone": "~0.9.9",
"underscore": "~1.4.3",
"jquery": "~1.7.3",
"q": "~0.8.11",
"markdown": "~0.4.0",
"grunt-shell": "~0.1.4"
"markdown": "~0.4.0"
}
}