diff --git a/tasks/admin/components/create.js b/tasks/admin/components/create.js index d3478a5ed..cc79be40b 100644 --- a/tasks/admin/components/create.js +++ b/tasks/admin/components/create.js @@ -282,7 +282,7 @@ module.exports = function(callback) { })) .pipe(tap(function(file) { fileNames += file.contents; })) .on('end', function(){ - gulp.src(release.templates.meteor) + gulp.src(release.templates.meteor.component) .pipe(plumber()) .pipe(flatten()) .pipe(replace(regExp.match.name, regExp.replace.name)) diff --git a/tasks/admin/distributions/create.js b/tasks/admin/distributions/create.js index d8039995f..82e2e2db9 100644 --- a/tasks/admin/distributions/create.js +++ b/tasks/admin/distributions/create.js @@ -59,16 +59,35 @@ module.exports = function(callback) { (function(distribution) { var - outputDirectory = path.join(release.outputRoot, distribution.toLowerCase()), + distLowerCase = distribution.toLowerCase(), + outputDirectory = path.join(release.outputRoot, distLowerCase), packageFile = path.join(outputDirectory, release.files.npm), - repoName = release.distRepoRoot + distribution + repoName = release.distRepoRoot + distribution, + regExp = { + match : { + version : '{version}' + } + }, task = { all : distribution + ' copying files', repo : distribution + ' create repo', + meteor : distribution + ' create meteor package.js', package : distribution + ' create package.json' } ; + + 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)) + .pipe(gulp.dest(outputDirectory)) + ; + }); + if(distribution == 'CSS') { gulp.task(task.repo, function() { return gulp.src('./dist/themes/default/**/*', { base: './dist/' }) @@ -105,6 +124,7 @@ module.exports = function(callback) { ; }); + tasks.push(task.meteor); tasks.push(task.repo); tasks.push(task.package); diff --git a/tasks/admin/release.js b/tasks/admin/release.js index 7ff1848e9..f37992879 100644 --- a/tasks/admin/release.js +++ b/tasks/admin/release.js @@ -20,7 +20,7 @@ var module.exports = function() { runSequence( - //'build', // build Semantic + '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 diff --git a/tasks/config/admin/release.js b/tasks/config/admin/release.js index 43b93e37e..5694a30b6 100644 --- a/tasks/config/admin/release.js +++ b/tasks/config/admin/release.js @@ -15,12 +15,16 @@ module.exports = { }, templates: { - bower : './tasks/config/admin/templates/bower.json', - composer : './tasks/config/admin/templates/composer.json', - package : './tasks/config/admin/templates/package.json', - meteor : './tasks/config/admin/templates/package.js', - readme : './tasks/config/admin/templates/README.md', - notes : './RELEASE-NOTES.md' + bower : './tasks/config/admin/templates/bower.json', + composer : './tasks/config/admin/templates/composer.json', + package : './tasks/config/admin/templates/package.json', + meteor : { + css : './tasks/config/admin/templates/css-package.js', + component : './tasks/config/admin/templates/component-package.js', + less : './tasks/config/admin/templates/less-package.js', + }, + readme : './tasks/config/admin/templates/README.md', + notes : './RELEASE-NOTES.md' }, org : 'Semantic-Org', diff --git a/tasks/config/admin/templates/package.js b/tasks/config/admin/templates/component-package.js similarity index 100% rename from tasks/config/admin/templates/package.js rename to tasks/config/admin/templates/component-package.js diff --git a/tasks/config/admin/templates/css-package.js b/tasks/config/admin/templates/css-package.js new file mode 100644 index 000000000..3d5b64983 --- /dev/null +++ b/tasks/config/admin/templates/css-package.js @@ -0,0 +1,47 @@ +var + where = 'client' // Adds files only to the client +; + +Package.describe({ + name : 'semantic:ui-css', + summary : 'Semantic UI - CSS Release of Semantic UI', + version : '{version}', + git : 'git://github.com/Semantic-Org/Semantic-UI-CSS.git', +}); + +Package.onUse(function(api) { + + var + fs = require('fs'), + path = require('path'), + files, + walk + ; + + // recursive sync walk + walk = function(dir) { + var + dir = dir || __dirname, + 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, 'clent'); + +}); diff --git a/tasks/config/admin/templates/less-package.js b/tasks/config/admin/templates/less-package.js new file mode 100644 index 000000000..197da5714 --- /dev/null +++ b/tasks/config/admin/templates/less-package.js @@ -0,0 +1,47 @@ +var + where = 'client' // Adds files only to the client +; + +Package.describe({ + name : 'semantic:ui', + summary : 'Semantic UI - LESS Release of Semantic UI', + version : '{version}', + git : 'git://github.com/Semantic-Org/Semantic-UI-LESS.git', +}); + +Package.onUse(function(api) { + + var + fs = require('fs'), + path = require('path'), + files, + walk + ; + + // recursive sync walk + walk = function(dir) { + var + dir = dir || __dirname, + 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, 'clent'); + +}); diff --git a/tasks/docs/serve.js b/tasks/docs/serve.js index a2a86f346..80cc752e6 100644 --- a/tasks/docs/serve.js +++ b/tasks/docs/serve.js @@ -116,11 +116,10 @@ module.exports = function () { isSiteTheme = (file.path.indexOf(source.site) !== -1); isDefinition = (file.path.indexOf(source.definitions) !== -1); - if(isConfig) { - console.log('Change detected in theme config'); - // impossible to tell which file was updated in theme.config, rebuild all - gulp.start('build'); + console.info('Change detected in theme config, rebuild docs with `build-docs`'); + // impossible to tell which file was updated in theme.config + return; } else if(isPackagedTheme) { console.log('Change detected in packaged theme'); diff --git a/tasks/watch.js b/tasks/watch.js index cf15f293d..c5c34f89d 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -106,11 +106,11 @@ module.exports = function(callback) { isSiteTheme = (file.path.indexOf(source.site) !== -1); isDefinition = (file.path.indexOf(source.definitions) !== -1); - if(isConfig) { - console.log('Change detected in theme config'); + console.info('Change detected in theme config'); // impossible to tell which file was updated in theme.config, rebuild all gulp.start('build'); + return; } else if(isPackagedTheme) { console.log('Change detected in packaged theme');