Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: node_js
node_js:
- "0.12"
before_script:
- sudo apt-get install xsltproc
- npm install -g grunt-cli
- grunt prepare
7 changes: 5 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ grunt.initConfig({
function log( callback, successMsg, errorMsg ) {
return function( error, result, code ) {
if ( error && errorMsg ) {
grunt.log.error( errorMsg + ": " + error );
grunt.log.error( errorMsg );
grunt.log.error( error );
grunt.log.error( result.stdout );
grunt.log.error( result.stderr );
} else if ( ! error && successMsg ) {
grunt.log.ok( successMsg );
}
Expand Down Expand Up @@ -306,7 +309,7 @@ function prepare( jqueryUi ) {
rimraf.sync( "tmp/api.jqueryui.com/dist" );
grunt.util.spawn({
cmd: "grunt",
args: [ "build" ],
args: [ "build", "--stack" ],
opts: {
cwd: "tmp/api.jqueryui.com"
}
Expand Down
18 changes: 15 additions & 3 deletions app/src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,23 @@
if ( !thisName || !thisDependencies ) {
return;
}
thisDependencies = thisDependencies.split( "," );

// Adjust path prefixes to match names
var path = thisName.match( /^(.+)\// );
thisDependencies = thisDependencies.split( "," ).map(function( dependency ) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a questionable amount of processing, but seems solid enough.

if ( !path ) {
return dependency;
}
if ( /\.\.\//.test( dependency ) ) {
return dependency.replace( /^.+\//, "" );
}
return path[ 1 ] + "/" + dependency;
});

dependencies[ thisName ] = $();
$.each( thisDependencies, function() {
var dependecy = this,
dependecyElem = $( "[name=" + this + "]" );
dependecyElem = $( ".components-area input[type=checkbox][name='" + this + "']" );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ended up selecting the version radio input, instead of the "version" module (which we don't show).

dependencies[ thisName ] = dependencies[ thisName ].add( dependecyElem );
if ( !dependents[ dependecy ] ) {
dependents[ dependecy ] = $();
Expand Down Expand Up @@ -318,7 +330,7 @@
});

if ( "version" in changed ) {
versionElement = $( "#download-builder [name=version][value=\"" + model.get( "version" ) + "\"]" );
versionElement = $( "#download-builder input[type=radio][name=version][value=\"" + model.get( "version" ) + "\"]" );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made this selector more specific as well.

versionElement.trigger( "click" );
themesLoad.done(function() {
$( ".advanced-settings .folder-name-area" ).toggle( !versionElement.data( "no-theme-folder" ) );
Expand Down
5 changes: 5 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"jqueryUi": [
{
"version": "origin/master",
"dependsOn": "jQuery1.7+",
"label": "preview"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm considering deploying this live, replacing version and label once we've got the beta out.

},
{
"version": "1.11.4",
"dependsOn": "jQuery1.6+",
Expand Down
18 changes: 12 additions & 6 deletions lib/jquery-ui-1-12.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
var categories, orderedComponents,
_ = require( "underscore" ),
fs = require( "fs" ),
glob = require( "./util" ).glob,
path = require( "path" );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unused.


categories = {
"UI Core": {
name: "UI Core",
description: "A required dependency, contains basic functions and initializers.",
"Core": {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be addressed in UI itself, improving the categories we use for "Core" files. Currently we have both "UI Core" and "Core", which makes no sense. We may want to create a "Utilities" category.

name: "Core",
description: "Various utilities and helpers",
order: 0
},
"Interactions": {
Expand Down Expand Up @@ -68,9 +67,16 @@ function get( data, key ) {
return match && match[ 1 ];
}

function trim( string ) {
return string.trim();
}

function getDependencies( data ) {
var match = data.match( /define\((\ ?\[[\s\S]*?\]\ ?), factory \);/ );
return match && JSON.parse( match[ 1 ] ) || [];
var match = data.match( /define\(\[([^\]]*?)\]/ );
if ( match === null ) {
return [];
}
return match[ 1 ].replace( /\/\/.+/g, "" ).replace( /"/, "" ).split( "," ).map( trim );
}

function JqueryUiManifests_1_12_0() {
Expand Down
2 changes: 1 addition & 1 deletion lib/jquery-ui-files-1-12.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function JqueryUiFiles_1_12_0( jqueryUi ) {
glob( jqueryUi.path + "!(node_modules|build)" ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile );
glob( jqueryUi.path + "!(node_modules|build)/**" ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile );

this.componentFiles = Files( glob( jqueryUi.path + "ui/*.js" ).map( stripJqueryUiPath ).map( readFile ) );
this.componentFiles = Files( glob( jqueryUi.path + "ui/**/*.js" ).map( stripJqueryUiPath ).map( readFile ) );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've got subfolders!


// Convert {path:<path>, data:<data>} into {path: <data>}.
files = this.cache;
Expand Down
5 changes: 4 additions & 1 deletion lib/package-1-12.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extend( Package.prototype, {
}
return indexTemplate({
ui: this.runtime.components.reduce(function( sum, component ) {
sum[ component ] = true;
sum[ component.replace( /^.+\//, "" ) ] = true;
return sum;
}, {}),
version: version
Expand Down Expand Up @@ -186,6 +186,9 @@ extend( Package.prototype, {
appDir: "ui",
include: this.runtime.components,
onCssBuildWrite: function( _path, data ) {
if ( data === undefined) {
throw new Error( "onCssBuildWrite failed (data is undefined) for path " + _path );
}
structureCssFileNames.push( path.basename( _path ) );
return stripBanner( data );
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"async": "0.1.22",
"bower": "1.3.8",
"builder-amd": "0.0.x",
"builder-jquery-css": "0.0.x",
"builder-jquery-css": "0.0.3",
"connect": "1.9.2",
"dateformat": "1.0.2-1.2.3",
"formidable": "1.0.9",
Expand All @@ -26,7 +26,7 @@
"handlebars": "1.0.12",
"jquery-ui-themeroller": "0.0.x",
"lzma": "1.2.1",
"node-packager": "0.0.5",
"node-packager": "0.0.6",
"optimist": "0.3.4",
"q": "1.1.2",
"requirejs": "2.1.8",
Expand Down
48 changes: 31 additions & 17 deletions test/package-1-12.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ function filePresent( files, filepath ) {
}

defaultTheme = themeGallery[ 0 ].vars;
someWidgets1 = "widget core position autocomplete button menu progressbar spinner tabs".split( " " );
someWidgets2 = "widget core mouse position draggable resizable button datepicker dialog slider tooltip".split( " " );
someWidgets1 = "widget core position widgets/autocomplete widgets/button widgets/menu widgets/progressbar widgets/spinner widgets/tabs".split( " " );
someWidgets2 = "widget core widgets/mouse position widgets/draggable widgets/resizable widgets/button widgets/datepicker widgets/dialog widgets/slider widgets/tooltip".split( " " );

commonFiles = [
"external/jquery/jquery.js",
Expand Down Expand Up @@ -57,9 +57,11 @@ tests = {
components: this.allComponents,
themeVars: defaultTheme
});
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES + 1 );
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES );
pkg.toJson(function( error, files ) {
test.ifError( error );
if (error) {
return test.done( error );
}
commonFilesCheck( test, files );
themeFilesCheck( test, files, true );
test.done();
Expand All @@ -70,9 +72,11 @@ tests = {
components: this.allComponents,
themeVars: themeGallery[ 1 ].vars
});
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES + 1 );
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES );
pkg.toJson(function( error, files ) {
test.ifError( error );
if (error) {
return test.done( error );
}
commonFilesCheck( test, files );
themeFilesCheck( test, files, true );
test.done();
Expand All @@ -84,9 +88,11 @@ tests = {
components: this.allWidgets,
themeVars: defaultTheme
});
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES + 1 );
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES );
pkg.toJson(function( error, files ) {
test.ifError( error );
if (error) {
return test.done( error );
}
commonFilesCheck( test, files );
themeFilesCheck( test, files, true );
test.done();
Expand All @@ -95,11 +101,13 @@ tests = {
"test: select all effects": function( test ) {
var pkg = new Packager( this.files, Package, {
components: this.allEffects,
themeVars: defaultTheme
themeVars: null
});
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES + 1 );
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES );
pkg.toJson(function( error, files ) {
test.ifError( error );
if (error) {
return test.done( error );
}
commonFilesCheck( test, files );
themeFilesCheck( test, files, false );
test.done();
Expand All @@ -110,9 +118,11 @@ tests = {
components: someWidgets1,
themeVars: defaultTheme
});
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES + 1 );
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES );
pkg.toJson(function( error, files ) {
test.ifError( error );
if (error) {
return test.done( error );
}
commonFilesCheck( test, files );
themeFilesCheck( test, files, true );
test.done();
Expand All @@ -123,9 +133,11 @@ tests = {
components: someWidgets2,
themeVars: defaultTheme
});
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES + 1 );
test.expect( COMMON_FILES_TESTCASES + THEME_FILES_TESTCASES );
pkg.toJson(function( error, files ) {
test.ifError( error );
if (error) {
return test.done( error );
}
commonFilesCheck( test, files );
themeFilesCheck( test, files, true );
test.done();
Expand All @@ -144,9 +156,11 @@ tests = {
themeVars: defaultTheme,
scope: scope
});
test.expect( filesToCheck.length + 1 );
test.expect( filesToCheck.length );
pkg.toJson(function( error, files ) {
test.ifError( error );
if (error) {
return test.done( error );
}
filesToCheck.forEach(function( filepath ) {
test.ok( scopeRe.test( files[ filepath ] ), "Missing scope selector on \"" + filepath + "\"." );
});
Expand Down