Skip to content

Commit

Permalink
Rewrote grunt scripts and bumped version number
Browse files Browse the repository at this point in the history
  • Loading branch information
jylauril committed Mar 23, 2013
1 parent 9565377 commit da199f9
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 48 deletions.
82 changes: 39 additions & 43 deletions Gruntfile.js
@@ -1,76 +1,72 @@
/*global module:false*/
module.exports = function(grunt) {

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

// Project configuration.
grunt.initConfig({

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

meta: {
banner: '/*!\n * <%= pkg.title %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * <%= pkg.homepage %>/\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> ' +
'<%= pkg.author.name %> <<%= pkg.author.url %>>\n */',

lib: {
intro: ';(function($) {\n' +
'var meta = { ' +
'version: "<%= pkg.version %>", ' +
'name: "<%= pkg.title %>" ' +
'};',
outro: '})(window.jQuery);'
}
'<%= pkg.author.name %> <<%= pkg.author.url %>>\n */\n'
},

clean: {
files: ['build/**/*']
options: {
force: true
},
build: ["build"]
},

coffee: {
lib: {
src: '<%= pkg.directories.lib %>/**/*.coffee',
options: {
preserve_dirs: true
options: {
join: true,
bare: false
},
files: {
'<%= pkg.directories.build %>/<%= pkg.name %>.js': [
'<%= pkg.directories.lib %>/utils.coffee',
'<%= pkg.directories.lib %>/runner.coffee',
'<%= pkg.directories.lib %>/expose.coffee'
]
}
}
},
},

concat: {
lib: {
src: [
'<banner:meta.banner>',
'<banner:meta.lib.intro>',
'<%= pkg.directories.lib %>/utils.js',
'<%= pkg.directories.lib %>/runner.js',
'<%= pkg.directories.lib %>/expose.js',
'<banner:meta.lib.outro>'
],
finish: {
options: {
banner: '<%= meta.banner %>',
process: true
},
src: ['<%= pkg.directories.build %>/<%= pkg.name %>.js'],
dest: '<%= pkg.directories.build %>/<%= pkg.name %>.js'
}
},

min: {
uglify: {
options: {
banner: '<%= meta.banner %>'
},
lib: {
src: ['<banner:meta.banner>', '<config:concat.lib.dest>'],
dest: '<%= pkg.directories.build %>/<%= pkg.name %>-min.js'
}
},

watch: {
coffee: {
files: '<config:coffee.lib.src>',
tasks: 'coffee'
files: {
'<%= pkg.directories.build %>/<%= pkg.name %>-min.js': '<%= concat.finish.dest %>'
}
}
}
});

grunt.registerTask('default', 'clean coffee concat');
grunt.registerTask('minify', 'min');
grunt.registerTask('release', 'default minify');
grunt.registerTask('lib', 'coffee:lib concat:lib');
grunt.registerTask('lib-min', 'concat:lib min:lib');
};
grunt.registerTask('default', ['clean', 'coffee', 'concat']);
grunt.registerTask('release', ['default', 'uglify']);
grunt.registerTask('lib', ['coffee', 'concat']);
};
11 changes: 7 additions & 4 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "jquery.runner",
"title": "jQuery-runner",
"version": "2.1.1",
"version": "2.1.2",
"description": "A simple runner/stopwatch jQuery plugin for counting time up and down.",
"homepage": "https://github.com/jylauril/jquery-runner",
"main": "build/jquery.runner.js",
Expand Down Expand Up @@ -54,8 +54,11 @@
],
"license": "MIT",
"dependencies": {
"grunt": ">=0.3.17",
"grunt-contrib": ">=0.3.0",
"grunt-coffee": "0.0.6"
"grunt": ">=0.4.0",
"grunt-contrib-uglify": ">=0.1.2",
"grunt-contrib-concat": ">=0.1.3",
"grunt-contrib-clean": ">=0.4.0",
"grunt-contrib-copy": ">=0.4.0",
"grunt-contrib-coffee": ">=0.6.0"
}
}
2 changes: 1 addition & 1 deletion runner.jquery.json
@@ -1,7 +1,7 @@
{
"name": "runner",
"title": "jQuery-runner",
"version": "2.1.1",
"version": "2.1.2",
"description": "A simple runner/stopwatch jQuery plugin for counting time up and down.",
"homepage": "https://github.com/jylauril/jquery-runner",
"docs": "https://github.com/jylauril/jquery-runner",
Expand Down

0 comments on commit da199f9

Please sign in to comment.