@interaktiv/conventional-changelog-dia

1.0.2 • Public • Published

@interaktiv/conventional-changelog-dia

conventional-changelog conventionalcommits.org preset with slightly adjustments for projects at DIA.

Commitizen friendly Conventional Commits Semantic Release Code of Conduct MIT License

npm latest version npm next version

Table of Contents

conventionalcommits.org convention

A concrete implementation of the specification described at conventionalcommits.org for automated CHANGELOG generation and version management.

See conventional-changelog-config-spec for available configuration options.

This is a extended version of the conventional-changelog-conventionalcommits preset with following differences:

  • Issue links are highlighted automatically by BitBucket e.g. #12345. But if there is a JIRA ticket reference like #EXM-123, then JIRA links will be generated - if configured see Configuration

  • Pull Requests and issues can have the same number on Bitbucket e.g. 1234.

    Therefore referencing a pull request should be done like this:

    pull request #1234 or pr #5678

    The pull request|pr part will be omitted and a link generated e.g.

    [#1234](https://github.com/MY-USER/MY-REPO/pulls/1234)

    or

    [#5678](https://github.com/MY-USER/MY-REPO/pulls/1234)

    By default this will create a Github Pull Requests url format. See Configuration for how to adjust the pull request url format.

Issues with the convention itself should be reported on the conventional-changelog-config-spec or conventional-changelog issue trackers.

Prerequisites

Installation

npm install @interaktiv/conventional-changelog-dia --save-dev

Usage

  1. Install the package in the project which will use it
  2. Set the preset to dia:
const changelog = require('conventional-changelog');
changelog({ preset: 'dia' });

Usage with semantic-release

.releaserc.js:

module.exports = {
  branch: 'master',
  plugins: [
    '@semantic-release/commit-analyzer',
    [
      '@semantic-release/release-notes-generator',
      {
        preset: 'dia',
      },
    ],
    '@semantic-release/changelog',
    '@semantic-release/npm',
    '@semantic-release/git',
  ],
};

Usage with corp-semantic-release

{
  "repository": {
    "type": "git",
    "url": "https://bitbucket.host.com/org/repo.git"
  },
  "bugs": {
    "url": "https://some.url/issues"
  },
  "scripts": {
    "semantic-release": "corp-semantic-release --changelogpreset dia"
  },
  "devDependencies": {
    "conventional-changelog-dia": "*",
    "corp-semantic-release": "6.2.0"
  }
}

Configuration

Options

Options Description Default
pullRequestUrlFormat A url representing the pull requests format (allowing a different URL to be swapped in for Gitlab, Bitbucket etc.): {{host}}/{{owner}}/{{repository}}/pulls/{{id}}
jiraUrlFormat A url representing the JIRA host format. -

Examples

The plugin can be configured in the semantic-release configuration file:

{
  plugins: [
    ['semantic-release/commit-analyzer', {
      preset: 'dia',
    }],
    ['semantic-release/release-notes-generator', {
      preset: 'dia',
      writerOpts: {
        // E.g. for Bitbucket repos
        pullRequestUrlFormat: '{{host}}/{{owner}}/{{repository}}/pull-requests/{{id}}',
        jiraUrlFormat: 'https://myinstance.jira.com/browse/{{id}}',
      },
    }],
  ],
}

Contributing

See CONTRIBUTING.md.

Acknowledgements

Big thanks to the conventional-changelog team for the original conventional-changelog-conventionalcommits preset implementation.

License

ISC Copyright © 2019-present die.interaktiven GmbH & Co. KG

Package Sidebar

Install

npm i @interaktiv/conventional-changelog-dia

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

48.2 kB

Total Files

15

Last publish

Collaborators

  • dia-bot
  • kbshl