Skip to content

Commit

Permalink
Merge pull request #7 from mcasimir/release/1.0.1
Browse files Browse the repository at this point in the history
Release/1.0.1
  • Loading branch information
mcasimir committed Jul 31, 2016
2 parents 9634a4e + 8054bbe commit 8ee71d2
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 23 deletions.
18 changes: 13 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<a name="v1.0.1"></a>
# [v1.0.1](https://github.com/mcasimir/release-flow/compare/v1.0.0..v1.0.1)

<a name="v1.0.0"></a>
# [v1.0.0](https://github.com/mcasimir/release-flow/commits/v1.0.0)

Expand All @@ -8,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))
- guess release number ([065766c](https://github.com/mcasimir/release-flow/commits/065766c))
4 changes: 2 additions & 2 deletions lib/plugins/generate-changelog/changelog-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '';
Expand Down Expand Up @@ -47,5 +47,5 @@ exports.default = function (context) {
level--;
});

return lines.join('\n');
return lines.join('\n') + '\n\n';
};
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -13,7 +13,9 @@
"cli": "npm run build && node ./lib/cli.js"
},
"pre-commit": {
"run": ["build"]
"run": [
"build"
]
},
"bin": {
"release-flow": "./lib/cli.js"
Expand Down Expand Up @@ -59,4 +61,4 @@
"pre-commit": "1.1.3",
"sinon": "1.17.5"
}
}
}
4 changes: 2 additions & 2 deletions src/plugins/generate-changelog/changelog-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function(context) {
}

let titleBullet = (
entry.isLeaf() ?
entry.isLeaf() && level !== 1 ?
'-' :
Array(level + 1).join('#')
) + ' ';
Expand Down Expand Up @@ -47,5 +47,5 @@ export default function(context) {
level--;
});

return lines.join('\n');
return lines.join('\n') + '\n\n';
}
38 changes: 28 additions & 10 deletions test/plugins/changelog-template.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ describe('changelog-template', function() {

let changelog = changelogTemplate(context);

equal(changelog, '<a name="release1"></a>');
equal(changelog, `<a name="release1"></a>
`);
});

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 = {
Expand All @@ -35,7 +37,9 @@ describe('changelog-template', function() {

equal(changelog,
`<a name="release1"></a>
- root`);
# root
`);
});

it('Render subject for non leaf entries as title', function() {
Expand All @@ -55,7 +59,9 @@ describe('changelog-template', function() {
`<a name="release1"></a>
# root
- child1`);
- child1
`);
});

it('Adds a space before >2nd level titles', function() {
Expand All @@ -80,7 +86,9 @@ describe('changelog-template', function() {
## child1
- child2`);
- child2
`);
});

it('Does not add a space after leaf entries', function() {
Expand Down Expand Up @@ -108,7 +116,9 @@ describe('changelog-template', function() {
## child1
- child2
- child3`);
- child3
`);
});

it('renders one link', function() {
Expand All @@ -126,7 +136,9 @@ describe('changelog-template', function() {

equal(changelog,
`<a name="release1"></a>
- root ([link 1](link-1-url))`);
# root ([link 1](link-1-url))
`);
});

it('renders two or more link comma separated', function() {
Expand All @@ -145,7 +157,9 @@ describe('changelog-template', function() {

equal(changelog,
`<a name="release1"></a>
- 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() {
Expand All @@ -163,7 +177,9 @@ describe('changelog-template', function() {

equal(changelog,
`<a name="release1"></a>
- **feat** - root`);
# **feat** - root
`);
});

it('renders subject link', function() {
Expand All @@ -181,6 +197,8 @@ describe('changelog-template', function() {

equal(changelog,
`<a name="release1"></a>
- [root](xyz)`);
# [root](xyz)
`);
});
});

0 comments on commit 8ee71d2

Please sign in to comment.