Skip to content

Commit a620f73

Browse files
committed
Add component.json for Bower
1 parent 1bf802e commit a620f73

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

component.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name":"jquery.smooth-scroll","title":"Smooth Scroll","description":"Easy implementation of smooth scrolling for same-page links","version":"1.4.7","homepage":"","author":{"name":"Karl Swedberg","email":"kswedberg@gmail.com","url":"http://www.learningjquery.com/"},"repository":{"type":"git","url":"https://github.com/kswedberg/jquery-smooth-scroll"},"bugs":{"url":"https://github.com/kswedberg/jquery-smooth-scroll/issues"},"licenses":[{"type":"MIT","url":"/blob/master/LICENSE-MIT"},{"type":"GPL","url":"/blob/master/LICENSE-GPL"}],"dependencies":{"jquery":"~1.3"},"keywords":[]}

grunt.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = function(grunt) {
44
// Project configuration.
55
grunt.initConfig({
66
pkg: '<json:smooth-scroll.jquery.json>',
7+
component: './component.json',
78
meta: {
89
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
910
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
@@ -60,11 +61,17 @@ module.exports = function(grunt) {
6061
// Concat specified files.
6162
var name = this.file.dest,
6263
files = grunt.file.expandFiles( this.file.src ),
64+
comp = grunt.config('component'),
65+
pkg = grunt.config("pkg"),
6366
compiled = grunt.helper('concat', files, {separator: this.data.separator}),
64-
version = "version = '" + grunt.config("pkg.version") + "'";
67+
version = "version = '" + pkg.version + "'";
6568

6669
// compiled = '/* concatenated files:\n' + this.file.src.join(', ') + '\n*/\n\n' + compiled;
6770

71+
// update components.json
72+
73+
grunt.file.write( comp, JSON.stringify(pkg) );
74+
6875
// Embed Version
6976
compiled = compiled.replace( /version = '[^']+'/, version );
7077
// Write concatenated source to file
@@ -77,6 +84,7 @@ module.exports = function(grunt) {
7784

7885
// Otherwise, print a success message.
7986
grunt.log.writeln( "File '" + name + "' created." );
87+
grunt.log.writeln( "File '" + comp + "' updated." );
8088
});
8189

8290
};

0 commit comments

Comments
 (0)