Skip to content

Commit c768fee

Browse files
committed
Put Bower support (bower.json) back in. Fixes kswedberg#91
1 parent bf6705f commit c768fee

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

Gruntfile.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,26 @@ module.exports = function(grunt) {
130130
grunt.file.write('index.html', head + doc + foot);
131131
});
132132

133+
grunt.registerTask('updateBower', 'Update bower.json to match package.json', function() {
134+
var pkg = require('./package.json');
135+
var props = ['name', 'main', 'homepage', 'repository', 'dependencies', 'keywords', 'license'];
136+
var json = {
137+
description: 'Easy implementation of smooth scrolling for same-page links'
138+
};
139+
140+
props.forEach(function(item) {
141+
if (pkg[item]) {
142+
json[item] = pkg[item];
143+
}
144+
});
145+
146+
json.authors = [pkg.author];
147+
json.moduleType = ['amd', 'node'];
148+
json.ignore = ['demo/', 'lib/', 'src/', 'test/', '**/.*', 'Gruntfile.js', 'package.json'];
149+
150+
grunt.file.write('bower.json', JSON.stringify(json, null, 2));
151+
});
152+
133153
grunt.registerTask('lint', ['jshint', 'jscs']);
134154
grunt.registerTask('build', ['lint', 'concat', 'version', 'uglify', 'docs']);
135155
grunt.registerTask('patch', ['lint', 'concat', 'version::patch', 'uglify']);

bower.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"description": "Easy implementation of smooth scrolling for same-page links",
3+
"name": "jquery-smooth-scroll",
4+
"main": "jquery.smooth-scroll.js",
5+
"homepage": "https://github.com/kswedberg/jquery-smooth-scroll",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/kswedberg/jquery-smooth-scroll"
9+
},
10+
"dependencies": {
11+
"jquery": ">=1.4.2"
12+
},
13+
"keywords": [
14+
"jQuery",
15+
"jquery-plugin",
16+
"scroll",
17+
"animation"
18+
],
19+
"license": "MIT",
20+
"authors": [
21+
{
22+
"name": "Karl Swedberg",
23+
"email": "kswedberg@gmail.com",
24+
"url": "http://www.learningjquery.com/"
25+
}
26+
],
27+
"moduleType": [
28+
"amd",
29+
"node"
30+
],
31+
"ignore": [
32+
"demo/",
33+
"lib/",
34+
"src/",
35+
"test/",
36+
"**/.*",
37+
"Gruntfile.js",
38+
"package.json"
39+
]
40+
}

0 commit comments

Comments
 (0)