6a53c401 by Michael Richards

Update to grunt 0.4.x and replace grunt.js with a Gruntfile.coffee. Update devel…

…opment dependencies to use tasks from grunt-contrib-*.
1 parent 8db554cd
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
meta:
banner:
'// rivets.js\n' +
'// version: <%= pkg.version %>\n' +
'// author: <%= pkg.author %>\n' +
'// license: <%= pkg.licenses[0].type %>\n'
coffee:
all:
files:
'lib/rivets.js': 'src/rivets.coffee'
uglify:
all:
options:
banner: '<%= meta.banner %>'
files:
'lib/rivets.min.js': 'lib/rivets.js'
jasmine:
all:
src: 'lib/rivets.js'
options:
specs: 'spec/rivets/**/*.js'
helpers: ['spec/matchers.js', 'spec/mock.data.js']
watch:
all:
files: 'src/rivets.coffee'
tasks: ['build', 'spec']
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-jasmine'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.registerTask 'default', ['watch']
grunt.registerTask 'spec', ['jasmine']
grunt.registerTask 'build', ['coffee', 'uglify']
module.exports = function(grunt) {
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner:
'// rivets.js\n' +
'// version: <%= pkg.version %>\n' +
'// author: <%= pkg.author %>\n' +
'// license: <%= pkg.licenses[0].type %>'
},
jasmine: {
all: ['spec/index.html']
},
lint: {
files: ['grunt.js', 'lib/**/*.js', 'spec/**/*.js']
},
min: {
dist: {
src: ['<banner:meta.banner>', 'lib/rivets.js'],
dest: 'lib/rivets.min.js'
}
},
watch: {
files: 'src/rivets.coffee',
tasks: 'build spec'
},
});
grunt.loadNpmTasks('grunt-jasmine-task');
grunt.registerTask('compile', 'Compiles CoffeeScript source into JavaScript.', function(){
var coffee = require('coffee-script');
var js = coffee.compile(grunt.file.read('src/rivets.coffee'));
var banner = grunt.task.directive('<banner:meta.banner>', function() { return null; });
if (js) grunt.file.write('lib/rivets.js', banner + js);
});
grunt.registerTask('default', 'watch');
grunt.registerTask('spec', 'jasmine');
grunt.registerTask('build', 'compile min');
};
{
"name" : "rivets",
"description" : "Declarative data binding facility.",
"version" : "0.4.9",
"author" : "Michael Richards",
"url" : "http://rivetsjs.com",
"main" : "./lib/rivets.js",
"licenses" : [{
"type" : "MIT",
"url" : "https://github.com/mikeric/rivets/blob/master/LICENSE"
}],
"repository" : {
"type" : "git",
"url" : "https://github.com/mikeric/rivets.git"
"name": "rivets",
"description": "Declarative data binding facility.",
"version": "0.4.9",
"author": "Michael Richards",
"url": "http://rivetsjs.com",
"main": "./lib/rivets.js",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/mikeric/rivets/blob/master/LICENSE"
}
],
"repository": {
"type": "git",
"url": "https://github.com/mikeric/rivets.git"
},
"devDependencies" : {
"grunt" : "0.3.x",
"grunt-jasmine-task" : "0.2.x",
"coffee-script" : "1.3.x"
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-jasmine": "~0.4.2",
"grunt-contrib-watch": "~0.3.1"
}
}
......