Skip to content

Commit

Permalink
feat(conventional-changelog): add conventional-changelog gulp support
Browse files Browse the repository at this point in the history
It's based on 0.0.11, a ticket is open to ask for the equivalent in 0.5.1 (conventional-changelog/conventional-changelog#117)
  • Loading branch information
davinkevin committed Oct 22, 2015
1 parent 7f48603 commit e8c4d96
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
Empty file added CHANGELOG.md
Empty file.
2 changes: 2 additions & 0 deletions build/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const root = path.dirname(__dirname);
export default {
root : root,
systemConfigJs : `${root}/system.config.js`,
packageJson : `${root}/package.json`,
changeLog : `${root}/CHANGELOG.md`,
srcDir: `${root}/${srcDirName}`,
releaseDir: `${root}/${releaseDirName}`,
releaseDirName: releaseDirName,
Expand Down
35 changes: 35 additions & 0 deletions build/tasks/conventional-changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* angularjs-jspm-seed
* Created by kdavin on 22/10/2015.
*/
import gulp from "gulp";
import fs from 'fs';
import cg from 'conventional-changelog';
import util from 'gulp-util';
import paths from '../paths';

const argv = util.env;
const from = argv.from, to = argv.to;

// Conventional Changelog Generating Task
// Can be use with '--from START_COMMIT --to END_COMMIT --version RELEASED_VERSION_NAME'
// ex : gulp conventional-changelog --from 70a938f811256262b8411d9f05d91f600eac4123
// it generate all the changelog from the commit id to today, it is useful to use the last commit id of the changelog.md
gulp.task('conventional-changelog', function(cal){
function changeParsed(err, log){
if (err) {
return cal(err);
}
fs.writeFile(paths.changeLog, log);
}
fs.readFile(paths.packageJson, 'utf8', function(err, data){
var ref$, repository, version;
ref$ = JSON.parse(data), repository = ref$.repository, version = argv.vname || ref$.version;
cg({
repository: repository.url,
version: version,
from: from,
to: to
}, changeParsed);
});
});
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/davinkevin/angularjs-jspm-seed.git"
},
"jspm": {
"configFile": "system.config.js",
"dependencies": {
Expand All @@ -21,6 +26,7 @@
"babel": "^5.8.23",
"browser-sync": "^2.9.11",
"connect-modrewrite": "^0.8.2",
"conventional-changelog": "^0.0.11",
"del": "^2.0.2",
"gulp": "^3.9.0",
"gulp-inject": "^3.0.0",
Expand Down

0 comments on commit e8c4d96

Please sign in to comment.