Browse Source

Finish meteor integration of dist/

pull/1845/head
jlukic 10 years ago
parent
commit
c9b990060e
9 changed files with 133 additions and 16 deletions
  1. 2
      tasks/admin/components/create.js
  2. 24
      tasks/admin/distributions/create.js
  3. 2
      tasks/admin/release.js
  4. 16
      tasks/config/admin/release.js
  5. 0
      tasks/config/admin/templates/component-package.js
  6. 47
      tasks/config/admin/templates/css-package.js
  7. 47
      tasks/config/admin/templates/less-package.js
  8. 7
      tasks/docs/serve.js
  9. 4
      tasks/watch.js

2
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))

24
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);

2
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

16
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',

tasks/config/admin/templates/package.js → tasks/config/admin/templates/component-package.js

47
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');
});

47
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');
});

7
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');

4
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');

Loading…
Cancel
Save