Skip to content
This repository has been archived by the owner on Sep 18, 2017. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: semantic-release/commit-analyzer-v2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: BookerSoftwareInc/commit-analyzer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 8 commits
  • 6 files changed
  • 1 contributor

Commits on Jul 22, 2017

  1. add more patch types

    jasonenglish committed Jul 22, 2017
    Copy the full SHA
    69202ee View commit details
  2. Copy the full SHA
    f864e08 View commit details

Commits on Jul 24, 2017

  1. add version

    jasonenglish committed Jul 24, 2017
    Copy the full SHA
    6e9137c View commit details
  2. bump version

    jasonenglish committed Jul 24, 2017
    Copy the full SHA
    d4b2f8e View commit details
  3. Copy the full SHA
    e9f99b8 View commit details
  4. update readme

    jasonenglish committed Jul 24, 2017
    Copy the full SHA
    1f27277 View commit details
  5. version bump

    jasonenglish committed Jul 24, 2017
    Copy the full SHA
    0e59c62 View commit details

Commits on Jul 25, 2017

  1. Copy the full SHA
    9f5c417 View commit details
Showing with 84 additions and 3 deletions.
  1. +2 −1 .gitignore
  2. +32 −0 README.md
  3. +31 −0 dist/index.js
  4. +1 −0 package.json
  5. +2 −1 src/index.js
  6. +16 −1 test/specs/index.js
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ node_modules
.nyc_output
.test
.tmp
.idea

# build-artifacts
dist
# dist
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
# NOTE
> TODO: Refactor, do PR to allow customization options to be passed in the package.json config, so we don't need to use this fork any longer
# Default Commit Message Format

Specific commit formats determines what the next version will be.

### Patch Release

```
fix(pencil): stop graphite breaking when too much pressure applied
docs(pencil): stop graphite breaking when too much pressure applied
style(pencil): stop graphite breaking when too much pressure applied
refactor(pencil): stop graphite breaking when too much pressure applied
chore(pencil): stop graphite breaking when too much pressure applied
test(pencil): stop graphite breaking when too much pressure applied
```

### ~~Minor~~ Feature Release

```
feat(pencil): add 'graphiteWidth' option
```

### ~~Major~~ Breaking Release

```
perf(pencil): remove graphiteWidth option
BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reason.
```

# semantic-release commit-analyzer
[![npm version](https://badge.fury.io/js/%40semantic-release%2Fcommit-analyzer.svg)](http://badge.fury.io/js/%40semantic-release%2Fcommit-analyzer)
[![Build Status](https://travis-ci.org/semantic-release/commit-analyzer.svg?branch=master)](https://travis-ci.org/semantic-release/commit-analyzer)
31 changes: 31 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

var _require = require('conventional-changelog/lib/git');

var parseRawCommit = _require.parseRawCommit;

module.exports = function (pluginConfig, _ref, cb) {
var commits = _ref.commits;

var MINOR_TYPES = ['fix', 'docs', 'style', 'refactor', 'chore', 'test'];
var type = null;

commits.map(function (commit) {
return parseRawCommit(commit.hash + '\n' + commit.message);
}).filter(function (commit) {
return !!commit;
}).every(function (commit) {
if (commit.breaks.length) {
type = 'major';
return false;
}

if (commit.type === 'feat') type = 'minor';

if (!type && MINOR_TYPES.indexOf(commit.type) !== -1) type = 'patch';

return true;
});

cb(null, type);
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@semantic-release/commit-analyzer",
"version": "3.0.1",
"description": "derive next semantic version from commits",
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
"bugs": {
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { parseRawCommit } = require('conventional-changelog/lib/git')

module.exports = function (pluginConfig, {commits}, cb) {
const MINOR_TYPES = ['fix', 'docs', 'style', 'refactor', 'chore', 'test']
let type = null

commits
@@ -17,7 +18,7 @@ module.exports = function (pluginConfig, {commits}, cb) {

if (commit.type === 'feat') type = 'minor'

if (!type && commit.type === 'fix') type = 'patch'
if (!type && MINOR_TYPES.indexOf(commit.type) !== -1) type = 'patch'

return true
})
17 changes: 16 additions & 1 deletion test/specs/index.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ test('derive version number from commits', (t) => {
analyzer({}, {
commits: [{
hash: 'asdf',
message: 'chore: build script'
message: 'build script'
}]
}, (err, type) => {
tt.error(err)
@@ -27,6 +27,21 @@ test('derive version number from commits', (t) => {
}, {
hash: '1234',
message: 'fix(scope): even nastier bug'
}, {
hash: '1234',
message: 'docs(scope): even nastier bug'
}, {
hash: '1234',
message: 'style(scope): even nastier bug'
}, {
hash: '1234',
message: 'refactor(scope): even nastier bug'
}, {
hash: '1234',
message: 'chore(scope): even nastier bug'
}, {
hash: '1234',
message: 'test(scope): even nastier bug'
}]
}, (err, type) => {
tt.error(err)