1.3.1 • Published 1 month ago

conventional-changelog-ghostwriter v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

NPM Package Version

You want to leverage conventional-changelog to create a CHANGELOG.md but none of the available presets support your commit types or tools, e.g., Bitbucket, JIRA, Trello. This preset supports configuration via a .changelogrc.js file.

This package is best used alongside the other ghostwriter tools. Each tool can be configured using the same .changelogrc.js file:

Installation

npm install --save-dev conventional-changelog-ghostwriter
pnpm install --save-dev conventional-changelog-ghostwriter
yarn add --dev conventional-changelog-ghostwriter

Usage

  1. Create and configure a .changelogrc.js file in the root of your repository
  2. Update your CHANGELOG.md generator to leverage conventional-changelog-ghostwriter

    • Conventional Changelog CLI

      conventional-changelog-cli -p ghostwriter
    • Lerna

      {
        ...
      
        "command": {
          "version": {
            "changelogPreset": "ghostwriter",
            "conventionalCommits": true
          }
        }
      
        ...
      }
    • Semantic Release

      module.exports = {
        ...
      
        plugins: [
          [
            '@semantic-release/commit-analyzer',
            {
              preset: 'ghostwriter',
            },
          ],
          [
            '@semantic-release/release-notes-generator',
            {
              preset: 'ghostwriter',
            },
          ],
        ],
      
        ...
      };
  3. Generate your CHANGELOG.md

Configuration

commitUrlFormat : string


The URL template to use when generating links to a specific commit hash.

Template VariableDescription
{{LONG_HASH}}The fully qualified git commit hash.
{{SHORT_HASH}}The short version of the git commit hash.

compareUrlFormat : string


The URL template to use when generating links to a comparison between two git shas.

Template VariableDescription
{{CURRENT_TAG}}The tag of the version the changelog is being generated for.
{{PREVIOUS_TAG}}The tag of the last version the changelog was generated for.

issuePrefixes : string[]


The array of prefixes used to detect references to issues.

issueReferencesPrefix : string = "for"


The prefix to use before listing issues that a commit refers to. Defaults to "for".

issueUrlFormat : string


The URL template to use when generating links to a comparison between two git shas.

Template VariableDescription
{{ISSUE_NUMBER}}The issue's number.
{{ISSUE_PREFIX}}The issue's prefix.

omitVersionSpacing : boolean | undefined


When true, omits the <br /> tag rendered between version numbers.

preset : "github" | undefined


The configuration preset to use which will set other configuration properties. If this property is set the following configuration properties are overwritten, i.e., nullable:

  • commitUrlFormat
  • compareUrlFormat
  • issuePrefixes
  • issueReferencesPrefix
  • issueUrlFormat

types : Array<HiddenType | VisibleType>


The array of type objects representing the explicitly supported commit message types, and whether they should show up in generated CHANGELOGs.

type CommitType = { description: string; type: string };

type HiddenType = CommitType & { hidden: true; section: undefined };

type VisibleType = CommitType & { hidden: undefined; section: string };

Noteworthy

Asterisk Scope

If the scope of a commit is * it will be omitted from the changelog.

Inputted Commit:

feat(*): add awesome things

Outputted Changelog:

feat: add awesome things

1.3.1

1 month ago

1.3.0

4 months ago

1.2.0

11 months ago

1.1.3

1 year ago

1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago