GithubHelp home page GithubHelp logo

acasaccia / conventional-changelog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from release-it/conventional-changelog

0.0 0.0 0.0 95 KB

Conventional changelog plugin for release-it

License: MIT License

JavaScript 100.00%

conventional-changelog's Introduction

Conventional Changelog plugin for release-it

This plugin will provide the recommended bump to release-it, and update the changelog file (e.g. CHANGELOG.md).

npm install --save-dev @release-it/conventional-changelog

Configuration

In the release-it config, for example:

"plugins": {
  "@release-it/conventional-changelog": {
    "preset": {
      "name": "angular"
    },
    "infile": "CHANGELOG.md"
  }
}

Options are passed verbatim to conventional-recommended-bump and conventional-changelog-core.

preset

Use one of:

  • angular
  • atom
  • codemirror
  • conventionalcommits
  • ember
  • eslint
  • express
  • jquery
  • jscs
  • jshint

Use an object with name and types to use a custom preset:

"plugins": {
  "@release-it/conventional-changelog": {
    "infile": "CHANGELOG.md",
    "preset": {
      "name": "conventionalcommits",
      "types": [
        {
          "type": "feat",
          "section": "Features"
        },
        {
          "type": "fix",
          "section": "Bug Fixes"
        },
        {}
      ]
    }
  }
}

See the Conventional Changelog Configuration Spec (v2.1.0) for the configuration object to pass as preset.

infile

Default value: undefined

  • Set a filename as infile to write the changelog to. If this file does not exist yet, it's created with the full history.
  • When infile is not set, the changelog generated by this plugin will still be used as release notes for e.g. GitHub Releases.
  • Set infile: false to disable the changelog writing (and only use the recommended bump for the next version).

header

Set the main header for the changelog document:

{
  "plugins": {
    "@release-it/conventional-changelog": {
      "infile": "CHANGELOG.md",
      "header": "# Changelog",
      "preset": {
        "name": "conventionalcommits"
      }
    }
  }
}

ignoreRecommendedBump

Default value: false

Use true to ignore the recommended bump, and use the version provided by release-it (command line argument or prompt).

(Note that the changelog preview shows the recommended bump, as the desired version isn't known yet. The infile will have the correct version.)

strictSemVer

Default value: false

Use true to strictly follow semver, also in consecutive pre-releases. This means that from a pre-release, a recommended bump will result in a next pre-release for the next version.

For example, from 1.0.0-alpha.0 a recommended bump of minor will result in a preminor bump to 1.1.0-alpha.0 (whereas the default behavior without this flag results in a prerelease bump to 1.0.0-alpha.1).

context

Default value: undefined

This option will be passed as the second argument (context) to conventional-changelog-core, for example:

"plugins": {
  "@release-it/conventional-changelog": {
    "context": {
      "linkCompare": false
    }
  }
}

gitRawCommitsOpts

Default value: undefined

Options for git-raw-commits. For example, you can use the following option to include merge commits into changelog:

{
  "plugins": {
    "@release-it/conventional-changelog": {
      "gitRawCommitsOpts": {
        "merges": null
      }
    }
  }
}

parserOpts

Default value: undefined

Options for conventional-commits-parser. For example, you can use the following option to set the merge pattern during parsing the commit message:

{
  "plugins": {
    "@release-it/conventional-changelog": {
      "parserOpts": {
        "mergePattern": "^Merge pull request #(\\d+) from (.*)$"
      }
    }
  }
}

writerOpts

Default value: undefined

Options for conventional-changelog-writer. For example, you can use the following option to group the commits by 'scope' instead of 'type' by default.

{
  "plugins": {
    "@release-it/conventional-changelog": {
      "writerOpts": {
        "groupBy": "scope"
      }
    }
  }
}

If you want to customize the templates used to write the changelog, you can do it like in a .release-it.js file like so:

const fs = require('fs');

const commitTemplate = fs.readFileSync('commit.hbs').toString();

module.exports = {
  plugins: {
    '@release-it/conventional-changelog': {
      writerOpts: {
        commitPartial: commitTemplate
      }
    }
  }
};

Command-line

Options for this plugin can be set from the command line. Some examples:

release-it --plugins.@release-it/conventional-changelog.infile=history.md
release-it --no-plugins.@release-it/conventional-changelog.infile
  • Keys are separated by dots.
  • Values can be negated by prefixing the key with no-.
  • Arguments may need to be single-quoted (') such as --'deep.key=value' or '--deep.key=value'

Depending on your shell or OS this may differ.

GitHub Actions

When using this plugin in a GitHub Action, make sure to set fetch-depth: 0 so the history is available to determine the correct recommended bump and changelog.

Also see https://github.com/release-it/release-it/blob/master/docs/ci.md#github-actions

conventional-changelog's People

Contributors

webpro avatar lpreterite avatar lastdragon-ru avatar silversonicaxel avatar jepricreations avatar thet avatar morevm avatar rondymesquita avatar whorka avatar xjq7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.