@@ -59,8 +59,21 @@ function addManifest( packager ) {
5959function buildCDNPackage ( callback ) {
6060 console . log ( "Building CDN package" ) ;
6161 var JqueryUi = require ( "download.jqueryui.com/lib/jquery-ui" ) ;
62- var Package = require ( "download.jqueryui.com/lib/package-1-12-themes" ) ;
62+ var PackageWithoutThemes = require ( "download.jqueryui.com/lib/package-1-13" ) ;
63+ var PackageOfThemes = require ( "download.jqueryui.com/lib/package-1-13-themes" ) ;
6364 var Packager = require ( "node-packager" ) ;
65+
66+ // PackageOfThemes doesn't contain JS files, PackageWithoutThemes doesn't contain themes;
67+ // we need both.
68+ function Package ( ) {
69+
70+ // PackageOfThemes invokes PackageWithoutThemes's constructor in its own so we don't
71+ // need to do it by ourselves; we just need to handle prototypes that way.
72+ PackageOfThemes . apply ( this , arguments ) ;
73+ }
74+
75+ Object . assign ( Package . prototype , PackageWithoutThemes . prototype , PackageOfThemes . prototype ) ;
76+
6477 var jqueryUi = new JqueryUi ( path . resolve ( "." ) ) ;
6578 var target = fs . createWriteStream ( "../" + jqueryUi . pkg . name + "-" + jqueryUi . pkg . version +
6679 "-cdn.zip" ) ;
@@ -71,18 +84,22 @@ function buildCDNPackage( callback ) {
7184 jqueryUi : jqueryUi ,
7285 themeVars : null
7386 } ) ;
74- packager . ready . then ( function ( ) {
75- removeExternals ( packager ) ;
76- addManifest ( packager ) ;
77- packager . toZip ( target , {
78- basedir : ""
79- } , function ( error ) {
80- if ( error ) {
81- Release . abort ( "Failed to zip CDN package" , error ) ;
82- }
83- callback ( ) ;
87+ packager . ready
88+ . then ( function ( ) {
89+ removeExternals ( packager ) ;
90+ addManifest ( packager ) ;
91+ packager . toZip ( target , {
92+ basedir : ""
93+ } , function ( error ) {
94+ if ( error ) {
95+ Release . abort ( "Failed to zip the CDN package" , error ) ;
96+ }
97+ callback ( ) ;
98+ } ) ;
99+ } )
100+ . catch ( function ( error ) {
101+ Release . abort ( "Failed to create the CDN package" , error ) ;
84102 } ) ;
85- } ) ;
86103}
87104
88105Release . define ( {
@@ -123,7 +140,7 @@ Release.define( {
123140} ;
124141
125142module . exports . dependencies = [
126- "download.jqueryui.com@2.1.2 " ,
143+ "download.jqueryui.com@2.2.1 " ,
127144 "node-packager@0.0.6" ,
128- "shelljs@0.2.6 "
145+ "shelljs@0.8.4 "
129146] ;
0 commit comments