From 15f1add38bf8802a46a9db9cacb8c7e98b9661b5 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 12:15:32 -0500 Subject: [PATCH 01/15] Fixes #1840, tab with ajax does not hide content correctly --- src/definitions/modules/tab.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/definitions/modules/tab.js b/src/definitions/modules/tab.js index 9af6746ef..7080b1e15 100644 --- a/src/definitions/modules/tab.js +++ b/src/definitions/modules/tab.js @@ -370,22 +370,22 @@ $.fn.tab = function(parameters) { cachedContent = module.cache.read(fullTabPath); + module.activate.tab(tabPath); + if(settings.cache && cachedContent) { module.debug('Showing existing content', fullTabPath); module.content.update(tabPath, cachedContent); - module.activate.tab(tabPath); settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent); } else if(existingRequest) { module.debug('Content is already loading', fullTabPath); - $tab - .addClass(className.loading) - ; + $tab.addClass(className.loading); } else if($.api !== undefined) { - requestSettings = $.extend(true, { headers: { 'X-Remote': true } }, settings.apiSettings, apiSettings); + requestSettings = $.extend(true, { + headers: { 'X-Remote': true } + }, settings.apiSettings, apiSettings); module.debug('Retrieving remote content', fullTabPath, requestSettings); - console.log(existingRequest, requestSettings, cachedContent); $tab.api( requestSettings ); } else { From 32e32d3934d8aa0a77eaf35ce6ba0e48b8fc5d1d Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 12:24:37 -0500 Subject: [PATCH 02/15] Related #1840, force removing duplicate slashes from path when auto: true --- src/definitions/modules/tab.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/definitions/modules/tab.js b/src/definitions/modules/tab.js index 7080b1e15..56ad47b77 100644 --- a/src/definitions/modules/tab.js +++ b/src/definitions/modules/tab.js @@ -75,10 +75,7 @@ $.fn.tab = function(parameters) { // set up automatic routing if(settings.auto) { - module.verbose('Setting up automatic tab retrieval from server'); - settings.apiSettings = { - url: (settings.path || '') + '/{$tab}' - }; + module.set.auto(); } // attach events if navigation wasn't set to window @@ -238,6 +235,22 @@ $.fn.tab = function(parameters) { }, set: { + auto: function() { + var + url = (typeof settings.path == 'string') + ? settings.path.replace(/\/$/, '') + '/{$tab}' + : '/{$tab}' + ; + module.verbose('Setting up automatic tab retrieval from server', url); + if($.isPlainObject(settings.apiSettings)) { + settings.apiSettings.url = url; + } + else { + settings.apiSettings = { + url: url + }; + } + }, state: function(state) { $.address.value(state); } From 58609bf62ad33e90fd68b0e41fa6e2e02deb6eb1 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 12:40:12 -0500 Subject: [PATCH 03/15] Simplify default API debug output for clarity --- src/definitions/behaviors/api.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/definitions/behaviors/api.js b/src/definitions/behaviors/api.js index 71eaef292..557c77849 100644 --- a/src/definitions/behaviors/api.js +++ b/src/definitions/behaviors/api.js @@ -180,7 +180,9 @@ $.api = $.fn.api = function(parameters) { complete : function() {} }); - module.verbose('Creating AJAX request with settings', ajaxSettings); + module.debug('Querying URL', ajaxSettings.url); + module.debug('Sending data', data, ajaxSettings.method); + module.verbose('Using AJAX settings', ajaxSettings); if( module.is.loading() ) { // throttle additional requests @@ -383,7 +385,7 @@ $.api = $.fn.api = function(parameters) { // if http status code returned and json returned error, look for it if( xhr.status != 200 && httpMessage !== undefined && httpMessage !== '') { - module.error(error.statusMessage + httpMessage); + module.error(error.statusMessage + httpMessage, ajaxSettings.url); } else { if(status == 'error' && settings.dataType == 'json') { @@ -767,7 +769,7 @@ $.api.settings = { namespace : 'api', debug : true, - verbose : true, + verbose : false, performance : true, // event binding From 268b30a017c6f72846627964079a63f39c3ef564 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 12:40:40 -0500 Subject: [PATCH 04/15] Admin task iteration --- RELEASE-NOTES.md | 6 ++++ tasks/admin/register-repos.js | 64 ----------------------------------- tasks/admin/release-all.js | 29 ---------------- tasks/admin/release.js | 5 ++- tasks/collections/admin.js | 23 ++++++------- tasks/config/admin/release.js | 1 + 6 files changed, 20 insertions(+), 108 deletions(-) delete mode 100644 tasks/admin/register-repos.js delete mode 100644 tasks/admin/release-all.js diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 4492916f1..b1ddd9c08 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,5 +1,11 @@ ## RELEASE NOTES +### Version 1.9.3 - February 19, 2015 + +- **Tab** - Fixed bug when loading `remote` content with `tab` where current tab would not hide while loading +- **Tab** - Tab with remote content and `auto: true` now removes duplicate slashes from url path +- **API** - Simplified `api` debug output to console to more clearly label url and data sent + ### Version 1.9.2 - February 19, 2015 Added new repositories for css and less only versions, can be installed with diff --git a/tasks/admin/register-repos.js b/tasks/admin/register-repos.js deleted file mode 100644 index 70f4411e3..000000000 --- a/tasks/admin/register-repos.js +++ /dev/null @@ -1,64 +0,0 @@ -/******************************* - Register PM -*******************************/ - -/* - Task to register component repos with Package Managers - * Registers component with bower - * Registers component with NPM -*/ - -var - // node dependencies - process = require('child_process'), - - // config - release = require('../config/admin/release'), - - total = release.components.length, - index = -1, - stream, - stepRepo -; - -module.exports = function(callback) { - - console.log('Registering repos with package managers'); - - // Do Git commands synchronously per component, to avoid issues - stepRepo = function() { - index = index + 1; - if(index >= total) { - return; - } - var - component = release.components[index], - outputDirectory = release.outputRoot + component + '/', - capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1), - packageName = release.packageRoot + component, - repoName = release.repoRoot + capitalizedComponent, - gitURL = 'https://github.com/' + release.org + '/' + repoName + '.git', - exec = process.exec, - execSettings = {cwd: outputDirectory}, - registerBower = 'bower register ' + packageName + ' ' + gitURL, - updateNPM = 'npm publish' - - ; - - /* Register with Bower */ - /* One Time - exec(registerBower, execSettings, function(err, stdout, stderr) { - stepRepo(); - }); - */ - - /* Register with NPM */ - exec(updateNPM, execSettings, function(err, stdout, stderr) { - console.log(err, stdout, stderr); - stepRepo(); - }); - - }; - stepRepo(); -}; - diff --git a/tasks/admin/release-all.js b/tasks/admin/release-all.js deleted file mode 100644 index 20df1f9dd..000000000 --- a/tasks/admin/release-all.js +++ /dev/null @@ -1,29 +0,0 @@ -/******************************* - Release All -*******************************/ - -/* - This task update all SUI individual component repos with new versions of components - - * Initializes repositories with current versions - * Creates local files at ../components/ with each repo for release - * Commits changes from create components - * Registers new versions with NPM Publish - -*/ - -var - runSequence = require('run-sequence') -; - -/* Release All */ -module.exports = function() { - - runSequence( - 'build', // build Semantic - 'init components', // sync with current github version - 'create components', // update each repo - 'update components' // commit changes to github - ); - -}; \ No newline at end of file diff --git a/tasks/admin/release.js b/tasks/admin/release.js index f37992879..e25afdbfb 100644 --- a/tasks/admin/release.js +++ b/tasks/admin/release.js @@ -7,8 +7,6 @@ * Initializes repositories with current versions * Creates local files at ../distributions/ with each repo for release - * Commits changes from create components - * Registers new versions with NPM Publish */ @@ -23,7 +21,8 @@ module.exports = function() { 'build', // build Semantic 'init distributions', // sync with current github version 'create distributions', // update each repo with changes from master repo - 'update distributions' // commit changes to github + 'init components', // sync with current github version + 'create components' // update each repo ); }; \ No newline at end of file diff --git a/tasks/collections/admin.js b/tasks/collections/admin.js index 21fe420f1..a384d1fab 100644 --- a/tasks/collections/admin.js +++ b/tasks/collections/admin.js @@ -26,25 +26,24 @@ module.exports = function(gulp) { createDistributions = require('../admin/distributions/create'), updateDistributions = require('../admin/distributions/update'), - // one time register with PM - registerRepos = require('../admin/register-repos'), - - // meta tasks - releaseAll = require('../admin/release-all'), - release = require('../admin/release') + release = require('../admin/release'), + publish = require('../admin/publish'), + register = require('../admin/register') ; - gulp.task('release', 'Publishes only packaged releases', release); - gulp.task('release all', 'Publishes all releases (components, package)', releaseAll); - + /* Release */ gulp.task('init distributions', 'Grabs each component from GitHub', initDistributions); gulp.task('create distributions', 'Updates files in each repo', createDistributions); - gulp.task('update distributions', 'Commits component updates from create to GitHub', updateDistributions); - gulp.task('init components', 'Grabs each component from GitHub', initComponents); gulp.task('create components', 'Updates files in each repo', createComponents); + + /* Publish */ + gulp.task('update distributions', 'Commits component updates from create to GitHub', updateDistributions); gulp.task('update components', 'Commits component updates from create to GitHub', updateComponents); - gulp.task('register repos', 'Registers all packages with NPM', registerRepos); + /* Tasks */ + gulp.task('release', 'Stages changes in GitHub repos for all distributions', release); + gulp.task('publish', 'Publishes all releases (components, package)', publish); + gulp.task('register', 'Registers all packages with NPM', register); }; \ No newline at end of file diff --git a/tasks/config/admin/release.js b/tasks/config/admin/release.js index 5694a30b6..7b8cb18b4 100644 --- a/tasks/config/admin/release.js +++ b/tasks/config/admin/release.js @@ -61,6 +61,7 @@ module.exports = { // components that get separate repositories for bower/npm components : [ 'accordion', + 'ad', 'api', 'breadcrumb', 'button', From d8cb6442f55d387d03410540bf247c58f056138f Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 12:42:30 -0500 Subject: [PATCH 05/15] Add renamed tasks --- tasks/admin/publish.js | 24 ++++++++ tasks/admin/register.js | 64 ++++++++++++++++++++ tasks/config/admin/templates/less-package.js | 3 +- 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 tasks/admin/publish.js create mode 100644 tasks/admin/register.js diff --git a/tasks/admin/publish.js b/tasks/admin/publish.js new file mode 100644 index 000000000..2e196f9a0 --- /dev/null +++ b/tasks/admin/publish.js @@ -0,0 +1,24 @@ +/******************************* + Release All +*******************************/ + +/* + This task update all SUI individual component repos with new versions of components + + * Commits changes from create components to GitHub and Tags + +*/ + +var + runSequence = require('run-sequence') +; + +/* Release All */ +module.exports = function() { + + runSequence( + 'update distributions', // commit less/css versions to github + 'update components' // commit components to github + ); + +}; \ No newline at end of file diff --git a/tasks/admin/register.js b/tasks/admin/register.js new file mode 100644 index 000000000..70f4411e3 --- /dev/null +++ b/tasks/admin/register.js @@ -0,0 +1,64 @@ +/******************************* + Register PM +*******************************/ + +/* + Task to register component repos with Package Managers + * Registers component with bower + * Registers component with NPM +*/ + +var + // node dependencies + process = require('child_process'), + + // config + release = require('../config/admin/release'), + + total = release.components.length, + index = -1, + stream, + stepRepo +; + +module.exports = function(callback) { + + console.log('Registering repos with package managers'); + + // Do Git commands synchronously per component, to avoid issues + stepRepo = function() { + index = index + 1; + if(index >= total) { + return; + } + var + component = release.components[index], + outputDirectory = release.outputRoot + component + '/', + capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1), + packageName = release.packageRoot + component, + repoName = release.repoRoot + capitalizedComponent, + gitURL = 'https://github.com/' + release.org + '/' + repoName + '.git', + exec = process.exec, + execSettings = {cwd: outputDirectory}, + registerBower = 'bower register ' + packageName + ' ' + gitURL, + updateNPM = 'npm publish' + + ; + + /* Register with Bower */ + /* One Time + exec(registerBower, execSettings, function(err, stdout, stderr) { + stepRepo(); + }); + */ + + /* Register with NPM */ + exec(updateNPM, execSettings, function(err, stdout, stderr) { + console.log(err, stdout, stderr); + stepRepo(); + }); + + }; + stepRepo(); +}; + diff --git a/tasks/config/admin/templates/less-package.js b/tasks/config/admin/templates/less-package.js index 197da5714..35e6f9de9 100644 --- a/tasks/config/admin/templates/less-package.js +++ b/tasks/config/admin/templates/less-package.js @@ -40,8 +40,9 @@ Package.onUse(function(api) { return files } files = walk(); - api.versionsFrom('1.0'); + + api.use('less', 'client'); api.addFiles(files, 'clent'); }); From d98656a3c63d029ff5e05da4b7b61d32e9c5d9f4 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 13:24:57 -0500 Subject: [PATCH 06/15] Fixes description redundancy #1607 --- tasks/config/admin/templates/component-package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/config/admin/templates/component-package.js b/tasks/config/admin/templates/component-package.js index 0f4c199ab..d7b234461 100644 --- a/tasks/config/admin/templates/component-package.js +++ b/tasks/config/admin/templates/component-package.js @@ -4,7 +4,7 @@ var Package.describe({ name : 'semantic:ui-{component}', - summary : 'Semantic UI - {Component} (official): Single component release of {component}', + summary : 'Semantic UI - {Component}: Single component release', version : '{version}', git : 'git://github.com/Semantic-Org/UI-{Component}.git', }); From 22a2b2901aef01eee458536d7689e7a3791c9b6c Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 13:28:26 -0500 Subject: [PATCH 07/15] #1607 add npm require to package.js templates --- tasks/config/admin/templates/less-package.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/config/admin/templates/less-package.js b/tasks/config/admin/templates/less-package.js index 35e6f9de9..897a557b3 100644 --- a/tasks/config/admin/templates/less-package.js +++ b/tasks/config/admin/templates/less-package.js @@ -12,8 +12,8 @@ Package.describe({ Package.onUse(function(api) { var - fs = require('fs'), - path = require('path'), + fs = Npm.require('fs'), + path = Npm.require('path'), files, walk ; From 3a75bdc8d14e2d6786fe0e51c72da34fa042a741 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 13:39:14 -0500 Subject: [PATCH 08/15] Swaps out __dirname constant for path.resolve() #1607 --- tasks/config/admin/templates/css-package.js | 2 +- tasks/config/admin/templates/less-package.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/config/admin/templates/css-package.js b/tasks/config/admin/templates/css-package.js index 3d5b64983..7bdcf7200 100644 --- a/tasks/config/admin/templates/css-package.js +++ b/tasks/config/admin/templates/css-package.js @@ -21,7 +21,7 @@ Package.onUse(function(api) { // recursive sync walk walk = function(dir) { var - dir = dir || __dirname, + dir = dir || path.resolve('.'), list = fs.readdirSync(dir), files = [] ; diff --git a/tasks/config/admin/templates/less-package.js b/tasks/config/admin/templates/less-package.js index 897a557b3..b2359377d 100644 --- a/tasks/config/admin/templates/less-package.js +++ b/tasks/config/admin/templates/less-package.js @@ -21,7 +21,7 @@ Package.onUse(function(api) { // recursive sync walk walk = function(dir) { var - dir = dir || __dirname, + dir = dir || path.resolve('.'), list = fs.readdirSync(dir), files = [] ; From 6e6f6cd71c641ec6306d68c2c0202605b2bd0e53 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 14:39:45 -0500 Subject: [PATCH 09/15] #1607 missing theme.less from LESS repo --- tasks/admin/distributions/create.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/admin/distributions/create.js b/tasks/admin/distributions/create.js index 82e2e2db9..b589fc778 100644 --- a/tasks/admin/distributions/create.js +++ b/tasks/admin/distributions/create.js @@ -80,7 +80,6 @@ module.exports = function(callback) { gulp.task(task.meteor, function() { gulp.src(release.templates.meteor[distLowerCase]) .pipe(plumber()) - .pipe(debug()) .pipe(flatten()) .pipe(replace(regExp.match.version, version)) .pipe(rename(release.files.meteor)) @@ -101,6 +100,7 @@ module.exports = function(callback) { else if(distribution == 'LESS') { gulp.task(task.repo, function() { return gulp.src('./src/theme.config.example', { base: './src/' }) + .pipe(gulp.src('./src/theme.less*', { base: './src/' })) .pipe(gulp.src('./src/definitions/**/*', { base: './src/' })) .pipe(gulp.src('./src/_site/**/*', { base: './src/' })) .pipe(gulp.src('./src/themes/**/*', { base: './src/' })) From 5e372c394d9b4dfdfb3aee7a4b52536b045c545f Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 14:40:41 -0500 Subject: [PATCH 10/15] #1607 remove client typo in package.js --- tasks/config/admin/templates/component-package.js | 5 +---- tasks/config/admin/templates/css-package.js | 2 +- tasks/config/admin/templates/less-package.js | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tasks/config/admin/templates/component-package.js b/tasks/config/admin/templates/component-package.js index d7b234461..74cd51b9d 100644 --- a/tasks/config/admin/templates/component-package.js +++ b/tasks/config/admin/templates/component-package.js @@ -1,6 +1,3 @@ -var - where = 'client' // Adds files only to the client -; Package.describe({ name : 'semantic:ui-{component}', @@ -13,5 +10,5 @@ Package.onUse(function(api) { api.versionsFrom('1.0'); api.addFiles([ {files} - ], where); + ], 'client'); }); diff --git a/tasks/config/admin/templates/css-package.js b/tasks/config/admin/templates/css-package.js index 7bdcf7200..b6d8f8848 100644 --- a/tasks/config/admin/templates/css-package.js +++ b/tasks/config/admin/templates/css-package.js @@ -42,6 +42,6 @@ Package.onUse(function(api) { files = walk(); api.versionsFrom('1.0'); - api.addFiles(files, 'clent'); + api.addFiles(files, 'client'); }); diff --git a/tasks/config/admin/templates/less-package.js b/tasks/config/admin/templates/less-package.js index b2359377d..47a8efb82 100644 --- a/tasks/config/admin/templates/less-package.js +++ b/tasks/config/admin/templates/less-package.js @@ -43,6 +43,6 @@ Package.onUse(function(api) { api.versionsFrom('1.0'); api.use('less', 'client'); - api.addFiles(files, 'clent'); + api.addFiles(files, 'client'); }); From 052d0743583a929cfbe0c5812f0548d2a3c924a4 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 15:26:47 -0500 Subject: [PATCH 11/15] #1607 Fix components without assets not creating manifest lists correctly --- tasks/admin/components/create.js | 62 ++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/tasks/admin/components/create.js b/tasks/admin/components/create.js index cc79be40b..478142f47 100644 --- a/tasks/admin/components/create.js +++ b/tasks/admin/components/create.js @@ -34,6 +34,7 @@ var rename = require('gulp-rename'), replace = require('gulp-replace'), tap = require('gulp-tap'), + util = require('gulp-util'), // config config = require('../../config/user'), @@ -72,6 +73,12 @@ module.exports = function(callback) { repoName = release.componentRepoRoot + capitalizedComponent, gitURL = 'https://github.com/' + release.org + '/' + repoName + '.git', repoURL = 'https://github.com/' + release.org + '/' + repoName + '/', + concatSettings = { + newline : '', + root : outputDirectory, + prepend : " '", + append : "'," + }, regExp = { match : { // templated values @@ -119,10 +126,13 @@ module.exports = function(callback) { notes : component + ' create release notes', composer : component + ' create composer.json', package : component + ' create package.json', - meteor : component + ' create package.js', + meteor : component + ' create meteor package.js', }, // paths to includable assets - assetPath = '/assets/**/' + component + '?(s).*' + manifest = { + assets : outputDirectory + '/assets/**/' + component + '?(s).*', + component : outputDirectory + '/' + component + '+(.js|.css)' + } ; // copy dist files into output folder adjusting asset paths @@ -265,32 +275,32 @@ module.exports = function(callback) { // Creates meteor package.js gulp.task(task.meteor, function() { var - fileNames = '' + filenames = '' ; - if(isJavascript) { - fileNames += ' \'' + component + '.js\',\n'; - } - if(isCSS) { - fileNames += ' \'' + component + '.css\',\n'; - } - return gulp.src(outputDirectory + assetPath, { base: outputDirectory}) - .pipe(concatFileNames('/dev/null', { - newline : '', - root : outputDirectory, - prepend : ' \'', - append : '\',' + return gulp.src(manifest.component) + .pipe(concatFileNames('empty.txt', concatSettings)) + .pipe(tap(function(file) { + filenames += file.contents; })) - .pipe(tap(function(file) { fileNames += file.contents; })) - .on('end', function(){ - gulp.src(release.templates.meteor.component) - .pipe(plumber()) - .pipe(flatten()) - .pipe(replace(regExp.match.name, regExp.replace.name)) - .pipe(replace(regExp.match.titleName, regExp.replace.titleName)) - .pipe(replace(regExp.match.version, version)) - .pipe(replace(regExp.match.files, fileNames)) - .pipe(rename(release.files.meteor)) - .pipe(gulp.dest(outputDirectory)) + .on('end', function() { + gulp.src(manifest.assets) + .pipe(concatFileNames('empty.txt', concatSettings)) + .pipe(tap(function(file) { + filenames += file.contents; + })) + .on('end', function() { + filenames = filenames.replace(/,(?=[^,]*$)/, '').trim(); // remove trailing slash + gulp.src(release.templates.meteor.component) + .pipe(plumber()) + .pipe(flatten()) + .pipe(replace(regExp.match.name, regExp.replace.name)) + .pipe(replace(regExp.match.titleName, regExp.replace.titleName)) + .pipe(replace(regExp.match.version, version)) + .pipe(replace(regExp.match.files, filenames)) + .pipe(rename(release.files.meteor)) + .pipe(gulp.dest(outputDirectory)) + ; + }) ; }) ; From 6079676eb5d82a1709a482a9b1467d4de6db6461 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 15:28:22 -0500 Subject: [PATCH 12/15] #1607 Regexp formatting --- tasks/admin/components/create.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/admin/components/create.js b/tasks/admin/components/create.js index 478142f47..6216debb5 100644 --- a/tasks/admin/components/create.js +++ b/tasks/admin/components/create.js @@ -97,6 +97,7 @@ module.exports = function(callback) { formExport : /\$\.fn\.\w+\s*=\s*function\(fields, parameters\)\s*{/g, settingsExport : /\$\.fn\.\w+\.settings\s*=/g, settingsReference : /\$\.fn\.\w+\.settings/g, + trailingComma : /,(?=[^,]*$)/, jQuery : /jQuery/g, }, replace : { @@ -289,7 +290,7 @@ module.exports = function(callback) { filenames += file.contents; })) .on('end', function() { - filenames = filenames.replace(/,(?=[^,]*$)/, '').trim(); // remove trailing slash + filenames = filenames.replace(regExp.trailingComma, '').trim(); // remove trailing slash gulp.src(release.templates.meteor.component) .pipe(plumber()) .pipe(flatten()) From c6371cc8d2942034a0712e8fb2d7cefb2ddc9bee Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 16:02:26 -0500 Subject: [PATCH 13/15] Move gulp walk over to admin task #1607 --- tasks/admin/components/create.js | 3 +- tasks/admin/distributions/create.js | 59 +++++++++++++++++++- tasks/config/admin/templates/css-package.js | 35 ++---------- tasks/config/admin/templates/less-package.js | 35 ++---------- 4 files changed, 67 insertions(+), 65 deletions(-) diff --git a/tasks/admin/components/create.js b/tasks/admin/components/create.js index 6216debb5..4a2e15c7f 100644 --- a/tasks/admin/components/create.js +++ b/tasks/admin/components/create.js @@ -290,7 +290,8 @@ module.exports = function(callback) { filenames += file.contents; })) .on('end', function() { - filenames = filenames.replace(regExp.trailingComma, '').trim(); // remove trailing slash + // remove trailing slash + filenames = filenames.replace(regExp.match.trailingComma, '').trim(); gulp.src(release.templates.meteor.component) .pipe(plumber()) .pipe(flatten()) diff --git a/tasks/admin/distributions/create.js b/tasks/admin/distributions/create.js index b589fc778..bdcc76f99 100644 --- a/tasks/admin/distributions/create.js +++ b/tasks/admin/distributions/create.js @@ -65,6 +65,7 @@ module.exports = function(callback) { repoName = release.distRepoRoot + distribution, regExp = { match : { + files : '{files}', version : '{version}' } }, @@ -73,15 +74,69 @@ module.exports = function(callback) { repo : distribution + ' create repo', meteor : distribution + ' create meteor package.js', package : distribution + ' create package.json' - } + }, + gatherFiles, + createList ; + // get files for meteor + gatherFiles = function(dir) { + var + dir = dir || path.resolve('.'), + list = fs.readdirSync(dir), + omitted = [ + '.git', + 'node_modules', + 'package.js', + 'package.json', + 'bower.json', + '.gitignore' + ] + files = [] + ; + list.forEach(function(file) { + var + isOmitted = (omitted.indexOf(file) > -1), + filePath = path.join(dir, file), + stat = fs.statSync(filePath) + ; + if(!isOmitted) { + if(stat && stat.isDirectory()) { + files = files.concat(gatherFiles(filePath)); + } + else { + files.push(filePath.replace(outputDirectory + path.sep, '')); + } + } + }) + return files + }; + + // spaces out list correctly + createList = function(files) { + var filenames = ''; + for(file in files) { + if(file == (files.length - 1) ) { + filenames += "'" + files[file] + "'"; + } + else { + filenames += "'" + files[file] + "',\n "; + } + } + return filenames; + }; + gulp.task(task.meteor, function() { + var + files = gatherFiles(outputDirectory) + filenames = createList(files) + ; gulp.src(release.templates.meteor[distLowerCase]) .pipe(plumber()) .pipe(flatten()) .pipe(replace(regExp.match.version, version)) + .pipe(replace(regExp.match.files, filenames)) .pipe(rename(release.files.meteor)) .pipe(gulp.dest(outputDirectory)) ; @@ -100,7 +155,7 @@ module.exports = function(callback) { else if(distribution == 'LESS') { gulp.task(task.repo, function() { return gulp.src('./src/theme.config.example', { base: './src/' }) - .pipe(gulp.src('./src/theme.less*', { base: './src/' })) + .pipe(gulp.src('./src/theme.less', { base: './src/' })) .pipe(gulp.src('./src/definitions/**/*', { base: './src/' })) .pipe(gulp.src('./src/_site/**/*', { base: './src/' })) .pipe(gulp.src('./src/themes/**/*', { base: './src/' })) diff --git a/tasks/config/admin/templates/css-package.js b/tasks/config/admin/templates/css-package.js index b6d8f8848..ad17ade93 100644 --- a/tasks/config/admin/templates/css-package.js +++ b/tasks/config/admin/templates/css-package.js @@ -11,37 +11,10 @@ Package.describe({ Package.onUse(function(api) { - var - fs = require('fs'), - path = require('path'), - files, - walk - ; - - // recursive sync walk - walk = function(dir) { - var - dir = dir || path.resolve('.'), - list = fs.readdirSync(dir), - files = [] - ; - list.forEach(function(file) { - var - filePath = path.join(dir, file), - stat = fs.statSync(filePath) - ; - if(stat && stat.isDirectory() && file !== 'node_modules') { - files = files.concat(walk(filePath)); - } - else { - files.push(filePath); - } - }) - return files - } - files = walk(); - api.versionsFrom('1.0'); - api.addFiles(files, 'client'); + + api.addFiles([ + {files} + ], 'client'); }); diff --git a/tasks/config/admin/templates/less-package.js b/tasks/config/admin/templates/less-package.js index 47a8efb82..e2f8a253d 100644 --- a/tasks/config/admin/templates/less-package.js +++ b/tasks/config/admin/templates/less-package.js @@ -11,38 +11,11 @@ Package.describe({ Package.onUse(function(api) { - var - fs = Npm.require('fs'), - path = Npm.require('path'), - files, - walk - ; - - // recursive sync walk - walk = function(dir) { - var - dir = dir || path.resolve('.'), - list = fs.readdirSync(dir), - files = [] - ; - list.forEach(function(file) { - var - filePath = path.join(dir, file), - stat = fs.statSync(filePath) - ; - if(stat && stat.isDirectory() && file !== 'node_modules') { - files = files.concat(walk(filePath)); - } - else { - files.push(filePath); - } - }) - return files - } - files = walk(); api.versionsFrom('1.0'); - api.use('less', 'client'); - api.addFiles(files, 'client'); + + api.addFiles([ + {files} + ], 'client'); }); From c7c84fbe21ecd774e038178fa8b07547c37ddeea Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 16:04:35 -0500 Subject: [PATCH 14/15] Update notes --- RELEASE-NOTES.md | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index b1ddd9c08..c5e1f61f6 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,11 +1,15 @@ ## RELEASE NOTES -### Version 1.9.3 - February 19, 2015 +### Version 1.9.3 - February 20, 2015 +**Bugs** - **Tab** - Fixed bug when loading `remote` content with `tab` where current tab would not hide while loading - **Tab** - Tab with remote content and `auto: true` now removes duplicate slashes from url path - **API** - Simplified `api` debug output to console to more clearly label url and data sent +**Docs** +- **Tab** - Added new tab remote content example with stubbed AJAX using SinonJS + ### Version 1.9.2 - February 19, 2015 Added new repositories for css and less only versions, can be installed with diff --git a/package.json b/package.json index 12a9d94a3..90a893d8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "semantic-ui", - "version" : "1.9.2", + "version" : "1.9.3", "title" : "Semantic UI", "description" : "Semantic empowers designers and developers by creating a shared vocabulary for UI.", "homepage" : "http://www.semantic-ui.com", From 9289c037af5495afaac94b9bfe14b587ce55b39e Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 20 Feb 2015 16:06:48 -0500 Subject: [PATCH 15/15] Fixes #1842, small typo caused rtl tasks not to run --- tasks/build.js | 2 +- tasks/watch.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/build.js b/tasks/build.js index 2f4e8342c..6dfd36a90 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -61,7 +61,7 @@ module.exports = function(callback) { // check for right-to-left language if(config.rtl === true || config.rtl === 'Yes') { - gulp.start('build rtl'); + gulp.start('build-rtl'); return; } diff --git a/tasks/watch.js b/tasks/watch.js index c5c34f89d..619792c2f 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -59,7 +59,7 @@ module.exports = function(callback) { // check for right-to-left language if(config.rtl === true || config.rtl === 'Yes') { - gulp.start('watch rtl'); + gulp.start('watch-rtl'); return; }