Skip to content

Commit f91b6b2

Browse files
committed
Packer: Simplify jQuery UI 1.11 package
Drop unused variables. Amend 462b732 Ref gh-207 gh-214
1 parent 462b732 commit f91b6b2

File tree

3 files changed

+7
-45
lines changed

3 files changed

+7
-45
lines changed

lib/builder-1-11.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function rjsConfig( attributes ) {
9393
* Builder 1.11
9494
*/
9595
function Builder_1_11_0( build, jqueryUi, components, options, callback ) {
96-
var _bundleCss, cssComponentFileNames, docsCategories, existingCss, selectedDemoRe, selectedRe, structureCss, structureCssBanner, structureCssMin,
96+
var _bundleCss, cssComponentFileNames, existingCss, selectedDemoRe, selectedRe, structureCss, structureCssBanner, structureCssMin,
9797
files = jqueryUi.files(),
9898
min = function( file ) {
9999
return files.min( file );
@@ -174,9 +174,6 @@ function Builder_1_11_0( build, jqueryUi, components, options, callback ) {
174174
});
175175
};
176176

177-
// Test files
178-
build.testFiles = files.testFiles;
179-
180177
// Ad hoc
181178
build.jqueryCore = files.jqueryCore;
182179

lib/jquery-ui-files-1-11.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,12 @@ function JqueryUiFiles_1_11_0( jqueryUi ) {
5252
return glob( jqueryUi.path + path ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile );
5353
}).reduce( flatten, Files() );
5454

55-
this.demoFiles = Files( glob( jqueryUi.path + "demos/*/**" ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile ) );
56-
57-
this.docFiles = Files( glob( jqueryUi.path + "docs/**" ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile ) );
58-
5955
this.i18nFiles = Files( glob( jqueryUi.path + "ui/i18n/*" ).map( stripJqueryUiPath ).map( readFile ) );
6056

61-
this.testFiles = testFiles.map(function( path ) {
62-
return glob( jqueryUi.path + path ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile );
63-
}).reduce( flatten, Files() );
64-
65-
this.baseThemeFiles = Files( glob( jqueryUi.path + "themes/base/**" ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile ) );
66-
6757
this.jqueryCore = Files( glob( jqueryUi.path + "jquery.js" ).map( stripJqueryUiPath ).map( readFile ) );
6858

6959
// Auxiliary variables
7060
this.baseThemeCss = this.get( "themes/base/theme.css" );
71-
this.demoSubdirs = glob( jqueryUi.path + "demos/*" ).filter( isDirectory ).map(function( filepath ) {
72-
// Get basename only with no trailing slash
73-
return path.basename( filepath ).replace( /\/$/, "" );
74-
}).sort();
75-
this.docsCategories = Docs.categories( optional( jqueryUi.path + "docs/categories.json" ) );
7661
}
7762

7863
module.exports = JqueryUiFiles_1_11_0;

test/jquery-ui.js

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
var JqueryUi = require( "../lib/jquery-ui" );
1+
var JqueryUi = require( "../lib/jquery-ui" ),
2+
semver = require( "semver" );
23

34
function notNull( data ) {
45
if ( data instanceof Buffer ) {
@@ -26,37 +27,16 @@ var tests = {
2627
test.ok( notNull( file.data ), "Null file \"" + file.path + "\"." );
2728
});
2829
test.done();
29-
},
30-
"test: demo files present": function( test ) {
31-
var files = this.jqueryUi.files();
32-
test.expect( files.demoFiles.length );
33-
files.demoFiles.forEach(function( file ) {
34-
test.ok( notNull( file.data ), "Null file \"" + file.path + "\"." );
35-
});
36-
test.done();
37-
},
38-
"test: doc files present": function( test ) {
39-
var files = this.jqueryUi.files();
40-
test.expect( files.docFiles.length );
41-
files.docFiles.forEach(function( file ) {
42-
test.ok( notNull( file.data ), "Null file \"" + file.path + "\"." );
43-
});
44-
test.done();
45-
},
46-
"test: base theme files present": function( test ) {
47-
var files = this.jqueryUi.files();
48-
test.expect( files.baseThemeFiles.length );
49-
files.baseThemeFiles.forEach(function( file ) {
50-
test.ok( notNull( file.data ), "Null file \"" + file.path + "\"." );
51-
});
52-
test.done();
5330
}
5431
};
5532

5633
module.exports = {};
5734

5835
// Build tests for each jqueryUi release
59-
JqueryUi.all().forEach(function( jqueryUi ) {
36+
JqueryUi.all().filter(function( jqueryUi ) {
37+
// Filter supported releases only
38+
return semver.gte( jqueryUi.pkg.version, "1.11.0-a" );
39+
}).forEach(function( jqueryUi ) {
6040
function deepTestBuild( obj, tests ) {
6141
Object.keys( tests ).forEach(function( i ) {
6242
if ( typeof tests[ i ] === "object" ) {

0 commit comments

Comments
 (0)