Skip to content

Commit db1d514

Browse files
authored
All: Drop support for jQuery UI 1.11 & below
Closes gh-613
1 parent 1cf4bd7 commit db1d514

39 files changed

+68
-5263
lines changed

Gruntfile.js

+9-213
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function log( callback, successMsg, errorMsg ) {
104104

105105
function cloneOrFetch( callback ) {
106106
async.series( [
107-
function( callback ) {
107+
function() {
108108
if ( fs.existsSync( "tmp/jquery-ui" ) ) {
109109
grunt.log.writeln( "Fetch updates for jquery-ui repo" );
110110
async.series( [
@@ -141,31 +141,6 @@ function cloneOrFetch( callback ) {
141141
}
142142
}, log( callback, "Cloned repo", "Error cloning repo" ) );
143143
}
144-
},
145-
function() {
146-
if ( fs.existsSync( "tmp/api.jqueryui.com" ) ) {
147-
grunt.log.writeln( "Fetch updates for api.jqueryui.com repo" );
148-
grunt.util.spawn( {
149-
cmd: "git",
150-
args: [ "fetch" ],
151-
opts: {
152-
cwd: "tmp/api.jqueryui.com"
153-
}
154-
}, log( callback, "Fetched repo", "Error fetching repo" ) );
155-
} else {
156-
grunt.log.writeln( "Cloning api.jqueryui.com repo" );
157-
grunt.util.spawn( {
158-
cmd: "git",
159-
args: [
160-
"clone",
161-
"https://github.com/jquery/api.jqueryui.com.git",
162-
"api.jqueryui.com"
163-
],
164-
opts: {
165-
cwd: "tmp"
166-
}
167-
}, log( callback, "Cloned repo", "Error cloning repo" ) );
168-
}
169144
}
170145
] );
171146
}
@@ -176,123 +151,15 @@ function checkout( jqueryUi ) {
176151
async.series( [
177152

178153
// Check out jquery-ui
179-
function( next ) {
154+
function() {
180155
grunt.log.writeln( "Checking out jquery-ui branch/tag: " + ref );
181156
grunt.util.spawn( {
182157
cmd: "git",
183158
args: [ "checkout", "-f", ref ],
184159
opts: {
185160
cwd: "tmp/jquery-ui"
186161
}
187-
}, log( jqueryUi.docs ? next : callback, "Done with checkout", "Error checking out" ) );
188-
},
189-
190-
// Check out api.jqueryui.com
191-
function() {
192-
var docRef = "origin/master";
193-
async.series( [
194-
195-
// Get the correct documentation for jquery-ui version
196-
function( callback ) {
197-
198-
// If ref is a branch, then get documentation "master" branch.
199-
if ( !( /^\d+.\d+/ ).test( ref ) ) {
200-
return callback();
201-
}
202-
203-
// If ref is a tag, then get its corresponding <major>-<minor> branch, if available or "master".
204-
grunt.util.spawn( {
205-
cmd: "git",
206-
args: [ "branch", "-a" ],
207-
opts: {
208-
cwd: "tmp/api.jqueryui.com"
209-
}
210-
}, function( error, docBranches ) {
211-
docBranches = String( docBranches );
212-
if ( error ) {
213-
grunt.log.error( "Error listing branches: " + error.stderr );
214-
} else {
215-
var correspondingBranch = ref.replace( /^(\d+).(\d+).*/, "$1-$2" ),
216-
isCorrespondingBranch = function( branch ) {
217-
return ( new RegExp( "origin/" + correspondingBranch + "$" ) ).test( branch );
218-
};
219-
if ( docBranches.split( "\n" ).some( isCorrespondingBranch ) ) {
220-
docRef = correspondingBranch;
221-
} else {
222-
grunt.log.writeln( "Did not find a \"" + correspondingBranch + "\" branch, using \"master\"" );
223-
}
224-
callback();
225-
}
226-
} );
227-
},
228-
function() {
229-
grunt.log.writeln( "Checking out api.jqueryui.com branch/tag: " + docRef );
230-
grunt.util.spawn( {
231-
cmd: "git",
232-
args: [ "checkout", "-f", docRef ],
233-
opts: {
234-
cwd: "tmp/api.jqueryui.com"
235-
}
236-
}, log( callback, "Done with checkout", "Error checking out" ) );
237-
}
238-
] );
239-
}
240-
] );
241-
};
242-
}
243-
244-
function install( jqueryUi ) {
245-
return function( callback ) {
246-
async.series( [
247-
function( next ) {
248-
if ( !jqueryUi.docs ) {
249-
return next();
250-
}
251-
grunt.log.writeln( "Installing api.jqueryui.com npm modules" );
252-
grunt.util.spawn( {
253-
cmd: "npm",
254-
args: [ "prune" ],
255-
opts: {
256-
cwd: "tmp/api.jqueryui.com"
257-
}
258-
}, log( next, null, "Error pruning npm modules" ) );
259-
},
260-
function() {
261-
if ( !jqueryUi.docs ) {
262-
return callback();
263-
}
264-
grunt.util.spawn( {
265-
cmd: "npm",
266-
args: [ "install" ],
267-
opts: {
268-
cwd: "tmp/api.jqueryui.com"
269-
}
270-
}, log( callback, "Installed npm modules", "Error installing npm modules" ) );
271-
}
272-
] );
273-
};
274-
}
275-
276-
function prepare( jqueryUi ) {
277-
return function( callback ) {
278-
async.series( [
279-
function() {
280-
if ( !jqueryUi.docs ) {
281-
return callback();
282-
}
283-
grunt.log.writeln( "Building API documentation for jQuery UI" );
284-
if ( !fs.existsSync( "tmp/api.jqueryui.com/config.json" ) ) {
285-
grunt.file.copy( "tmp/api.jqueryui.com/config-sample.json", "tmp/api.jqueryui.com/config.json" );
286-
grunt.log.writeln( "Copied config-sample.json to config.json" );
287-
}
288-
fs.rmSync( "tmp/api.jqueryui.com/dist", { recursive: true, force: true } );
289-
grunt.util.spawn( {
290-
cmd: "node_modules/.bin/grunt",
291-
args: [ "build", "--stack" ],
292-
opts: {
293-
cwd: "tmp/api.jqueryui.com"
294-
}
295-
}, log( callback, "Done building documentation", "Error building documentation" ) );
162+
}, log( callback, "Done with checkout", "Error checking out" ) );
296163
}
297164
] );
298165
};
@@ -319,7 +186,7 @@ function copy( jqueryUi ) {
319186
next();
320187
}
321188
},
322-
function( next ) {
189+
function() {
323190
var from = "tmp/jquery-ui",
324191
to = "jquery-ui/" + ref;
325192
grunt.log.writeln( "Copying jQuery UI " + version + " over to jquery-ui/" + ref );
@@ -335,35 +202,10 @@ function copy( jqueryUi ) {
335202
} );
336203
} catch ( e ) {
337204
grunt.log.error( "Error copying", e.toString() );
338-
return ( jqueryUi.docs ? next : callback )( e );
205+
return callback( e );
339206
}
340207
grunt.log.ok( "Done copying" );
341-
( jqueryUi.docs ? next : callback )();
342-
},
343-
function( callback ) {
344-
var srcpath = "tmp/api.jqueryui.com/dist/wordpress",
345-
destpath = "jquery-ui/" + ref + "/docs/";
346-
grunt.log.writeln( "Copying API documentation for jQuery UI over to " + destpath );
347-
[ srcpath + "/posts/post", srcpath + "/posts/page" ].forEach( function( srcpath ) {
348-
grunt.file.expand( { filter: "isFile" }, srcpath + "/**" ).forEach( function( file ) {
349-
350-
// OBS: No overwrite check is needed, because the posts/pages basenames must be unique among themselves.
351-
grunt.file.copy( file, file.replace( srcpath, destpath ) );
352-
} );
353-
} );
354208
callback();
355-
},
356-
function() {
357-
var removePath = ref + "/node_modules";
358-
grunt.log.writeln( "Cleaning up copied jQuery UI" );
359-
const rmCallback = log( callback, `Removed jquery-ui/${ removePath }`, `Error removing jquery-ui/${ removePath }` );
360-
fsp.rm( `jquery-ui/${ removePath }`, { recursive: true, force: true } )
361-
.then( () => {
362-
rmCallback( null, "OK", 0 );
363-
} )
364-
.catch( error => {
365-
rmCallback( error, null, 1 );
366-
} );
367209
}
368210
] );
369211
};
@@ -375,8 +217,6 @@ function prepareAll( callback ) {
375217
async.forEachSeries( config.jqueryUi, function( jqueryUi, callback ) {
376218
async.series( [
377219
checkout( jqueryUi ),
378-
install( jqueryUi ),
379-
prepare( jqueryUi ),
380220
copy( jqueryUi )
381221
], function( err ) {
382222

@@ -420,77 +260,33 @@ function packagerZip( packageModule, zipBasedir, themeVars, folder, jqueryUi, ca
420260
}
421261

422262
function buildPackages( folder, callback ) {
423-
var Builder = require( "./lib/builder" ),
424-
fs = require( "fs" ),
425-
path = require( "path" ),
426-
JqueryUi = require( "./lib/jquery-ui" ),
427-
Packer = require( "./lib/packer" ),
428-
ThemeGallery = require( "./lib/themeroller-themegallery" ),
429-
ThemesPacker = require( "./lib/themes-packer" );
263+
var JqueryUi = require( "./lib/jquery-ui" ),
264+
ThemeGallery = require( "./lib/themeroller-themegallery" );
430265

431266
// For each jQuery UI release specified in the config file:
432267
async.forEachSeries( JqueryUi.all(), function( jqueryUi, callback ) {
433-
var builder = new Builder( jqueryUi, ":all:" );
434-
435268
async.series( [
436269

437270
// (a) Build jquery-ui-[VERSION].zip;
438271
function( callback ) {
439272
if ( semver.gte( jqueryUi.pkg.version, "1.13.0-a" ) ) {
440273
packagerZip( "./lib/package-1-13", "jquery-ui-" + jqueryUi.pkg.version,
441274
new ThemeGallery( jqueryUi )[ 0 ].vars, folder, jqueryUi, callback );
442-
return;
443-
}
444-
if ( semver.gte( jqueryUi.pkg.version, "1.12.0-a" ) ) {
275+
} else {
445276
packagerZip( "./lib/package-1-12", "jquery-ui-" + jqueryUi.pkg.version,
446277
new ThemeGallery( jqueryUi )[ 0 ].vars, folder, jqueryUi, callback );
447-
return;
448-
}
449-
var stream,
450-
theme = new ThemeGallery( jqueryUi )[ 0 ],
451-
packer = new Packer( builder, theme, { bundleSuffix: "" } ),
452-
filename = path.join( folder, packer.filename() );
453-
grunt.log.ok( "Building \"" + filename + "\"" );
454-
if ( fs.existsSync( filename ) ) {
455-
grunt.log.warn( filename + "\" already exists. Skipping..." );
456-
return callback();
457278
}
458-
stream = fs.createWriteStream( filename );
459-
packer.zipTo( stream, function( error ) {
460-
if ( error ) {
461-
return callback( error );
462-
}
463-
return callback();
464-
} );
465279
},
466280

467281
// (b) Build themes package jquery-ui-themes-[VERSION].zip;
468282
function( callback ) {
469283
if ( semver.gte( jqueryUi.pkg.version, "1.13.0-a" ) ) {
470284
packagerZip( "./lib/package-1-13-themes", "jquery-ui-themes-" + jqueryUi.pkg.version,
471285
null, folder, jqueryUi, callback );
472-
return;
473-
}
474-
if ( semver.gte( jqueryUi.pkg.version, "1.12.0-a" ) ) {
286+
} else {
475287
packagerZip( "./lib/package-1-12-themes", "jquery-ui-themes-" + jqueryUi.pkg.version,
476288
null, folder, jqueryUi, callback );
477-
return;
478289
}
479-
var stream,
480-
packer = new ThemesPacker( builder ),
481-
filename = path.join( folder, packer.filename() );
482-
grunt.log.ok( "Building \"" + filename + "\"" );
483-
if ( fs.existsSync( filename ) ) {
484-
grunt.log.warn( filename + "\" already exists. Skipping..." );
485-
return callback();
486-
}
487-
stream = fs.createWriteStream( filename );
488-
packer.zipTo( stream, function( error, result ) {
489-
if ( error ) {
490-
return callback( error );
491-
}
492-
return callback();
493-
} );
494290
}
495291

496292
], function( error ) {

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jQuery UI DownloadBuilder & ThemeRoller backend and frontend application.
44
- [node >= 18 and npm](https://nodejs.org/en/download/)
55
- ImageMagick 6.6.x. ([see below for instructions to compile it from source](#compile-and-install-imagemagick-from-source))
66
- grunt-cli: `npm install -g grunt-cli`
7-
- [api.jqueryui.com](https://github.com/jquery/api.jqueryui.com#requirements) requirements.
87

98
## Getting Started
109

@@ -33,14 +32,14 @@ Use the config file to define which jQueryUI version DownloadBuilder should serv
3332
```
3433
"jqueryUi": [
3534
{
36-
"version": "1.10.0"
37-
"dependsOn": "jQuery 1.7+",
35+
"version": "1.14.0"
36+
"dependsOn": "jQuery 1.12+",
3837
"label": "Stable",
3938
"stable": true
4039
},
4140
{
42-
"version": "1.9.1"
43-
"dependsOn": "jQuery 1.6+",
41+
"version": "1.13.3"
42+
"dependsOn": "jQuery 1.8+",
4443
"label": "Legacy"
4544
}
4645
}

app/src/download.js

-3
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,6 @@
342342
if ( "version" in changed ) {
343343
versionElement = $( "#download-builder input[type=radio][name=version][value=\"" + model.get( "version" ) + "\"]" );
344344
versionElement.trigger( "click" );
345-
themesLoad.done( function() {
346-
$( ".advanced-settings .folder-name-area" ).toggle( !versionElement.data( "no-theme-folder" ) );
347-
} );
348345
if ( created.version ) {
349346
initComponents( initialComponents );
350347
} else {

config.json

-17
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,6 @@
1414
"version": "1.12.1",
1515
"dependsOn": "jQuery1.7+",
1616
"label": "Legacy"
17-
},
18-
{
19-
"version": "1.11.4",
20-
"dependsOn": "jQuery1.6+",
21-
"label": "Legacy"
22-
},
23-
{
24-
"version": "1.10.4",
25-
"dependsOn": "jQuery1.6+",
26-
"label": "Legacy",
27-
"docs": true
28-
},
29-
{
30-
"version": "1.9.2",
31-
"dependsOn": "jQuery1.6+",
32-
"label": "Legacy",
33-
"docs": true
3417
}
3518
],
3619
"jquery": "3.7.1"

0 commit comments

Comments
 (0)