From 06febc71a3b57ba9eea0c3fa9d0486c088c28b88 Mon Sep 17 00:00:00 2001 From: mcasimir Date: Sun, 31 Jul 2016 20:59:30 +0200 Subject: [PATCH 1/4] Release v1.0.1 --- CHANGELOG.md | 3 ++- package.json | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abd796c..b774ee9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ - + +- [v1.0.1](https://github.com/mcasimir/release-flow/compare/v1.0.0..v1.0.1) # [v1.0.0](https://github.com/mcasimir/release-flow/commits/v1.0.0) ## Features diff --git a/package.json b/package.json index 5fdb1f7..2112d23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "release-flow", - "version": "1.0.0", + "version": "1.0.1", "description": "Git flow conventional releases", "main": "dist/Release.js", "scripts": { @@ -13,7 +13,9 @@ "cli": "npm run build && node ./lib/cli.js" }, "pre-commit": { - "run": ["build"] + "run": [ + "build" + ] }, "bin": { "release-flow": "./lib/cli.js" @@ -59,4 +61,4 @@ "pre-commit": "1.1.3", "sinon": "1.17.5" } -} +} \ No newline at end of file From aaa9c8de12062d4a440d800db46db3dc59a511d3 Mon Sep 17 00:00:00 2001 From: mcasimir Date: Sun, 31 Jul 2016 21:03:05 +0200 Subject: [PATCH 2/4] manually fixed changelog --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b774ee9..1f4fd7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ -- [v1.0.1](https://github.com/mcasimir/release-flow/compare/v1.0.0..v1.0.1) +# [v1.0.1](https://github.com/mcasimir/release-flow/compare/v1.0.0..v1.0.1) + + # [v1.0.0](https://github.com/mcasimir/release-flow/commits/v1.0.0) ## Features @@ -9,4 +11,4 @@ - added cli ([24582bc](https://github.com/mcasimir/release-flow/commits/24582bc)) - squash commits with same message in changelog ([1aac643](https://github.com/mcasimir/release-flow/commits/1aac643)) - generate changelog ([4ed812c](https://github.com/mcasimir/release-flow/commits/4ed812c)) -- guess release number ([065766c](https://github.com/mcasimir/release-flow/commits/065766c)) \ No newline at end of file +- guess release number ([065766c](https://github.com/mcasimir/release-flow/commits/065766c)) From 991d1aef010b0700ffe1d93c6120fb972603a136 Mon Sep 17 00:00:00 2001 From: mcasimir Date: Sun, 31 Jul 2016 21:12:35 +0200 Subject: [PATCH 3/4] fix CHANGELOG rendering with empty conventional entries --- .../generate-changelog/changelog-template.js | 4 +- .../generate-changelog/changelog-template.js | 4 +- test/plugins/changelog-template.spec.js | 38 ++++++++++++++----- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/lib/plugins/generate-changelog/changelog-template.js b/lib/plugins/generate-changelog/changelog-template.js index 9326a37..f7300d3 100644 --- a/lib/plugins/generate-changelog/changelog-template.js +++ b/lib/plugins/generate-changelog/changelog-template.js @@ -47,5 +47,5 @@ exports.default = function (context) { level--; }); - return lines.join('\n'); -}; \ No newline at end of file + return lines.join('\n') + '\n\n'; +}; diff --git a/src/plugins/generate-changelog/changelog-template.js b/src/plugins/generate-changelog/changelog-template.js index b24a936..75fafec 100644 --- a/src/plugins/generate-changelog/changelog-template.js +++ b/src/plugins/generate-changelog/changelog-template.js @@ -12,7 +12,7 @@ export default function(context) { } let titleBullet = ( - entry.isLeaf() ? + entry.isLeaf() && level !== 1 ? '-' : Array(level + 1).join('#') ) + ' '; @@ -47,5 +47,5 @@ export default function(context) { level--; }); - return lines.join('\n'); + return lines.join('\n') + '\n\n'; } diff --git a/test/plugins/changelog-template.spec.js b/test/plugins/changelog-template.spec.js index a69b32b..126a111 100644 --- a/test/plugins/changelog-template.spec.js +++ b/test/plugins/changelog-template.spec.js @@ -18,10 +18,12 @@ describe('changelog-template', function() { let changelog = changelogTemplate(context); - equal(changelog, ''); + equal(changelog, ` + +`); }); - it('Adds bullet list entry for each top level leaf', function() { + it('Adds h1 entry for each top level leaf', function() { let root = new ChangelogEntry('root'); let context = { @@ -35,7 +37,9 @@ describe('changelog-template', function() { equal(changelog, ` -- root`); +# root + +`); }); it('Render subject for non leaf entries as title', function() { @@ -55,7 +59,9 @@ describe('changelog-template', function() { ` # root -- child1`); +- child1 + +`); }); it('Adds a space before >2nd level titles', function() { @@ -80,7 +86,9 @@ describe('changelog-template', function() { ## child1 -- child2`); +- child2 + +`); }); it('Does not add a space after leaf entries', function() { @@ -108,7 +116,9 @@ describe('changelog-template', function() { ## child1 - child2 -- child3`); +- child3 + +`); }); it('renders one link', function() { @@ -126,7 +136,9 @@ describe('changelog-template', function() { equal(changelog, ` -- root ([link 1](link-1-url))`); +# root ([link 1](link-1-url)) + +`); }); it('renders two or more link comma separated', function() { @@ -145,7 +157,9 @@ describe('changelog-template', function() { equal(changelog, ` -- root ([link 1](link-1-url), [link 2](link-2-url))`); +# root ([link 1](link-1-url), [link 2](link-2-url)) + +`); }); it('renders scope in bold', function() { @@ -163,7 +177,9 @@ describe('changelog-template', function() { equal(changelog, ` -- **feat** - root`); +# **feat** - root + +`); }); it('renders subject link', function() { @@ -181,6 +197,8 @@ describe('changelog-template', function() { equal(changelog, ` -- [root](xyz)`); +# [root](xyz) + +`); }); }); From 8054bbe09f351bd279f521ad201007d8b4bac779 Mon Sep 17 00:00:00 2001 From: mcasimir Date: Sun, 31 Jul 2016 21:17:41 +0200 Subject: [PATCH 4/4] auto release through CI --- .travis.yml | 18 +++++++++++++----- .../generate-changelog/changelog-template.js | 4 ++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index a90cb64..ccf9e62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,17 @@ language: node_js node_js: - - "6" +- '6' install: - - npm install - - npm install -g codecov +- npm install +- npm install -g codecov script: - - npm run test:ci - - codecov +- npm run test:ci +- codecov +deploy: + provider: npm + email: maurizio.cas@gmail.com + api_key: + secure: mOKBUKhquWm42nYbXf3pr144KyG2KVqW0ldWXblVPm5U8ZIPCqMhmRUJD3M/fyeLVMoUoOlVXu1AhxTyFIi5y4TjH29joAC0ZnppI/vr+Ki4zcgHOzPuUHgthsxL8Ov40sJUPEg1oId7XXH5Dj5Y3+zNr4SqyN04F96NqLN+dVcHhDHrxdag0swdXyAIFloGXFJFGOABOH+MBq5InujyVfQ56a6iT8lAZDkzr6GkFGMuao4pavVny4bVehacIHrByYJq+To6zxn6/afqtWUNt6hpPqn02nvJcFSdamC69GNmwVGBDGe1ZYvBN2r3nYwIb+wJr0iBD0hCRQxdiXKpLjGdYUm9LMbz3ZWLYYOw49xZEsiQDAgumTSN4CwlyE1Ba3kgZhaqOilYEdqbUqWthOVDRCiLicza/MrnMhd0GYPUb+/fVrpfdYkCL3f11/APpYf03GKPXcHpVZmk+nKCM2XFMGmoePg6DYG7OqMKl5znie4n4MfvuEM1fsjJzj85xEceaWjNdQkee6VbkSoW+A3EFNS+tT1Be6VXaX8i8WwD7BiFg+s89rj0k4GX1gpTcu1SNJTI8KbL60ZPa8Gb+5CS8KFufVvXBy46vadWqwJ4/tfuA519GniNcQkMSfoL6q6BMwDJycTdITi9KmFkW2QU0XGUUZoHLqWZO7rxQDA= + on: + tags: true + repo: mcasimir/release-flow diff --git a/lib/plugins/generate-changelog/changelog-template.js b/lib/plugins/generate-changelog/changelog-template.js index f7300d3..0de9dbb 100644 --- a/lib/plugins/generate-changelog/changelog-template.js +++ b/lib/plugins/generate-changelog/changelog-template.js @@ -16,7 +16,7 @@ exports.default = function (context) { lines.push(''); } - var titleBullet = (entry.isLeaf() ? '-' : Array(level + 1).join('#')) + ' '; + var titleBullet = (entry.isLeaf() && level !== 1 ? '-' : Array(level + 1).join('#')) + ' '; var subject = entry.subject; var scope = entry.scope || ''; @@ -48,4 +48,4 @@ exports.default = function (context) { }); return lines.join('\n') + '\n\n'; -}; +}; \ No newline at end of file