1.0.1 • Published 7 years ago

dv-plugin-analyze-commits v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Semantic Release Analyze Commits Plugin!

MIT License Version Travis Build Status Code Coverage

A semantic-release plugin to configure the logic of analyzing commits for bumping the package semver by major, minor, or patch release.

Watch on GitHub Star on GitHub Tweet

Getting Started

This is a plugin for semantic-release so you'll need to have it already installed.

npm install -D dv-plugin-analyze-commits
// or
yarn add -D dv-plugin-analyze-commits

Configure semantic-release to use the plugin for analyzing commits in your package.json:

{
  "release": {
    "analyzeCommits": "node_modules/dv-plugin-analyze-commits/src/index.js"
  }
}

The plugin uses this default config file to determine how to bump the semver.

Configuration

.acrc.js or .acrc.json config file

To configure the behavior yourself, create a .acrc.js file at the root of your project and the plugin will pick it up.

// .acrc.js
module.exports = {
  major: {
    types: [...],
    notes: [...]
  },
  minor: {
    types: [...],
    notes: [...]
  },
  patch: {
    types: [...],
    notes: [...]
  }
};

config from package.json

You can also add the same configuration inside your package.json as well:

// package.json
{
  ...
  "config": {
    "dvAnalyzeCommits": {
      major: {
        types: [...],
        notes: [...]
      },
      minor: {
        types: [...],
        notes: [...]
      },
      patch: {
        types: [...],
        notes: [...]
      }
    }
  }
  ...
}

.acrc.js has priority over the config in package.json.

Specifying a config filepath

You can also specify a specific path for the config inside your package.json and it'll look for it instead of .acrc.js.

// package.json
{
  ...
  "config": {
    "dvAnalyzeCommits": {
      "configFilepath": 'config/dvAnalyzeCommits.js'
    }
  }
  ...
}

All notes and types are case sensitive

Analyzing Commit Messages

type and note are all case sensitive based on the configuration.

Type

feat: add a new feature

Add the new feature

feat is the type.

Note

feat: add a new feature

BUMP MAJOR: Will need

BUMP MAJOR is the note.

License

MIT. Copyright (c) 2017 Dexter Vu.