Browse Source

Iteration on auto release notes etc

pull/1204/head
jlukic 10 years ago
parent
commit
57171fa9f1
3 changed files with 37 additions and 49 deletions
  1. 46
      gulpfile.js
  2. 1
      tasks/admin/release.js
  3. 39
      tasks/admin/templates/package.json

46
gulpfile.js

@ -687,8 +687,8 @@ gulp.task('release components', false, ['copy release components'], function() {
outputDirectory = release.outputRoot + component,
capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1),
repoName = release.repoRoot + capitalizedComponent,
gitURL = 'git@github.com:' + release.owner + '/' + repoName + '.git',
repoURL = 'https://github.com/' + release.owner + '/' + repoName + '/',
gitURL = 'git@github.com:' + release.org + '/' + repoName + '.git',
repoURL = 'https://github.com/' + release.org + '/' + repoName + '/',
gitOptions = { cwd: path.resolve(outputDirectory) }
;
// exit conditions
@ -785,10 +785,15 @@ gulp.task('copy release components', false, function() {
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'),
gitURL = 'git@github.com:' + release.org + '/' + repoName + '.git',
repoURL = 'https://github.com/' + release.org + '/' + repoName + '/',
bower = require(release.templates.bower),
package = require(release.templates.package)
package = require(release.templates.package),
regExp = {
relatedNotes : new RegExp('^((?!(^.*(' + component + ').*$|###.*)).)*$', 'gmi'),
whitespace : /\n\s*\n\s*\n/g,
trim : /^\s+|\s+$/g
}
;
// copy dist files into output folder
stream = gulp.src(release.source + component + '.*')
@ -799,9 +804,8 @@ gulp.task('copy release components', false, function() {
// extend bower.json
bower.name = repoName;
bower.description = capitalizedComponent + ' - Semantic UI Component';
bower.description = capitalizedComponent + ' - Semantic UI';
if(isJavascript) {
// ... as a js component
bower.main = [
component + '.js',
component + '.css'
@ -811,13 +815,25 @@ gulp.task('copy release components', false, function() {
};
}
else {
// ... as a css component
bower.main = [
component + '.css'
];
}
// copy modified release notes
// extend package.json
package.name = repoName;
package.title = 'Semantic UI - ' + capitalizedComponent;
package.repository = {
type : 'git',
url : gitURL
};
if(isJavascript) {
package.dependencies = {
jquery: 'x.x.x'
};
}
// copy modified bower file
gulp.src(release.templates.bower)
.pipe(plumber())
.pipe(flatten())
@ -825,11 +841,21 @@ gulp.task('copy release components', false, function() {
.pipe(gulp.dest(outputDirectory))
;
// copy modified package file
gulp.src(release.templates.package)
.pipe(plumber())
.pipe(flatten())
.pipe(jeditor(package)) // 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(replace(regExp.relatedNotes, '')) // Remove release notes for lines not mentioning component
.pipe(replace(regExp.whitespace, '\n\n'))
.pipe(replace(regExp.trim, ''))
.pipe(gulp.dest(outputDirectory))
;
// extend output json

1
tasks/admin/release.js

@ -24,7 +24,6 @@ module.exports = {
homepage : 'http://beta.semantic-ui.com',
// components that get separate repositories for bower/npm
components : [
"accordion",

39
tasks/admin/templates/package.json

@ -6,9 +6,6 @@
"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"
@ -19,39 +16,5 @@
"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"
}
"devDependencies": {}
}
Loading…
Cancel
Save