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({ grunt.initConfig({
lint: { pkg: grunt.file.readJSON('package.json'),
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/'
}
},
jshint: { jshint: {
all: [
'Gruntfile.js',
'spec/*.js',
'src/js/**/*.js',
'src/js/**/**/*.js',
'src/levels/**/*.js',
],
options: { options: {
curly: true, curly: true,
// sometimes triple equality is just redundant and unnecessary // sometimes triple equality is just redundant and unnecessary
@ -142,8 +117,7 @@ module.exports = function(grunt) {
boss: true, boss: true,
eqnull: true, eqnull: true,
browser: true, browser: true,
debug: true debug: true,
},
globals: { globals: {
Raphael: true, Raphael: true,
require: true, require: true,
@ -159,6 +133,41 @@ module.exports = function(grunt) {
process: 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: { jasmine_node: {
specNameMatcher: 'spec', specNameMatcher: 'spec',
projectRoot: '.', projectRoot: '.',
@ -167,26 +176,30 @@ module.exports = function(grunt) {
requirejs: false requirejs: false
}, },
browserify: { browserify: {
'build/bundle.js': { dist: {
entries: ['src/**/*.js', 'src/js/**/*.js'] files: {
//prepend: ['<banner:meta.banner>'], 'build/bundle.js': ['src/**/*.js', 'src/js/**/*.js'],
},
} }
} }
}); });
// all my npm helpers // all my npm helpers
grunt.loadNpmTasks('grunt-jslint'); grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-browserify'); grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-hash'); grunt.loadNpmTasks('grunt-hash');
grunt.loadNpmTasks('grunt-rm'); grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-shell'); grunt.loadNpmTasks('grunt-shell-spawn');
grunt.loadNpmTasks('grunt-jasmine-node'); 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('build',
grunt.registerTask('fastBuild', 'rm browserify hash buildIndex'); ['clean', 'browserify', 'uglify', 'hash', 'buildIndex', 'shell', 'jasmine_node', 'jshint', 'lintStrings', 'compliment']
grunt.registerTask('watching', 'fastBuild jasmine_node lint lintStrings'); );
grunt.registerTask('fastBuild', ['clean', 'browserify', 'hash', 'buildIndex']);
grunt.registerTask('watching', ['fastBuild', 'jasmine_node', 'jshint', 'lintStrings']);
grunt.registerTask('default', 'build'); grunt.registerTask('default', ['build']);
grunt.registerTask('test', 'jasmine_node'); grunt.registerTask('test', ['jasmine_node']);
}; };

View file

@ -1,23 +1,25 @@
{ {
"name": "LearnGitBranching", "name": "LearnGitBranching",
"version": "0.5.0", "version": "0.8.0",
"devDependencies": { "devDependencies": {
"grunt": "~0.3.17", "grunt": "~0.4.2",
"jasmine-node": "~1.11.0", "jasmine-node": "~1.12.0",
"grunt-browserify": "0.1.1", "grunt-browserify": "~1.3.0",
"grunt-jslint": "~0.2.2-1", "grunt-jasmine-node": "~0.1.0",
"grunt-jasmine-node": "0.1.0", "grunt-hash": "~0.5.0",
"grunt-hash": "0.2.2", "prompt": "0.2.9",
"grunt-rm": "~0.0.3", "browserify": "~3.14.0",
"grunt-shell": "0.1.4", "grunt-cli": "~0.1.11",
"prompt": "0.2.9" "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": { "dependencies": {
"backbone": "~0.9.9", "backbone": "~0.9.9",
"underscore": "~1.4.3", "underscore": "~1.4.3",
"jquery": "~1.7.3", "jquery": "~1.7.3",
"q": "~0.8.11", "q": "~0.8.11",
"markdown": "~0.4.0", "markdown": "~0.4.0"
"grunt-shell": "~0.1.4"
} }
} }