Build: Fix manifest dependencies

Clone bower dependencies instead of reusing and modifying the same object
multiple times.
This commit is contained in:
Jörn Zaefferer 2014-05-07 22:39:21 +02:00
parent 56e092d43d
commit 6ef5c3844d

View File

@ -38,7 +38,7 @@ grunt.registerTask( "manifest", "Generate jquery.json manifest files", function(
bower = grunt.file.readJSON( "bower.json" ); bower = grunt.file.readJSON( "bower.json" );
Object.keys( plugins ).forEach(function( plugin ) { Object.keys( plugins ).forEach(function( plugin ) {
var manifest, var manifest, bowerKey,
data = plugins[ plugin ], data = plugins[ plugin ],
name = plugin.charAt( 0 ).toUpperCase() + plugin.substr( 1 ); name = plugin.charAt( 0 ).toUpperCase() + plugin.substr( 1 );
@ -65,11 +65,15 @@ grunt.registerTask( "manifest", "Generate jquery.json manifest files", function(
docs: data.docs || replace( baseManifest.docs || docs: data.docs || replace( baseManifest.docs ||
"http://api.jqueryui.com/{plugin}/" ), "http://api.jqueryui.com/{plugin}/" ),
download: "http://jqueryui.com/download/", download: "http://jqueryui.com/download/",
dependencies: bower.dependencies, dependencies: {},
// custom // custom
category: data.category || type category: data.category || type
}; };
for ( bowerKey in bower.dependencies ) {
manifest.dependencies[ bowerKey ] = bower.dependencies[ bowerKey ];
}
(baseManifest.dependencies || []) (baseManifest.dependencies || [])
.concat(data.dependencies || []) .concat(data.dependencies || [])
.forEach(function( dependency ) { .forEach(function( dependency ) {