Skip to content

Commit de23503

Browse files
committed
Upgrade to Grunt 0.4
1 parent 2f3ef8f commit de23503

File tree

4 files changed

+63
-46
lines changed

4 files changed

+63
-46
lines changed

grunt.js renamed to Gruntfile.js

Lines changed: 52 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,22 @@
1-
/*global module:false*/
21
module.exports = function(grunt) {
32

4-
// Project configuration.
3+
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
4+
55
grunt.initConfig({
6-
pkg: '<json:package.json>',
6+
pkg: require('./package.json'),
77
meta: {
88
banner: '/*!\n' +
99
' * <%= pkg.title || pkg.name %> v<%= pkg.version %>\n' +
1010
' * <%= pkg.homepage %>\n' +
11-
' * \n' +
11+
' *\n' +
1212
' * Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %>\n' +
1313
' * This content is released under the <%= _.pluck(pkg.licenses, "type").join(", ") %> license<%= pkg.licenses.length === 1 ? "" : "s" %>\n' +
1414
' * <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' +
15-
' */',
16-
microbanner: '/*! <%= pkg.title || pkg.name %> v<%= pkg.version %> | Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %> | <%= pkg.homepage %> | <%= _.pluck(pkg.licenses, "url").join(", ") %> */'
17-
},
18-
lint: {
19-
files: ['grunt.js', 'test/**/*.js', 'src/**/*.js']
20-
},
21-
server: {
22-
port: 8573
23-
},
24-
qunit: {
25-
urls: ['1.4.3', '1.10.1', '2.0.2'].map(function(version) {
26-
return 'http://localhost:<%= server.port %>/test/jquery.stellar.html?jquery=' + version;
27-
})
28-
},
29-
concat: {
30-
dist: {
31-
src: ['<banner:meta.banner>', '<file_strip_banner:src/<%= pkg.name %>.js>'],
32-
dest: '<%= pkg.name %>.js'
33-
}
34-
},
35-
min: {
36-
dist: {
37-
src: ['<banner:meta.microbanner>', '<config:concat.dist.dest>'],
38-
dest: '<%= pkg.name %>.min.js'
39-
}
40-
},
41-
watch: {
42-
files: '<config:lint.files>',
43-
tasks: 'server lint qunit'
15+
' */\n\n',
16+
microbanner: '/*! <%= pkg.title || pkg.name %> v<%= pkg.version %> | Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %> | <%= pkg.homepage %> | <%= _.pluck(pkg.licenses, "url").join(", ") %> */\n'
4417
},
4518
jshint: {
19+
files: ['Gruntfile.js', 'test/**/*.js', 'src/**/*.js'],
4620
options: {
4721
evil: true,
4822
curly: false,
@@ -54,18 +28,55 @@ module.exports = function(grunt) {
5428
sub: true,
5529
undef: true,
5630
boss: true,
57-
browser: true
31+
browser: true,
32+
node: true,
33+
predef: {
34+
jQuery: true
35+
}
36+
}
37+
},
38+
connect: {
39+
server: {
40+
options: {
41+
port: 8573
42+
}
43+
}
44+
},
45+
qunit: {
46+
all: {
47+
options: {
48+
urls: ['1.4.3', '1.10.1', '2.0.2'].map(function(version) {
49+
return 'http://localhost:<%= connect.server.options.port %>/test/jquery.stellar.html?jquery=' + version;
50+
})
51+
}
52+
}
53+
},
54+
concat: {
55+
options: {
56+
banner: '<%= meta.banner %>',
57+
stripBanners: true
5858
},
59-
globals: {
60-
jQuery: true
59+
dist: {
60+
src: ['src/<%= pkg.name %>.js'],
61+
dest: '<%= pkg.name %>.js'
6162
}
6263
},
63-
uglify: {}
64+
uglify: {
65+
options: {
66+
banner: '<%= meta.microbanner %>'
67+
},
68+
dist: {
69+
src: ['<%= concat.dist.dest %>'],
70+
dest: '<%= pkg.name %>.min.js'
71+
}
72+
},
73+
watch: {
74+
files: '<%= jshint.files %>',
75+
tasks: ['server', 'jshint', 'qunit']
76+
}
6477
});
6578

66-
// Default task.
67-
grunt.registerTask('default', 'server lint qunit concat min');
68-
69-
grunt.registerTask('test', 'server lint qunit');
79+
grunt.registerTask('default', ['connect', 'jshint', 'qunit', 'concat', 'uglify']);
80+
grunt.registerTask('test', ['connect', 'jshint', 'qunit']);
7081

7182
};

jquery.stellar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*!
22
* Stellar.js v0.6.2
33
* http://markdalgleish.com/projects/stellar.js
4-
*
5-
* Copyright 2013, Mark Dalgleish
4+
*
5+
* Copyright 2014, Mark Dalgleish
66
* This content is released under the MIT license
77
* http://markdalgleish.mit-license.org
88
*/

0 commit comments

Comments
 (0)