Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-modular-release

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-modular-release - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

57

index.js

@@ -9,13 +9,33 @@ 'use strict';

module.exports = function(gulp) {
var versionNumber = argv.v;
var releaseBranch = 'release/' + versionNumber;
module.exports = function(gulp, userConfig) {
// default configuration
var config = {
versionNumber: argv.v,
bumpFiles: ['./package.json', './bower.json'],
changelogFile: './CHANGELOG.md',
conventionalChangelog: 'angular',
commitMessage: 'bump version number ' + argv.v,
tagPrefix: '',
masterBranch: 'master',
developBranch: 'develop',
releaseBranch: 'release/' + argv.v
};
// overwrite with user configuration
if (userConfig && userConfig.release) {
for (var configKey in userConfig.release) {
config[configKey] = userConfig.release[configKey];
}
}
// tasks
gulp.task('bump', function() {
if (!semver.valid(versionNumber)) {
if (!semver.valid(config.versionNumber)) {
throw 'Failed: specify version "-v X.X.X';
}
return gulp.src(['./package.json', './bower.json'])
.pipe(bump({version: versionNumber}))
return gulp.src(config.bumpFiles)
.pipe(bump({version: config.versionNumber}))
.pipe(gulp.dest('./'));

@@ -25,5 +45,5 @@ });

gulp.task('changelog', ['bump'], function() {
return gulp.src('./CHANGELOG.md')
return gulp.src(config.changelogFile)
.pipe(conventionalChangelog({
preset: 'angular'
preset: config.conventionalChangelog
}))

@@ -33,9 +53,10 @@ .pipe(gulp.dest('./'));

gulp.task('createBranch', function() {
return git.checkout(releaseBranch, {args: '-b'});
gulp.task('createBranch', function(cb) {
git.checkout(config.releaseBranch, {args: '-b'}, cb);
});
gulp.task('commit', ['bump', 'changelog', 'createBranch'], function() {
return gulp.src(['./bower.json', './package.json', './CHANGELOG.md'])
.pipe(git.commit('bump version number ' + versionNumber));
var files = config.bumpFiles.concat(config.changelogFile);
return gulp.src(files)
.pipe(git.commit(config.commitMessage));
});

@@ -45,24 +66,24 @@

git.checkout('develop', {}, mergeInDevelop);
git.checkout(config.developBranch, {}, mergeInDevelop);
function mergeInDevelop() {
git.merge(releaseBranch, {args: '--no-ff'}, checkoutMaster);
git.merge(config.releaseBranch, {args: '--no-ff'}, checkoutMaster);
}
function checkoutMaster() {
git.checkout('master', {}, mergeInMaster);
git.checkout(config.masterBranch, {}, mergeInMaster);
}
function mergeInMaster() {
git.merge(releaseBranch, {args: '--no-ff'}, tagVersion);
git.merge(config.releaseBranch, {args: '--no-ff'}, tagVersion);
}
function tagVersion() {
git.tag('v' + versionNumber, versionNumber, {}, deleteBranch);
git.tag(config.tagPrefix + config.versionNumber, config.versionNumber, {}, deleteBranch);
}
function deleteBranch() {
git.branch(releaseBranch, {args: '-d'}, cb);
git.branch(config.releaseBranch, {args: '-d'}, cb);
}
});
};
{
"name": "gulp-modular-release",
"version": "0.1.1",
"version": "0.1.2",
"description": "Modular extension to release projects using git-flow release strategy",

@@ -17,5 +17,9 @@ "main": "index.js",

"release",
"git-flow"
"git-flow",
"gulp-modular"
],
"author": "Sebastian Henneberg",
"contributors": [
"Sebastian Henneberg <dev@sebastianhenneberg.de> (http://sebastianhenneberg.de/)",
"Max Klenk <max@klenk.biz>"
],
"license": "MIT",

@@ -22,0 +26,0 @@ "bugs": {

@@ -1,4 +0,7 @@

# gulp-modular-release
Modular extension to release projects using git-flow release strategy
# gulp-modular-release [![npm version](https://badge.fury.io/js/gulp-modular-release.svg)](https://www.npmjs.com/package/gulp-modular-release)
Modular extension to release projects using [git-flow](https://github.com/nvie/gitflow) release strategy.
Works well alone or together with [gulp-modular](https://github.com/ONE-LOGIC/gulp-modular).
## Installation

@@ -16,3 +19,20 @@

gulpModularRelease(gulp);
// optionally overwrite default configuration
var config = {
//// task [`release`] creates a new release
release: {
// versionNumber: argv.v, // the version number of the new release
// bumpFiles: ['./package.json', './bower.json'], // write version number to these files
// changelogFile: './CHANGELOG.md', // generate changelog in this file
// conventionalChangelog: 'angular', // choose preset style like: : 'angular', 'atom', 'eslint', 'jscs', 'jshint'
// commitMessage: 'bump version number ' + argv.v, // message of bump commit
// tagPrefix: '', // define a prefix like 'v' for the git tag
// masterBranch: 'master', // the projects master branch
// developBranch: 'develop', // the projects develop branch
// releaseBranch: 'release/' + argv.v // the release branch created while releasing
}
};
gulpModularRelease(gulp, config);
```

@@ -19,0 +39,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc