Browse Source

Iteration on build deploy, filtering release notes, auto bower update

pull/1204/head
jlukic 10 years ago
parent
commit
8750b1f244
9 changed files with 197 additions and 27 deletions
  1. 3
      dist/components/card.css
  2. 2
      dist/components/card.min.css
  3. 4
      dist/semantic.css
  4. 2
      dist/semantic.min.css
  5. 101
      gulpfile.js
  6. 10
      tasks/admin/questions.js
  7. 19
      tasks/admin/release.js
  8. 26
      tasks/admin/templates/bower.json
  9. 57
      tasks/admin/templates/package.json

3
dist/components/card.css

@ -724,6 +724,9 @@ a.ui.card:hover,
.ui.stackable.cards {
display: block !important;
}
.ui.stackable.cards .card:first-child {
margin-top: 0em !important;
}
.ui.stackable.cards > .card {
display: block !important;
height: auto !important;

2
dist/components/card.min.css
File diff suppressed because it is too large
View File

4
dist/semantic.css

@ -3894,6 +3894,10 @@ a.ui.card:hover,
display: block !important;
}
.ui.stackable.cards .card:first-child {
margin-top: 0em !important;
}
.ui.stackable.cards > .card {
display: block !important;
height: auto !important;

2
dist/semantic.min.css
File diff suppressed because it is too large
View File

101
gulpfile.js

@ -533,7 +533,7 @@ gulp.task('install', 'Set-up project for first time', function () {
console.info('Extending semantic.json (Gulp config)');
gulp.src(jsonSource)
.pipe(plumber())
.pipe(rename(settings.rename.json))
.pipe(rename(settings.rename.json)) // preserve file extension
.pipe(jeditor(json))
.pipe(gulp.dest('./'))
;
@ -542,7 +542,7 @@ gulp.task('install', 'Set-up project for first time', function () {
console.info('Creating semantic.json (Gulp config)');
gulp.src(jsonSource)
.pipe(plumber())
.pipe(rename({ extname : '' }))
.pipe(rename({ extname : '' })) // remove .template from ext
.pipe(jeditor(json))
.pipe(gulp.dest('./'))
;
@ -635,8 +635,9 @@ gulp.task('release', false, function() {
protocol : 'https',
timeout : 5000
});
github.authenticate({
type: "oauth",
type: 'oauth',
token: oAuthToken
});
@ -663,16 +664,18 @@ gulp.task('bump', false, function () {
//gulp.task('release components', false, ['build', 'copy release components'], function() {
gulp.task('release components', false, ['copy release components'], function() {
/*
var
index = 0,
total = release.components.length,
stream,
stepGit
stepCheckGit
;
console.log('Handling git');
// Do Git commands synchronously, to avoid issues
stepGit = function() {
stepCheckGit = function() {
index = index + 1;
if(index >= total) {
@ -681,11 +684,11 @@ gulp.task('release components', false, ['copy release components'], function() {
var
component = release.components[index],
outputDirectory = release.folderRoot + component,
outputDirectory = release.outputRoot + component,
capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1),
repo = release.repoRoot + capitalizedComponent,
gitURL = 'git@github.com:' + release.owner + '/' + repo + '.git',
repoURL = 'https://github.com/' + release.owner + '/' + repo + '/',
repoName = release.repoRoot + capitalizedComponent,
gitURL = 'git@github.com:' + release.owner + '/' + repoName + '.git',
repoURL = 'https://github.com/' + release.owner + '/' + repoName + '/',
gitOptions = { cwd: path.resolve(outputDirectory) }
;
// exit conditions
@ -697,37 +700,44 @@ gulp.task('release components', false, ['copy release components'], function() {
git.pull('origin', 'master', gitOptions, function(error) {
if(error) {
console.log(error);
return;
// initialize local repo
git.init(gitOptions, function(error) {
if(error) {
console.error('Error initializing repo', error);
console.error('Error initializing repo');
return;
}
// add remote url
git.addRemote('origin', gitURL, gitOptions, function(error) {
if(error) {
console.error('Unable to add remote', error);
// origin already set (do nothing)
}
// try pull
git.pull('origin', 'master', gitOptions, function(error) {
if(error) {
// Repo doesnt exist creating
console.log('Create new repo', repoName, release.org);
github.repos.createFromOrg({
org: release.org,
name: repoName,
homepage: release.homepage
}, stepCheckGit);
}
stepGit();
});
});
});
}
else {
stepGit();
stepCheckGit();
}
});
};
stepGit();
return stepCheckGit();
// create bower.json *ignore*
@ -738,7 +748,7 @@ gulp.task('release components', false, ['copy release components'], function() {
;
// if not try creating repo
github.repos.get({
user : release.owner,
user : release.org,
repo : release.repo
}, function(error, response) {
if(error) {
@ -760,19 +770,72 @@ gulp.task('release components', false, ['copy release components'], function() {
gulp.task('copy release components', false, function() {
var
stream,
index
index,
hasJavascript
;
console.log('Moving files to component folders');
// copy source files and extend package files
for(index in release.components) {
var
component = release.components[index],
outputDirectory = release.folderRoot + component
outputDirectory = release.outputRoot + component,
isJavascript = fs.existsSync(output.compressed + component + '.js'),
capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1),
repoName = release.repoRoot + capitalizedComponent,
repoURL = 'https://github.com/' + release.owner + '/' + repoName + '/',
notesRegExp = new RegExp('^((?!(^.*(' + component + ').*$|###.*)).)*$', 'gmi'),
bower = require(release.templates.bower),
package = require(release.templates.package)
;
// copy files into folder
stream = gulp.src(output.compressed + component + '.*')
// copy dist files into output folder
stream = gulp.src(release.source + component + '.*')
.pipe(plumber())
.pipe(flatten())
.pipe(gulp.dest(outputDirectory)) // pipe to output directory
;
// extend bower.json
bower.name = repoName;
bower.description = capitalizedComponent + ' - Semantic UI Component';
if(isJavascript) {
// ... as a js component
bower.main = [
component + '.js',
component + '.css'
];
bower.dependencies = {
jquery: '>=1.8'
};
}
else {
// ... as a css component
bower.main = [
component + '.css'
];
}
// copy modified release notes
gulp.src(release.templates.bower)
.pipe(plumber())
.pipe(flatten())
.pipe(jeditor(bower)) // pipe in modifications from above
.pipe(gulp.dest(outputDirectory))
;
// create release notes
gulp.src(release.templates.notes)
.pipe(plumber())
.pipe(flatten())
.pipe(replace(notesRegExp, '')) // Remove release notes for other components
.pipe(gulp.dest(outputDirectory))
;
console.log(bower);
// extend output json
// does it have js
// copy files into folder
}
});

10
tasks/admin/questions.js

@ -25,7 +25,6 @@ module.exports = {
type: 'list',
name: 'action',
message: 'How should we provide files to docs?',
when: when.hasConfig,
choices: [
{
name: 'Watch changes',
@ -37,6 +36,15 @@ module.exports = {
}
]
}
],
createRepo: [
{
type: 'confirm',
name: 'allow',
message: 'Create new repo?',
default: true
}
]
};

19
tasks/admin/release.js

@ -5,15 +5,24 @@
// release settings
module.exports = {
owner : 'Semantic-Org',
repo : 'Semantic-UIs',
// path to components for repos
source : './dist/components/',
templates: {
bower : './tasks/admin/templates/bower.json',
package : './tasks/admin/templates/package.json'
},
org : 'Semantic-Org',
repo : 'Semantic-UI',
// root name for repos
repoRoot : 'UI-',
folderRoot : '../components/',
// root path to repos
outputRoot : '../components/',
homepage : 'http://beta.semantic-ui.com',
homepage : 'http://beta.semantic-ui.com',
description: 'Semantic UI component',
// components that get separate repositories for bower/npm
components : [

26
tasks/admin/templates/bower.json

@ -0,0 +1,26 @@
{
"name" : "Component",
"description" : "Component distribution",
"homepage" : "http://beta.semantic-ui.com",
"author": {
"name" : "Jack Lukic",
"web" : "http://www.jacklukic.com"
},
"keywords": [
"semantic",
"ui",
"css3",
"framework"
],
"license" : [
"http://semantic-ui.mit-license.org/"
],
"ignore": [
"docs",
"node",
"server",
"spec",
"src",
"test"
]
}

57
tasks/admin/templates/package.json

@ -0,0 +1,57 @@
{
"name": "semantic",
"version": "1.0.0",
"title": "Semantic UI",
"description": "Semantic empowers designers and developers by creating a shared vocabulary for UI.",
"homepage": "http://www.semantic-ui.com",
"author": "Jack Lukic <jack@semantic-ui.com>",
"license": "MIT",
"scripts": {
"test": "gulp test"
},
"repository": {
"type": "git",
"url": "git://github.com/Semantic-Org/Semantic-UI.git#1.0"
},
"bugs": {
"url": "https://github.com/Semantic-Org/Semantic-UI/issues"
},
"dependencies": {
"jquery": "x.x.x"
},
"devDependencies": {
"better-console": "^0.2.3",
"del": "^0.1.3",
"extend": "^2.0.0",
"github": "^0.2.2",
"gulp": "^3.8.8",
"gulp-autoprefixer": "^1.0.1",
"gulp-batch": "^1.0.1",
"gulp-clone": "^1.0.0",
"gulp-concat": "^2.4.1",
"gulp-concat-css": "^1.0.0",
"gulp-copy": "0.0.2",
"gulp-csscomb": "^3.0.3",
"gulp-debug": "^1.0.1",
"gulp-flatten": "0.0.4",
"gulp-git": "^0.5.3",
"gulp-header": "^1.1.1",
"gulp-help": "^1.2.0",
"gulp-json-editor": "^2.1.0",
"gulp-karma": "0.0.4",
"gulp-less": "^1.3.6",
"gulp-minify-css": "^0.3.10",
"gulp-notify": "^2.0.0",
"gulp-plumber": "^0.6.6",
"gulp-print": "^1.1.0",
"gulp-prompt": "^0.1.1",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.4.0",
"gulp-sourcemaps": "^1.2.4",
"gulp-uglify": "^1.0.1",
"gulp-util": "^3.0.1",
"gulp-watch": "^1.1.0",
"rtlcss": "^1.4.0",
"wrench": "^1.5.8"
}
}
Loading…
Cancel
Save